changeset 1213:0edcdc5e7e91

Treat feed_title as unicode, also some cosmetic fixes
author Shitiz Garg <mail@dragooon.net>
date Fri, 06 Jan 2012 22:17:05 +0530
parents 98d0b7dfaf1a
children 8d547ec39a76
files MoinMoin/apps/feed/views.py MoinMoin/items/__init__.py MoinMoin/templates/atom.html MoinMoin/templates/diff_text_atom.html MoinMoin/themes/modernized/static/atom.xslt
diffstat 5 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/feed/views.py	Fri Jan 06 19:06:38 2012 +0530
+++ b/MoinMoin/apps/feed/views.py	Fri Jan 06 22:17:05 2012 +0530
@@ -84,19 +84,18 @@
                 logging.exception("content rendering crashed")
                 content = _(u'MoinMoin feels unhappy.')
                 content_type = 'text'
+            author = get_editor_info(rev.meta, external=True)
             rev_comment = rev.meta.get(COMMENT, '')
             if rev_comment:
                 # Trim down extremely long revision comment
                 if len(rev_comment) > 80:
                     content = render_template('atom.html', get='comment_cont_merge', comment=rev_comment[79:], content=Markup(content))
                     rev_comment = u"{0}...".format(rev_comment[:79])
-            author = get_editor_info(rev.meta, external=True)
-            if rev_comment is not '':
-                feed_title = "{0} - {1}".format(author.get(NAME, ''), rev_comment)
+                feed_title = u"{0} - {1}".format(author.get(NAME, ''), rev_comment)
             else:
-                feed_title = "{0}".format(author.get(NAME, ''))
+                feed_title = u"{0}".format(author.get(NAME, ''))
             if not item_name:
-                feed_title = "{0} - {1}".format(name, feed_title)
+                feed_title = u"{0} - {1}".format(name, feed_title)
             feed.add(title=feed_title, title_type='text',
                      summary=content, summary_type=content_type,
                      author=author,
@@ -111,3 +110,4 @@
         if cid is not None:
             app.cache.set(cid, content)
     return Response(content, content_type='application/atom+xml')
+
--- a/MoinMoin/items/__init__.py	Fri Jan 06 19:06:38 2012 +0530
+++ b/MoinMoin/items/__init__.py	Fri Jan 06 22:17:05 2012 +0530
@@ -929,7 +929,6 @@
 class Image(Binary):
     """ Base class for image/* """
     def _render_data_diff(self, oldrev, newrev):
-        print 'test'
         print self._internal_representation()
 item_registry.register(Image._factory, Type('image/*'))
 
--- a/MoinMoin/templates/atom.html	Fri Jan 06 19:06:38 2012 +0530
+++ b/MoinMoin/templates/atom.html	Fri Jan 06 22:17:05 2012 +0530
@@ -31,7 +31,7 @@
 {%- if get == 'xml' -%}
     <?xml-stylesheet type="text/xsl" href="{{ theme_static('atom.xslt') }}"?>
 {%- elif get == 'comment_cont_merge' -%}
-    <p style="font-size: 14px">...{{ comment }}</p> <br /> {{ content }}
+    <p style="font-size: 1.2em">…{{ comment }}</p> <br /> {{ content }}
 {%- elif get == 'first_revision' -%}
     {{ content }}
     <br />
@@ -42,7 +42,7 @@
             </td>
         </tr>
     </table>
-    <strong>{{ safe_style() }}</strong>
+    {{ safe_style() }}
 {%- elif get == 'binary' -%}
     {{ content }}
     <br />
@@ -57,4 +57,5 @@
         </tr>
     </table>
     {{ safe_style() }}
-{%- endif -%}
\ No newline at end of file
+{%- endif -%}
+
--- a/MoinMoin/templates/diff_text_atom.html	Fri Jan 06 19:06:38 2012 +0530
+++ b/MoinMoin/templates/diff_text_atom.html	Fri Jan 06 22:17:05 2012 +0530
@@ -40,3 +40,4 @@
     .moin-diff-added span { background-color: #80FF80; }
     .moin-diff-removed span { background-color: #FFFF80; }
 </style>
+
--- a/MoinMoin/themes/modernized/static/atom.xslt	Fri Jan 06 19:06:38 2012 +0530
+++ b/MoinMoin/themes/modernized/static/atom.xslt	Fri Jan 06 22:17:05 2012 +0530
@@ -43,4 +43,5 @@
             <div style="padding: 0px 30px 0px 30px;" class="summary"><xsl:value-of select="atom:summary" /></div>
         </div>
     </xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>
+