damned-lies r1143 - in branches/djamnedlies: . languages stats templates/languages
- From: claudep svn gnome org
- To: svn-commits-list gnome org
- Subject: damned-lies r1143 - in branches/djamnedlies: . languages stats templates/languages
- Date: Sat, 8 Nov 2008 14:55:29 +0000 (UTC)
Author: claudep
Date: Sat Nov 8 14:55:29 2008
New Revision: 1143
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1143&view=rev
Log:
2008-11-08 Claude Paroz <claude 2xlibre net>
* languages/urls.py: Fixed regression: /languages/ll redirect to
corresponding team page.
* stats/models.py: Get human-readable category name.
* templates/languages/language_release_stats.html: Use new catname.
Modified:
branches/djamnedlies/ChangeLog
branches/djamnedlies/languages/urls.py
branches/djamnedlies/stats/models.py
branches/djamnedlies/templates/languages/language_release_stats.html
Modified: branches/djamnedlies/languages/urls.py
==============================================================================
--- branches/djamnedlies/languages/urls.py (original)
+++ branches/djamnedlies/languages/urls.py Sat Nov 8 14:55:29 2008
@@ -3,4 +3,5 @@
urlpatterns = patterns('',
url(r'^$', 'languages.views.languages', name='languages'),
url(r'(?P<locale>[\w\- ]+)/(?P<release_name>[\w-]+)/$', 'languages.views.language_release', name='language_release'),
+ url(r'(?P<team_slug>[\w\- ]+)/$', 'teams.views.team', name='team_slug'),
)
Modified: branches/djamnedlies/stats/models.py
==============================================================================
--- branches/djamnedlies/stats/models.py (original)
+++ branches/djamnedlies/stats/models.py Sat Nov 8 14:55:29 2008
@@ -623,7 +623,6 @@
}
for stat in pot_stats:
dtype = stat.domain.dtype
- #import pdb; pdb.set_trace()
categdescr = stat.branch.category_set.get(release=self).category
domname = _(stat.domain.description)
modname = stat.domain.module.name
@@ -675,6 +674,7 @@
stats[dtype]['totalfuzzyperc'] = 0
stats[dtype]['totaluntransperc'] = 0
for key, categ in stats[dtype]['categs'].items():
+ categ['catname'] = Category.get_cat_name(key)
categ['cattotal'] = categ['cattrans'] + categ['catfuzzy'] + categ['catuntrans']
categ['cattransperc'] = int(100*categ['cattrans']/categ['cattotal'])
# Sort modules
@@ -707,6 +707,13 @@
def __unicode__(self):
return "%s (%s, %s)" % (self.get_category_display(), self.release, self.branch)
+
+ @classmethod
+ def get_cat_name(cls, key):
+ for entry in CATEGORY_CHOICES:
+ if key == entry[0]:
+ return _(entry[1])
+ return key
class Statistics(models.Model):
branch = models.ForeignKey(Branch)
Modified: branches/djamnedlies/templates/languages/language_release_stats.html
==============================================================================
--- branches/djamnedlies/templates/languages/language_release_stats.html (original)
+++ branches/djamnedlies/templates/languages/language_release_stats.html Sat Nov 8 14:55:29 2008
@@ -19,7 +19,9 @@
{% ifnotequal catname "default" %}
<tr><td colspan="3" class="leftcell" style="background: inherit; font-size: 120%; font-weight: bold; padding-top:1em;">
{% with categ.cattransperc as percentage %}
- {% blocktrans %}{{ catname }} ({{ percentage }}% translated){% endblocktrans %}
+ {% with categ.catname as categname %}
+ {% blocktrans %}{{ categname }} ({{ percentage }}% translated){% endblocktrans %}
+ {% endwith %}
{% endwith %}
</td></tr>
{% endifnotequal %}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]