Compare commits

...

12 Commits

22 changed files with 282 additions and 77 deletions

View File

@ -191,6 +191,7 @@ views:
display_diag: display_diag:
files: files:
- web/layouts/diags/display-diag.html - web/layouts/diags/display-diag.html
- web/layouts/diags/_partials/diags-files.html
delete: delete:
files: files:
- web/layouts/diags/delete-diag.html - web/layouts/diags/delete-diag.html

View File

@ -1,4 +1,4 @@
{{define "content"}} {{define "content"}}
<p>Vous avez reçu un commentaire sur PARCOURSMOB de la part de <b>{{.user}}</b></p> <p>Vous avez reçu un commentaire sur PARCOURSMOB de la part de <b>{{.user}}</b></p>
<p>{{.key}}</p> <p>{{unescapeHTML .key}}</p>
{{end}} {{end}}

View File

@ -8,7 +8,7 @@
fields: { fields: {
name: null, name: null,
type: null, type: null,
description: null, description: '',
allday: false, allday: false,
startdate: null, startdate: null,
enddate: null, enddate: null,
@ -50,6 +50,16 @@
} }
}, },
isFormValid: true, isFormValid: true,
init() {
let quill = new Quill(this.$refs.quill, { theme: 'snow' })
quill.root.innerHTML = this.fields.description
quill.on('text-change', () => {
this.fields.description = quill.root.innerHTML
})
},
validate() { validate() {
this.formValidation = Iodine.assert(this.fields, this.rules) this.formValidation = Iodine.assert(this.fields, this.rules)
@ -103,10 +113,12 @@
<div class="col-span-6"> <div class="col-span-6">
<label for="description" class="block text-sm font-medium text-gray-700">Description</label> <label for="description" class="block text-sm font-medium text-gray-700">Description</label>
<div class="mt-1"> <div class="mt-1">
<textarea rows="4" name="description" id="descrpition" x-model="fields.description" <!-- <textarea rows="4" name="description" id="descrpition" x-model="fields.description"
@blur="validateField('description')" @blur="validateField('description')"
:class="formValidation.fields.description.valid == false ? 'border-co-red border-2' : 'border-gray-300'" :class="formValidation.fields.description.valid == false ? 'border-co-red border-2' : 'border-gray-300'"
class="shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-2xl"></textarea> class="shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-2xl"></textarea> -->
<input type="hidden" name="description" x-model="fields.description" />
<div x-ref="quill" class="shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-b-2xl">></div>
</div> </div>
</div> </div>
@ -277,4 +289,4 @@
</form> </form>
</div> </div>
{{end}} {{end}}

View File

@ -78,7 +78,7 @@
{{if .ViewState.event.Description}} {{if .ViewState.event.Description}}
<div class="sm:col-span-2"> <div class="sm:col-span-2">
<dt class="text-sm font-medium text-gray-500">Description</dt> <dt class="text-sm font-medium text-gray-500">Description</dt>
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.event.Description}}</dd> <dd class="mt-1 text-sm text-gray-900">{{ unescapeHTML .ViewState.event.Description}}</dd>
</div> </div>
{{end}} {{end}}
</dl> </dl>
@ -219,4 +219,4 @@
</div> </div>
</div> </div>
</main> </main>
{{ end }} {{ end }}

View File

