test dessin_edit
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
<metal:block use-macro="main_template">
|
||||
<div metal:fill-slot="content">
|
||||
|
||||
<div style="row">
|
||||
<div id="dessin"></div>
|
||||
</div> <!-- row -->
|
||||
|
||||
|
||||
<!-- Drawingboard -->
|
||||
<link href="${request.static_url('mondumas:static/dist/drawingboard/drawingboard.min.css')}" rel="stylesheet" media="all">
|
||||
<script src="${request.static_url('mondumas:static/dist/drawingboard/drawingboard.min.js')}"></script>
|
||||
<script>
|
||||
var simpleBoard = new DrawingBoard.Board('dessin', {
|
||||
background: 'none',
|
||||
size: 10,
|
||||
controls: [
|
||||
'Color',
|
||||
{ Size: { type: 'dropdown' } },
|
||||
{ Navigation: { } },
|
||||
],
|
||||
size: 1,
|
||||
webStorage: 'session',
|
||||
enlargeYourContainer: true
|
||||
});
|
||||
</script>
|
||||
|
||||
</div><!-- content -->
|
||||
</metal:block>
|
||||
60
mondumas/templates/dossier/dessin_edit.pt
Normal file
60
mondumas/templates/dossier/dessin_edit.pt
Normal file
@@ -0,0 +1,60 @@
|
||||
<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="dessin_edit-form" action="${url}" method="post">
|
||||
<div class="form-group">
|
||||
<a href="${request.application_url}/dossier_view/${nodossier}" class="btn btn-default" role="button">
|
||||
<span class="glyphicon glyphicon-chevron-left"></span> Annuler</a>
|
||||
<button class="btn btn-primary" type="submit" name="form.submitted">
|
||||
<span class="glyphicon glyphicon-ok"></span> Enregistrer</button>
|
||||
</div>
|
||||
<!-- this will be the input used to pass the drawingboard content to the server -->
|
||||
<input type="hidden" name="image" value="">
|
||||
|
||||
</form>
|
||||
</div> <!-- row -->
|
||||
<div style="row">
|
||||
<div id="dessin"></div>
|
||||
</div> <!-- row -->
|
||||
|
||||
<!-- Drawingboard -->
|
||||
<link href="${request.static_url('mondumas:static/dist/drawingboard/drawingboard.min.css')}" rel="stylesheet" media="all">
|
||||
<script src="${request.static_url('mondumas:static/dist/drawingboard/drawingboard.min.js')}"></script>
|
||||
<script>
|
||||
var simpleBoard = new DrawingBoard.Board('dessin', {
|
||||
background: 'none',
|
||||
size: 10,
|
||||
controls: [
|
||||
'Color',
|
||||
{ Size: { type: 'dropdown' } },
|
||||
{ Navigation: { } },
|
||||
],
|
||||
size: 1,
|
||||
webStorage: 'session',
|
||||
enlargeYourContainer: true
|
||||
});
|
||||
$(document).ready(function() {
|
||||
$('#dessin_edit-form').on('submit', function(e) {
|
||||
//get drawingboard content
|
||||
var img = simpleBoard.getImg();
|
||||
|
||||
//we keep drawingboard content only if it's not the 'blank canvas'
|
||||
var imgInput = (simpleBoard.blankCanvas == img) ? '' : img;
|
||||
// alert("imgInput : " + imgInput);
|
||||
|
||||
//put the drawingboard content in the form field to send it to the server
|
||||
$(this).find('input[name=image]').val( imgInput );
|
||||
|
||||
//we can also assume that everything goes well server-side
|
||||
//and directly clear webstorage here so that the drawing isn't shown again after form submission
|
||||
//but the best would be to do when the server answers that everything went well
|
||||
simpleBoard.clearWebStorage();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</div><!-- content -->
|
||||
</metal:block>
|
||||
@@ -283,38 +283,24 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3 class="text-center">NOTES et CROQUIS</h3>
|
||||
<h3 class="text-center">NOTES et DESSIN</h3>
|
||||
<p>
|
||||
<a href="${request.application_url}/note_edit/${nodossier}/0" class="btn btn-success" role="button">
|
||||
<span class="glyphicon glyphicon-text-size"></span> Ajouter une NOTE</a>
|
||||
<a href="${request.application_url}/dessin_edit/${nodossier}/0" class="btn btn-success" role="button">
|
||||
<span class="glyphicon glyphicon-picture"></span> Ajouter dessin</a>
|
||||
</p>
|
||||
<br />
|
||||
<div class="row">
|
||||
<!-- bouton AJOUT NOTE-->
|
||||
<div class="text-center col-sm-3">
|
||||
<a href="${request.application_url}/note_add/${nodossier}">
|
||||
<span class="glyphicon glyphicon-plus logo-success"></span>
|
||||
<h4>NOTE</h4></a>
|
||||
</div>
|
||||
<!-- Listes des Notes -->
|
||||
<div class="text-center" tal:repeat="item dem_notes">
|
||||
<div class="col-sm-3">
|
||||
<a href="${request.application_url}/note_edit/${nodossier}/${item.noligne}" tal:condition="item.type_note=='NOTE'">
|
||||
<a href="${request.application_url}/note_edit/${nodossier}/${item.noligne}">
|
||||
<span class="glyphicon glyphicon-text-size logo-primary"></span>
|
||||
<h4>${item.libelle}</h4></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="text-center col-sm-3">
|
||||
<a href="${request.application_url}/croquis_edit/">
|
||||
<span class="glyphicon glyphicon-plus logo-success"></span>
|
||||
<h4>CROQUIS</h4></a>
|
||||
</div>
|
||||
<div class="text-center" tal:repeat="item dem_croquis">
|
||||
<div class="col-sm-3">
|
||||
<a href="${request.application_url}/croquis_edit/" tal:condition="item.type_note=='CROQUIS'">
|
||||
<span class="glyphicon glyphicon-picture logo-primary"></span>
|
||||
<h4>${item.libelle}</h4></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- PANEL RDF -->
|
||||
<div id="tab_rdf" class="tab-pane fade">
|
||||
@@ -394,34 +380,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal : add NOTES et CROQUIS -->
|
||||
<div class="modal fade" id="addNote" role="dialog" aria-labelledby="addNoteLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Ajouter une note ou un croquis</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- The form is placed inside the body of modal -->
|
||||
<form id="add_justif-form" class="form-horizontal" action="${url}" method="post">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-6">Voulez-vous ajouter</label>
|
||||
<div class="col-sm-6">
|
||||
<label class="radio-inline"><input type="radio" name="type_note" value="NOTE" checked>une note</label>
|
||||
<label class="radio-inline"><input type="radio" name="type_note" value="CROQUIS">un croquis</label>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
|
||||
<button type="submit" class="btn btn-warning" name="form.addNote">Ajouter</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</metal:block>
|
||||
|
||||
@@ -5,13 +5,6 @@
|
||||
|
||||
<div class="row">
|
||||
<form id="text_edit-form" action="${url}" method="post">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="text-text">Tapez ou dictez le texte :</label>
|
||||
<textarea class="form-control monospace-font" rows="30" cols="40" id="notes" name="notes">${note.notes}</textarea>
|
||||
</div>
|
||||
<p>Modifié le : ${note.modif_le.strftime('%d-%m-%Y')} par ${note.usermaj}
|
||||
</p>
|
||||
<div class="form-group">
|
||||
<a href="${request.application_url}/dossier_view/${nodossier}" class="btn btn-default" role="button">
|
||||
<span class="glyphicon glyphicon-chevron-left"></span> Annuler</a>
|
||||
@@ -20,10 +13,16 @@
|
||||
<button class="btn btn-warning" type="submit" name="form.deleted">
|
||||
<span class="glyphicon glyphicon-remove"></span> Supprimer</button>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="text-text">Tapez ou dictez le texte :</label>
|
||||
<textarea class="form-control monospace-font" rows="30" cols="40" id="notes" name="notes">${note.notes}</textarea>
|
||||
</div>
|
||||
<p>Modifié le : ${note.modif_le.strftime('%d-%m-%Y')} par ${note.usermaj}
|
||||
</p>
|
||||
</form>
|
||||
<br />
|
||||
<br />
|
||||
</div> <!-- row -->
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
Reference in New Issue
Block a user