changeset 2324:a3c2a9f3a009

adds item actions to localpanel
author sharky93 <rishabhr123@gmail.com>
date Sat, 13 Jul 2013 02:48:26 +0530
parents 3831fd0c8fa0
children e3447f9e98ee
files MoinMoin/themes/basic/templates/show.html
diffstat 1 files changed, 65 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/basic/templates/show.html	Sat Jul 13 02:43:58 2013 +0530
+++ b/MoinMoin/themes/basic/templates/show.html	Sat Jul 13 02:48:26 2013 +0530
@@ -156,6 +156,69 @@
     {% endfor %}
 {% endblock %}
 
+{% block item_actions %}
+    <li class="nav-header">Item Actions</li>
+    {%- for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %}
+        {%- if not check_exists or check_exists and exists %}
+
+            {%- if endpoint == 'frontend.rename_item' and user.may.write(item_name) %}
+                <li>
+                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                        <span class="icon-tag"></span>
+                        {{ label }}
+                    </a>
+                </li>
+            {%- endif %}
+
+            {%- if endpoint == 'frontend.delete_item' and user.may.write(item_name) %}
+                <li>
+                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                        <span class="icon-remove"></span>
+                        {{ label }}
+                    </a>
+                </li>
+            {% endif %}
+
+            {%- if endpoint == 'frontend.destroy_item' and user.may.destroy(item_name) %}
+                <li>
+                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                        <span class="icon-trash"></span>
+                        {{ label }}
+                    </a>
+                </li>
+            {%- endif %}
+
+            {%- if endpoint == 'frontend.similar_names' and user.may.write(item_name) %}
+                <li>
+                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                        <span class="icon-search"></span>
+                        {{ label }}
+                    </a>
+                </li>
+            {%- endif %}
+
+            {%- if endpoint == 'frontend.download_item' and user.may.write(item_name) %}
+                <li>
+                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                        <span class="icon-download-alt"></span>
+                        {{ label }}
+                    </a>
+                </li>
+            {%- endif %}
+
+            {%- if endpoint == 'frontend.copy_item' and user.may.write(item_name) %}
+                <li>
+                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                        <span class="icon-comment"></span>
+                        {{ label }}
+                    </a>
+                </li>
+            {%- endif %}
+
+        {% endif %}
+    {% endfor %}
+{% endblock %}
+
 {% block local_panel %}
         
         <!-- user, site, item actions -->
@@ -163,6 +226,8 @@
 
         {{ self.site_actions() }}
 
+        {{ self.item_actions() }}
+
         {% if rev %}
         <li class="nav-header">Metadata</li>
                 <li>{{ _("Revision:") }} {{rev.revid | shorten_id}}</li>