edit web/layouts/agenda/_partials/event-files.html & web/layouts/agenda/display-event.html

This commit is contained in:
Nicolas CARON 2024-10-15 10:52:23 +02:00
parent 56f0700999
commit 5eccdcf89b
4 changed files with 22 additions and 10 deletions

View File

@ -105,6 +105,7 @@ views:
files:
- web/layouts/_partials/address_autocomplete.html
- web/layouts/agenda/create-event.html
- web/layouts/agenda/_partials/event-files.html
delete_subscriber:
files:
- web/layouts/agenda/delete-subscriber.html

View File

@ -45,6 +45,7 @@ x-data="{
<table class="min-w-full divide-y divide-gray-300">
<thead>
<tr>
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Type</th>
<th scope="col" class="hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 lg:table-cell">Nom du document</th>
<th scope="col" class="hidden px-3 py-3.5 text-left text-sm font-semibold text-gray-900 lg:table-cell">Ajouté le</th>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
@ -55,6 +56,11 @@ x-data="{
<tbody>
{{range .ViewState.documents}}
<tr>
<td class="relative py-4 pl-4 sm:pl-6 pr-3 text-sm">
<div class="font-medium text-gray-900">
<span class="bg-co-blue text-xs text-white rounded-xl p-1 mr-2">{{index $.ViewState.file_types_map .Metadata.Type}}</span>
</div>
</td>
<td class="px-3 py-3.5 text-sm text-gray-900 lg:table-cell">{{.Metadata.Name}}</td>
<td class="px-3 py-3.5 text-sm text-gray-500 lg:table-cell">{{.LastModified.Format "02/01/2006"}}</td>
<td class="relative py-3.5 pl-3 pr-4 sm:pr-6 text-right text-sm font-medium">
@ -72,7 +78,7 @@ x-data="{
</div>
{{end}}
{{ if eq (index .ViewState.event.Owners 0) .Group.ID }}
<h3 class="text-lg">Ajouter un document</h3>
<form method="POST" action="/app/agenda/{{.ViewState.event.ID}}/documents" @submit="submit" enctype="multipart/form-data">
<div class="md:grid md:grid-cols-6 p-2">
@ -123,6 +129,6 @@ x-data="{
Ajouter le document
</button>
</form>
{{end}}
</div>
{{end}}

View File

@ -200,8 +200,6 @@
</div>
</div>
<div class="flex justify-end">
<p x-show="! isFormValid" class="px-4 py-2 text-sm text-co-red">Certains champs de sont pas valides.</p>
<a href="/app/agenda/">

View File

@ -85,6 +85,7 @@
</div>
</div>
</section>
{{ if eq (index .ViewState.event.Owners 0) .Group.ID }}
<section aria-labelledby="subscribers-table"></section>
<div class="bg-white shadow sm:rounded-lg">
@ -203,13 +204,19 @@
{{end}}
{{end}}
</div>
</section>
</div>
<div class="mt-8 max-w-3xl mx-auto grid grid-cols-1 gap-6 sm:px-6 lg:max-w-7xl lg:grid-flow-col-dense lg:grid-cols-3">
<div class="space-y-6 lg:col-start-1 lg:col-span-2">
<section aria-labelledby="event-documents">
<div class="bg-white mt-4 px-4 py-5 shadow sm:rounded-lg sm:px-6">
<h2 id="documents-title" class="text-lg font-medium text-gray-900">Documents</h2>
<div class="flex justify-between items-center">
<div>{{template "event_files" .}}</div>
</div>
</div>
</section>
</div>
</div>
</main>
{{ end }}