Changes profil page and access to admin part (renkan and django). Update interface to be more lisible
authorrougeronj
Thu, 11 Dec 2014 17:34:22 +0100
changeset 400 9b290d5c11d8
parent 399 44d627c3a9fb
child 401 08d30e121c86
child 403 7bf61c597cb0
Changes profil page and access to admin part (renkan and django). Update interface to be more lisible
src/hdalab/static/hdalab/css/profile.css
src/hdalab/templates/profile_home.html
src/hdalab/templates/registration/registration_form.html
--- a/src/hdalab/static/hdalab/css/profile.css	Thu Dec 11 15:46:44 2014 +0100
+++ b/src/hdalab/static/hdalab/css/profile.css	Thu Dec 11 17:34:22 2014 +0100
@@ -1,5 +1,9 @@
-#container p, p{
+p{
     font-size: 16px;
+    margin: 10px 10px 0;
+}
+h2{
+	font-size:18px
 }
 table{
 	font-size: 14px;
@@ -56,4 +60,8 @@
 }
 li.edito{
     margin-top: 10px;
+}
+.sub-content{
+	padding: 20px 0;
+	border-top: 1px solid #b0b0b0;
 }
\ No newline at end of file
--- a/src/hdalab/templates/profile_home.html	Thu Dec 11 15:46:44 2014 +0100
+++ b/src/hdalab/templates/profile_home.html	Thu Dec 11 17:34:22 2014 +0100
@@ -32,68 +32,80 @@
     <div class="all-title">
     	<h1>{% trans 'Mon profil' %}</h1>
    	</div>
-    <p><a href="{% url 'auth_password_change' %}">Modification du mot de passe</a></p>
-    <br>
-    <p>
-    	<a href="{% url 'renkan_new' %}" >Nouveau Renkan</a>
-    	 {% if user.is_staff %} / <a href="{% url 'manage_renkans' %}" >Administrer les Renkan</a>{% endif %}
-    	 {% if user.is_superuser %} / <a href="{% url 'admin:index' %}" >Administrer Hdabo</a>{% endif %}
-   	</p> 
-    <p>&nbsp;</p>
-    <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 }}"/> - <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">
-          <th><a href="?sort=title&order={% if sort_param == 'title' %}{{ opposite }}{% else %}asc{% endif %}{{ filters }}">{% trans 'Title' %}</a>
-              {% if sort_param == 'title' %}<span class="ui-icon {% if opposite == 'asc' %}ui-icon-triangle-1-s{% else %}ui-icon-triangle-1-n{% endif %}"></span>{% endif %}</th>
-          <th><a href="?sort=date&order={% if sort_param == 'date' %}{{ opposite }}{% else %}desc{% endif %}{{ filters }}">{% trans 'Modification date' %}</a>
-              {% if sort_param == 'date' %}<span class="ui-icon {% if opposite == 'asc' %}ui-icon-triangle-1-s{% else %}ui-icon-triangle-1-n{% endif %}"></span>{% endif %}</th>
-          <th>{% trans 'Preview' %}</th>
-          <th><a href="?sort=state&order={% if sort_param == 'state' %}{{ opposite }}{% else %}asc{% endif %}{{ filters }}">{% trans 'State' %}</a>
-              {% if sort_param == 'state' %}<span class="ui-icon {% if opposite == 'asc' %}ui-icon-triangle-1-s{% else %}ui-icon-triangle-1-n{% endif %}"></span>{% endif %}</th>
-          <th>{% trans 'Actions' %}</th>
-        </tr>
-      </thead>
-      <tbody>
-      {% for hr in page.object_list %}
-       {% with hr.renkan as r %}
-        <tr class="border_bottom">
-            <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>
-            <td>
-                {% if hr.state == 1 %}<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>
-                {% else %}<span class="ui-icon ui-icon-blank renkan-basic-action"></span>{% endif %}
-                <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 %}
-      {% endfor %}
-      </tbody>
-    </table>
-    <p>{% 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>
+   	{% if user.is_staff %}
+   	<div class="sub-content">
+    	<h2>/ {% trans 'Adminsitration du Site' %}</h2>
+    	  <p>
+    	  	<a href="{% url 'manage_renkans' %}" >Administrer les Renkan</a>
+    	  	/ <a href="{% url 'admin:index' %}" >Administrer Hdabo</a>
+    	  </p>
+   	</div>
+   	{% endif %}
+   	<div class="sub-content">
+    	<h2>/ {% trans 'Modifier mon profil' %}</h2>
+		<p>
+			<a href="{% url 'auth_password_change' %}">Modification du mot de passe</a>
+		</p>
+   	</div>
+	<div class="sub-content">
+		<h2>/ {% trans 'Gerer mes Renkan' %}</h2>
+		<p>
+    		<a href="{% url 'renkan_new' %}">{% trans 'Nouveau Renkan' %}</a>
+   		</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 }}"/> - <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">
+	          <th><a href="?sort=title&order={% if sort_param == 'title' %}{{ opposite }}{% else %}asc{% endif %}{{ filters }}">{% trans 'Title' %}</a>
+	              {% if sort_param == 'title' %}<span class="ui-icon {% if opposite == 'asc' %}ui-icon-triangle-1-s{% else %}ui-icon-triangle-1-n{% endif %}"></span>{% endif %}</th>
+	          <th><a href="?sort=date&order={% if sort_param == 'date' %}{{ opposite }}{% else %}desc{% endif %}{{ filters }}">{% trans 'Modification date' %}</a>
+	              {% if sort_param == 'date' %}<span class="ui-icon {% if opposite == 'asc' %}ui-icon-triangle-1-s{% else %}ui-icon-triangle-1-n{% endif %}"></span>{% endif %}</th>
+	          <th>{% trans 'Preview' %}</th>
+	          <th><a href="?sort=state&order={% if sort_param == 'state' %}{{ opposite }}{% else %}asc{% endif %}{{ filters }}">{% trans 'State' %}</a>
+	              {% if sort_param == 'state' %}<span class="ui-icon {% if opposite == 'asc' %}ui-icon-triangle-1-s{% else %}ui-icon-triangle-1-n{% endif %}"></span>{% endif %}</th>
+	          <th>{% trans 'Actions' %}</th>
+	        </tr>
+	      </thead>
+	      <tbody>
+	      {% for hr in page.object_list %}
+	       {% with hr.renkan as r %}
+	        <tr class="border_bottom">
+	            <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>
+	            <td>
+	                {% if hr.state == 1 %}<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>
+	                {% else %}<span class="ui-icon ui-icon-blank renkan-basic-action"></span>{% endif %}
+	                <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 %}
+	      {% endfor %}
+	      </tbody>
+	    </table>
+	    <p>{% 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>
+	</div>
 {% endblock %}
\ No newline at end of file
--- a/src/hdalab/templates/registration/registration_form.html	Thu Dec 11 15:46:44 2014 +0100
+++ b/src/hdalab/templates/registration/registration_form.html	Thu Dec 11 17:34:22 2014 +0100
@@ -17,7 +17,7 @@
 	{% if form.errors %}
 		<p class="error">{% trans "Oups ! Il y a un problème dans les données du nouvel utilisateur" %}</p>
 	{% endif %}
-	<form action="" method='post'>
+	<form action="." method='post'>
 		{% csrf_token %}
 		<input type="hidden" name="next" value="{% if next %}{{ next }}{% else %}{% url 'home' %}{% endif %}" />
 		<p>