@ -44,6 +44,16 @@
} }
}, },
isFormValid: true, isFormValid: true,
init() {
let quill = new Quill(this.$refs.quill, { theme: 'snow' })
quill.root.innerHTML = this.fields.description
quill.on('text-change', () => {
this.fields.description = quill.root.innerHTML
})
},
validate() { validate() {
this.formValidation = Iodine.assert(this.fields, this.rules) this.formValidation = Iodine.assert(this.fields, this.rules)
@ -99,10 +109,12 @@
<label for="description" class="block text-sm font-medium text-gray-700">Description</label> <label for="description" class="block text-sm font-medium text-gray-700">Description</label>
<div class="mt-1"> <div class="mt-1">
<textarea rows="4" name="description" id="descrpition" value="{{.ViewState.event.Description}}" <!--<textarea rows="4" name="description" id="descrpition" value="{{.ViewState.event.Description}}"
x-model="fields.description" @blur="validateField('description')" x-model="fields.description" @blur="validateField('description')"
:class="formValidation.fields.description.valid == false ? 'border-co-red border-2' : 'border-gray-300'" :class="formValidation.fields.description.valid == false ? 'border-co-red border-2' : 'border-gray-300'"
class="shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-2xl"></textarea> class="shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-2xl"></textarea>-->
<input type="hidden" name="description" x-model="fields.description" />
<div x-ref="quill" class="shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-b-2xl">></div>
</div> </div>
</div> </div>
@ -252,4 +264,4 @@
</div> </div>
</div> </div>
{{end}} {{end}}
{{end}} {{end}}

View File

@ -29,11 +29,12 @@
<div class="flex-1 ml-3"> <div class="flex-1 ml-3">
<a href="/app/diags/{{$diags}}"class="mt-1 text-sm text-gray-900">{{.Name}}</a> <a href="/app/diags/{{$diags}}"class="mt-1 text-sm text-gray-900">{{.Name}}</a>
</div> </div>
<div class="flex-1 ml-3">
<p class="mt-1 text-sm text-gray-900">{{(timeFrom .Diagdate).Format "02/01/2006"}}</p>
</div>
<a href="/app/diags/{{$diags}}" target="_blank"> <a href="/app/diags/{{$diags}}" target="_blank">
<button type="button" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30">Voir<span class="sr-only"> le diagnostic</span></button> <button type="button" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30">Voir<span class="sr-only"> le diagnostic</span></button>
</a> </a>
<a href="/app/diags/{{$diags}}/delete" class="inline-flex"><button type="button"
class="w-full ml-4 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> </li>
{{end}} {{end}}
{{if eq .Deleted true}} {{if eq .Deleted true}}
@ -41,6 +42,9 @@
<div class="flex-1 ml-3"> <div class="flex-1 ml-3">
<p class="mt-1 text-sm text-gray-900">{{.Name}}</p> <p class="mt-1 text-sm text-gray-900">{{.Name}}</p>
</div> </div>
<div class="flex-1 ml-3">
<p class="mt-1 text-sm text-gray-900">{{(timeFrom .Diagdate).Format "02/01/2006"}}</p>
</div>
<div class="flex-1 ml-3"> <div class="flex-1 ml-3">
<p class="mt-1 text-sm text-gray-900">Ce diagnostic a été retiré</p> <p class="mt-1 text-sm text-gray-900">Ce diagnostic a été retiré</p>
</div> </div>

View File

@ -9,21 +9,15 @@
fields: { fields: {
name: null, name: null,
namespace: 'parcoursmob_beneficiaries', namespace: 'parcoursmob_beneficiaries',
json_schema: null,
ui_schema: null,
}, },
rules: { rules: {
name: ['required'], name: ['required'],
namespace: ['required'], namespace: ['required'],
json_schema: ['required'],
ui_schema: ['required']
}, },
formValidation: { formValidation: {
valid: false, valid: false,
fields: { fields: {
name: {valid: null}, name: {valid: null},
json_schema: {valid: null},
ui_schema: {valid: null},
} }
}, },
isFormValid: true, isFormValid: true,
@ -64,7 +58,7 @@
</div> </div>
</div> </div>
<input type="hidden" name="namespace" value="parcoursmob_beneficiaries" /> <input type="hidden" name="namespace" value="parcoursmob_beneficiaries" />
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6 mt-6"> <!-- <div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6 mt-6">
<div class="md:grid md:grid-cols-3 md:gap-6"> <div class="md:grid md:grid-cols-3 md:gap-6">
<div class="md:col-span-1"> <div class="md:col-span-1">
<h3 class="text-lg font-medium leading-6 text-gray-900">Schéma JSON</h3> <h3 class="text-lg font-medium leading-6 text-gray-900">Schéma JSON</h3>
@ -101,7 +95,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div> -->
<div class="flex justify-end"> <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> <p x-show="! isFormValid" class="px-4 py-2 text-sm text-co-red">Certains champs de sont pas valides.</p>
<a href="/app/beneficiaries/{{.ViewState.beneficiary}}"> <a href="/app/beneficiaries/{{.ViewState.beneficiary}}">

View File

@ -0,0 +1,132 @@
{{define "diags_files"}}
<div class="px-4 py-6 sm:px-6"
x-data="{
fields: {
name: null,
type: diagnostic,
file: null,
},
rules: {
name: ['required'],
type: ['required'],
file: ['required'],
},
formValidation: {
valid: false,
fields: {
name: {valid: null},
type: {valid: null},
file: {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
}
}">
{{if eq (len .ViewState.documents) 0}}
<p class="p-12 text-gray-500 text-center text-md">Aucun document</p>
{{end}}
{{if gt (len .ViewState.documents) 0}}
<div class="-mx-4 mb-10 ring-1 ring-gray-300 sm:-mx-6 md:mx-0 md:rounded-lg">
<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">
<span class="sr-only">Actions</span>
</th>
</tr>
</thead>
<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">
<a href="/app/diags/{{$.ViewState.diag.ID}}/documents/{{.FileName}}" target="_blank">
<button type="button" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30">Voir<span class="sr-only"> le document</span></button>
</a>
</td>
</tr>
{{end}}
<!-- More plans... -->
</tbody>
</table>
</div>
{{end}}
<h3 class="text-lg">Ajouter un document</h3>
<form method="POST" action="/app/diags/{{.ViewState.diag.ID}}/documents" @submit="submit" enctype="multipart/form-data">
<div class="md:grid md:grid-cols-6 p-2">
<div class="sm:col-span-2">
<label for="type" class="block text-sm font-medium text-gray-700">Type</label>
<select id="type" name="type" class="mt-1 block w-full rounded-l-2xl border-gray-300 py-2 pl-3 pr-10 text-base focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm"
x-model="fields.type" @blur="validateField('type')"
:class="formValidation.fields.type.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
<option value="" selected>Sélectionner un type</option>
{{range .ViewState.diags_files_types}}
<option value="{{.}}">{{index $.ViewState.file_types_map .}}</option>
{{end}}
</select>
</div>
<div class="sm:col-span-4">
<label for="name" class="block text-sm font-medium text-gray-700">Nom</label>
<input type="text" name="name" id="name"
placeholder="Nom du fichier"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-r-2xl"
x-model="fields.name" @blur="validateField('name')"
:class="formValidation.fields.name.valid == false ? 'border-co-red border-2' : 'border-gray-300'" />
</div>
<div class="sm:col-span-6 mt-4">
<label for="cover-photo" class="block text-sm font-medium text-gray-700">Téléchargement</label>
<div class="mt-1 flex justify-center rounded-md border-2 border-dashed px-6 pt-5 pb-6"
x-on:drop="console.log('toto')"
:class="formValidation.fields.file.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
<div class="space-y-1 text-center">
{{.IconSet.Icon "hero:outline/folder-plus" "mx-auto h-12 w-12 text-gray-400"}}
<div class="flex text-sm text-gray-600">
<label for="file-upload" class="relative cursor-pointer rounded-md bg-white font-medium text-co-blue focus-within:outline-none focus-within:ring-2 focus-within:ring-co-blue focus-within:ring-offset-2 hover:text-co-blue">
<span>Sélectionnez un fichier </span>
<input id="file-upload" name="file-upload" type="file" class="sr-only"
x-model="fields.file" @blur="validateField('file')">
</label>
<!-- <p class="pl-1">ou glissez-déposez</p> -->
</div>
<p class="text-xs text-gray-500">Jusqu'à 10MB</p>
<p class="text-co-blue p-2" x-text="fields.file" x-if="fields.file"></p>
</div>
</div>
</div>
</div>
<button type="submit"
class="rounded-2xl border border-transparent bg-co-blue px-4 py-2 my-4 mt-8 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">
Ajouter le document
</button>
</form>
</div>
{{end}}

View File

@ -27,6 +27,10 @@
</div> </div>
<div class="border-t border-gray-200 px-4 py-5 sm:px-6"> <div class="border-t border-gray-200 px-4 py-5 sm:px-6">
<dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2"> <dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2">
<div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Date du diagnostic</dt>
<dd class="mt-1 text-sm text-gray-900">{{(timeFrom .ViewState.diag.Diagdate).Format "02/01/2006"}}</dd>
</div>
{{if eq .ViewState.diag.Namespace "parcoursmob_beneficiaries"}} {{if eq .ViewState.diag.Namespace "parcoursmob_beneficiaries"}}
<div class="sm:col-span-1"> <div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Type</dt> <dt class="text-sm font-medium text-gray-500">Type</dt>
@ -45,7 +49,7 @@
<dd class="mt-1 text-sm text-gray-900">Diagnostic véhicule réservé</dd> <dd class="mt-1 text-sm text-gray-900">Diagnostic véhicule réservé</dd>
</div> </div>
{{end}} {{end}}
{{if .ViewState.diag.Json_schema}} <!-- {{if .ViewState.diag.Json_schema}}
<div class="sm:col-span-2"> <div class="sm:col-span-2">
<dt class="text-sm font-medium text-gray-500">JSON_schema</dt> <dt class="text-sm font-medium text-gray-500">JSON_schema</dt>
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.diag.Json_schema}}</dd> <dd class="mt-1 text-sm text-gray-900">{{.ViewState.diag.Json_schema}}</dd>
@ -56,9 +60,21 @@
<dt class="text-sm font-medium text-gray-500">UI_schema</dt> <dt class="text-sm font-medium text-gray-500">UI_schema</dt>
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.diag.Ui_schema}}</dd> <dd class="mt-1 text-sm text-gray-900">{{.ViewState.diag.Ui_schema}}</dd>
</div> </div>
{{end}} {{end}} -->
</dl> </dl>
</div> </div>
</div> </div>
</section> </section>
<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 "diags_files" .}}</div>
</div>
</div>
</section>
</div>
</div>
{{ end }} {{ end }}

