cadoles-arcad/template/layouts/admin_app_edit.html.tmpl

92 lines
4.7 KiB
Cheetah

{{define "title"}}Modifier l'app - Administration - Arcad{{end}}
{{define "body"}}
{{template "header" .}}
<section class="block">
<div>
<div>
<div>
{{template "admin_menu" ""}}
</div>
<div>
{{template "flash" .}}
<div>
<div>
<a class="button level-item" href="/admin/apps">← Retour</a>
</div>
<div class="level-right"></div>
</div>
<form action="/admin/apps/{{ .App.ID }}" method="post">
<div>
<div>
<h5 class="text-center text-gray-900 mt-4 text-xl font-medium font-bold mb-2">Informations de l'app</h5>
<div class="field level-item">
<input id="publishedSwitch" type="checkbox" name="published" class="" {{if .IsPublished}}checked="checked"{{end}} />
<label for="publishedSwitch">Publiée ?</label>
</div>
</div>
<div class="field">
<label class="block text-gray-700 text-lg font-bold mb-2">Identifiant</label>
<div>
<p class="shadow appearance-none border focus:border-cyan-600 rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline">{{ .App.ID }}</p>
</div>
</div>
<div class="field">
<label class="block text-gray-700 text-lg font-bold mb-2">Titre</label>
<div>
<input class="shadow appearance-none border focus:border-cyan-600 rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline" type="text"
name="title"
value="{{if .Form}}{{ .Form.Get "title" }}{{else}}{{ .App.Manifest.Title }}{{end}}">
</div>
</div>
<div class="field">
<label class="block text-gray-700 text-lg font-bold mb-2">Description</label>
<div>
<textarea class="h-64 focus:border-cyan-600 block w-full px-3 py-1.5 text-base font-normal text-gray-700 bg-white bg-clip-padding border border-solid border-gray-300 rounded transition ease-in-out m-0 focus:text-gray-700 focus:bg-white focus:outline-none"
name="description">{{if .Form}}{{ .Form.Get "description" }}{{else}}{{ .App.Manifest.Description }}{{end}}</textarea>
</div>
</div>
<div class="field">
<label class="block text-gray-700 text-lg font-bold mb-2">Ordre d'affichage</label>
<div>
<input class="shadow appearance-none border focus:border-cyan-600 rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline" type="number"
step="1"
min="0"
name="order"
value="{{if .Form}}{{ .Form.Get "order" }}{{else}}{{ .App.Order }}{{end}}">
</div>
</div>
<div class="field" data-controller="tags-editor">
<label class="block text-gray-700 text-lg font-bold mb-2">Tags</label>
<div>
<div class="field has-addons">
<div class="flex">
<input class="w-5/6 shadow appearance-none border focus:border-cyan-600 rounded-l w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" type="text" placeholder="Nouveau tag" data-target="tags-editor.newTag">
<a class="text-center w-1/6 text-white p-1 bg-cyan-600 text-bold rounded-r" data-action="click->tags-editor#onAddTag">
+
</a>
</div>
</div>
<div class="hidden" data-target="tags-editor.tagsContainer"></div>
<input class="mt-4 shadow appearance-none border focus:border-cyan-600 rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline" type="text"
data-target="tags-editor.tagsSource"
name="tags"
value="{{if .Form}}{{ .Form.Get "tags" }}{{else}}{{range .App.Manifest.Tags}}{{.}},{{end}}{{end}}" />
</div>
</div>
{{ .csrfField }}
<div class="buttons" style="justify-content:flex-end">
<button type="submit" class="block m-auto mt-8 bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">Modifier</button>
</div>
</div>
</form>
</div>
</div>
</div>
</section>
{{end}}
{{define "body_script"}}
<script defer src="/admin.js"></script>
{{end}}
{{template "base" .}}