damned-lies r901 - in trunk: . templates



Author: claudep
Date: Mon Jun 16 20:59:09 2008
New Revision: 901
URL: http://svn.gnome.org/viewvc/damned-lies?rev=901&view=rev

Log:
2008-06-16  Claude Paroz  <claude 2xlibre net>

	* teams.py:
	* templates/team.tmpl: Allow to show language summary stats even when
	there isn't a team in charge of the language.

Modified:
   trunk/ChangeLog
   trunk/teams.py
   trunk/templates/team.tmpl

Modified: trunk/teams.py
==============================================================================
--- trunk/teams.py	(original)
+++ trunk/teams.py	Mon Jun 16 20:59:09 2008
@@ -229,6 +229,8 @@
 class LanguageRequest(DamnedRequest):
     def render(self, type='html'):
         langid = self.request
+        releaselist = releases.Releases(deep=1, gather_stats = langid).data
+        releaselist.sort(compare_releases)
         myteam = TranslationTeams(only_language=langid)
         if len(myteam):
             teamid = myteam.data.keys()[0]
@@ -239,12 +241,14 @@
                     if lang != langid:
                         del team['language'][lang]
 
-            self.language = langid
             self.language_name = team['language'][langid]['content']
-            releaselist = releases.Releases(deep=1, gather_stats = langid).data
-            releaselist.sort(compare_releases)
             team['language'][langid]['releases'] = releaselist
             self.team = team
-
-            DamnedRequest.render(self, type)
+        else:
+            self.language_name = langid
+            self.langstats = { langid: {'content':langid, 'releases': releaselist} }
+            self.team = None
+        
+        self.language = langid
+        DamnedRequest.render(self, type)
 

Modified: trunk/templates/team.tmpl
==============================================================================
--- trunk/templates/team.tmpl	(original)
+++ trunk/templates/team.tmpl	Mon Jun 16 20:59:09 2008
@@ -1,9 +1,10 @@
-#set global pageTitle=$team.description
+#set global pageTitle=$language_name
 #set global pageSection="teams"
 #include "templates/header.tmpl"
 
 <div class="mainpage">
 
+#if $team
 <h1>${_("%(lang)s Translation Team"), lang=$team.description}</h1>
 
 <table><tr><td valign="top" width="50%">
@@ -35,19 +36,22 @@
   </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>
+  #set languageDict = $team.language
+#else
+  <h1>${_("Language code: %s") % $language}</h1>
+  #set languageDict = $langstats
+#end if
 
-#if len($team.language)
-#for $lang, $ldata in $team.language.items()
+#if len($languageDict)
+#for $lang, $ldata in $languageDict.items()
 <h2>$ldata.content</h2>
 
 #set releases=$ldata.releases



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