View File

@ -6,7 +6,7 @@
<div class="sm:flex-auto"> <div class="sm:flex-auto">
<p class="mt-2 text-sm text-gray-700"></p> <p class="mt-2 text-sm text-gray-700"></p>
</div> </div>
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none"> <!-- <div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
<a href="/app/diags/history"> <a href="/app/diags/history">
<button type="button" <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"> 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">
@ -14,7 +14,7 @@
Historique Historique
</button> </button>
</a> </a>
</div> </div> -->
</div> </div>
</div> </div>
@ -32,8 +32,8 @@
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6"> <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
Type Type
</th> </th>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6"> <th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:pl-6">
<span class="sr-only">Actions</span> Date
</th> </th>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6"> <th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
<span class="sr-only">Actions</span> <span class="sr-only">Actions</span>
@ -44,7 +44,6 @@
<a href="/app/diags/{{.ID}}"> <a href="/app/diags/{{.ID}}">
<tr> <tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6"> <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<div class="font-medium text-gray-900">{{.Name}}</div> <div class="font-medium text-gray-900">{{.Name}}</div>
</td> </td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6"> <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
@ -58,6 +57,9 @@
<div class="text-gray-500">Diagnostic véhicule réservé</div> <div class="text-gray-500">Diagnostic véhicule réservé</div>
{{end}} {{end}}
</td> </td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
<div class="font-medium text-gray-900">{{(timeFrom .Diagdate).Format "02/01/2006"}}</div>
</td>
<td class="whitespace nowrap py-4 pl-4 pr-3 text-sm sm:pl-6"> <td class="whitespace nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
{{if eq .Deleted true}} {{if eq .Deleted true}}
<div 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">Diagnostic retiré</div> <div 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">Diagnostic retiré</div>

