Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions src/moin/templates/itemviews.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
Comment and Transclusion links may be hidden by Javascript if item lacks content.
#}

{% set item = item %}
{% set not_trash = not item_is_deleted if item_is_deleted is defined else True %}
{% set icon_classes = theme_supp.get_endpoint_iconmap() %}
{%- set item = item -%}
{%- set not_trash = not item_is_deleted if item_is_deleted is defined else True -%}
{%- set icon_classes = theme_supp.get_endpoint_iconmap() -%}

{%- macro a_label(icon_class, label) %}
<i class="{{ icon_class }}"></i>
<span>{{ label }}</span>
<i class="{{ icon_class }}"></i><span>{{ label }}</span>
{%- endmacro %}

<ul class="moin-itemviews panel">
Expand Down Expand Up @@ -107,7 +106,7 @@
</li>
{%- endif %}

{% if endpoint == 'special.transclusions' and not_trash -%}
{%- if endpoint == 'special.transclusions' and not_trash %}
<li class="moin-transclusions-button">
<a class="moin-transclusions-tooltip" href="#" title="{{ title }}">{{ a_label(icon_class, label) }}</a>
</li>
Expand All @@ -120,11 +119,11 @@
{%- set supp_name = '%s/%s' % (fqname, sub_item_name) %}
{%- if not_trash and (storage.has_item(supp_name) or user.may.write(supp_name)) %}
{% set title = _('Discuss contents of this item') %}
<li>
<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>
</li>
<li>
<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>
</li>
{%- endif %}
{%- endif %}
{%- endfor %}
Expand Down
2 changes: 1 addition & 1 deletion src/moin/templates/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% import "utils.html" as utils with context %}
{% import "snippets.html" as snippets with context %}
{% import "itemviews.html" as itemviews with context %}
{% import theme("itemviews.html") as itemviews with context %}

{% set footer_meta = snippets.footer_meta() %}

Expand Down
246 changes: 124 additions & 122 deletions src/moin/themes/focus/templates/itemviews.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,146 +17,148 @@
<span>{{ label }}</span>
{%- endmacro %}

<div class="moin-itemviews panel">
{%- for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %}
{% set icon_class = icon_classes[endpoint] %}
{%- if may.write and not_trash %}
{%- if current_path.startswith("/+")
and endpoint == 'frontend.show_item'
<div id="top-bar">
<div class="moin-itemviews panel">
{%- for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %}
{% set icon_class = icon_classes[endpoint] %}
{%- if may.write and not_trash %}
{%- if current_path.startswith("/+")
and endpoint == 'frontend.show_item'
%}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- elif not current_path.startswith("/+")
and endpoint == 'frontend.modify_item' %}
<div>
<a class="moin-modify-button" href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}
{%- endif %}
{%- endfor %}
<div id="top-bar-menu">
<input id="top-bar-menu-switch" type="checkbox" />
<div id="top-bar-menu-label">
<label for="top-bar-menu-switch">
<span>{{ _('More') }}</span>
<i class="fa fa-caret-down"></i>
</label>
</div>
<div id="top-bar-menu-content">
{%- for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %}
{% set icon_class = icon_classes[endpoint] %}
{%- if may.write
and not_trash
and endpoint == 'frontend.modify_item'
and current_path.startswith("/+")
and not current_path.startswith("/+modify/")
%}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
<a class="moin-modify-button" href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- elif not current_path.startswith("/+")
and endpoint == 'frontend.modify_item' %}
{%- endif %}
{%- if endpoint in [
'frontend.show_item_meta',
'frontend.history',
'frontend.download_item',
] %}
<div>
<a class="moin-modify-button" href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}
{%- endif %}
{%- endfor %}
<div id="top-bar-menu">
<input id="top-bar-menu-switch" type="checkbox" />
<div id="top-bar-menu-label">
<label for="top-bar-menu-switch">
<span>{{ _('More') }}</span>
<i class="fa fa-caret-down"></i>
</label>
</div>
<div id="top-bar-menu-content">
{%- for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %}
{% set icon_class = icon_classes[endpoint] %}
{%- if may.write
and not_trash
and endpoint == 'frontend.modify_item'
and current_path.startswith("/+")
and not current_path.startswith("/+modify/")
%}
<div>
<a class="moin-modify-button" href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}
{%- if endpoint in [
'frontend.show_item_meta',
'frontend.history',
'frontend.download_item',
] %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}

{%- if not_trash and endpoint in [
'frontend.index',
'frontend.refs',
'frontend.sitemap',
'frontend.similar_names',
'frontend.copy_item',
] %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}
{%- if not_trash and endpoint in [
'frontend.index',
'frontend.refs',
'frontend.sitemap',
'frontend.similar_names',
'frontend.copy_item',
] %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}

