changeset 2663:06f564821562

Made summary field necessary for blog entries
author Saurabh Kathpalia <saurabh.kathpalia95@gmail.com>
date Sat, 19 Jul 2014 09:59:42 +0530
parents 2a50e6628a16
children c040fb080073
files MoinMoin/items/blog.py MoinMoin/templates/blog/utils.html
diffstat 2 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/items/blog.py	Fri Jul 18 11:51:20 2014 +0530
+++ b/MoinMoin/items/blog.py	Sat Jul 19 09:59:42 2014 +0530
@@ -18,7 +18,7 @@
 
 from MoinMoin.i18n import L_
 from MoinMoin.themes import render_template
-from MoinMoin.forms import OptionalText, Tags, DateTime
+from MoinMoin.forms import Text, Tags, DateTime
 from MoinMoin.storage.middleware.protecting import AccessDenied
 from MoinMoin.constants.keys import NAME_EXACT, WIKINAME, ITEMTYPE, MTIME, PTIME, TAGS
 from MoinMoin.items import Item, Default, register, BaseMetaForm
@@ -35,7 +35,7 @@
 
 
 class BlogEntryMetaForm(BaseMetaForm):
-    summary = (OptionalText.using(label=L_("Title"))
+    summary = (Text.using(label=L_("Title (required)", optional=False))
                .with_properties(placeholder=L_("One-line title of the blog entry")))
     ptime = DateTime.using(label=L_('Publication time (UTC)'), optional=True)
 
--- a/MoinMoin/templates/blog/utils.html	Fri Jul 18 11:51:20 2014 +0530
+++ b/MoinMoin/templates/blog/utils.html	Sat Jul 19 09:59:42 2014 +0530
@@ -2,11 +2,7 @@
 {% import "utils.html" as utils %}
 
 {% macro show_blog_entry(entry_item) %}
-    {% if entry_item.meta['summary'] %}
-        {% set title = entry_item.meta['summary'] %}
-    {% else %}
-        {% set title = entry_item.name %}
-    {% endif %}
+    {% set title = entry_item.meta['summary'] %}
     <h1><a href="{{ url_for('frontend.show_item', item_name=entry_item.name) }}"
         title="{{ title }}" class="moin-blog-entry-link">{{ title }}</a></h1>
     {% if user.may.write(entry_item.name) %}