damned-lies r1387 - in trunk: . media/css media/img media/js templates/people



Author: claudep
Date: Sat Jan 24 14:54:29 2009
New Revision: 1387
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1387&view=rev

Log:
2009-01-24  Claude Paroz  <claude 2xlibre net>

	* README: Add instructions for jQuery installation.
	* media/css/main.css: Add styles for sortable tables.
	* media/img/(bg|asc|desc).gif: Icons (arrows) for sortable headers.
	* templates/people/person_detail.html: Make the 'Working on' table
	sortable.
	Fixes bug #567676.

Added:
   trunk/media/img/asc.gif   (contents, props changed)
   trunk/media/img/bg.gif   (contents, props changed)
   trunk/media/img/desc.gif   (contents, props changed)
Modified:
   trunk/ChangeLog
   trunk/README
   trunk/media/css/main.css
   trunk/media/js/   (props changed)
   trunk/templates/people/person_detail.html

Modified: trunk/README
==============================================================================
--- trunk/README	(original)
+++ trunk/README	Sat Jan 24 14:54:29 2009
@@ -19,7 +19,10 @@
 
 2 - Python 2.5 (for hashlib module).
 
-3 - [Optional] Django Evolution is an extension to Django that allows
+3 - jQuery (tested with 1.3.1) (http://jquery.com) and jQuery 
+    tablesorter (http://tablesorter.com).
+
+4 - [Optional] Django Evolution is an extension to Django that allows
     you to track changes in your models over time, and to update the
     database to reflect those changes.
 
@@ -30,11 +33,11 @@
     Run './manage.py syncdb' before any model changes and './manage.py
     evolve --hint --execute' after.
 
-4 - [Optional] Django Debug Toolbar
+5 - [Optional] Django Debug Toolbar
     git clone git://github.com/dcramer/django-debug-toolbar.git
     Define USE_DEBUG_TOOLBAR to True in settings.py to use it.
 
-5 - [Optional] python-openid and django-openid (see OpenID support below).
+6 - [Optional] python-openid and django-openid (see OpenID support below).
 
 Installation
 ============
@@ -47,6 +50,10 @@
 3 - Configure Sites in admin interface to define the 'View on site'
     link.
 
+4 - Download jQuery and tablesorter .min.js files and copy them
+    in /media/js directory. Create a symlink jquery-latest.min.js
+    poiting to jquery-.?.?.?.min.js
+
 OpenID support
 ==============
 If you want OpenID support, checkout Simon Willison's django_openid

Modified: trunk/media/css/main.css
==============================================================================
--- trunk/media/css/main.css	(original)
+++ trunk/media/css/main.css	Sat Jan 24 14:54:29 2009
@@ -22,6 +22,21 @@
     text-align: left;
 }
 
+/* styles related to jQuery tablesorter component */
+table.tablesorter thead tr .header {
+    background-image: url(../img/bg.gif);
+    background-repeat: no-repeat;
+    background-position: center right;
+    background-color: #EEEEEE;
+    cursor: pointer;
+}
+table.tablesorter thead tr .headerSortUp {
+    background-image: url(../img/asc.gif);
+}
+table.tablesorter thead tr .headerSortDown {
+    background-image: url(../img/desc.gif);
+}
+
 h2 {
     width: 100%;
     margin-top: 2em;

Added: trunk/media/img/asc.gif
==============================================================================
Binary file. No diff available.

Added: trunk/media/img/bg.gif
==============================================================================
Binary file. No diff available.

Added: trunk/media/img/desc.gif
==============================================================================
Binary file. No diff available.

Modified: trunk/templates/people/person_detail.html
==============================================================================
--- trunk/templates/people/person_detail.html	(original)
+++ trunk/templates/people/person_detail.html	Sat Jan 24 14:54:29 2009
@@ -3,6 +3,18 @@
 {% load humanize %}
 {% load stats_extras %}
 
+{% block extrahead %}
+<script type="text/javascript" src="{{ MEDIA_URL}}js/jquery-latest.min.js"></script> 
+<script type="text/javascript" src="{{ MEDIA_URL}}js/jquery.tablesorter.min.js"></script>
+<script type="text/javascript">
+$(document).ready(function() 
+    { 
+        $("#working_on").tablesorter(); 
+    } 
+);
+</script>
+{% endblock %}
+
 {% block subcontent %}
 {% if user.is_authenticated %}
 {% ifequal user.username person.username %}
@@ -37,17 +49,19 @@
 {% if states %}
 <h2>{% trans "Working on" %}</h2>
 
-<table>
-<tr>
-  <th>{% trans "Date" %}</th><th>{% trans "Module" %}</th><th>{% trans "State" %}</th>
-</tr>
+<table class="tablesorter" id="working_on">
+<thead><tr>
+  <th class="header">{% trans "Date" %}</th><th>{% trans "Module" %}</th><th>{% trans "State" %}</th>
+</tr></thead>
+<tbody>
 {% for state in states %}
 <tr>
-  <td>{{ state.updated|naturalday:dateformat }}</td>
+  <td><span style="display: none;">{{ state.updated }}</span>{{ state.updated|naturalday:dateformat }}</td>
   <td><a href="{{ state.get_absolute_url }}">{{ state.branch.module.get_description }} - {{ state.branch.name }} - {{ state.domain.get_description }} - {{ state.language.get_name }}</a></td>
   <td>{{ state.get_state }}</td>
 </tr>
 {% endfor %}
+</tbody>
 </table>
 
 {% endif %}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]