src/hdalab/templates/profile_home.html
changeset 329 ea6268cf8c83
parent 302 106c33871db4
child 330 5c171e379ea2
--- a/src/hdalab/templates/profile_home.html	Wed Sep 03 17:22:23 2014 +0200
+++ b/src/hdalab/templates/profile_home.html	Fri Sep 05 12:43:52 2014 +0200
@@ -2,6 +2,7 @@
 {% load i18n %}
 {% load static %}
 {% load thumbnail %}
+{% load hdalab_tags %}
 
 {% block title %}{{block.super}} > Profil utilisateur : {{ user.username }}{% endblock %}
 
@@ -39,15 +40,17 @@
       {% for hr in renkan_list %}
        {% with hr.renkan as r %}
         <tr class="border_bottom">
-            <td>{{ r.title }} ({{ r.id }})</td>
+            <td>{{ r.title }}</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 }}</td>
+            <td>{{ hr.state|state_to_str }}</td>
             <td>
                 <a title="Edit renkan" href="{% url 'renkan_edit' %}?rk_id={{ r.rk_id }}" class="renkan-basic-action"><span class="ui-icon ui-icon-pencil"></span></a>
                 <a title="View renkan" href="{% url 'renkan_view' %}?rk_id={{ r.rk_id }}" class="renkan-basic-action"><span class="ui-icon ui-icon-eye"></span></a>
                 <a title="Copy renkan" href="{% url 'renkan_copy' rk_id=r.rk_id %}?next={% url 'profile_home' %}" class="renkan-basic-action" onclick="return confirm('{% trans "Are you sure you want to copy this renkan ?" %}');" ><span class="ui-icon ui-icon-copy"></span></a>
                 <a title="Remove renkan" href="{% url 'renkan_delete' rk_id=r.rk_id %}?next={% url 'profile_home' %}" class="renkan-basic-action" onclick="return confirm('{% trans "Are you sure you want to delete this renkan ? You cannot undo this action." %}');" ><span class="ui-icon ui-icon-trash"></span></a>
+                {% if hr.state == 1 %}<a title="Publish renkan" href="{% url 'renkan_moderate' rk_id=r.rk_id state=2 %}?next={% url 'profile_home' %}" class="renkan-basic-action" onclick="return confirm('{% trans "Are you sure you want to ask to publish this renkan ?" %}');" ><span class="ui-icon ui-icon-unlocked"></span></a>
+                {% else %}<a title="Unpublish renkan" href="{% url 'renkan_moderate' rk_id=r.rk_id state=1 %}?next={% url 'profile_home' %}" class="renkan-basic-action" onclick="return confirm('{% trans "Are you sure you want to unpublish this renkan ?" %}');" ><span class="ui-icon ui-icon-locked"></span></a>{% endif %}
             </td>
         </tr>
        {% endwith %}