{%- if endpoint == 'frontend.highlight_item' and item and ('text' in item.contenttype or 'docbook' in item.contenttype) %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}
{%- if endpoint == 'frontend.highlight_item' and item and ('text' in item.contenttype or 'docbook' in item.contenttype) %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}

{%- if endpoint in [
'frontend.rename_item', 'frontend.delete_item',
] and may.write and not_trash %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}
{%- if endpoint in [
'frontend.rename_item', 'frontend.delete_item',
] and may.write and not_trash %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}

{%- if endpoint in [
'frontend.convert_item',
] and may.write and item and theme_supp.is_markup_or_text(item.contenttype) and not_trash %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}
{%- if endpoint in [
'frontend.convert_item',
] and may.write and item and theme_supp.is_markup_or_text(item.contenttype) and not_trash %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}

{%- if endpoint == 'frontend.destroy_item' and may.destroy %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}
{%- if endpoint == 'frontend.destroy_item' and may.destroy %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}

{%- if endpoint == 'frontend.quicklink_item' and user.valid and not_trash %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">
{%- if user.is_quicklinked_to([fqname]) %}
{{ a_label(icon_class, _('Remove Link')) }}
{%- else %}
{{ a_label(icon_class, _('Add Link')) }}
{%- endif %}
</a>
</div>
{%- endif %}
{%- if endpoint == 'frontend.quicklink_item' and user.valid and not_trash %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">
{%- if user.is_quicklinked_to([fqname]) %}
{{ a_label(icon_class, _('Remove Link')) }}
{%- else %}
{{ a_label(icon_class, _('Add Link')) }}
{%- endif %}
</a>
</div>
{%- endif %}

{%- if endpoint == 'frontend.subscribe_item' and user.valid and not_trash %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">
{%- if user.is_subscribed_to(item) %}
{{ a_label(icon_class, _('Unsubscribe')) }}
{%- else %}
{{ a_label(icon_class, _('Subscribe')) }}
{%- endif %}
</a>
</div>
{%- endif %}
{%- if endpoint == 'frontend.subscribe_item' and user.valid and not_trash %}
<div>
<a href="{{ url_for(endpoint, item_name = fqname) }}" title="{{ title }}" rel="nofollow">
{%- if user.is_subscribed_to(item) %}
{{ a_label(icon_class, _('Unsubscribe')) }}
{%- else %}
{{ a_label(icon_class, _('Subscribe')) }}
{%- endif %}
</a>
</div>
{%- endif %}

{%- if endpoint == 'special.comments' and not_trash %}
<div class="moin-toggle-comments-button">
<a class="moin-toggle-comments-tooltip" href="#" title="{{ title }}">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}
{%- if endpoint == 'special.comments' and not_trash %}
<div class="moin-toggle-comments-button">
<a class="moin-toggle-comments-tooltip" href="#" title="{{ title }}">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}

{% if endpoint == 'special.transclusions' and not_trash -%}
<div class="moin-transclusions-button">
<a class="moin-transclusions-tooltip" href="#" title="{{ title }}">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}
{% if endpoint == 'special.transclusions' and not_trash -%}
<div class="moin-transclusions-button">
<a class="moin-transclusions-tooltip" href="#" title="{{ title }}">{{ a_label(icon_class, label) }}</a>
</div>
{%- endif %}

{%- if endpoint == 'special.supplementation' and fqname %}
{%- for sub_item_name in cfg.supplementation_item_names %}
{%- set current_sub = item_name.rsplit('/', 1)[-1] %}
{%- if not current_sub in cfg.supplementation_item_names %}
{%- set supp_name = '%s/%s/%s' % (fqname.namespace, item_name, sub_item_name) %}
{%- if not_trash and (storage.has_item(supp_name) or user.may.write(supp_name)) %}
{% set title = _('Discuss contents of this item') %}
<div>
<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>
</div>
{%- if endpoint == 'special.supplementation' and fqname %}
{%- for sub_item_name in cfg.supplementation_item_names %}
{%- set current_sub = item_name.rsplit('/', 1)[-1] %}
{%- if not current_sub in cfg.supplementation_item_names %}
{%- set supp_name = '%s/%s/%s' % (fqname.namespace, item_name, sub_item_name) %}
{%- if not_trash and (storage.has_item(supp_name) or user.may.write(supp_name)) %}
{% set title = _('Discuss contents of this item') %}
<div>
<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>
</div>
{%- endif %}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- endfor %}
</div>
</div>
</div>
</div>
58 changes: 0 additions & 58 deletions src/moin/themes/focus/templates/show.html

This file was deleted.