[Cdd-commits] r923 - in cdd/trunk/webtools: . inc templates

CDD Subversion Commit noreply at alioth.debian.org
Sat Jul 5 17:49:57 UTC 2008


Author: tille
Date: Sat Jul  5 17:49:57 2008
New Revision: 923

Modified:
   cdd/trunk/webtools/inc/style.css
   cdd/trunk/webtools/tasks.py
   cdd/trunk/webtools/templates/tasks.xhtml
Log:
"Fix tranlation" and "task description translation" links


Modified: cdd/trunk/webtools/inc/style.css
==============================================================================
--- cdd/trunk/webtools/inc/style.css	(original)
+++ cdd/trunk/webtools/inc/style.css	Sat Jul  5 17:49:57 2008
@@ -687,3 +687,9 @@
 	vertical-align: top;
 	text-align: left;
 }
+
+.trans {
+	font:6pt sans-serif;
+	font-style:italic;
+	text-align: right;
+}

Modified: cdd/trunk/webtools/tasks.py
==============================================================================
--- cdd/trunk/webtools/tasks.py	(original)
+++ cdd/trunk/webtools/tasks.py	Sat Jul  5 17:49:57 2008
@@ -31,9 +31,11 @@
 cdeps.MarkupPreformatedStringsCDD()
 
 data = cdeps.data
-data['tasks']     = cdeps.GetTaskDescDict()
-data['taskskeys'] = cdeps.metapackagekeys
-data['languages'] = languages
+data['tasks']            = cdeps.GetTaskDescDict()
+data['taskskeys']        = cdeps.metapackagekeys
+data['languages']        = languages
+# Work around the fact that it seems to be impossible to mention '&' in the template
+data['ampandworkaround'] = Markup('&force=1')
 
 # Define directories used
 current_dir  = os.path.dirname(__file__)

Modified: cdd/trunk/webtools/templates/tasks.xhtml
==============================================================================
--- cdd/trunk/webtools/templates/tasks.xhtml	(original)
+++ cdd/trunk/webtools/templates/tasks.xhtml	Sat Jul  5 17:49:57 2008
@@ -32,8 +32,13 @@
 	           <span py:otherwise="">${tasks[task].metapkg.desc['en']['short']}</span>
                  </span></em><br/>
 				<p><span py:choose="">
-	           <span py:when="tasks[task].metapkg.desc.has_key(lang)">${tasks[task].metapkg.desc[lang]['long']}</span>
-	           <span py:otherwise="">${tasks[task].metapkg.desc['en']['long']}</span>
+	           <span py:when="tasks[task].metapkg.desc.has_key(lang)">${tasks[task].metapkg.desc[lang]['long']}
+                     <div class="trans" py:if="lang != 'en'"><a href="http://ddtp.debian.net/ddtss/index.cgi/${lang}/fetch?package=${tasks[task].metapkg.pkg}${ampandworkaround}">${fixtranslation}</a></div>
+                   </span>
+	           <span py:otherwise="">${tasks[task].metapkg.desc['en']['long']}
+                     <div class="trans" py:if="lang !=
+                     'en'"><a href="http://ddtp.debian.net/ddtss/index.cgi/${lang}/fetch?package=${tasks[task].metapkg.pkg}">${translatedesc}</a></div>
+                   </span>
                  </span></p>
 			</div>
 			<div class="row">
@@ -97,10 +102,12 @@
                  <span py:when="'unofficial'"><a href="${project.pkgURL}">${unofficialpkg}</a></span>
                  <span py:otherwise="">${nopkgavail}</span>
                </span><br />
+            <span py:if="lang != 'en'">
 	       <span py:choose="">
-	           <span py:when="project.desc.has_key(lang)"><!-- have to ask for proper URL ask DDTP server for yet translated descriptions <a href="http://ddtp.debian.net/ddtss/index.cgi/${lang}/translate/${project.pkg}">${fixtranslation}</a> --></span>
-	           <span py:otherwise=""><a href="http://ddtp.debian.net/ddtss/index.cgi/${lang}/translate/${project.pkg}">${translatedesc}</a></span>
+	           <span py:when="project.desc.has_key(lang)"><a href="http://ddtp.debian.net/ddtss/index.cgi/${lang}/fetch?package=${project.pkg}${ampandworkaround}">${fixtranslation}</a></span>
+	           <span py:otherwise=""><a href="http://ddtp.debian.net/ddtss/index.cgi/${lang}/fetch?package=${project.pkg}">${translatedesc}</a></span>
                </span>
+            </span>
            </td>
          </tr>
          <tr>



More information about the Cdd-commits mailing list