damned-lies r1264 - in trunk: . media/css templates/teams templates/vertimus vertimus



Author: claudep
Date: Tue Dec 30 10:39:34 2008
New Revision: 1264
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1264&view=rev

Log:
2008-12-30  Claude Paroz  <claude 2xlibre net>

	* media/css/main.css: Add new class used in vertimus_detail.
	* templates/teams/team_base.html: Fix table width.
	* templates/teams/team_detail.html: Swap doc and ui stats display.
	* templates/vertimus/vertimus_detail.html: Display all releases containing
	the branch. Fix translation details.
	* vertimus/models.py: Use gettext_lazy so as Action and State descriptions
	are translated at the last time.
	* vertimus/views.py: Get pot Stats object when there is still no
	translation for a language.

Modified:
   trunk/ChangeLog
   trunk/media/css/main.css
   trunk/templates/teams/team_base.html
   trunk/templates/teams/team_detail.html
   trunk/templates/vertimus/vertimus_detail.html
   trunk/vertimus/models.py
   trunk/vertimus/views.py

Modified: trunk/media/css/main.css
==============================================================================
--- trunk/media/css/main.css	(original)
+++ trunk/media/css/main.css	Tue Dec 30 10:39:34 2008
@@ -179,6 +179,12 @@
   padding: 0.5em 12px 0;
 }
 
