Mercurial > moin > 2.0
changeset 2692:fba2cb757335
Improved UI of Blog items in basic theme
author | Saurabh Kathpalia <saurabh.kathpalia95@gmail.com> |
---|---|
date | Wed, 06 Aug 2014 21:50:19 +0530 |
parents | 43987f1b008e |
children | 759817e9bc28 |
files | MoinMoin/templates/blog/utils.html MoinMoin/themes/basic/static/css/blog.css |
diffstat | 2 files changed, 87 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/templates/blog/utils.html Wed Aug 06 05:32:51 2014 +0530 +++ b/MoinMoin/templates/blog/utils.html Wed Aug 06 21:50:19 2014 +0530 @@ -2,44 +2,45 @@ {% import "utils.html" as utils %} {% macro show_blog_entry(entry_item) %} - {% 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) %} - <div class="moin-blog-entry-modify"> - <span class="moin-blog-icon">✐</span> - <a href="{{ url_for('frontend.modify_item', item_name=entry_item.name) }}">{{ _("Modify entry") }}</a> - </div> - {% endif %} - <div class="moin-blog-entry-info"> - {% set publication_time = entry_item.meta['ptime'] or entry_item.meta['mtime'] %} - {% if publication_time %} - {{ _("Published on") }} {{ publication_time|datetimeformat }} - {{ _("by") }} {{ utils.editor_info(entry_item.meta) }} - {% else %} - {{ _("Not published yet.") }} - {% endif %} - </div> - <div class="moin-blog-entry-content"> - {{ entry_item.content._render_data()|safe }} {# rendered blog entry content #} - </div> - <div class="moin-blog-entry-bottominfo"> - {% set tags = entry_item.meta['tags']|sort %} - {% if tags %} {# display blog entry's tags as a list if it is not empty #} - <div class="moin-blog-entry-tags"> - {{ _("Tags:") }} - <ul class="moin-blog-entry-tags"> - {% for tag in tags %} - <li><a href="{{ url_for('frontend.tagged_items', tag=tag) }}">{{ tag }}</a></li> - {% endfor %} - </ul> + {% set summary = entry_item.meta['summary'] %} + <div class="bg-info moin-blog-entry"> + <h1><a href="{{ url_for('frontend.show_item', item_name=entry_item.name) }}" + title="{{ summary }}" class="moin-blog-entry-link">{{ summary }}</a></h1> + {% if user.may.write(entry_item.fqname) %} + <div class="moin-blog-entry-modify"> + <span class="moin-blog-icon">✐</span> + <a href="{{ url_for('frontend.modify_item', item_name=entry_item.fqname) }}">{{ _("Modify") }}</a> </div> {% endif %} - <div class="moin-blog-entry-comments"> - {% set discussion_item_name = '{0}/{1}'.format(entry_item.name, cfg.supplementation_item_names[0]) %} - <a href="{{ url_for('frontend.show_item', item_name=discussion_item_name) }}">{{ _("Discussion page") }}</a> + <div class="moin-blog-entry-info"> + {% set publication_time = entry_item.meta['ptime'] or entry_item.meta['mtime'] %} + {% if publication_time %} + {{ _("Published on") }} {{ publication_time|datetimeformat }} + {{ _("by") }} {{ utils.editor_info(entry_item.meta) }} + {% endif %} </div> - </div> + <div class="moin-blog-entry-content"> + {{ entry_item.content._render_data()|safe }} {# rendered blog entry content #} + </div> + <div class="moin-blog-entry-bottominfo"> + {% set tags = entry_item.meta['tags']|sort %} + {% if tags %} {# display blog entry's tags as a list if it is not empty #} + <div class="moin-blog-entry-tags"> + {{ _("Tags:") }} + <ul class="moin-blog-entry-tags"> + {% for tag in tags %} + <li><a href="{{ url_for('frontend.tagged_items', tag=tag) }}">{{ tag }}</a></li> + {% endfor %} + </ul> + </div> + {% endif %} + {# TODO: If entry has no name then subitem cannot be defined #} + <div class="moin-blog-entry-comments"> + {% set discussion_item_name = '{0}/{1}'.format(entry_item.name, cfg.supplementation_item_names[0]) %} + <a href="{{ url_for('frontend.show_item', item_name=discussion_item_name) }}">{{ _("Discussion page") }}</a> + </div> + </div> + </div><br><br> {% endmacro %} {% macro widget_supertags(blog_name, supertags) %}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MoinMoin/themes/basic/static/css/blog.css Wed Aug 06 21:50:19 2014 +0530 @@ -0,0 +1,51 @@ +#moin-blog-header { + margin: -0.5em 0 0.5em 0; + font-size: 20px; +} +#moin-blog-content{ + padding: 10px 0 0 0; + display: table-cell; + width: 100%; +} +#moin-blog-body { + display: table; + width: 80%; +} +.moin-blog-entry-comments { + padding-bottom: 10px; +} +#moin-blog-content h1 a { + text-decoration: none; + font-size: 30px; +} +.moin-blog-entry { + border: 2px solid #99CCFF; + padding-left: 10px; + padding-right: 10px; + border-radius: 10px; +} +.moin-blog-icon { + font-size: 1.6em +} +.moin-blog-entry-info { + font-size: 12px; + color: #737373; + padding-bottom: 10px; +} +.moin-blog-entry-modify { + font-size: 15px; + margin: 0; + float: right; + padding-left: 10px; +} +ul.moin-blog-entry-tags { + list-style: none; + display: inline; + margin: 0; +} +ul.moin-blog-entry-tags li { + display: inline; +} +ul.moin-blog-entry-tags li:after { + content: ","; +}