changeset 2387:9bf41329f031

icon dict to map endpoints with icon retrieved from helper functions
author sharky93 <rishabhr123@gmail.com>
date Sat, 17 Aug 2013 05:54:42 +0530
parents 96fbb30f3aba
children 7328625c7ef2
files MoinMoin/themes/__init__.py MoinMoin/themes/basic/templates/itemviews.html MoinMoin/themes/basic/templates/layout.html MoinMoin/themes/basic/templates/show.html
diffstat 4 files changed, 25 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/__init__.py	Sat Aug 17 05:30:12 2013 +0530
+++ b/MoinMoin/themes/__init__.py	Sat Aug 17 05:54:42 2013 +0530
@@ -94,6 +94,28 @@
                 'frontend.similar_names', 'frontend.download_item', 'frontend.copy_item',] if self.user.may.write(item_name) else []
         return user_actions, item_navigation, item_actions
 
+    def get_endpoint_iconmap(self):
+        icon = {'frontend.quicklink_item' : "icon-star-empty",
+               'frontend.subscribe_item' : "icon-envelope",
+               'frontend.index' : "icon-list-alt",
+               'frontend.sitemap' : "icon-map-marker",
+               'frontend.rename_item' : "icon-tag",
+               'frontend.delete_item' : "icon-trash",
+               'frontend.destroy_item' : "icon-fire",
+               'frontend.similar_names' : "icon-search",
+               'frontend.download_item' : "icon-download-alt",
+               'frontend.copy_item' : "icon-comment",
+               'special.supplementation' : "icon-comment",
+               'frontend.show_item' : "icon-eye-open",
+               'frontend.modify_item' : "icon-pencil",
+               'frontend.history' : "icon-time",
+               'frontend.show_item_meta' : "icon-wrench",
+               'frontend.highlight_item' : "icon-picture",
+               'frontend.backrefs' : "icon-share",
+               'special.comments' : "icon-comment",
+               'special.transclusions' : "icon-edit",};
+        return icon        
+
     def location_breadcrumbs(self, item_name):
         """
         Assemble the location using breadcrumbs (was: title)
--- a/MoinMoin/themes/basic/templates/itemviews.html	Sat Aug 17 05:30:12 2013 +0530
+++ b/MoinMoin/themes/basic/templates/itemviews.html	Sat Aug 17 05:54:42 2013 +0530
@@ -1,15 +1,7 @@
 {% set exists = storage.has_item(item_name) %}
 {% set current_endpoint = request.endpoint %}
 
-{% set icon = {'frontend.show_item' : "icon-eye-open",
-               'frontend.modify_item' : "icon-pencil",
-               'frontend.history' : "icon-time",
-               'frontend.show_item_meta' : "icon-wrench",
-               'frontend.highlight_item' : "icon-picture",
-               'frontend.backrefs' : "icon-share",
-               'special.comments' : "icon-comment",
-               'special.transclusions' : "icon-edit",
-           } %}
+{% from theme("layout.html") import icon with context %}
 
 {% set navtabs = theme_supp.get_action_tabs(item_name) %}
 
--- a/MoinMoin/themes/basic/templates/layout.html	Sat Aug 17 05:30:12 2013 +0530
+++ b/MoinMoin/themes/basic/templates/layout.html	Sat Aug 17 05:54:42 2013 +0530
@@ -9,6 +9,8 @@
 {% set current_url = url_for_item(endpoint = request.endpoint, item_name = item_name) %}
 {% endif %}
 
+{% set icon = theme_supp.get_endpoint_iconmap() %}
+
 {% block head %}
     {{ super() }}
     <link media="all" rel="stylesheet" href="{{ theme_static('css/basic.css') }}" />
--- a/MoinMoin/themes/basic/templates/show.html	Sat Aug 17 05:30:12 2013 +0530
+++ b/MoinMoin/themes/basic/templates/show.html	Sat Aug 17 05:54:42 2013 +0530
@@ -3,19 +3,6 @@
 {% import theme("itemviews.html") as itemviews with context %}
 {% set exists = storage.has_item(item_name) %}
 
-{% set icon = {'frontend.quicklink_item' : "icon-star-empty",
-               'frontend.subscribe_item' : "icon-envelope",
-               'frontend.index' : "icon-list-alt",
-               'frontend.sitemap' : "icon-map-marker",
-               'frontend.rename_item' : "icon-tag",
-               'frontend.delete_item' : "icon-trash",
-               'frontend.destroy_item' : "icon-fire",
-               'frontend.similar_names' : "icon-search",
-               'frontend.download_item' : "icon-download-alt",
-               'frontend.copy_item' : "icon-comment",
-               'special.supplementation' : "icon-comment",
-           } %}
-
 {% set user_actions, item_navigation, item_actions = theme_supp.get_local_panel(item_name) %}
 
 {% block views %}