Commits

Shitiz Garg committed af3fdd4

Change feed title, also make the first revision show HTML

Comments (0)

Files changed (2)

MoinMoin/apps/feed/views.py

                     content = hl_item._render_data_diff_atom(previous_rev, this_rev)
                 else:
                     # full html rendering for new items
-                    content = render_template('atom.html', get='first_revision', content=hl_item._render_data(), revision=this_revid)
+                    content = render_template('atom.html', get='first_revision', content=Markup(hl_item._render_data()), revision=this_revid)
                 content_type = 'html'
             except Exception as e:
                 logging.exception("content rendering crashed")
                 content = _(u'MoinMoin feels unhappy.')
                 content_type = 'text'
             rev_comment = rev.meta.get(COMMENT, '')
-            if not rev_comment:
-                rev_comment = _(u'Revision: {0}').format(this_revid[0:7])
-            else:
+            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])
-            feed.add(title=rev_comment, title_type='text',
+            author = get_editor_info(rev.meta, external=True)
+            if rev_comment is not '':
+                feed_title = "{0} - {1}".format(author.get(NAME, ''), rev_comment)
+            else:
+                feed_title = "{0}".format(author.get(NAME, ''))
+            feed.add(title=feed_title, title_type='text',
                      summary=content, summary_type=content_type,
-                     author=get_editor_info(rev.meta, external=True),
+                     author=author,
                      url=url_for_item(name, rev=this_revid, _external=True),
                      updated=datetime.fromtimestamp(rev.meta[MTIME]),
                     )

MoinMoin/templates/atom.html

 {%- elif get == 'first_revision' -%}
     <div class="moin-diff-info moin-diff-info-rev-id">
         <span class="moin-diff-info-caption"><strong>Revision: {{ revision | shorten_id }}</strong> - <i>{{ _('First revision') }}</i></span>
-    </div>
-    <div style="background-color: #cfc"><blockquote>{{ content }}</blockquote></div>
+    </div><br />
+    {{ content }}
 {%- endif -%}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.