view MoinMoin/themes/basic/templates/show.html @ 2353:22340caadc9b

Fixes #12, better title for the a sub-nav in the local panel
author sharky93 <rishabhr123@gmail.com>
date Thu, 25 Jul 2013 19:20:04 +0530
parents 72600fae3986
children 1d461ab9df80
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) %}

{% 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 %}
    <li class="nav-header">User Actions</li>
    {%- 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 == 'frontend.quicklink_item' and user.valid %}
                <li>
                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                        <span class="icon-star-empty"></span>
                        {%- if user.is_quicklinked_to([item_name]) %}
                            {{ _('Remove Link') }}
                        {%- else %}
                            {{ _('Add Link') }}
                        {%- endif %}
                    </a>
                </li>
            {%- endif %}

            {%- if endpoint == 'frontend.subscribe_item' and user.valid %}
                <li>
                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                        <span class="icon-envelope"></span>
                        {%- if user.is_subscribed_to([item_name]) %}
                            {{ _('Unsubscribe') }}
                        {%- else %}
                            {{ _('Subscribe') }}
                        {%- endif %}
                    </a>
                </li>
            {%- endif %}
        {%- endif %}
    {% endfor %}
{% endblock %}

{% block site_actions %}
    <li class="nav-header">Item Navigation</li>
    {%- 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 == 'frontend.index' %}
                <li>
                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                    <span class="icon-list-alt"></span>
                        {{ label }}
                    </a>
                </li>
            {%- endif %}

            {%- if endpoint == 'frontend.sitemap' %}
                <li>
                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                    <span class="icon-map-marker"></span>
                        {{ label }}
                    </a>
                </li>
            {%- endif %}

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

{% block item_actions %}
    <li class="nav-header">Item Actions</li>
    {%- 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 == 'frontend.rename_item' and user.may.write(item_name) %}
                <li>
                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                        <span class="icon-tag"></span>
                        {{ label }}
                    </a>
                </li>
            {%- endif %}

            {%- if endpoint == 'frontend.delete_item' and user.may.write(item_name) %}
                <li>
                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                        <span class="icon-trash"></span>
                        {{ label }}
                    </a>
                </li>
            {% endif %}

            {%- if endpoint == 'frontend.destroy_item' and user.may.destroy(item_name) %}
                <li>
                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                        <span class="icon-fire"></span>
                        {{ label }}
                    </a>
                </li>
            {%- endif %}

            {%- if endpoint == 'frontend.similar_names' and user.may.write(item_name) %}
                <li>
                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                        <span class="icon-search"></span>
                        {{ label }}
                    </a>
                </li>
            {%- endif %}

            {%- if endpoint == 'frontend.download_item' and user.may.write(item_name) %}
                <li>
                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                        <span class="icon-download-alt"></span>
                        {{ label }}
                    </a>
                </li>
            {%- endif %}

            {%- if endpoint == 'frontend.copy_item' and user.may.write(item_name) %}
                <li>
                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
                        <span class="icon-comment"></span>
                        {{ label }}
                    </a>
                </li>
            {%- endif %}

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

{% block local_panel %}
        
        <!-- user, site, item actions -->
        {{ self.user_actions() }}

        {{ self.site_actions() }}

        {{ self.item_actions() }}

{% endblock %}