ajout p_texts

This commit is contained in:
2020-03-12 22:33:40 +01:00
parent 932fc6a441
commit ae4484374f
14 changed files with 327 additions and 28 deletions

View File

@@ -1,6 +1,8 @@
<metal:block use-macro="main_template">
<div metal:fill-slot="content">
<div class="alert alert-danger" tal:condition="message" tal:content="message" />
<div class="row">
<form id="change-dossier-details-form" class="form-horizontal" action="${url}" method="post" tal:condition="dossier"
data-fv-framework="bootstrap"
@@ -29,30 +31,15 @@
data-fv-stringlength-message="40 caractères maximum" />
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-4" for="C_CP">Code postal</label>
<div class="col-xs-5">
<input class="form-control" type="text" id="C_CP" name="C_CP" value="${dossier.C_CP}"
placeholder="5 caractères maximum"
data-fv-notempty="true"
data-fv-notempty-message="Le code postal est obligatoire"
data-fv-stringlength="true"
data-fv-stringlength-max="5"
data-fv-stringlength-message="5 caractères maximum" />
<div class="form-group">
<label class="control-label col-xs-4" for="code_postal">Code postal</label>
<div class="col-xs-8">
<input class="form-control" type="text" id="code_postal" name="code_postal" value="${code_postal}"
placeholder="5 caractères maximum"
data-fv-notempty="true"
data-fv-notempty-message="Le code postal est obligatoire" />
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-4" for="C_VILLE">Ville</label>
<div class="col-xs-5">
<input class="form-control" type="text" id="C_VILLE" name="C_VILLE" value="${dossier.C_VILLE}"
placeholder="45 caractères maximum"
data-fv-notempty="true"
data-fv-notempty-message="La Ville est obligatoire"
data-fv-stringlength="true"
data-fv-stringlength-max="25"
data-fv-stringlength-message="25 caractères maximum" />
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Etage</label>
<div class="col-sm-5">
@@ -62,6 +49,11 @@
data-fv-stringlength-max="10"
data-fv-stringlength-message="10 caractères maximum" />
</div>
<div class="col-sm-3 checkbox">
<label><input type="checkbox" name="ascenseur" value="dossier.c_ascenseur" id="ascenseur"
tal:attributes="checked dossier.c_ascenseur != 0 and 'checked' or None">Ascenceur
</label>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Code d'accès</label>
@@ -91,7 +83,7 @@
value="${dossier.C_TEL1}" placeholder="20 caractères maximum"
data-fv-phone="true"
data-fv-phone-country="FR"
data-fv-phone-message="Ce numéro de téléphone n'est pas vailde" />
data-fv-phone-message="Ce numéro de téléphone n'est pas valide" />
</div>
</div>
<div class="form-group">
@@ -156,12 +148,28 @@
<br />
<br />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$(document).ready(function() {
$('#change-dossier-details-form').formValidation();
$('form input').on('keypress', function(e) {
return e.which !== 13;
});
$('#code_postal').autocomplete({
source: function (request, response) {
$.ajax({
url:'/ajax_codepostal',
dataType: 'json',
data: {
recherche: request.term,
},
success: function (data) {
response( data );
},
});
},
minLength: 3,
});
});
</script>

View File

@@ -84,7 +84,18 @@
return '<a href="' + goto_url + data + '">' + data + '</a>';
},
},
]
],
"createdRow": function( row, data, dataIndex ){
if ( data[6] == "Humidité" ) {
$('td', row).eq(6).css('background-color', 'Crimson').css('color', 'white');
}
if ( data[6] == "En-cours" ) {
$('td', row).eq(6).css('background-color', 'Orange');
}
if ( data[6] == "Terminé" ) {
$('td', row).eq(6).css('background-color', 'LightGreen');
}
},
});
});

View File

@@ -24,11 +24,14 @@
<tr>
<td>
Etage - Code<br />
Ascenseur<br />
Tél. domicile - prof.<br />
Tél. mobile - fax
</td>
<td>
${dossier.C_ETAGE} - ${dossier.C_CODE}<br />
<span tal:condition="dossier.c_ascenseur==0">NON</span><br />
<span tal:condition="dossier.c_ascenseur!=0">OUI</span><br />
${dossier.C_TEL1} - ${dossier.C_TEL2}<br />
${dossier.C_TELP} - ${dossier.C_FAX}
</td>

View File

