damned-lies r900 - in trunk: . templates
- From: claudep svn gnome org
- To: svn-commits-list gnome org
- Subject: damned-lies r900 - in trunk: . templates
- Date: Mon, 16 Jun 2008 19:46:37 +0000 (UTC)
Author: claudep
Date: Mon Jun 16 19:46:37 2008
New Revision: 900
URL: http://svn.gnome.org/viewvc/damned-lies?rev=900&view=rev
Log:
2008-06-16 Claude Paroz <claude 2xlibre net>
* teams.py:
* templates/language-release.tmpl: Allow to show language stats even when
there isn't a team in charge of the language.
Modified:
trunk/ChangeLog
trunk/teams.py
trunk/templates/language-release.tmpl
Modified: trunk/teams.py
==============================================================================
--- trunk/teams.py (original)
+++ trunk/teams.py Mon Jun 16 19:46:37 2008
@@ -52,8 +52,10 @@
self.data = { teamid : teams[teamid] }
return
-
- self.data = teams
+ if only_language:
+ self.data = {} # No team found
+ else:
+ self.data = teams # All teams
# Implement dictionary methods
@@ -187,7 +189,9 @@
release = t_rel
else:
(t_rel, t_ext) = (None, None)
-
+ print "Release not found!"
+ return
+
myteam = TranslationTeams(only_language=langid)
if len(myteam):
teamid = myteam.data.keys()[0]
@@ -198,27 +202,29 @@
if lang != langid:
del team['language'][lang]
- if release:
- self.language = langid
- language_name = team['language'][langid]['content']
- myreleases = releases.Releases(deep=1, only_release=release,
- gather_stats=langid).data
- if myreleases:
- self.release = myreleases[0]
- else:
- print "Release not found!!"
- if not team.has_key('description') and language_name:
- team['description'] = ( _("%(lang)s Translation Team")
- % { 'lang' : language_name } )
- if not team.has_key('bugzilla-component') and language_name:
- team['bugzilla-component'] = "%s [%s]" % (language_name,
- langid)
- self.language_name = language_name
- self.team = team
+ language_name = team['language'][langid]['content']
- DamnedRequest.render(self, type)
- else:
- print "Release not found!"
+ if not team.has_key('description') and language_name:
+ team['description'] = ( _("%(lang)s Translation Team")
+ % { 'lang' : language_name } )
+ if not team.has_key('bugzilla-component') and language_name:
+ team['bugzilla-component'] = "%s [%s]" % (language_name,
+ langid)
+
+ self.language_name = language_name
+ self.team = team
+ else:
+ self.team = None
+
+ myreleases = releases.Releases(deep=1, only_release=release,
+ gather_stats=langid).data
+ if myreleases:
+ self.release = myreleases[0]
+ else:
+ print "Release not found!!"
+ self.language = langid
+
+ DamnedRequest.render(self, type)
class LanguageRequest(DamnedRequest):
def render(self, type='html'):
Modified: trunk/templates/language-release.tmpl
==============================================================================
--- trunk/templates/language-release.tmpl (original)
+++ trunk/templates/language-release.tmpl Mon Jun 16 19:46:37 2008
@@ -1,9 +1,10 @@
-#set global pageTitle=$release.description + " - " + $language_name
+#set global pageTitle=$release.description + " - " + $language
#set global pageSection="languages"
#include "templates/header.tmpl"
<div class="mainpage">
+#if $team
<h1>${_("%(lang)s Translation Team"), lang=$team.description} â ${language_name}</h1>
<table><tr><td valign="top" width="50%">
@@ -35,16 +36,18 @@
</ul>
#end if
-
-
-</td><td valign="top">
-#if $team.has_key('coordinator')
- <h2>$_("Coordinator")</h2>
- #set global person=$team.coordinator
- #set global printroles=0
- #include "templates/person-base.tmpl"
-#end if
+ </td><td valign="top">
+ #if $team.has_key('coordinator')
+ <h2>$_("Coordinator")</h2>
+ #set global person=$team.coordinator
+ #set global printroles=0
+ #include "templates/person-base.tmpl"
+ #end if
</td></tr></table>
+#else
+ <h1>${_("Language code: %s") % $language}</h1>
+ <p>${_("There is no translation team in charge of '%s' translation.") % $language}</p>
+#end if
<h2>$release.description</h2>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]