added message to clarify which fields are mandatory when creating an annotation
authordurandn
Mon, 24 Oct 2016 14:04:26 +0200
changeset 232 ba23092b436a
parent 231 b7c007c10abe
child 233 c8e69dc3aafd
added message to clarify which fields are mandatory when creating an annotation
src/iconolab/templates/iconolab/change_annotation.html
--- a/src/iconolab/templates/iconolab/change_annotation.html	Thu Oct 20 15:30:47 2016 +0200
+++ b/src/iconolab/templates/iconolab/change_annotation.html	Mon Oct 24 14:04:26 2016 +0200
@@ -96,7 +96,15 @@
                           <span class="sr-only">Erreur:</span>
                             {{ form.non_field_errors | striptags }}
                         </div>
+                    {% else %}
+                      {% if not annotation %}
+                        <div class="alert alert-info" role="alert">
+                          <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
+                          <span class="sr-only">Info:</span>
+                            Un de ces trois champs doit être non-vide: titre, description ou mots-clés.
+                        </div>
                       {% endif %}
+                    {% endif %}
           
                     {% if form.errors %}
                     <div id="errors" style="display: none;">
@@ -109,7 +117,7 @@
                     {% endif %}
                     {% csrf_token %}
                     <fieldset class="form-group {% if form.title.errors %}has-error{% endif %}">
-                      <label class="control-label" for="id_{{ form.title.name }}">{{ form.title.label }}</label>
+                      <label class="control-label" for="id_{{ form.title.name }}">Titre</label>
                       {% if form.title.errors %}
                         <div class="alert alert-danger" role="alert">
                           <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
@@ -122,7 +130,7 @@
                         id="id_{{ form.title.name }}" value="{% if form.title.value %}{{ form.title.value}}{% endif %}">
                     </fieldset>
                     <fieldset class="form-group {% if form.description.errors %}has-error{% endif %}">
-                      <label class="control-label" for="id_{{ form.description.name }}">{{ form.description.label }}</label>
+                      <label class="control-label" for="id_{{ form.description.name }}">Description</label>
                       {% if form.description.errors %}
                         <div class="alert alert-danger" role="alert">
                           <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
@@ -135,7 +143,7 @@
                         id="id_{{ form.description.name }}" >{% if form.description.value %}{{ form.description.value}}{% endif %}</textarea>
                     </fieldset>
                     <fieldset class="form-group">
-                      <label class="control-label" for="id_{{ form.tags.name }}">{{ form.tags.label }}</label>
+                      <label class="control-label" for="id_{{ form.tags.name }}">Mots-Clés</label>
                       {% if form.tags.errors %}
                         <div class="alert alert-danger" role="alert">
                           <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
@@ -147,7 +155,7 @@
                     </fieldset>
 
                     <fieldset class="form-group {% if form.comment.errors %}has-error{% endif %}">
-                      <label class="control-label" for="id_{{ form.comment.name }}">{{ form.comment.label }}</label>
+                      <label class="control-label" for="id_{{ form.comment.name }}">Commentaire sur mon annotation</label>
                       {% if form.comment.errors %}
                         <div class="alert alert-danger" role="alert">
                           <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
@@ -157,7 +165,7 @@
                       {% endif %}
                       <textarea class="form-control"
                         name="{{ form.comment.name }}"
-                        id="id_{{ form.comment.name }}" ></textarea>
+                        id="id_{{ form.comment.name }}" >{% if not annotation %} Commentaire de création de mon annotation.{% endif %}</textarea>
                     </fieldset>
         			<input id="fragment-hidden-field" v-model="normalizePath" type="hidden" name="fragment"></input>
         			<button type="submit" class="save btn btn-default btn-sm">Enregister</button>