View File

@ -9,14 +9,10 @@
fields: { fields: {
name: '{{.ViewState.diag.Name}}', name: '{{.ViewState.diag.Name}}',
namespace: '{{.ViewState.diag.Namespace}}', namespace: '{{.ViewState.diag.Namespace}}',
json_schema: '{{.ViewState.diag.Json_schema}}',
ui_schema: '{{.ViewState.diag.Ui_schema}}',
}, },
rules: { rules: {
name: ['required'], name: ['required'],
namespace: ['required'], namespace: ['required']
json_schema: ['required'],
ui_schema: ['required']
}, },
formValidation: { formValidation: {
valid: false, valid: false,
@ -65,7 +61,7 @@
</div> </div>
</div> </div>
<input type="hidden" name="namespace" value="{{.ViewState.diag.Namespace}}" /> <input type="hidden" name="namespace" value="{{.ViewState.diag.Namespace}}" />
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6 mt-6"> <!-- <div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6 mt-6">
<div class="md:grid md:grid-cols-3 md:gap-6"> <div class="md:grid md:grid-cols-3 md:gap-6">
<div class="md:col-span-1"> <div class="md:col-span-1">
<h3 class="text-lg font-medium leading-6 text-gray-900">Schéma JSON</h3> <h3 class="text-lg font-medium leading-6 text-gray-900">Schéma JSON</h3>
@ -102,7 +98,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div> -->
<div class="flex justify-end"> <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> <p x-show="! isFormValid" class="px-4 py-2 text-sm text-co-red">Certains champs de sont pas valides.</p>
<a href="/app/diags/{{.ViewState.diag.ID}}"> <a href="/app/diags/{{.ViewState.diag.ID}}">

View File

@ -5,9 +5,11 @@
<head> <head>
<title>PARCOURSMOB</title> <title>PARCOURSMOB</title>
<link rel="stylesheet" href="/public/css/main.css" /> <link rel="stylesheet" href="/public/css/main.css" />
<link href="https://cdn.jsdelivr.net/npm/quill@2.0.2/dist/quill.snow.css" rel="stylesheet" />
<!-- <script defer type="text/javascript" src="/public/js/main.js" defer></script> --> <!-- <script defer type="text/javascript" src="/public/js/main.js" defer></script> -->
<script src="https://cdn.jsdelivr.net/npm/@kingshott/iodine@8.1.0/dist/iodine.min.umd.js" defer></script> <script src="https://cdn.jsdelivr.net/npm/@kingshott/iodine@8.1.0/dist/iodine.min.umd.js" defer></script>
<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" defer></script> <script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.2/dist/quill.js"></script>
</head> </head>
<body class="h-full" x-data="{ offCanvasMenu: false }"> <body class="h-full" x-data="{ offCanvasMenu: false }">
@ -175,4 +177,4 @@
</body> </body>
</html> </html>
{{end}} {{end}}

View File

@ -54,7 +54,7 @@
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.admins.Data.first_name}}</dd> <dd class="mt-1 text-sm text-gray-900">{{.ViewState.admins.Data.first_name}}</dd>
</div> </div>
<div class="sm:col-span-1"> <div class="sm:col-span-1">
<dt class="text-sm font-medium text-gray-500">Prénon</dt> <dt class="text-sm font-medium text-gray-500">Prénom</dt>
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.admins.Data.last_name}} <dd class="mt-1 text-sm text-gray-900">{{.ViewState.admins.Data.last_name}}
</dd> </dd>
</div> </div>