@@ -10,6 +10,7 @@
<!-- Bootstrap core + Plug-ins CSS -->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet">
<link href="//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.9.0/fullcalendar.min.css" rel="stylesheet">
<link href="//cdnjs.cloudflare.com/ajax/libs/fullcalendar-scheduler/1.9.4/scheduler.min.css" rel="stylesheet">
<link href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" rel="stylesheet">

View File

@@ -11,6 +11,10 @@
<a href="${request.application_url}/rdf_causes_list"><span class="glyphicon glyphicon-tint logo-primary"></span></a>
<h4>RDF : CAUSES</h4>
</div>
<div class="col-sm-3">
<a href="${request.application_url}/text_list"><span class="glyphicon glyphicon-list-alt logo-primary"></span></a>
<h4>TEXTES EMAIL</h4>
</div>
</div>
<br />
<div class="row text-center">

View File

@@ -0,0 +1,69 @@
<metal:block use-macro="main_template">
<div metal:fill-slot="content">
<div class="alert alert-danger" tal:condition="message" tal:content="message" />
<div class="row">
<form id="text_edit-form" action="${url}" method="post" class="form-horizontal">
<div class="form-group">
<label class="control-label col-xs-2" for="intitule">Intitulé</label>
<div class="col-xs-8">
<input class="form-control" type="text" id="intitule" name="intitule" value="${intitule}"
placeholder="40 caractères maximum"
data-fv-notempty="true"
data-fv-notempty-message="L'intitule est obligatoire"
data-fv-stringlength="true"
data-fv-stringlength-max="40"
data-fv-stringlength-message="40 caractères maximum" />
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-2" for="text-text">Texte</label>
<div class="col-xs-8">
<textarea class="form-control monospace-font" rows="15" cols="40" id="text-text" name="texte">${texte}</textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-2" for="theme">Thème</label>
<div class="col-xs-4">
<select class="form-control" id="theme" name="theme">
<div tal:repeat="item themes">
<option value="${item}" tal:attributes="selected theme==item and 'selected' or None">${item}</option>
</div>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-8">
<button class="btn btn-primary" type="submit" name="form.submitted">
<span class="glyphicon glyphicon-ok"></span>&nbsp;Enregistrer</button>
<a href="${request.application_url}/text_view/${text_id}" class="btn btn-default" role="button">
<span class="glyphicon glyphicon-chevron-left"></span>&nbsp;Annuler</a>
</div>
</div>
<div class="form-group" tal:condition="text_id != '0'">
<div class="col-sm-offset-2 col-sm-8">
<button class="btn btn-warning" type="submit" name="form.deleted">
<span class="glyphicon glyphicon-remove"></span>&nbsp;Supprimer</button>
</div>
</div>
</form>
<br />
<br />
</div> <!-- row -->
<script>
$(document).ready(function() {
$('#text_edit-form').formValidation();
$('form input').on('keypress', function(e) {
return e.which !== 13;
});
});
</script>
</div>
</metal:block>

View File

@@ -0,0 +1,31 @@
<metal:block use-macro="main_template">
<div metal:fill-slot="content">
<div class="row">
<p>
<a href="text_edit/0" class="btn btn-success" role="button">
<span class="glyphicon glyphicon-plus"></span>&nbsp;
Créer un nouveau texte</a>
</p>
<table class="table table-condensed table-striped table-bordered">
<tr>
<th>Intitulé</th>
<th>Thème</th>
<th>Dernière mise à jour</th>
</tr>
<tr tal:repeat="ligne texts">
<td><a href="text_view/${ligne.text_id}">${ligne.intitule}</a></td>
<td>${ligne.theme}</td>
<td><span tal:content="ligne.modif_le.strftime('%d/%m/%Y %H:%M')" /></td>
</tr>
</table>
</div>
<br />
<br />
</div>
</metal:block>

View File

@@ -0,0 +1,18 @@
<metal:block use-macro="main_template">
<div metal:fill-slot="content">
<br />
<a href="${request.application_url}/text_list" class="btn btn-default" role="button">
<span class="glyphicon glyphicon-chevron-left"></span>&nbsp;Fermer</a>
<a href="${request.application_url}/text_edit/${text_id}" class="btn btn-primary" role="button">
<span class="glyphicon glyphicon-pencil"></span>&nbsp;Modifier</a>
<br />
<hr>
<div tal:replace="structure texte">Page text goes here.</div>
<hr>
<br />
<br />
</div>
</metal:block>