Add module diags in menu & home page for diags
This commit is contained in:
		
							parent
							
								
									395160db6e
								
							
						
					
					
						commit
						676eea1238
					
				| 
						 | 
				
			
			@ -172,6 +172,13 @@ views:
 | 
			
		|||
    display_group:
 | 
			
		||||
      files:
 | 
			
		||||
        - web/layouts/group_module/display_group.html
 | 
			
		||||
  diags:
 | 
			
		||||
    list:
 | 
			
		||||
      files:
 | 
			
		||||
        - web/layouts/diags/home.html
 | 
			
		||||
    delete:
 | 
			
		||||
      files:
 | 
			
		||||
        - web/layouts/diags/delete-diag.html
 | 
			
		||||
 | 
			
		||||
  administration:
 | 
			
		||||
    home:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,12 +21,14 @@
 | 
			
		|||
                </li>
 | 
			
		||||
            {{else}}
 | 
			
		||||
                {{range .ViewState.diags}}
 | 
			
		||||
                {{ $diags := .ID }}
 | 
			
		||||
                {{if eq .Deleted false}}
 | 
			
		||||
                    <li class="py-5 px-4 flex">
 | 
			
		||||
                            <div class="flex-1 ml-3">
 | 
			
		||||
                                <p class="mt-1 text-sm text-gray-900">{{.Name}}</p>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </a>
 | 
			
		||||
                        <a href="/app/diags/{{$diags}}/delete" class="inline-flex"><button type="button"
 | 
			
		||||
                            class="w-full px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm text-white bg-co-red hover:bg-co-red focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">Retirer</button></a>
 | 
			
		||||
                    </li>
 | 
			
		||||
                {{end}}
 | 
			
		||||
                {{end}}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,39 @@
 | 
			
		|||
{{define "content"}}
 | 
			
		||||