View File

@ -1,6 +1,17 @@
{{define "content"}} {{define "content"}}
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 space-y-6"> <div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 space-y-6" x-data="{
comment: '',
init() {
let quill = new Quill(this.$refs.quill, { theme: 'snow', modules: { toolbar: [[{ 'header': [1, 2, 3, 4, 5, 6, false] }], ['bold', 'italic', 'underline'], ['link', 'image']] } })
quill.root.innerHTML = this.comment
quill.on('text-change', () => {
this.comment = quill.root.innerHTML
})
},
}">
<h1 class="text-2xl font-semibold text-gray-900">Demande de support technique</h1> <h1 class="text-2xl font-semibold text-gray-900">Demande de support technique</h1>
<div class="bg-white py-2 px-4 shadow sm:rounded-lg sm:px-10"> <div class="bg-white py-2 px-4 shadow sm:rounded-lg sm:px-10">
<p class="text-sm text-gray-600 p-4"> <p class="text-sm text-gray-600 p-4">
@ -10,9 +21,11 @@
<div class="mb-4 w-full bg-gray-50 rounded-3xl border border-gray-200 dark:bg-gray-700 dark:border-gray-600"> <div class="mb-4 w-full bg-gray-50 rounded-3xl border border-gray-200 dark:bg-gray-700 dark:border-gray-600">
<div class="py-2 px-4 rounded-3xl bg-white dark:bg-gray-800"> <div class="py-2 px-4 rounded-3xl bg-white dark:bg-gray-800">
<label class="sr-only">Votre message</label> <label class="sr-only">Votre message</label>
<textarea name="comment" rows="4" class="block w-full resize-none border-0 border-b border-transparent p-0 pb-2 focus:border-co-blue focus:ring-0 sm:text-sm" placeholder="Votre message..." required></textarea> <div x-ref="quill" class="block w-full resize-none border-0 border-b border-transparent p-0 pb-2 focus:border-co-blue focus:ring-0 sm:text-sm"></div>
<input type="hidden" name="comment" x-model="comment" />
</div> </div>
<div class="flex justify-center items-center py-2 px-3 border-t dark:border-gray-600"> <div class="flex justify-center items-center py-2 px-3 border-t dark:border-gray-600">
<button type="submit" value="send message" class="px-2 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"> <button type="submit" value="send message" class="px-2 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">

View File

@ -9,21 +9,15 @@
fields: { fields: {
name: null, name: null,
namespace: 'parcoursmob_bookings', namespace: 'parcoursmob_bookings',
json_schema: null,
ui_schema: null,
}, },
rules: { rules: {
name: ['required'], name: ['required'],
namespace: ['required'], namespace: ['required'],
json_schema: ['required'],
ui_schema: ['required']
}, },
formValidation: { formValidation: {
valid: false, valid: false,
fields: { fields: {
name: {valid: null}, name: {valid: null},
json_schema: {valid: null},
ui_schema: {valid: null},
} }
}, },
isFormValid: true, isFormValid: true,
@ -64,7 +58,7 @@
</div> </div>
</div> </div>
<input type="hidden" name="namespace" value="parcoursmob_bookings" /> <input type="hidden" name="namespace" value="parcoursmob_bookings" />
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6 mt-6"> <!-- <div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6 mt-6">
<div class="md:grid md:grid-cols-3 md:gap-6"> <div class="md:grid md:grid-cols-3 md:gap-6">
<div class="md:col-span-1"> <div class="md:col-span-1">
<h3 class="text-lg font-medium leading-6 text-gray-900">Schéma JSON</h3> <h3 class="text-lg font-medium leading-6 text-gray-900">Schéma JSON</h3>
@ -101,7 +95,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div> -->
<div class="flex justify-end"> <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> <p x-show="! isFormValid" class="px-4 py-2 text-sm text-co-red">Certains champs de sont pas valides.</p>
<a href="/app/vehicles/bookings/{{.ViewState.booking}}"> <a href="/app/vehicles/bookings/{{.ViewState.booking}}">

View File

