#4 : Enlarge input size.
authorcavaliet
Tue, 05 Jul 2011 15:32:48 +0200
changeset 61 52fcbb0e0a67
parent 60 03634cfb8bbe
child 62 953ee4c9c7c3
#4 : Enlarge input size. #7 : Tag categorisation available in datasheet template.
web/hdabo/static/hdabo/js/hdabo.js
web/hdabo/templates/partial/one_sheet.html
web/hdabo/templates/partial/tag_table.html
web/hdabo/views.py
--- a/web/hdabo/static/hdabo/js/hdabo.js	Fri Jun 24 10:34:24 2011 +0200
+++ b/web/hdabo/static/hdabo/js/hdabo.js	Tue Jul 05 15:32:48 2011 +0200
@@ -108,6 +108,7 @@
     	onblur    : "submit",
     	submitdata: {
             csrfmiddlewaretoken:global_csrf_token,
+            datasheet_id:$('#datasheet_id').val(),
             num_page:$('#num_page').val(),
             nb_by_page:$('#nb_by_page').val(),
             searched:$('#searched_str').val()
--- a/web/hdabo/templates/partial/one_sheet.html	Fri Jun 24 10:34:24 2011 +0200
+++ b/web/hdabo/templates/partial/one_sheet.html	Tue Jul 05 15:32:48 2011 +0200
@@ -19,13 +19,13 @@
         {# <p><b>original_modification_date</b><br/>{{ds.original_modification_date|date:"d/m/Y"}}</p> #}
     </div>
     <div class="right_sheet">
-        <p><input type="radio" name="gr_validated{{ds.hda_id}}" id="not_validated" value="not_validated" {% if not ds.validated %}checked{% endif %} />En cours
-        <input type="radio" name="gr_validated{{ds.hda_id}}" id="validated" value="validated" {% if ds.validated %}checked{% endif %} />Validé
+        <p><input type="radio" name="gr_validated{{ds.hda_id}}" id="not_validated" value="not_validated" {% if not ds.validated %}checked{% endif %} {% if valid == "2" %}disabled{% endif %} />En cours
+        <input type="radio" name="gr_validated{{ds.hda_id}}" id="validated" value="validated" {% if ds.validated %}checked{% endif %} {% if valid == "2" %}disabled{% endif %} />Validé
         {% if ds.validated %}
         &nbsp;&nbsp; par {{ds.validator.username}} le {{ds.validation_date|date:"d/m/Y"}}
         {% endif %}
         {% if valid != "2" %}
-        <span style="float:right;">Ajouter un tag : <input type="text" name="wp_search" id="wp_search" /> <span id="ok_search" class="hand_cursor"><b>OK</b></span></span>
+        <span style="float:right;">Ajouter un tag : <input type="text" name="wp_search" id="wp_search" size="60" /> <span id="ok_search" class="hand_cursor"><b>OK</b></span></span>
         {% endif %}
         </p>
         {% csrf_token %}
--- a/web/hdabo/templates/partial/tag_table.html	Fri Jun 24 10:34:24 2011 +0200
+++ b/web/hdabo/templates/partial/tag_table.html	Tue Jul 05 15:32:48 2011 +0200
@@ -37,8 +37,8 @@
 	            {% else %}
 	            &nbsp;
 	            {% endif %}
-            </td>	        
-            <td>{% if t.tag.category %}{{ t.tag.category }}{% endif %}</td>
+            </td>
+            <td class="tag_category" id="{{t.tag.id}}">{% if t.tag.category %}{{ t.tag.category }}{% endif %}</td>
             <td class="text_centered"><img src="{{STATIC_URL}}hdabo/img/red_cross.png" class="remove_wp_link" id="{{t.tag.id}}" alt="{{t.tag.label}}" /></td>
             <td>{% if t.tag.alias %}{{t.tag.alias}}{% endif %}</td>
             <td class="text_centered"><img src="{{STATIC_URL}}hdabo/img/tag_remove.png" class="remove_tag_from_list" id="{{t.tag.id}}" alt="{{t.tag.label}}" /></td></tr>
--- a/web/hdabo/views.py	Fri Jun 24 10:34:24 2011 +0200
+++ b/web/hdabo/views.py	Tue Jul 05 15:32:48 2011 +0200
@@ -444,7 +444,10 @@
     else :
         tag.category = None
     tag.save()
-    # This function is available only in all_tags_table context
-    return get_all_tags_table(request=request, num_page=request.POST["num_page"], nb_by_page=request.POST["nb_by_page"], searched=request.POST["searched"])
+    
+    if u"datasheet_id" in request.POST :
+        return get_tag_table(request=request, ds_id=request.POST["datasheet_id"], valid=0)
+    else :
+        return get_all_tags_table(request=request, num_page=request.POST["num_page"], nb_by_page=request.POST["nb_by_page"], searched=request.POST["searched"])