view MoinMoin/themes/basic/templates/show.html @ 2390:2d0c705b6b42

Fixes #31, use of a custom class for quicklinks
author sharky93 <rishabhr123@gmail.com>
date Sat, 17 Aug 2013 18:10:50 +0530
parents d6f71eda64d6
children 0cb9f75fb9ba
line wrap: on
line source
{% extends theme("layout.html") %}
{% import "utils.html" as utils %}
{% import theme("itemviews.html") as itemviews with context %}
{% set exists = storage.has_item(item_name) %}

{% set user_actions, item_navigation, item_actions = theme_supp.get_local_panel(item_name) %}

{% block views %}
    {{ itemviews }}
{% endblock %}

{% block content %}

    {% block content_data %}
        {% if data_rendered %}
        <div id="moin-content-data">
            {{ data_rendered }}
        </div>
        {% endif %}
    {% endblock %}

{% endblock %}

{% block user_actions %}
    {% set user_actions_exist = false %}

    {% if user.valid %}
    <div class="list-group-item">User Actions</div>
        {%- 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 in user_actions %}
                    {%- if endpoint == 'frontend.quicklink_item' %}
                        {%- if not user.is_quicklinked_to([item_name]) %}
                            <a class="list-group-item" href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                            <span class="icon-stack">
                                <i class={{icon[endpoint]}}></i>
                            </span> 
                            {{ _('Add Link') }}
                            </a>
                        {%- endif %}
                    {% elif endpoint == 'frontend.subscribe_item' %}
                        <a class="list-group-item" href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                        <span class="icon-stack">
                            <i class={{icon[endpoint]}}></i>
                        </span> 
                        {%- if user.is_subscribed_to([item_name]) %}
                            {{ _('Unsubscribe') }}
                        {%- else %}
                            {{ _('Subscribe') }}
                        {%- endif %}
                        </a>
                    {% endif %}
                {%- endif %}

            {%- endif %}
        {% endfor %}
    {% endif %}
{% endblock %}

{% block site_actions %}
    <div class="list-group-item">Item Navigation</div>
    {%- 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 in item_navigation %}
                <a class="list-group-item" href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                <span class="icon-stack">    
                    <i class={{icon[endpoint]}}></i>
                </span>
                    {{ label }}
                </a>
            {%- endif %}

        {% endif %}
    {% endfor %}
{% endblock %}

{% block item_actions %}
    <div class="list-group-item">Item Actions</div>
    {%- 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 == 'special.supplementation' %}
                {%- 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' % (item_name, sub_item_name) %}
                        {%- if storage.has_item(supp_name) or user.may.write(supp_name) %}
                            <a class="list-group-item" href="{{ url_for('frontend.show_item', item_name=supp_name) }}" rel="nofollow">
                                <span class="icon-stack">
                                    <i class={{icon[endpoint]}}></i>
                                </span>
                                {{ _(sub_item_name) }}
                            </a>
                        {%- endif %}
                    {%- endif %}
                {%- endfor %}
            {%- elif endpoint in item_actions %}
                <a class="list-group-item" href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                <span class="icon-stack">
                    <i class={{icon[endpoint]}}></i>
                </span>
                    {{ label }}
                </a>
            {%- endif %}

        {% endif %}
    {% endfor %}
{% endblock %}

{% block local_panel %}
        
        <!-- user, site, item actions -->
    <div class="list-group">
        {{ self.user_actions() }}

        {{ self.site_actions() }}

        {{ self.item_actions() }}
    </div>

{% endblock %}