|
17 | 17 | <span>{{ label }}</span>
|
18 | 18 | {%- endmacro %}
|
19 | 19 |
|
20 |
| -<div class="moin-itemviews panel"> |
21 |
| - {%- for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %} |
22 |
| - {% set icon_class = icon_classes[endpoint] %} |
23 |
| - {%- if may.write and not_trash %} |
24 |
| - {%- if current_path.startswith("/+") |
25 |
| - and endpoint == 'frontend.show_item' |
26 |
| - %} |
27 |
| - <div> |
28 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
29 |
| - </div> |
30 |
| - {%- elif not current_path.startswith("/+") |
31 |
| - and endpoint == 'frontend.modify_item' %} |
32 |
| - <div> |
33 |
| - <a class="moin-modify-button" href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
34 |
| - </div> |
35 |
| - {%- endif %} |
36 |
| - {%- endif %} |
37 |
| - {%- endfor %} |
38 |
| - <div id="top-bar-menu"> |
39 |
| - <input id="top-bar-menu-switch" type="checkbox" /> |
40 |
| - <div id="top-bar-menu-label"> |
41 |
| - <label for="top-bar-menu-switch"> |
42 |
| - <span>{{ _('More') }}</span> |
43 |
| - <i class="fa fa-caret-down"></i> |
44 |
| - </label> |
45 |
| - </div> |
46 |
| - <div id="top-bar-menu-content"> |
47 |
| - {%- for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %} |
48 |
| - {% set icon_class = icon_classes[endpoint] %} |
49 |
| - {%- if may.write |
50 |
| - and not_trash |
51 |
| - and endpoint == 'frontend.modify_item' |
52 |
| - and current_path.startswith("/+") |
53 |
| - and not current_path.startswith("/+modify/") |
54 |
| - %} |
55 |
| - <div> |
56 |
| - <a class="moin-modify-button" href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
57 |
| - </div> |
58 |
| - {%- endif %} |
59 |
| - {%- if endpoint in [ |
60 |
| - 'frontend.show_item_meta', |
61 |
| - 'frontend.history', |
62 |
| - 'frontend.download_item', |
63 |
| - ] %} |
64 |
| - <div> |
65 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
66 |
| - </div> |
| 20 | +<div id="top-bar"> |
| 21 | + <div class="moin-itemviews panel"> |
| 22 | + {%- for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %} |
| 23 | + {% set icon_class = icon_classes[endpoint] %} |
| 24 | + {%- if may.write and not_trash %} |
| 25 | + {%- if current_path.startswith("/+") |
| 26 | + and endpoint == 'frontend.show_item' |
| 27 | + %} |
| 28 | + <div> |
| 29 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 30 | + </div> |
| 31 | + {%- elif not current_path.startswith("/+") |
| 32 | + and endpoint == 'frontend.modify_item' %} |
| 33 | + <div> |
| 34 | + <a class="moin-modify-button" href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 35 | + </div> |
| 36 | + {%- endif %} |
67 | 37 | {%- endif %}
|
| 38 | + {%- endfor %} |
| 39 | + <div id="top-bar-menu"> |
| 40 | + <input id="top-bar-menu-switch" type="checkbox" /> |
| 41 | + <div id="top-bar-menu-label"> |
| 42 | + <label for="top-bar-menu-switch"> |
| 43 | + <span>{{ _('More') }}</span> |
| 44 | + <i class="fa fa-caret-down"></i> |
| 45 | + </label> |
| 46 | + </div> |
| 47 | + <div id="top-bar-menu-content"> |
| 48 | + {%- for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %} |
| 49 | + {% set icon_class = icon_classes[endpoint] %} |
| 50 | + {%- if may.write |
| 51 | + and not_trash |
| 52 | + and endpoint == 'frontend.modify_item' |
| 53 | + and current_path.startswith("/+") |
| 54 | + and not current_path.startswith("/+modify/") |
| 55 | + %} |
| 56 | + <div> |
| 57 | + <a class="moin-modify-button" href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 58 | + </div> |
| 59 | + {%- endif %} |
| 60 | + {%- if endpoint in [ |
| 61 | + 'frontend.show_item_meta', |
| 62 | + 'frontend.history', |
| 63 | + 'frontend.download_item', |
| 64 | + ] %} |
| 65 | + <div> |
| 66 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 67 | + </div> |
| 68 | + {%- endif %} |
68 | 69 |
|
69 |
| - {%- if not_trash and endpoint in [ |
70 |
| - 'frontend.index', |
71 |
| - 'frontend.refs', |
72 |
| - 'frontend.sitemap', |
73 |
| - 'frontend.similar_names', |
74 |
| - 'frontend.copy_item', |
75 |
| - ] %} |
76 |
| - <div> |
77 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
78 |
| - </div> |
79 |
| - {%- endif %} |
| 70 | + {%- if not_trash and endpoint in [ |
| 71 | + 'frontend.index', |
| 72 | + 'frontend.refs', |
| 73 | + 'frontend.sitemap', |
| 74 | + 'frontend.similar_names', |
| 75 | + 'frontend.copy_item', |
| 76 | + ] %} |
| 77 | + <div> |
| 78 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 79 | + </div> |
| 80 | + {%- endif %} |
80 | 81 |
|
81 |
| - {%- if endpoint == 'frontend.highlight_item' and item and ('text' in item.contenttype or 'docbook' in item.contenttype) %} |
82 |
| - <div> |
83 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
84 |
| - </div> |
85 |
| - {%- endif %} |
| 82 | + {%- if endpoint == 'frontend.highlight_item' and item and ('text' in item.contenttype or 'docbook' in item.contenttype) %} |
| 83 | + <div> |
| 84 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 85 | + </div> |
| 86 | + {%- endif %} |
86 | 87 |
|
87 |
| - {%- if endpoint in [ |
88 |
| - 'frontend.rename_item', 'frontend.delete_item', |
89 |
| - ] and may.write and not_trash %} |
90 |
| - <div> |
91 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
92 |
| - </div> |
93 |
| - {%- endif %} |
| 88 | + {%- if endpoint in [ |
| 89 | + 'frontend.rename_item', 'frontend.delete_item', |
| 90 | + ] and may.write and not_trash %} |
| 91 | + <div> |
| 92 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 93 | + </div> |
| 94 | + {%- endif %} |
94 | 95 |
|
95 |
| - {%- if endpoint in [ |
96 |
| - 'frontend.convert_item', |
97 |
| - ] and may.write and item and theme_supp.is_markup_or_text(item.contenttype) and not_trash %} |
98 |
| - <div> |
99 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
100 |
| - </div> |
101 |
| - {%- endif %} |
| 96 | + {%- if endpoint in [ |
| 97 | + 'frontend.convert_item', |
| 98 | + ] and may.write and item and theme_supp.is_markup_or_text(item.contenttype) and not_trash %} |
| 99 | + <div> |
| 100 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 101 | + </div> |
| 102 | + {%- endif %} |
102 | 103 |
|
103 |
| - {%- if endpoint == 'frontend.destroy_item' and may.destroy %} |
104 |
| - <div> |
105 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
106 |
| - </div> |
107 |
| - {%- endif %} |
| 104 | + {%- if endpoint == 'frontend.destroy_item' and may.destroy %} |
| 105 | + <div> |
| 106 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 107 | + </div> |
| 108 | + {%- endif %} |
108 | 109 |
|
109 |
| - {%- if endpoint == 'frontend.quicklink_item' and user.valid and not_trash %} |
110 |
| - <div> |
111 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow"> |
112 |
| - {%- if user.is_quicklinked_to([fqname]) %} |
113 |
| - {{ a_label(icon_class, _('Remove Link')) }} |
114 |
| - {%- else %} |
115 |
| - {{ a_label(icon_class, _('Add Link')) }} |
116 |
| - {%- endif %} |
117 |
| - </a> |
118 |
| - </div> |
119 |
| - {%- endif %} |
| 110 | + {%- if endpoint == 'frontend.quicklink_item' and user.valid and not_trash %} |
| 111 | + <div> |
| 112 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow"> |
| 113 | + {%- if user.is_quicklinked_to([fqname]) %} |
| 114 | + {{ a_label(icon_class, _('Remove Link')) }} |
| 115 | + {%- else %} |
| 116 | + {{ a_label(icon_class, _('Add Link')) }} |
| 117 | + {%- endif %} |
| 118 | + </a> |
| 119 | + </div> |
| 120 | + {%- endif %} |
120 | 121 |
|
121 |
| - {%- if endpoint == 'frontend.subscribe_item' and user.valid and not_trash %} |
122 |
| - <div> |
123 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow"> |
124 |
| - {%- if user.is_subscribed_to(item) %} |
125 |
| - {{ a_label(icon_class, _('Unsubscribe')) }} |
126 |
| - {%- else %} |
127 |
| - {{ a_label(icon_class, _('Subscribe')) }} |
128 |
| - {%- endif %} |
129 |
| - </a> |
130 |
| - </div> |
131 |
| - {%- endif %} |
| 122 | + {%- if endpoint == 'frontend.subscribe_item' and user.valid and not_trash %} |
| 123 | + <div> |
| 124 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow"> |
| 125 | + {%- if user.is_subscribed_to(item) %} |
| 126 | + {{ a_label(icon_class, _('Unsubscribe')) }} |
| 127 | + {%- else %} |
| 128 | + {{ a_label(icon_class, _('Subscribe')) }} |
| 129 | + {%- endif %} |
| 130 | + </a> |
| 131 | + </div> |
| 132 | + {%- endif %} |
132 | 133 |
|
133 |
| - {%- if endpoint == 'special.comments' and not_trash %} |
134 |
| - <div class="moin-toggle-comments-button"> |
135 |
| - <a class="moin-toggle-comments-tooltip" href="#" title="{{ title }}">{{ a_label(icon_class, label) }}</a> |
136 |
| - </div> |
137 |
| - {%- endif %} |
| 134 | + {%- if endpoint == 'special.comments' and not_trash %} |
| 135 | + <div class="moin-toggle-comments-button"> |
| 136 | + <a class="moin-toggle-comments-tooltip" href="#" title="{{ title }}">{{ a_label(icon_class, label) }}</a> |
| 137 | + </div> |
| 138 | + {%- endif %} |
138 | 139 |
|
139 |
| - {% if endpoint == 'special.transclusions' and not_trash -%} |
140 |
| - <div class="moin-transclusions-button"> |
141 |
| - <a class="moin-transclusions-tooltip" href="#" title="{{ title }}">{{ a_label(icon_class, label) }}</a> |
142 |
| - </div> |
143 |
| - {%- endif %} |
| 140 | + {% if endpoint == 'special.transclusions' and not_trash -%} |
| 141 | + <div class="moin-transclusions-button"> |
| 142 | + <a class="moin-transclusions-tooltip" href="#" title="{{ title }}">{{ a_label(icon_class, label) }}</a> |
| 143 | + </div> |
| 144 | + {%- endif %} |
144 | 145 |
|
145 |
| - {%- if endpoint == 'special.supplementation' and fqname %} |
146 |
| - {%- for sub_item_name in cfg.supplementation_item_names %} |
147 |
| - {%- set current_sub = item_name.rsplit('/', 1)[-1] %} |
148 |
| - {%- if not current_sub in cfg.supplementation_item_names %} |
149 |
| - {%- set supp_name = '%s/%s/%s' % (fqname.namespace, item_name, sub_item_name) %} |
150 |
| - {%- if not_trash and (storage.has_item(supp_name) or user.may.write(supp_name)) %} |
151 |
| - {% set title = _('Discuss contents of this item') %} |
152 |
| - <div> |
153 |
| - <a class="moin-subitem-discuss" href="{{ url_for('frontend.show_item', item_name=supp_name) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, _(sub_item_name)) }}</a> |
154 |
| - </div> |
| 146 | + {%- if endpoint == 'special.supplementation' and fqname %} |
| 147 | + {%- for sub_item_name in cfg.supplementation_item_names %} |
| 148 | + {%- set current_sub = item_name.rsplit('/', 1)[-1] %} |
| 149 | + {%- if not current_sub in cfg.supplementation_item_names %} |
| 150 | + {%- set supp_name = '%s/%s/%s' % (fqname.namespace, item_name, sub_item_name) %} |
| 151 | + {%- if not_trash and (storage.has_item(supp_name) or user.may.write(supp_name)) %} |
| 152 | + {% set title = _('Discuss contents of this item') %} |
| 153 | + <div> |
| 154 | + <a class="moin-subitem-discuss" href="{{ url_for('frontend.show_item', item_name=supp_name) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, _(sub_item_name)) }}</a> |
| 155 | + </div> |
| 156 | + {%- endif %} |
155 | 157 | {%- endif %}
|
156 |
| - {%- endif %} |
157 |
| - {%- endfor %} |
158 |
| - {%- endif %} |
159 |
| - {%- endfor %} |
| 158 | + {%- endfor %} |
| 159 | + {%- endif %} |
| 160 | + {%- endfor %} |
| 161 | + </div> |
160 | 162 | </div>
|
161 | 163 | </div>
|
162 | 164 | </div>
|
0 commit comments