Compare commits

..

No commits in common. "09b0458f627d0040b39a7258e57c64b96d8bd0b9" and "3dce51620fc53c5564ac7ed1e2218dc6176db539" have entirely different histories.

3 changed files with 56 additions and 86 deletions

View File

@ -40,8 +40,12 @@
<!-- ajout du bouton supprimer --> <!-- ajout du bouton supprimer -->
<td> <td>
<!-- <form class="mt-4" action="/app/agenda/{{$evid}}/{{.Subscriber}}/delete" method="POST" @submit="submit">
<button type="submit"
class="rounded-2xl border border-transparent bg-co-blue px-4 py-2 w-full text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:w-auto">Supprimer le bénéficiaire</button>
</form> -->
<a href="/app/agenda/{{$evid}}/{{.Subscriber}}/delete" class="inline-flex"><button type="button" <a href="/app/agenda/{{$evid}}/{{.Subscriber}}/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-red">Retirer</button></a> class="w-full px-4 py-2 border border-transparent text-sm font-medium rounded-2xl shadow-sm text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-co-blue">Supprimer le bénéficiaire</button></a>
</td> </td>
<!-- fin --> <!-- fin -->
</tr> </tr>

View File

@ -68,13 +68,9 @@
{{ if eq (index .ViewState.event.Owners 0) .Group.ID }} {{ if eq (index .ViewState.event.Owners 0) .Group.ID }}
<section aria-labelledby="subscribers-table"></section> <section aria-labelledby="subscribers-table"></section>
<div class="bg-white shadow sm:rounded-lg"> <div class="bg-white shadow sm:rounded-lg">
<div class="flex justify-between px-4 py-5 sm:px-6"> <div class="px-4 py-5 sm:px-6">
<h2 id="event-information-title" class="text-lg leading-6 font-medium text-gray-900">Tous les inscrits</h2> <h2 id="event-information-title" class="text-lg leading-6 font-medium text-gray-900">Tous les inscrits</h2>
<a href="/app/agenda/{{.ViewState.event.ID}}/history"> <a href="/app/agenda/{{.ViewState.event.ID}}/history" class="mt-1 max-w-2xl text-sm text-gray-500">Historique</a>
<button type="submit"class="rounded-2xl border border-transparent bg-co-blue px-4 py-2 w-full text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 sm:w-auto">
Bénéficiaires désinscrits
</button>
</a>
</div> </div>
{{template "subscribers_table" .}} {{template "subscribers_table" .}}
</div> </div>
@ -150,16 +146,11 @@
<h2 id="subscribers-title" class="text-lg font-medium text-gray-900 mt-10">Bénéficiaires {{.Group.Data.name}} inscrits</h2> <h2 id="subscribers-title" class="text-lg font-medium text-gray-900 mt-10">Bénéficiaires {{.Group.Data.name}} inscrits</h2>
<div class="mt-2"> <div class="mt-2">
<ul class="p-1"> <ul class="p-1">
{{$evid := .ViewState.event.ID}}
{{range .ViewState.event.Subscriptions}} {{range .ViewState.event.Subscriptions}}
{{if eq $.Group.ID .Data.subscribed_by.group.id}} {{if eq $.Group.ID .Data.subscribed_by.group.id}}
<a href="/app/beneficiaries/{{.Subscriber}}"> <a href="/app/beneficiaries/{{.Subscriber}}">
<li class="inline-flex text-sm p-2"><img class="h-6 w-6 rounded-co mr-2" src="/app/beneficiaries/{{.Subscriber}}/picture"> {{ (index $.ViewState.subscribers .Subscriber).Data.first_name }} {{ (index $.ViewState.subscribers .Subscriber).Data.last_name }} <li class="inline-flex text-sm p-2"><img class="h-6 w-6 rounded-co mr-2" src="/app/beneficiaries/{{.Subscriber}}/picture"> {{ (index $.ViewState.subscribers .Subscriber).Data.first_name }} {{ (index $.ViewState.subscribers .Subscriber).Data.last_name }}</li>
</a> </a>
<a href="/app/agenda/{{$evid}}/{{.Subscriber}}/delete" class="inline-flex">
<button type="button"
class="w-full ml-2 px-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-red">x</button></a>
</li>
{{end}} {{end}}
{{end}} {{end}}
</ul> </ul>

View File

