|
7 | 7 | Comment and Transclusion links may be hidden by Javascript if item lacks content.
|
8 | 8 | #}
|
9 | 9 |
|
10 |
| -{% set exists = fqname and storage.get_item(**fqname.query) %} |
11 | 10 | {% set item = item %}
|
12 | 11 | {% set not_trash = not item_is_deleted if item_is_deleted is defined else True %}
|
13 | 12 | {% set icon_classes = theme_supp.get_endpoint_iconmap() %}
|
|
21 | 20 | <li class="moin-panel-heading">{{ _('Item Views') }}</li>
|
22 | 21 | {%- for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %}
|
23 | 22 | {% set icon_class = icon_classes[endpoint] %}
|
24 |
| - {%- if not check_exists or check_exists and exists %} |
25 |
| - {%- if endpoint in [ |
26 |
| - 'frontend.show_item', |
27 |
| - 'frontend.show_item_meta', |
28 |
| - 'frontend.history', |
29 |
| - 'frontend.download_item', |
30 |
| - ] %} |
31 |
| - <li> |
32 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
33 |
| - </li> |
34 |
| - {%- endif %} |
| 23 | + {%- if endpoint in [ |
| 24 | + 'frontend.show_item', |
| 25 | + 'frontend.show_item_meta', |
| 26 | + 'frontend.history', |
| 27 | + 'frontend.download_item', |
| 28 | + ] %} |
| 29 | + <li> |
| 30 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 31 | + </li> |
| 32 | + {%- endif %} |
35 | 33 |
|
36 |
| - {%- if not_trash and endpoint in [ |
37 |
| - 'frontend.index', |
38 |
| - 'frontend.refs', |
39 |
| - 'frontend.sitemap', |
40 |
| - 'frontend.similar_names', |
41 |
| - 'frontend.copy_item', |
42 |
| - ] %} |
43 |
| - <li> |
44 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
45 |
| - </li> |
46 |
| - {%- endif %} |
| 34 | + {%- if not_trash and endpoint in [ |
| 35 | + 'frontend.index', |
| 36 | + 'frontend.refs', |
| 37 | + 'frontend.sitemap', |
| 38 | + 'frontend.similar_names', |
| 39 | + 'frontend.copy_item', |
| 40 | + ] %} |
| 41 | + <li> |
| 42 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 43 | + </li> |
| 44 | + {%- endif %} |
47 | 45 |
|
48 |
| - {%- if endpoint == 'frontend.highlight_item' and item and ('text' in item.contenttype or 'docbook' in item.contenttype) %} |
49 |
| - <li> |
50 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
51 |
| - </li> |
52 |
| - {%- endif %} |
| 46 | + {%- if endpoint == 'frontend.highlight_item' and item and ('text' in item.contenttype or 'docbook' in item.contenttype) %} |
| 47 | + <li> |
| 48 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 49 | + </li> |
| 50 | + {%- endif %} |
53 | 51 |
|
54 |
| - {%- if endpoint == 'frontend.modify_item' and may.write and not_trash %} |
55 |
| - <li> |
56 |
| - <a class="moin-modify-button" href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
57 |
| - </li> |
58 |
| - {%- endif %} |
| 52 | + {%- if endpoint == 'frontend.modify_item' and may.write and not_trash %} |
| 53 | + <li> |
| 54 | + <a class="moin-modify-button" href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 55 | + </li> |
| 56 | + {%- endif %} |
59 | 57 |
|
60 |
| - {%- if endpoint in [ |
61 |
| - 'frontend.rename_item', 'frontend.delete_item', |
62 |
| - ] and may.write and not_trash %} |
63 |
| - <li> |
64 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
65 |
| - </li> |
66 |
| - {%- endif %} |
| 58 | + {%- if endpoint in [ |
| 59 | + 'frontend.rename_item', 'frontend.delete_item', |
| 60 | + ] and may.write and not_trash %} |
| 61 | + <li> |
| 62 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 63 | + </li> |
| 64 | + {%- endif %} |
67 | 65 |
|
68 |
| - {%- if endpoint in [ |
69 |
| - 'frontend.convert_item', |
70 |
| - ] and may.write and item and theme_supp.is_markup_or_text(item.contenttype) and not_trash %} |
71 |
| - <li> |
72 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
73 |
| - </li> |
74 |
| - {%- endif %} |
| 66 | + {%- if endpoint in [ |
| 67 | + 'frontend.convert_item', |
| 68 | + ] and may.write and item and theme_supp.is_markup_or_text(item.contenttype) and not_trash %} |
| 69 | + <li> |
| 70 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 71 | + </li> |
| 72 | + {%- endif %} |
75 | 73 |
|
76 |
| - {%- if endpoint == 'frontend.destroy_item' and may.destroy %} |
77 |
| - <li> |
78 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
79 |
| - </li> |
80 |
| - {%- endif %} |
| 74 | + {%- if endpoint == 'frontend.destroy_item' and may.destroy %} |
| 75 | + <li> |
| 76 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a> |
| 77 | + </li> |
| 78 | + {%- endif %} |
81 | 79 |
|
82 |
| - {%- if endpoint == 'frontend.quicklink_item' and user.valid and not_trash %} |
83 |
| - <li> |
84 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow"> |
85 |
| - {%- if user.is_quicklinked_to([fqname]) %} |
86 |
| - {{ a_label(icon_class, _('Remove Link')) }} |
87 |
| - {%- else %} |
88 |
| - {{ a_label(icon_class, _('Add Link')) }} |
89 |
| - {%- endif %} |
90 |
| - </a> |
91 |
| - </li> |
92 |
| - {%- endif %} |
| 80 | + {%- if endpoint == 'frontend.quicklink_item' and user.valid and not_trash %} |
| 81 | + <li> |
| 82 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow"> |
| 83 | + {%- if user.is_quicklinked_to([fqname]) %} |
| 84 | + {{ a_label(icon_class, _('Remove Link')) }} |
| 85 | + {%- else %} |
| 86 | + {{ a_label(icon_class, _('Add Link')) }} |
| 87 | + {%- endif %} |
| 88 | + </a> |
| 89 | + </li> |
| 90 | + {%- endif %} |
93 | 91 |
|
94 |
| - {%- if endpoint == 'frontend.subscribe_item' and user.valid and not_trash %} |
95 |
| - <li> |
96 |
| - <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow"> |
97 |
| - {%- if user.is_subscribed_to(item) %} |
98 |
| - {{ a_label(icon_class, _('Unsubscribe')) }} |
99 |
| - {%- else %} |
100 |
| - {{ a_label(icon_class, _('Subscribe')) }} |
101 |
| - {%- endif %} |
102 |
| - </a> |
103 |
| - </li> |
104 |
| - {%- endif %} |
| 92 | + {%- if endpoint == 'frontend.subscribe_item' and user.valid and not_trash %} |
| 93 | + <li> |
| 94 | + <a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow"> |
| 95 | + {%- if user.is_subscribed_to(item) %} |
| 96 | + {{ a_label(icon_class, _('Unsubscribe')) }} |
| 97 | + {%- else %} |
| 98 | + {{ a_label(icon_class, _('Subscribe')) }} |
| 99 | + {%- endif %} |
| 100 | + </a> |
| 101 | + </li> |
| 102 | + {%- endif %} |
105 | 103 |
|
106 |
| - {%- if endpoint == 'special.comments' and not_trash %} |
107 |
| - <li class="moin-toggle-comments-button"> |
108 |
| - <a class="moin-toggle-comments-tooltip" href="#" title="{{ title }}">{{ a_label(icon_class, label) }}</a> |
109 |
| - </li> |
110 |
| - {%- endif %} |
| 104 | + {%- if endpoint == 'special.comments' and not_trash %} |
| 105 | + <li class="moin-toggle-comments-button"> |
| 106 | + <a class="moin-toggle-comments-tooltip" href="#" title="{{ title }}">{{ a_label(icon_class, label) }}</a> |
| 107 | + </li> |
| 108 | + {%- endif %} |
111 | 109 |
|
112 |
| - {% if endpoint == 'special.transclusions' and not_trash -%} |
113 |
| - <li class="moin-transclusions-button"> |
114 |
| - <a class="moin-transclusions-tooltip" href="#" title="{{ title }}">{{ a_label(icon_class, label) }}</a> |
115 |
| - </li> |
116 |
| - {%- endif %} |
| 110 | + {% if endpoint == 'special.transclusions' and not_trash -%} |
| 111 | + <li class="moin-transclusions-button"> |
| 112 | + <a class="moin-transclusions-tooltip" href="#" title="{{ title }}">{{ a_label(icon_class, label) }}</a> |
| 113 | + </li> |
| 114 | + {%- endif %} |
117 | 115 |
|
118 |
| - {%- if endpoint == 'special.supplementation' and fqname %} |
119 |
| - {%- for sub_item_name in cfg.supplementation_item_names %} |
120 |
| - {%- set current_sub = item_name.rsplit('/', 1)[-1] %} |
121 |
| - {%- if not current_sub in cfg.supplementation_item_names %} |
122 |
| - {%- set supp_name = '%s/%s' % (fqname, sub_item_name) %} |
123 |
| - {%- if not_trash and (storage.has_item(supp_name) or user.may.write(supp_name)) %} |
124 |
| - {% set title = _('Discuss contents of this item') %} |
125 |
| - <li> |
126 |
| - <a class="moin-subitem-discuss" href="{{ url_for('frontend.show_item', item_name = supp_name) }}" |
127 |
| - title="{{ title }}" rel="nofollow">{{ a_label(icon_class, _(sub_item_name)) }} |
128 |
| - </a> |
129 |
| - </li> |
130 |
| - {%- endif %} |
| 116 | + {%- if endpoint == 'special.supplementation' and fqname %} |
| 117 | + {%- for sub_item_name in cfg.supplementation_item_names %} |
| 118 | + {%- set current_sub = item_name.rsplit('/', 1)[-1] %} |
| 119 | + {%- if not current_sub in cfg.supplementation_item_names %} |
| 120 | + {%- set supp_name = '%s/%s' % (fqname, sub_item_name) %} |
| 121 | + {%- if not_trash and (storage.has_item(supp_name) or user.may.write(supp_name)) %} |
| 122 | + {% set title = _('Discuss contents of this item') %} |
| 123 | + <li> |
| 124 | + <a class="moin-subitem-discuss" href="{{ url_for('frontend.show_item', item_name = supp_name) }}" |
| 125 | + title="{{ title }}" rel="nofollow">{{ a_label(icon_class, _(sub_item_name)) }} |
| 126 | + </a> |
| 127 | + </li> |
131 | 128 | {%- endif %}
|
132 |
| - {%- endfor %} |
133 |
| - {%- endif %} |
| 129 | + {%- endif %} |
| 130 | + {%- endfor %} |
134 | 131 | {%- endif %}
|
135 | 132 | {%- endfor %}
|
136 | 133 | </ul>
|
0 commit comments