changeset 1710:2bd2dad3cc74

Add 'Modify entry' link on a blog entry. It is displayed on the entry if the user has the right to modify this entry.
author Pavel Sviderski <pavel@psviderski.name>
date Sat, 18 Aug 2012 17:33:50 +0200
parents 4bf5108b1d73
children 6ba24e1114d5
files MoinMoin/templates/blog_layout.html MoinMoin/themes/modernized/static/css/common.css MoinMoin/themes/modernized/static/css/stylus/main.styl
diffstat 3 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/templates/blog_layout.html	Sat Aug 18 16:45:23 2012 +0200
+++ b/MoinMoin/templates/blog_layout.html	Sat Aug 18 17:33:50 2012 +0200
@@ -11,6 +11,12 @@
     {% endif %}
     <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">&#x2710;</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 publish_time = entry_item.meta['ptime'] %}
         {% if publish_time %}
--- a/MoinMoin/themes/modernized/static/css/common.css	Sat Aug 18 16:45:23 2012 +0200
+++ b/MoinMoin/themes/modernized/static/css/common.css	Sat Aug 18 17:33:50 2012 +0200
@@ -310,8 +310,10 @@
 #moin-blog-header{margin:1em 0 -1em 0}
 #moin-blog-content{padding:0 2em 0 0;display:table-cell}
 #moin-blog-sidebar{width:15em;display:table-cell}
+.moin-blog-icon{font-size:1.6em}
 .moin-blog-entry-info{font-size:.8em;color:#737373}
 .moin-blog-entry-bottominfo{font-size:.8em;color:#737373;padding:0 1em;border:1px solid #4e7da9}
+.moin-blog-entry-modify{font-size:.8em;margin:0;float:right}
 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:","}
--- a/MoinMoin/themes/modernized/static/css/stylus/main.styl	Sat Aug 18 16:45:23 2012 +0200
+++ b/MoinMoin/themes/modernized/static/css/stylus/main.styl	Sat Aug 18 17:33:50 2012 +0200
@@ -581,6 +581,9 @@
     width 15em
     display table-cell
 
+.moin-blog-icon
+    font-size 1.6em
+
 .moin-blog-entry-info
     font-size 0.8em
     color footer_color
@@ -591,6 +594,11 @@
     padding 0em 1em
     border border_style
 
+.moin-blog-entry-modify
+    font-size 0.8em
+    margin 0
+    float right
+
 ul.moin-blog-entry-tags
     list-style none
     display inline