@ -1,76 +1,51 @@
{{define "content"}} {{define "content"}}
<main class="py-10"> <table class="min-w-full divide-y divide-gray-300 border-t border-gray-200">
<div <thead class="bg-gray-50">
class="max-w-3xl mx-auto px-4 sm:px-6 md:flex md:items-center md:justify-between md:space-x-5 lg:max-w-7xl lg:px-8"> <tr>
<div class="flex items-center space-x-5"> <th scope="col"
<div> class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 ">
<h1 class="text-2xl font-bold text-gray-900">Bénéficiaires désinscrits de l'évènement {{.ViewState.event.Name}}</h1> Bénéficiaire
<p class="text-m font-medium text-gray-500"> </th>
{{if eq .ViewState.event.Startdate .ViewState.event.Enddate}} <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Le {{(timeFrom .ViewState.event.Startdate).Format "02/01/2006"}} Prescripteur
{{else}} </th>
Du {{(timeFrom .ViewState.event.Startdate).Format "02/01/2006"}} au {{(timeFrom <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
.ViewState.event.Enddate).Format "02/01/2006"}} Date d'inscription
{{end}} </th>
</p> <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
<a href="/app/agenda/{{.ViewState.event.ID}}" class="mt-1 max-w-2xl text-sm text-gray-500">Retour</a> Supprimé par
</div> </th>
</div> <th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
</div> <span class="sr-only">Date de supression</span>
</th>
<table class="mt-4 min-w-full divide-y divide-gray-300 border-t border-gray-200"> <th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
<thead class="bg-gray-50"> <span class="sr-only">Actions</span>
<tr> </th>
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 "> </tr>
Bénéficiaire </thead>
</th> {{$evid := .ViewState.event.ID}}
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6"> <tbody class="divide-y divide-gray-200 bg-white">
Prescripteur {{range .ViewState.event.Subscriptions}}
</th> <tr>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6"> <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6 text-center">
Désinscrit par <a href="/app/beneficiaries/{{.Subscriber}}" class="flex">
</th> <img class="h-6 w-6 rounded-co mr-2" src="/app/beneficiaries/{{.Subscriber}}/picture" alt=" "> {{ (index $.ViewState.subscribers .Subscriber).Data.first_name }} {{ (index $.ViewState.subscribers .Subscriber).Data.last_name }}
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6"> </a>
Date de suppression </td>
</th> <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6"> <div class="flex"><img class="h-6 w-6 rounded-co mr-2" src="/app/beneficiaries/{{.Data.subscribed_by.user.id}}/picture" alt=" "> {{.Data.subscribed_by.user.display_name}}</div>
Motif {{.Data.subscribed_by.group.name}}
</th> </td>
</tr> <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
</thead> {{(timeFormat .CreatedAt "02/01/2006")}}
<tbody class="divide-y divide-gray-200 bg-white"> </td>
{{range .ViewState.event.DeletedSubscription}} <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<tr> <!-- <a href=""
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6 text-center"> class="text-co-blue hover:text-co-blue">Voir</a> -->
<a href="/app/beneficiaries/{{.Subscriber}}" class="flex"> </td>
<img class="h-6 w-6 rounded-co mr-2" src="/app/beneficiaries/{{.Subscriber}}/picture" alt=" ">
{{ (index $.ViewState.subscribers .Subscriber).Data.first_name }} {{ (index
$.ViewState.subscribers .Subscriber).Data.last_name }}
</a>
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<div class="flex"><img class="h-6 w-6 rounded-co mr-2"
src="/app/beneficiaries/{{.Data.subscribed_by.user.id}}/picture" alt=" ">
{{.Data.subscribed_by.user.display_name}}</div>
{{.Data.subscribed_by.group.name}}
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<div class="flex"><img class="h-6 w-6 rounded-co mr-2"
src="/app/beneficiaries/{{.Data.unsubscribed_by.user.id}}/picture" alt=" ">
{{.Data.unsubscribed_by.user.display_name}}</div>
{{.Data.unsubscribed_by.group.name}}
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
{{(timeFormat .CreatedAt "02/01/2006")}}
</td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<div class="flex">{{.Data.motif}}</div>
</td>
</tr>
{{end}}
</tbody>
</table>
</main>
</tr>
{{end}}
</tbody>
</table>
{{end}} {{end}}