damned-lies r1158 - in trunk: . stats stats/conf templates templates/languages templates/teams



Author: claudep
Date: Mon Nov 10 15:15:41 2008
New Revision: 1158
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1158&view=rev

Log:
2008-11-10  Claude Paroz  <claude 2xlibre net>

	* TODO: Updated.
	* stats/conf/settings_sample.py: Remove obsolete variables.
	* stats/models.py: Don't select POT files in get_global_stats.
	* stats/views.py: webroot now unused.
	* templates/stats_show.html: Hard-coded link replaced by url tag.
	* templates/teams/team_base.html: New factorized team basic display.
	* templates/languages/language_release.html:
	* templates/teams/team_detail.html: Use team_base.html.
	* urls.py: Added ending slash.

Added:
   trunk/templates/teams/team_base.html
Modified:
   trunk/ChangeLog
   trunk/TODO
   trunk/stats/conf/settings_sample.py
   trunk/stats/models.py
   trunk/stats/views.py
   trunk/templates/languages/language_release.html
   trunk/templates/stats_show.html
   trunk/templates/teams/team_detail.html
   trunk/urls.py

Modified: trunk/TODO
==============================================================================
--- trunk/TODO	(original)
+++ trunk/TODO	Mon Nov 10 15:15:41 2008
@@ -1,3 +1,2 @@
 Things left to do:
- * Still a webroot in stats_show.html
- * team_detail.html and language_release.html should share the team detail part.
+ * Tests, tests, tests...

Modified: trunk/stats/conf/settings_sample.py
==============================================================================
--- trunk/stats/conf/settings_sample.py	(original)
+++ trunk/stats/conf/settings_sample.py	Mon Nov 10 15:15:41 2008
@@ -4,7 +4,6 @@
 DATABASE_ENGINE = getattr(settings, "DATABASE_ENGINE")
 DEBUG = getattr(settings, "DEBUG", True)
 WHEREAREWE = 'http://l10n.gnome.org/'
-WEBROOT = "/stats"
 WHOAREWE = 'danilo gnome org'
 
 # When in STRINGFREEZE, where to send notifications (gnome-i18n gnome org) on any POT changes
@@ -14,12 +13,3 @@
 SCRATCHDIR = ""
 POTDIR = os.path.join(SCRATCHDIR, "POT")
 
-# Used for migration
-OLD_DAMNEDLIES = ""
-
-# Uncomment to migrate the old_statistics table from an external MySQL
-# database.
-# MYSQL_SETTINGS = dict(db='db',
-#                       user='user',
-#                       host='localhost',
-#                       passwd='pwd')

Modified: trunk/stats/models.py
==============================================================================
--- trunk/stats/models.py	(original)
+++ trunk/stats/models.py	Mon Nov 10 15:15:41 2008
@@ -615,7 +615,7 @@
                    ON br.id = stat.branch_id
             LEFT JOIN category
                    ON category.branch_id = br.id