@ -27,11 +27,12 @@
<div class="flex-1 ml-3"> <div class="flex-1 ml-3">
<a href="/app/diags/{{$diags}}" class="mt-1 text-sm text-gray-900">{{.Name}}</a> <a href="/app/diags/{{$diags}}" class="mt-1 text-sm text-gray-900">{{.Name}}</a>
</div> </div>
<div class="flex-1 ml-3">
<p class="mt-1 text-sm text-gray-900">{{(timeFrom .Diagdate).Format "02/01/2006"}}</p>
</div>
<a href="/app/diags/{{$diags}}" target="_blank"> <a href="/app/diags/{{$diags}}" target="_blank">
<button type="button" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30">Voir<span class="sr-only"> le diagnostic</span></button> <button type="button" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30">Voir<span class="sr-only"> le diagnostic</span></button>
</a> </a>
<a href="/app/diags/{{$diags}}/delete" class="inline-flex"><button type="button"
class="w-full ml-4 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> </li>
{{end}} {{end}}
{{if eq .Deleted true}} {{if eq .Deleted true}}
@ -39,6 +40,9 @@
<div class="flex-1 ml-3"> <div class="flex-1 ml-3">
<p class="mt-1 text-sm text-gray-900">{{.Name}}</p> <p class="mt-1 text-sm text-gray-900">{{.Name}}</p>
</div> </div>
<div class="flex-1 ml-3">
<p class="mt-1 text-sm text-gray-900">{{(timeFrom .Diagdate).Format "02/01/2006"}}</p>
</div>
<div class="flex-1 ml-3"> <div class="flex-1 ml-3">
<p class="mt-1 text-sm text-gray-900">Ce diagnostique a été retiré</p> <p class="mt-1 text-sm text-gray-900">Ce diagnostique a été retiré</p>
</div> </div>

View File

@ -67,8 +67,11 @@
{{if .Data.administrator_unavailability}} {{if .Data.administrator_unavailability}}
<div class="text-gray-900" ></div> <div class="text-gray-900" ></div>
{{else}} {{else}}
<div class="text-gray-900" ><img class="h-6 w-6 rounded-co" <div class="text-gray-900" >
src="/app/beneficiaries/{{.Driver}}/picture" alt=""></div> <!--<img class="h-6 w-6 rounded-co" src="/app/beneficiaries/{{.Driver}}/picture" alt="">-->
{{ (index $.ViewState.drivers_map .Driver).Data.first_name }}
{{ (index $.ViewState.drivers_map .Driver).Data.last_name }}
</div>
{{end}} {{end}}
</td> </td>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6"> <td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6">
@ -94,4 +97,4 @@
</div> </div>
</div> </div>
</div> </div>
{{end}} {{end}}

View File

@ -26,12 +26,13 @@
<li class="py-5 px-4 flex"> <li class="py-5 px-4 flex">
<div class="flex-1 ml-3"> <div class="flex-1 ml-3">
<a href="app/diags/{{$diags}}" class="mt-1 text-sm text-gray-900">{{.Name}}</a> <a href="app/diags/{{$diags}}" class="mt-1 text-sm text-gray-900">{{.Name}}</a>
<div class="flex-1 ml-3">
<p class="mt-1 text-sm text-gray-900">{{(timeFrom .Diagdate).Format "02/01/2006"}}</p>
</div>
</div> </div>
<a href="/app/diags/{{$diags}}" target="_blank"> <a href="/app/diags/{{$diags}}" target="_blank">
<button type="button" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30">Voir<span class="sr-only"> le diagnostic</span></button> <button type="button" class="inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-co-blue focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30">Voir<span class="sr-only"> le diagnostic</span></button>
</a> </a>
<a href="/app/diags/{{$diags}}/delete" class="inline-flex"><button type="button"
class="w-full ml-4 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> </li>
{{end}} {{end}}
{{if eq .Deleted true}} {{if eq .Deleted true}}
@ -39,6 +40,9 @@
<div class="flex-1 ml-3"> <div class="flex-1 ml-3">
<p class="mt-1 text-sm text-gray-900">{{.Name}}</p> <p class="mt-1 text-sm text-gray-900">{{.Name}}</p>
</div> </div>
<div class="flex-1 ml-3">
<p class="mt-1 text-sm text-gray-900">{{(timeFrom .Diagdate).Format "02/01/2006"}}</p>
</div>
<div class="flex-1 ml-3"> <div class="flex-1 ml-3">
<p class="mt-1 text-sm text-gray-900">Ce diagnostique a été retiré</p> <p class="mt-1 text-sm text-gray-900">Ce diagnostique a été retiré</p>
</div> </div>

View File