+div.release_link {
+  float: right;
+  font-size:small;
+  margin-left: 40px;
+}
+
 div.uploaded_file {
   float: right;
   padding: 2px;

Modified: trunk/templates/teams/team_base.html
==============================================================================
--- trunk/templates/teams/team_base.html	(original)
+++ trunk/templates/teams/team_base.html	Tue Dec 30 10:39:34 2008
@@ -2,7 +2,7 @@
 {% load i18n %}
 
 {% with team.get_description as lang %}
-<table><tr><td valign="top" width="50%">
+<table width="100%"><tr><td valign="top" width="50%">
   <h2>{% trans "Details" %}</h2>
 
   {% if team.webpage_url %}

Modified: trunk/templates/teams/team_detail.html
==============================================================================
--- trunk/templates/teams/team_detail.html	(original)
+++ trunk/templates/teams/team_detail.html	Tue Dec 30 10:39:34 2008
@@ -19,14 +19,26 @@
 {% for lang in team.get_languages %}
   <h2>{{ lang.get_name }}</h2>
   <table class="stats">
-  <thead><tr><th>{% trans "Release" %}</th><th>{% trans "Documentation" %}</th><th>{% trans "Graph" %}</th>
-         <th>{% trans "User Interface" %}</th><th>{% trans "Graph" %}</th></tr></thead>
+  <thead><tr><th>{% trans "Release" %}</th><th>{% trans "User Interface" %}</th><th>{% trans "Graph" %}</th>
+         <th>{% trans "Documentation" %}</th><th>{% trans "Graph" %}</th></tr></thead>
   {% for stat in lang.get_release_stats %}
     <tr>
       <td class="leftcell">
         {{ stat.description }}</a>
       </td>
   
+    <td><a href="{% url language_release lang.locale,stat.name,"ui" %}">
+        {{ stat.uitransperc }}% ({{ stat.uitrans }}/{{ stat.uifuzzy }}/{{ stat.uiuntrans }})</a>
+    </td>
+    <td style="width: 108px; text-align: center;"><div class="graph">
+      <div class="translated" style="width:{{ stat.uitransperc }}px;"></div>
+      <div class="fuzzy" style="left:{{ stat.uitransperc }}px; width:{{ stat.uifuzzyperc }}px;"></div>
+      {% with stat.uitransperc|add:stat.uifuzzyperc as upos %}
+      <div class="untranslated" style="left:{{ upos }}px; width:{{ stat.uiuntransperc }}px;"></div>
+      {% endwith %}
+      </div>
+    </td>
+
     {% if stat.doctotal %}
       <td><a href="{% url language_release lang.locale,stat.name,"doc" %}">
           {{ stat.doctransperc }}% ({{ stat.doctrans }}/{{ stat.docfuzzy }}/{{ stat.docuntrans }})</a>
@@ -42,18 +54,6 @@
     {% else %}
       <td>-</td><td></td>
     {% endif %}
-
-    <td><a href="{% url language_release lang.locale,stat.name,"ui" %}">
-        {{ stat.uitransperc }}% ({{ stat.uitrans }}/{{ stat.uifuzzy }}/{{ stat.uiuntrans }})</a>
-    </td>
-    <td style="width: 108px; text-align: center;"><div class="graph">
-      <div class="translated" style="width:{{ stat.uitransperc }}px;"></div>
-      <div class="fuzzy" style="left:{{ stat.uitransperc }}px; width:{{ stat.uifuzzyperc }}px;"></div>
-      {% with stat.uitransperc|add:stat.uifuzzyperc as upos %}
-      <div class="untranslated" style="left:{{ upos }}px; width:{{ stat.uiuntransperc }}px;"></div>
-      {% endwith %}
-      </div>
-    </td>
   </tr>
   {% endfor %}
 </table>

Modified: trunk/templates/vertimus/vertimus_detail.html
==============================================================================
--- trunk/templates/vertimus/vertimus_detail.html	(original)
+++ trunk/templates/vertimus/vertimus_detail.html	Tue Dec 30 10:39:34 2008
@@ -7,18 +7,20 @@
 
 {% block content %}
 <div class="mainpage">
-{% with branch.releases.all.0 as release %}
-<p align="right"><small>
-{% if release %}
-  <a href="{% url languages.views.language_release language.locale, release.name, domain.dtype %}">{% trans release.description %} - {{ language.get_name }}</a>
+{% with branch.releases.all as releases %}
+<div class="release_link">
+{% if releases %}
+  <p><em>{% trans "Used in release(s):" %}</em><br />
+  {% for release in releases %}
+  <a href="{% url languages.views.language_release language.locale, release.name, domain.dtype %}">{% trans release.description %} - {{ language.get_name }}</a><br />
+  {% endfor %}
 {% else %}
   <a href="{% url stats.views.module module.name %}">{{ module.get_description }}</a>
 {% endif %}
-</small></p>
-
+</div>
 {% endwith %}
 
-<h1>{{ module.get_description }} - {{ branch.name }} - {% trans domain.description %} - {% trans language %}</h1>
+<h1>{{ module.get_description }} - {{ branch.name }} - {% trans domain.description %} - {{ language.get_name }}</h1>
 
 {% if module.comment %}
   <p>{{ module.comment|safe }}</p>
@@ -28,7 +30,7 @@
   {% endifnotequal %}
 {% endif %}
 
-<h3>{% trans "State:" %} {{ state }}
+<h3>{% trans "State:" %} {{ state.description }}
 {% ifnotequal state.name 'none' %}
 ({{ state.updated|date:"D d M Y P" }})
 {% endifnotequal %}
@@ -79,9 +81,9 @@
     <div class="vertimus_action_content">
       {% if action.file %}
       <div class="uploaded_file">
-        <a href="{{ action.file.url }}"><img src="{{ MEDIA_URL }}img/download.png"/>{{ action.get_filename }}</a></div>
+        <a href="{{ action.file.url }}"><img src="{{ MEDIA_URL }}img/download.png"/>&nbsp;{{ action.get_filename }}</a></div>
       {% endif %}
-      <p>{{ action.comment|linebreaksbr|default:"No comment" }}</p><br/>
+      <p>{{ action.comment|linebreaksbr|default:_("No comment") }}</p><br/>
     </div>
   </div>
   {% endfor %}
@@ -95,7 +97,7 @@
     <table class="djform">
       {{ action_form.as_table }}
       <tr><td></td>
-        <td><input type="submit" value="Submit"></td><tr>
+        <td><input type="submit" value="{% trans "Submit" %}"></td><tr>
     </table>
   </form>
 {% else %}

Modified: trunk/vertimus/models.py
==============================================================================
--- trunk/vertimus/models.py	(original)
+++ trunk/vertimus/models.py	Tue Dec 30 10:39:34 2008
@@ -22,7 +22,7 @@
 
 from datetime import datetime
 from django.db import models
-from django.utils.translation import ugettext as _
+from django.utils.translation import ugettext_lazy as _
 from django.core import mail, urlresolvers
 from django.contrib.sites.models import Site
 from django.conf import settings
@@ -91,7 +91,7 @@
         return self._state_db
 
     def __unicode__(self):
-        return self.description
+        return unicode(self.description)
 
     def _get_available_actions(self, action_names):
         action_names.append('WC')
@@ -161,7 +161,7 @@
 
 class StateProofreading(StateAbstract):
     name = 'Proofreading'
-    description = 'Proofreading'
+    description = _('Proofreading')
 
     def get_available_actions(self, person):
         action_names = []
@@ -188,7 +188,7 @@
 
 class StateToReview(StateAbstract):
     name = 'ToReview'
-    description = 'To Review'
+    description = _('To Review')
 
     def get_available_actions(self, person):
         action_names = []
@@ -324,7 +324,7 @@
         self._action_db.save()
 
     def __unicode__(self):
-        return self.description
+        return unicode(self.description) # needs unicode() because description is lazy
     
     def get_filename(self):
         if self._action_db.file:

Modified: trunk/vertimus/views.py
==============================================================================
--- trunk/vertimus/views.py	(original)
+++ trunk/vertimus/views.py	Tue Dec 30 10:39:34 2008
@@ -55,7 +55,11 @@
 def vertimus(request, branch, domain, language, stats=None):
     """The Vertimus view and form management"""
     if not stats:
-        stats = get_object_or_404(Statistics, branch=branch, domain=domain, language=language)
+        try:
+            stats = Statistics.objects.get(branch=branch, domain=domain, language=language)
+        except Statistics.DoesNotExist:
+            # Get the POT file stats
+            stats = get_object_or_404(Statistics, branch=branch, domain=domain, language=None)
 
     # Get the state of the translation
     (state_db, created) = StateDb.objects.get_or_create(



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