-            WHERE category.release_id = %s
+            WHERE category.release_id = %s AND stat.language_id IS NOT NULL
             GROUP BY domain.dtype, stat.language_id
             ORDER BY domain.dtype, trans DESC"""
         cursor = connection.cursor()

Modified: trunk/stats/views.py
==============================================================================
--- trunk/stats/views.py	(original)
+++ trunk/stats/views.py	Mon Nov 10 15:15:41 2008
@@ -42,7 +42,6 @@
     mod.translated_name = _(mod.description)
     context = {
         'pageSection':  "module",
-        'webroot': settings.WEBROOT,
         'module': mod,
         'prof': utils.Profiler()
     }
@@ -63,7 +62,7 @@
 
 def releases(request, format='html'):
     all_releases = Release.objects.order_by('status', '-name')
-    if format != 'html':
+    if format in ('json', 'xml'):
         data = serializers.serialize(format, all_releases)
         return HttpResponse(data, mimetype=MIME_TYPES[format])
     else:

Modified: trunk/templates/languages/language_release.html
==============================================================================
--- trunk/templates/languages/language_release.html	(original)
+++ trunk/templates/languages/language_release.html	Mon Nov 10 15:15:41 2008
@@ -7,48 +7,18 @@
 <div class="mainpage">
 
 {% with language.locale as locale %}
-{% if language.team %}
-  <h1>{% blocktrans with language.team.description as lang %}{{ lang }} Translation Team â {{ locale }}{% endblocktrans %}</h1>
+{% with language.team as team %}
+{% if team %}
+  <h1>{% blocktrans with team.get_description as lang %}{{ lang }} Translation Team â {{ locale }}{% endblocktrans %}</h1>
 
-<table><tr><td valign="top" width="50%">
-  <h2>{% trans "Details" %}</h2>
+  {% include "teams/team_base.html" %}
 
-  {% if language.team.webpage_url %}
-  <strong>{% blocktrans with language.team.description as lang %}{{ lang }} Translation Team Page:{% endblocktrans %}</strong> 
-  <a href="{{ language.team.webpage_url }}">{{ language.team.webpage_url }}</a><br />
-  {% endif %}
-
-  <br/><strong>{% trans "Bugzilla:" %}</strong>
-  <ul>
-    <li><a href="{{ language.bugs_url_enter|safe }}">{% trans "Report Bug in Translation" %}</a></li>
-    <li><a href="{{ language.bugs_url_show|safe }}">{% trans "Show Existing Bugs" %}</a></li>
-  </ul>
-
-  {% if language.team.mailing_list %}
-  <br/><strong>{% trans "Mailing List:" %}</strong>
-  <ul>
-    <li><a href="mailto:{{ language.team.mailing_list }}">{% trans "Send e-mail to the list" %}</a></li>
-    {% if language.team.mailing_list_subscribe %}
-    <li><a href="{{ language.team.mailing_list_subscribe }}">{% trans "Subscribe" %}</a></li>
-    {% endif %}
-  </ul>
-  {% endif %}
-
-  </td><td valign="top">
-  {% if language.team.coordinator %}
-    <h2>{% trans "Coordinator" %}</h2>
-    {% with language.team.coordinator as person %}
-    {% with 0 as printroles %}
-    {% include "person_base.html" %}
-    {% endwith %}
-    {% endwith %}
-  {% endif %}
-</td></tr></table>
 {% else %}
   <h1>{% blocktrans %}Language code: {{ locale }}{% endblocktrans %}</h1>
   <p>{% blocktrans %}There is no translation team in charge of '{{ locale }}' translation.{% endblocktrans %}</p>
 {% endif %}
 {% endwith %}
+{% endwith %}
 
 <h2>{% trans release.description %}</h2>
 

Modified: trunk/templates/stats_show.html
==============================================================================
--- trunk/templates/stats_show.html	(original)
+++ trunk/templates/stats_show.html	Mon Nov 10 15:15:41 2008
@@ -40,7 +40,7 @@
       </td>
       <td>{{ line.get_translationstat|safe }}</td>
       {% if stat1.fig_count %}
-       <td><a href="{{ webroot }}module/{{ module.name }}/{{ stat1.domain.name }}/{{ branch.name }}/{{ line.language.locale}}/images">
+       <td><a href="{% url stats.views.docimages module_name=module.name,potbase=stat1.domain.name,branch_name=branch.name,langcode=line.language.locale %}">
            <img src="/media/img/figure.png" alt="{% trans "Display document figures" %}"></a></td>
       {% endif %}
       <td style="width: 108px; text-align: center;"><div class="graph">

Added: trunk/templates/teams/team_base.html
==============================================================================
--- (empty file)
+++ trunk/templates/teams/team_base.html	Mon Nov 10 15:15:41 2008
@@ -0,0 +1,40 @@
+{# Variables 'team' and 'language' must be defined prior to calling this template #}
+{% load i18n %}
+
+{% with team.get_description as lang %}
+<table><tr><td valign="top" width="50%">
+  <h2>{% trans "Details" %}</h2>
+
+  {% if team.webpage_url %}
+  <strong>{% blocktrans %}{{ lang }} Translation Team Page:{% endblocktrans %}</strong> 
+  <a href="{{ team.webpage_url }}">{{ team.webpage_url }}</a><br />
+  {% endif %}
+
+  <br/><strong>{% trans "Bugzilla:" %}</strong>
+  <ul>
+    <li><a href="{{ language.bugs_url_enter|safe }}">{% trans "Report Bug in Translation" %}</a></li>
+    <li><a href="{{ language.bugs_url_show|safe }}">{% trans "Show Existing Bugs" %}</a></li>
+  </ul>
+
+  {% if team.mailing_list %}
+  <br/><strong>{% trans "Mailing List:" %}</strong>
+  <ul>
+    <li><a href="mailto:{{ team.mailing_list }}">{% trans "Send e-mail to the list" %}</a></li>
+    {% if team.mailing_list_subscribe %}
+    <li><a href="{{ team.mailing_list_subscribe }}">{% trans "Subscribe" %}</a></li>
+    {% endif %}
+  </ul>
+  {% endif %}
+  
+  </td><td valign="top">
+  {% if team.coordinator %}
+    <h2>{% trans "Coordinator" %}</h2>
+    {% with team.coordinator as person %}
+    {% with 0 as printroles %}
+    {% include "person_base.html" %}
+    {% endwith %}
+    {% endwith %}
+  {% endif %}
+</td></tr></table>
+{% endwith %}
+

Modified: trunk/templates/teams/team_detail.html
==============================================================================
--- trunk/templates/teams/team_detail.html	(original)
+++ trunk/templates/teams/team_detail.html	Mon Nov 10 15:15:41 2008
@@ -6,50 +6,15 @@
 {% block content %}
 <div class="mainpage">
 
-{% with team.get_description as lang %}
 {% if not team.fake %}
-<h1>{% blocktrans %}{{ lang }} Translation Team{% endblocktrans %}</h1>
+  <h1>{% blocktrans with team.get_description as lang %}{{ lang }} Translation Team{% endblocktrans %}</h1>
 
-<table><tr><td valign="top" width="50%">
-  <h2>{% trans "Details" %}</h2>
-
-  {% if team.webpage_url %}
-  <strong>{% blocktrans %}{{ lang }} Translation Team Page:{% endblocktrans %}</strong> 
-  <a href="{{ team.webpage_url }}">{{ team.webpage_url }}</a><br />
-  {% endif %}
-
-  <br/><strong>{% trans "Bugzilla:" %}</strong>
-  <ul>
-    {% with team.get_languages.0 as language %}
-    <li><a href="{{ language.bugs_url_enter|safe }}">{% trans "Report Bug in Translation" %}</a></li>
-    <li><a href="{{ language.bugs_url_show|safe }}">{% trans "Show Existing Bugs" %}</a></li>
-    {% endwith %}
-  </ul>
-
-  {% if team.mailing_list %}
-  <br/><strong>{% trans "Mailing List:" %}</strong>
-  <ul>
-    <li><a href="mailto:{{ team.mailing_list }}">{% trans "Send e-mail to the list" %}</a></li>
-    {% if team.mailing_list_subscribe %}
-    <li><a href="{{ team.mailing_list_subscribe }}">{% trans "Subscribe" %}</a></li>
-    {% endif %}
-  </ul>
-  {% endif %}
-  
-  </td><td valign="top">
-  {% if team.coordinator %}
-    <h2>{% trans "Coordinator" %}</h2>
-    {% with team.coordinator as person %}
-    {% with 0 as printroles %}
-    {% include "person_base.html" %}
-    {% endwith %}
-    {% endwith %}
-  {% endif %}
-</td></tr></table>
+  {% with team.get_languages.0 as language %}
+  {% include "teams/team_base.html" %}
+  {% endwith %}
 {% else %}
-<h1>{{ lang }}</h1>
+  <h1>{{ team.get_description }}</h1>
 {% endif %}
-{% endwith %}
 
 {% for lang in team.get_languages %}
   <h2>{% trans lang.name %}</h2>

Modified: trunk/urls.py
==============================================================================
--- trunk/urls.py	(original)
+++ trunk/urls.py	Mon Nov 10 15:15:41 2008
@@ -16,7 +16,7 @@
 
 urlpatterns += patterns('stats.views',
     url(r'^module/$', 'modules', name='modules'),
-    (r'^module/(?P<module_name>[\w\-\+]+)$', 'module'),
+    (r'^module/(?P<module_name>[\w\-\+]+)/$', 'module'),
     (r'^module/(?P<module_name>[\w\-\+]+)/(?P<potbase>\w+)/(?P<branch_name>[\w-]+)/(?P<langcode>\w+)/images/$', 'docimages'),
     url(r'^releases/(?P<format>(html|json|xml))?/?$', 'releases', name='releases'),
     (r'^releases/(?P<release_name>[\w-]+)$', 'release'),



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