correction bug cration actif AUTTRE

This commit is contained in:
2020-04-14 09:30:43 +02:00
parent e5acd171fc
commit e344887606
2 changed files with 22 additions and 9 deletions

View File

@@ -20,15 +20,9 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-2" for="doc-text">Texte</label> <label class="control-label col-xs-2" for="texte">Texte</label>
<div class="col-xs-8"> <div class="col-xs-8">
<textarea class="form-control" rows="15" cols="40" id="doc-text" name="texte" <textarea class="form-control" rows="15" cols="40" id="texte" name="texte">${texte}</textarea>
data-fv-notempty="true"
data-fv-notempty-message="Le texte est obligatoire"
data-fv-stringlength="true"
data-fv-stringlength-max="30000"
data-fv-stringlength-message="30000 caractères maximum">${texte}
</textarea>
</div> </div>
</div> </div>
@@ -64,7 +58,25 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('#doc_edit-form').formValidation(); $('#doc_edit-form').formValidation({
framework: 'bootstrap',
message: 'This value is not valid',
icon: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
texte: {
validators: {
stringLength: {
max: 30000,
message: '30000 caractères maximum'
},
}
},
},
});
$('form input').on('keypress', function(e) { $('form input').on('keypress', function(e) {
return e.which !== 13; return e.which !== 13;
}); });

View File

@@ -117,6 +117,7 @@ def actif2_edit(request):
actif['cours'] = '0' actif['cours'] = '0'
actif['ter'] = '0' actif['ter'] = '0'
actif['pc_rdt'] = '0' actif['pc_rdt'] = '0'
actif['modif_le'] = None
page_title= 'Nouvel actif' page_title= 'Nouvel actif'
else: else:
# lire la fiche du actif # lire la fiche du actif