go-skeletor/templates/config/edit.tmpl

114 lines
5.1 KiB
Cheetah

{{if eq .mode "submit"}}
<h1>Ajout Configuration</h1>
{{else}}
<h1>Modification Configuration = {{.config.Title}}</h1>
{{end}}
{{$value:=.config.Value}}
{{ if eq $value ""}}
{{$value = .config.Defaultvalue}}
{{end}}
<form method="post">
<button type="submit" href="{{.conf.AppRoutes.usersubmit}}" class="btn btn-success">Valider</button>
<a href="{{.conf.AppRoutes.configlist}}" class="btn btn-secondary">Annuler</a>
{{if eq .mode "update"}}
<a href="{{.conf.AppRoutes.configdelete}}" class="btn btn-danger float-end">Supprimer</a>
{{end}}
<div class="alert alert-info mt-3" role="alert">
{{.config.Help | unescaped}}
</div>
<div class="card mt-3">
<div class="card-header">
Informations
</div>
<div class="card-body">
<div class="mb-3">
{{if eq .config.Typefield "string"}}
<label for="value" class="form-label form-required">Valeur</label>
<input type="string" class="form-control" id="value" name="value" required value="{{$value}}">
{{end}}
{{if eq .config.Typefield "integer"}}
<label for="value" class="form-label form-required">Valeur</label>
<input type="number" min=1 class="form-control" id="value" name="value" required value="{{$value}}">
{{end}}
{{if eq .config.Typefield "color"}}
<label for="value" class="form-label form-required">Valeur</label>
<input type="string" class="form-control spectrum" id="value" name="value" required value="{{$value}}">
{{end}}
{{if eq .config.Typefield "logo"}}
<center>
<img src="{{.conf.AppWeburl}}/uploads/logo/{{$value}}" id="valueimage" height="90px">
<input type="hidden" class="form-control" id="value" name="value" required value="{{$value}}"><br>
<bouton class="btn btn-info mt-1" style="width:90px" onClick="ModalLoad('mymodallarge','Logo','{{.conf.AppRoutes.upload}}logo/value');" title='Ajouter un Logo'>Modifier</a>
</center>
{{end}}
{{if eq .config.Typefield "font"}}
<div class="form-group">
<label for="value" class="form-label form-required">Valeur</label>
<select id="value" name="value" class="form-control">
<option value=""></option>
<option value="ABeeZee-Regular">ABeeZee-Regular</option>
<option value="Acme-Regular">Acme-Regular</option>
<option value="AlfaSlabOne-Regular">AlfaSlabOne-Regular</option>
<option value="Anton-Regular">Anton-Regular</option>
<option value="Baloo-Regular">Baloo-Regular</option>
<option value="CarterOne-Regular">CarterOne-Regular</option>
<option value="Chewy-Regular">Chewy-Regular</option>
<option value="Courgette-Regular">Courgette-Regular</option>
<option value="FredokaOne-Regular">FredokaOne-Regular</option>
<option value="Grandstander">Grandstander</option>
<option value="Helvetica">Helvetica</option>
<option value="Justanotherhand-Regular">Justanotherhand-Regular</option>
<option value="Lato-Regular">Lato-Regular</option>
<option value="LexendDeca-Regular">LexendDeca-Regular</option>
<option value="LuckiestGuy-Regular">LuckiestGuy-Regular</option>
<option value="Overpass-Black">Overpass-Black</option>
<option value="PassionOne">PassionOne</option>
<option value="Peacesans">Peacesans</option>
<option value="Redressed">Redressed</option>
<option value="Righteous-Regular">Righteous-Regular</option>
<option value="Roboto-Regular">Roboto-Regular</option>
<option value="RubikMonoOne-Regular">RubikMonoOne-Regular</option>
<option value="SigmarOne-Regular">SigmarOne-Regular</option>
<option value="Signika-Regular">Signika-Regular</option>
<option value="Teko-Bold">Teko-Bold</option>
<option value="Viga-Regular">Viga-Regular</option>
</select>
</div>
{{end}}
{{if eq .config.Typefield "editor"}}
<textarea name="value" class="ckeditor">
{{$value | unescaped}}
</textarea>
{{end}}
</div>
</div>
</div>
</form>
<script>
{{if eq .config.Typefield "font"}}
$('#value option[value="{{$value}}"]').prop('selected', true);
{{end}}
{{if eq .config.Typefield "logo"}}
function CallbackUpload(id,path,filename) {
$("#"+id).val(filename);
$("#"+id+"image").attr("src",path+filename);
$("#mymodallarge").modal("hide");
}
{{end}}
</script>