src/hdalab/templates/profile_home.html
changeset 344 1473ba25af1f
parent 343 12b6fc19d78f
child 396 064f4cdc48c3
--- a/src/hdalab/templates/profile_home.html	Mon Sep 29 12:43:40 2014 +0200
+++ b/src/hdalab/templates/profile_home.html	Tue Sep 30 12:31:48 2014 +0200
@@ -15,6 +15,19 @@
 
 {% block profile_actif %}actif{% endblock %}
 
+{% block js_import %}
+{{block.super}}
+<script src="{% static 'hdalab/lib/jquery-ui-1.10.4.min.js' %}"></script>
+<script type="text/javascript">
+    $(document).ready(function() {
+        $("#toggle-search").click(function(){
+            $("#advanced-form").toggle();
+        });
+        $(".date").datepicker({ dateFormat: 'yy-mm-dd' });
+    });
+</script>
+{% endblock %}
+
 {% block main_content %}
     <h2>Mon profil</h2>
     <p><a href="{% url 'renkan_new' %}" >Nouveau Renkan</a> - <a href="{% url 'auth_password_change' %}">Modification du mot de passe</a></p>
@@ -22,7 +35,22 @@
     <p>Mes renkans : </p>
     <p class="inline">{% if page.has_previous %}<a href="?page={{ page.previous_page_number }}&sort={{ sort_param }}&order={{ order_param }}{{ filters }}" >{% trans 'Previous' %}</a>{% endif %}
        {% if page.has_previous and page.has_next %} - {% endif %}{% if page.has_next %}<a href="?page={{ page.next_page_number }}&sort={{ sort_param }}&order={{ order_param }}{{ filters }}">{% trans 'Next' %}</a>{% endif %}</p>
-    <form class="inline"><p>{% if page.has_previous or page.has_next %} - {% endif %}{% trans 'Filter' %} : <input type="text" name="title" value="{{ title }}"/></p></form>
+    <form class="inline"><p>{% if page.has_previous or page.has_next %} - {% endif %}{% trans 'Filter' %} : <input type="text" name="title" value="{{ title }}"/> - <span class="hand_cursor" id="toggle-search">{% trans 'Advanced search' %}</span></p></p></form>
+    <form id="advanced-form" style="display: {% if startdate != '' or enddate != '' or username != '' or state != '' %}block{% else %}none{% endif %};">
+      <p>{% trans 'Title' %} : <input type="text" name="title" value="{{ title }}"/></p>
+      <p>{% trans 'Modification date' %} : {% trans 'begin' %} <input type="text" name="startdate" value="{{ startdate }}" class="date" /> -
+                                           {% trans 'end' %} : <input type="text" name="enddate" value="{{ enddate }}" class="date" /></p>
+      <p>{% trans 'State' %} : 
+        <select name="state">
+            <option value=""></option>
+            <option value="1"{% if state == '1' %} selected="selected"{% endif %}>{% trans 'Edition' %}</option>
+            <option value="2"{% if state == '2' %} selected="selected"{% endif %}>{% trans 'Moderated' %}</option>
+            <option value="3"{% if state == '3' %} selected="selected"{% endif %}>{% trans 'Published' %}</option>
+            <option value="4"{% if state == '4' %} selected="selected"{% endif %}>{% trans 'Rejected' %}</option>
+        </select>
+      </p>
+      <p><input type="submit" value="{% trans 'Search' %}"/></p>
+    </form>
     <table id="rk-table">
       <thead>
         <tr class="border_bottom">
@@ -40,7 +68,7 @@
       {% for hr in page.object_list %}
        {% with hr.renkan as r %}
         <tr class="border_bottom">
-            <td>{{ r.title }}</td>
+            <td><a title="View renkan" href="{% url 'renkan_view' %}?rk_id={{ r.rk_id }}">{{ r.title }}</a></td>
             <td>{{ r.modification_date|date:"Y-m-d H:i" }}</td>
             <td>{% thumbnail r.image 100x100 as thumb %}<img src="{{ thumb.url }}" width="{{ thumb.width }}" height="{{ thumb.height }}" /></td>
             <td>{{ hr.state|state_to_str }}</td>