<div>
 | 
			
		||||
        <form method="POST" >
 | 
			
		||||
 | 
			
		||||
            <div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"></div>
 | 
			
		||||
        
 | 
			
		||||
            <div class="fixed inset-0 z-10 overflow-y-auto">
 | 
			
		||||
            <div class="flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0">
 | 
			
		||||
 | 
			
		||||
                <div class="relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all sm:my-8 sm:w-full max-w-lg sm:p-6">
 | 
			
		||||
                <div>
 | 
			
		||||
                    <div class="mx-auto flex h-12 w-12 items-center justify-center rounded-co bg-co-blue text-white">
 | 
			
		||||
                    {{.IconSet.Icon "hero:outline/information-circle" "h-6 w-6"}}
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="mt-3 text-center sm:mt-5">
 | 
			
		||||
                        <h3 class="text-lg font-medium leading-6 text-gray-900" id="modal-title">Confirmation de retrait</h3>
 | 
			
		||||
                        <div class="mt-2">
 | 
			
		||||
                            <p class="text-sm text-gray-500">Voulez-vous vraiment retirer ce dignostique ?</p>
 | 
			
		||||
                        </div>
 | 
			
		||||
                        <div class="col-span-6">
 | 
			
		||||
                            <label for="motif" class="block text-sm font-medium text-gray-700">Motif</label>
 | 
			
		||||
                            <div class="mt-1">
 | 
			
		||||
                                <textarea rows="4" name="motif" id="motif"
 | 
			
		||||
                                    class="shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-2xl"></textarea>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="mt-5 sm:mt-6 sm:grid sm:grid-flow-row-dense sm:grid-cols-2">
 | 
			
		||||
                    <a href="/app/diags/{{.ViewState.eventid}}" class="mt-3 inline-flex w-full justify-center rounded-l-2xl border border-gray-300 bg-white px-4 py-2 text-base font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:col-start-1 sm:mt-0 sm:text-sm">Annuler</a>
 | 
			
		||||
                    <button  type="submit" class="inline-flex w-full justify-center rounded-r-2xl border border-transparent bg-co-blue px-4 py-2 text-base font-medium text-white shadow-sm hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:col-start-2 sm:text-sm">Confirmation</button>
 | 
			
		||||
                </div>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </form>
 | 
			
		||||
 | 
			
		||||
 </div>
 | 
			
		||||
{{end}}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,71 @@
 | 
			
		|||
{{define "content"}}
 | 
			
		||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
 | 
			
		||||
    <h1 class="text-2xl font-semibold text-gray-900">Diagnostiques effectués</h1>
 | 
			
		||||
 | 
			
		||||
    <div class="sm:flex sm:items-center">
 | 
			
		||||
        <div class="sm:flex-auto">
 | 
			
		||||
            <p class="mt-2 text-sm text-gray-700"></p>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
 | 
			
		||||
            <a href="/app/diags/history">
 | 
			
		||||
                <button type="button"
 | 
			
		||||
                    class="inline-flex items-center justify-center mr-3 bg-white hover:bg-gray-50 border-gray-300 border px-4 py-2 text-gray-700 flex items-center text-sm rounded-2xl focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">
 | 
			
		||||
                    {{$.IconSet.Icon "hero:outline/calendar" "h-5 w-5 mr-3"}}
 | 
			
		||||
                    Historique
 | 
			
		||||
                </button>
 | 
			
		||||
            </a>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8">
 | 
			
		||||
    <div class="mt-8 flex flex-col">
 | 
			
		||||
        <div class="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8">
 | 
			
		||||
            <div class="inline-block min-w-full py-2 align-middle md:px-6 lg:px-8">
 | 
			
		||||
                <div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg">
 | 
			
		||||
                    <table class="min-w-full divide-y divide-gray-300">
 | 
			
		||||
                        <thead class="bg-gray-50">
 | 
			
		||||
                            <tr>
 | 
			
		||||
                                <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
                                    Nom du diagnostique
 | 
			
		||||
                                </th>
 | 
			
		||||
                                <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
 | 
			
		||||
                                    Type
 | 
			
		||||
                                </th>
 | 
			
		||||
                                <th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
 | 
			
		||||
                                    <span class="sr-only">Actions</span>
 | 
			
		||||
                                </th>
 | 
			
		||||
                            </tr>
 | 
			
		||||
                            <tbody class="divide-y divide-gray-200 bg-white">
 | 
			
		||||
                                {{range .ViewState.diags}}
 | 
			
		||||
                                {{if eq .Deleted false}}
 | 
			
		||||
                                <a href="/app/diags/{{.ID}}">
 | 
			
		||||
                                <tr>
 | 
			
		||||
                                    <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
			
		||||
 | 
			
		||||
                                        <div class="font-medium text-gray-900">{{.Name}}</div>
 | 
			
		||||
                                    </td>
 | 
			
		||||
                                    <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
			
		||||
                                        {{if eq .Namespace "parcoursmob_beneficiaries"}}
 | 
			
		||||
                                        <div class="text-gray-500">Diagnostique personnelle</div>
 | 
			
		||||
                                        {{end}}
 | 
			
		||||
                                        {{if eq .Namespace "parcoursmob_vehicle"}}
 | 
			
		||||
                                        <div class="text-gray-500">Diagnostique automobile</div>
 | 
			
		||||
                                        {{end}}
 | 
			
		||||
                                    </td>
 | 
			
		||||
                                    <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
 | 
			
		||||
                                        <a href="/app/diags/{{.ID}}" class="text-co-blue hover:text-co-blue">Voir</a>
 | 
			
		||||
                                    </td>
 | 
			
		||||
                                </tr>
 | 
			
		||||
                                </a>
 | 
			
		||||
                                {{end}}
 | 
			
		||||
                                {{end}}
 | 
			
		||||
                            </tbody>
 | 
			
		||||
                        </thead>
 | 
			
		||||
                    </table>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
{{end}}
 | 
			
		||||
		Loading…
	
		Reference in New Issue