@ -9,21 +9,15 @@
fields: { fields: {
name: null, name: null,
namespace: 'parcoursmob_vehicles', namespace: 'parcoursmob_vehicles',
json_schema: null,
ui_schema: null,
}, },
rules: { rules: {
name: ['required'], name: ['required'],
namespace: ['required'], namespace: ['required'],
json_schema: ['required'],
ui_schema: ['required']
}, },
formValidation: { formValidation: {
valid: false, valid: false,
fields: { fields: {
name: {valid: null}, name: {valid: null},
json_schema: {valid: null},
ui_schema: {valid: null},
} }
}, },
isFormValid: true, isFormValid: true,
@ -64,7 +58,7 @@
</div> </div>
</div> </div>
<input type="hidden" name="namespace" value="parcoursmob_vehicles" /> <input type="hidden" name="namespace" value="parcoursmob_vehicles" />
<div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6 mt-6"> <!-- <div class="bg-white shadow px-4 py-5 sm:rounded-lg sm:p-6 mt-6">
<div class="md:grid md:grid-cols-3 md:gap-6"> <div class="md:grid md:grid-cols-3 md:gap-6">
<div class="md:col-span-1"> <div class="md:col-span-1">
<h3 class="text-lg font-medium leading-6 text-gray-900">Schéma JSON</h3> <h3 class="text-lg font-medium leading-6 text-gray-900">Schéma JSON</h3>
@ -101,7 +95,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div> -->
<div class="flex justify-end"> <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> <p x-show="! isFormValid" class="px-4 py-2 text-sm text-co-red">Certains champs de sont pas valides.</p>
<a href="/app/vehicles-management/fleet/{{.ViewState.vehicle}}"> <a href="/app/vehicles-management/fleet/{{.ViewState.vehicle}}">

View File

@ -10,11 +10,13 @@
licence_plate: null, licence_plate: null,
name: null, name: null,
type: null, type: null,
informations: '',
}, },
rules: { rules: {
licence_plate: ['required'], // 'regexMatch:^[A-Z]{1,2}-[0-9]{1,3}-[A-Z]{1,2}$' licence_plate: ['required'], // 'regexMatch:^[A-Z]{1,2}-[0-9]{1,3}-[A-Z]{1,2}$'
name: ['required'], name: ['required'],
type: ['required'], type: ['required'],
informations: ['optional']
}, },
formValidation: { formValidation: {
valid: false, valid: false,
@ -22,9 +24,19 @@
name: {valid: null}, name: {valid: null},
licence_plate: {valid: null}, licence_plate: {valid: null},
type: {valid: null}, type: {valid: null},
informations: {valid: null},
} }
}, },
isFormValid: true, isFormValid: true,
init() {
let quill = new Quill(this.$refs.quill, { theme: 'snow', modules: { toolbar: [[{ 'header': [1, 2, 3, 4, 5, 6, false] }], ['bold', 'italic', 'underline'], ['link', 'image']] } })
quill.root.innerHTML = this.fields.informations
quill.on('text-change', () => {
this.fields.informations = quill.root.innerHTML
})
},
validate() { validate() {
this.formValidation = Iodine.assert(this.fields, this.rules) this.formValidation = Iodine.assert(this.fields, this.rules)
}, },
@ -94,13 +106,13 @@
@blur="fields.licence_plate = fields.licence_plate.toUpperCase(); validateField('licence_plate')" @blur="fields.licence_plate = fields.licence_plate.toUpperCase(); validateField('licence_plate')"
:class="formValidation.fields.licence_plate.valid == false ? 'border-co-red border-2' : 'border-gray-300'"> :class="formValidation.fields.licence_plate.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
</div> </div>
<div class="col-span-3"> <!--<div class="col-span-3">
<label for="kilometers" <label for="kilometers"
class="block text-sm font-medium text-gray-700">Kilométrage</label> class="block text-sm font-medium text-gray-700">Kilométrage</label>
<input type="text" name="kilometers" id="kilometers" placeholder="1 km" <input type="text" name="kilometers" id="kilometers" placeholder="1 km"
class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl" class="mt-1 focus:ring-co-blue focus:border-co-blue block w-full shadow-sm sm:text-sm rounded-2xl"
x-model="fields.kilometers"> x-model="fields.kilometers">
</div> </div>-->
</div> </div>
</div> </div>
</div> </div>
@ -118,8 +130,8 @@
<div class="mt-5"> <div class="mt-5">
<label for="informations" class="block text-sm font-medium text-gray-700">Informations pratiques</label> <label for="informations" class="block text-sm font-medium text-gray-700">Informations pratiques</label>
<div class="mt-1"> <div class="mt-1">
<textarea rows="4" name="informations" id="informations" <div x-ref="quill" class="shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-b-2xl"></div>
class="shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-2xl"></textarea> <input type="hidden" name="informations" x-model="fields.informations" />
</div> </div>
</div> </div>
</div> </div>
@ -138,4 +150,4 @@
</div> </div>
</form> </form>
</div> </div>
{{end}} {{end}}

