[Mpuls-commits] r2723 - in base/trunk: . mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu May 20 13:29:35 CEST 2010


Author: bh
Date: 2010-05-20 13:29:34 +0200 (Thu, 20 May 2010)
New Revision: 2723

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/lib/renderer.py
Log:
* mpulsweb/lib/renderer.py (ViewRenderer._renderRepeatList)
(ViewRenderer._renderMatrix, ErrorRenderer.render_items): Use the
tag function in more places when rendering HTML tags.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-05-20 10:49:33 UTC (rev 2722)
+++ base/trunk/ChangeLog	2010-05-20 11:29:34 UTC (rev 2723)
@@ -1,5 +1,11 @@
 2010-05-20  Bernhard Herzog  <bh at intevation.de>
 
+	* mpulsweb/lib/renderer.py (ViewRenderer._renderRepeatList)
+	(ViewRenderer._renderMatrix, ErrorRenderer.render_items): Use the
+	tag function in more places when rendering HTML tags.
+
+2010-05-20  Bernhard Herzog  <bh at intevation.de>
+
 	* mpulsweb/lib/renderer.py (RepeatGroupRenderer.render_digest)
 	(RepeatGroupRenderer.render): Rework these methods a little to
 	avoid some problems that could occur if the rg_digests haven't

Modified: base/trunk/mpulsweb/lib/renderer.py
===================================================================
--- base/trunk/mpulsweb/lib/renderer.py	2010-05-20 10:49:33 UTC (rev 2722)
+++ base/trunk/mpulsweb/lib/renderer.py	2010-05-20 11:29:34 UTC (rev 2723)
@@ -432,14 +432,10 @@
             out.append('</td>')
             out.append('<td class="vcontrol" width="15">')
             if not self.ro_mode:
-                out.append('''<input name="del_rg"
-                            type="image"
-                            src="/images/icons/delete_active_16.png"
-                            value="%s"
-                            alt="%s"
-                            title="%s">''' % (child.getIdentifier(),
-                                              _('Delete RG'),
-                                              _('Delete RG')))
+                out.append(tag("input", name="del_rg", type="image",
+                               src="/images/icons/delete_active_16.png",
+                               value=child.getIdentifier(),
+                               alt=_('Delete RG'), title=_('Delete RG')))
             out.append('</td>')
             out.append('</tr>')
         if self.ro_mode:
@@ -449,14 +445,10 @@
             out.append('<tr>')
             out.append('<td class="hcontrol" style="text-align: right;"'
                        ' colspan="2">')
-            out.append('''<input width="16"
-                        name="add_rg"
-                        type="image" src="/images/icons/new_16.png"
-                        value="%s"
-                        alt="%s"
-                        title="%s">''' % (node.getIdentifier(),
-                                          _('Add new RG'),
-                                          _('Add new RG')))
+            out.append(tag("input", width="16", name="add_rg",
+                           type="image", src="/images/icons/new_16.png",
+                           value=node.getIdentifier(),
+                           alt=_('Add new RG'), title=_('Add new RG')))
             out.append("</td>")
             out.append("</tr>")
         return out
@@ -738,7 +730,7 @@
 
         out.append('<thead>')
         out.append('<tr>')
-        out.append('<th class="label" colspan="%s">' % nr_of_children)
+        out.append(tag("th", class_="label", colspan=nr_of_children))
         out.append(self._renderLabel(node, False))
         out.append(self._renderAttributes(node))
         out.append('</th>')
@@ -764,14 +756,15 @@
         out.append('<tbody>')
         for num, row in enumerate(node.getChildren()):
             out.append('<tr>')
-            out.append('<td class="label %s">' % (num%2 and "hl" or ""))
+            out.append(tag("td", class_=("label %s"
+                                         % (num % 2 and "hl" or ""))))
             out.append(self._renderLabel(row, False))
             out.extend(self._renderAttributes(row))
             out.append('</td>')
             self.stateStack.append(str(row.getValue()))
             for col in self._getMeta(row).children:
                 value = col.getValue()
-                out.append('<td class="%s">' % (num%2 and "hl" or ""))
+                out.append(tag("td", class_=(num%2 and "hl" or "")))
                 out.append(tag("input", type="radio", name=row.getIdentifier(),
                                value=value, disabled=self.ro_mode,
                                checked=(value == self.stateStack[-1]),
@@ -783,15 +776,17 @@
 
         # write legend
         length = len(self._getMeta(node.getChildren()[0]).children)+1
-        out.append('<tr><td colspan="%s"></td></tr>' % str(length))
+        out.append('<tr>')
+        out.append(tag("td", colspan=length))
+        out.append('</td></tr>')
         if legend:
             out.append('<tr>')
-            out.append('<td class="legend" colspan="%s">' % str(length))
+            out.append(tag("td", class_="legend", colspan=length))
             out.append(" ".join(legend))
             out.append('</td>')
             out.append('</tr>')
         out.append('<tr>')
-        out.append('<td class="label" colspan="%s">' % str(length))
+        out.append(tag("td", class_="label", colspan=length))
         out.append(self._renderErrors(node))
         out.append('</td>')
         out.append('</tr>')
@@ -1065,7 +1060,7 @@
             return ""
 
         out = []
-        out.append('<div class="widget dialog %s">' % css_class)
+        out.append(tag("div", class_=("widget dialog %s" % css_class)))
         out.append('<h1>')
         out.append(tag("img", src=icon, alt=''))
         out.append(escape(title))



More information about the Mpuls-commits mailing list