parcoursmob/themes/default/web/layouts/administration/create_group.html

142 lines
8.0 KiB
HTML

{{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">Administration > Créer une organisation</h1>
</div>
<div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8 mt-8" x-data="{
fields: {
name: null,
},
rules: {
name: ['required'],
},
formValidation: {
valid: false,
fields: {
name: {valid: null},
}
},
isFormValid: true,
validate() {
this.formValidation = Iodine.assert(this.fields, this.rules)
},
validateField(field) {
this.formValidation.fields[field] = Iodine.assert(this.fields[field], this.rules[field])
},
submit(event) {
this.validate()
if(!this.formValidation.valid) {
this.isFormValid = false
event.preventDefault()
}
return this.formValidation.valid
}
}">
<form class="space-y-6" method="POST" @submit="submit">
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
<div class="md:grid md:grid-cols-3 md:gap-6">
<div class="md:col-span-1">
<h3 class="text-lg font-medium leading-6 text-gray-900">Nouvelle organisation</h3>
<p class="mt-1 text-sm text-gray-500">Informations de base sur la nouvelle organisation à créer</p>
</div>
<div class="mt-5 md:mt-0 md:col-span-2">
<div class="grid grid-cols-6 gap-6">
<div class="col-span-6">
<label for="name" class="block text-sm font-medium text-gray-700">Nom de
l'organisation</label>
<input type="text" name="name" id="name"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
x-model="fields.name" @blur="validateField('name')"
:class="formValidation.fields.name.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
</div>
</div>
</div>
</div>
</div>
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6">
<div class="md:grid md:grid-cols-3 md:gap-6">
<div class="md:col-span-1">
<h3 class="text-lg font-medium leading-6 text-gray-900">Paramètres</h3>
<p class="mt-1 text-sm text-gray-500">Paramètres de configuration de l'organisation (modules
accessibles, ...)</p>
</div>
<div class="mt-5 md:mt-0 md:col-span-2">
<fieldset>
<legend class="sr-only">Droits d'accès aux modules</legend>
<div class="text-base font-medium text-gray-900" aria-hidden="true">Droits d'accès aux modules</div>
<div class="mt-4 space-y-4">
<div class="flex items-start">
<div class="h-5 flex items-center">
<input id="beneficiaries" name="modules.beneficiaries" type="checkbox" checked
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
</div>
<div class="ml-3 text-sm">
<label for="modules.beneficiaries" class="font-medium text-gray-700">Bénéficiaires</label>
<p class="text-gray-500">Gestion des bénéficiaires assignés à sa propre organisation.
</p>
</div>
</div>
<div class="flex items-start">
<div class="flex items-center h-5">
<input id="journeys" name="modules.journeys" type="checkbox"
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
</div>
<div class="ml-3 text-sm">
<label for="modules.journeys" class="font-medium text-gray-700">Déplacements</label>
<p class="text-gray-500">Trouver des solutions et organiser les déplacements de ses bénéficiaires.</p>
</div>
</div>
<div class="flex items-start">
<div class="flex items-center h-5">
<input id="vehicles" name="modules.vehicles" type="checkbox"
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
</div>
<div class="ml-3 text-sm">
<label for="modules.vehicles" class="font-medium text-gray-700">Véhicules</label>
<p class="text-gray-500">Trouver et réserver des véhicules pour ses bénéficiaires.
</p>
</div>
</div>
<div class="flex items-start">
<div class="flex items-center h-5">
<input id="vehicles_management" name="modules.vehicles_management" type="checkbox"
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
</div>
<div class="ml-3 text-sm">
<label for="modules.vehicles_management" class="font-medium text-gray-700">Gestion des véhicules</label>
<p class="text-gray-500">Gérer les véhicules et réservations (pour les gestionnaires de flottes)
</p>
</div>
</div>
<div class="flex items-start">
<div class="flex items-center h-5">
<input id="events" name="modules.events" type="checkbox"
class="focus:ring-co-blue h-4 w-4 text-co-blue border-gray-300 rounded">
</div>
<div class="ml-3 text-sm">
<label for="modules.events" class="font-medium text-gray-700">Agenda dispositifs</label>
<p class="text-gray-500">Agenda des dispositifs pour les bénéficiaires (sessions permis, événements, ...)
</p>
</div>
</div>
</div>
</fieldset>
</div>
</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/administration/">
<button type="button"
class="bg-white py-2 px-4 border border-gray-300 rounded-2xl shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Annuler</button>
</a>
<button type="submit"
class="ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-2xl text-white bg-co-blue hover:bg-co-blue focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-co-blue">Créer l'organisation</button>
</div>
</form>
</div>
{{end}}