View File

@ -69,7 +69,7 @@
{{if .ViewState.vehicle.Data.informations}} {{if .ViewState.vehicle.Data.informations}}
<div class="sm:col-span-2"> <div class="sm:col-span-2">
<dt class="text-sm font-medium text-gray-500">Informations pratiques pour le bénéficiaire</dt> <dt class="text-sm font-medium text-gray-500">Informations pratiques pour le bénéficiaire</dt>
<dd class="mt-1 text-sm text-gray-900">{{.ViewState.vehicle.Data.informations}}</dd> <dd class="mt-1 text-sm text-gray-900">{{unescapeHTML .ViewState.vehicle.Data.informations}}</dd>
</div> </div>
{{end}} {{end}}
@ -243,4 +243,4 @@
</form> </form>
</div> </div>
</div> </div>
{{end}} {{end}}

View File

@ -10,6 +10,7 @@
licence_plate: '{{ .ViewState.vehicle.Data.licence_plate }}', licence_plate: '{{ .ViewState.vehicle.Data.licence_plate }}',
name: '{{ .ViewState.vehicle.Data.name }}', name: '{{ .ViewState.vehicle.Data.name }}',
kilometers: '{{ .ViewState.vehicle.Data.kilometers }}', kilometers: '{{ .ViewState.vehicle.Data.kilometers }}',
informations: '{{ .ViewState.vahicle.Data.informations}}',
}, },
rules: { rules: {
licence_plate: ['required', 'regexMatch:^[A-Z]{1,2}-[0-9]{1,3}-[A-Z]{1,2}$'], licence_plate: ['required', 'regexMatch:^[A-Z]{1,2}-[0-9]{1,3}-[A-Z]{1,2}$'],
@ -23,6 +24,15 @@
} }
}, },
isFormValid: true, isFormValid: true,
init() {
let quill = new Quill(this.$refs.quill, { theme: 'snow', modules: { toolbar: [[{ 'header': [1, 2, 3, 4, 5, 6, false] }], ['bold', 'italic', 'underline'], ['link', 'image']] } })
quill.root.innerHTML = this.fields.informations
quill.on('text-change', () => {
this.fields.informations = quill.root.innerHTML
})
},
validate() { validate() {
this.formValidation = Iodine.assert(this.fields, this.rules) this.formValidation = Iodine.assert(this.fields, this.rules)
}, },
@ -95,7 +105,7 @@
@blur="fields.licence_plate = fields.licence_plate.toUpperCase(); validateField('licence_plate')" @blur="fields.licence_plate = fields.licence_plate.toUpperCase(); validateField('licence_plate')"
:class="formValidation.fields.licence_plate.valid == false ? 'border-co-red border-2' : 'border-gray-300'"> :class="formValidation.fields.licence_plate.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
</div> </div>
<div class="col-span-3"> <!--<div class="col-span-3">
<label for="kilometers" <label for="kilometers"
class="block text-sm font-medium text-gray-700">Kilométrage</label> class="block text-sm font-medium text-gray-700">Kilométrage</label>
<input type="text" name="kilometers" id="kilometers" placeholder="1200 km" <input type="text" name="kilometers" id="kilometers" placeholder="1200 km"
@ -103,7 +113,7 @@
x-model="fields.kilometers" x-model="fields.kilometers"
@blur="fields.kilometers; validateField('kilometers')" @blur="fields.kilometers; validateField('kilometers')"
:class="formValidation.fields.kilometers.valid == false ? 'border-co-red border-2' : 'border-gray-300'"> :class="formValidation.fields.kilometers.valid == false ? 'border-co-red border-2' : 'border-gray-300'">
</div> </div>-->
</div> </div>
</div> </div>
</div> </div>
@ -121,8 +131,8 @@
<div class="mt-5"> <div class="mt-5">
<label for="informations" class="block text-sm font-medium text-gray-700">Informations pratiques pour le bénéficiaire</label> <label for="informations" class="block text-sm font-medium text-gray-700">Informations pratiques pour le bénéficiaire</label>
<div class="mt-1"> <div class="mt-1">
<textarea rows="4" name="informations" id="informations" <div x-ref="quill" class="shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-b-2xl"></div>
class="shadow-sm focus:ring-co-blue focus:border-co-blue block w-full sm:text-sm border-gray-300 rounded-2xl"></textarea> <input type="hidden" name="informations" x-model="fields.informations" />
</div> </div>
</div> </div>
</div> </div>
@ -141,4 +151,4 @@
</div> </div>
</form> </form>
</div> </div>
{{end}} {{end}}