Source

django-swingcms / swingcms / cms / templates / cms / action_buttons.html

{% load i18n %}
{% load cms_filters %}
{% load custodian_tags_and_filters %}


<div class='buttons'>

    <h4>{% trans 'actions on this' %} {% trans obj.model_name %}:</h4>
    <br />

    <!-- VIEW, EDIT, COPY, CUT, DELETE, PERMISSIONS -->

    <div class="line">

        <b>{% trans 'actions' %}:</b>

        {% ifperm 'view' 'obj' in obj.perms %}
            <a style="display: inline;" href='/view/{{ obj.model_name }}/{{ obj.id }}'>{% trans 'view' %}</a>|
        {% endifperm %}
        {% ifperm 'edit' 'obj' in obj.perms %}
            <a href='/edit/{{ obj.model_name }}/{{ obj.id }}'>{% trans 'edit' %}</a>|
        {% endifperm %}
        {% ifperm 'copy' 'obj' in obj.perms %}
            <a href='/copy/{{ obj.model_name }}/{{ obj.id }}?next={{ request.path }}'>{% trans 'copy' %}</a>|
        {% endifperm %}

        {% if obj.model_name == 'folder' and obj.id == 1 %}
            <!-- nothing to do: is 'home' folder -->
        {% else %}
            {% ifperm 'cut' 'obj' in obj.perms %}
                <a href='/cut/{{ obj.model_name }}/{{ obj.id }}?next={{ request.path }}'>{% trans 'cut' %}</a>|
            {% endifperm %}
            {% ifperm 'change' 'obj' in obj.perms %}
                <a href="/change/{{ obj.model_name }}/{{ obj.id }}?next={{ request.path }}">{% trans 'change' %}</a>|
            {% endifperm %}
            {% ifperm 'delete' 'obj' in obj.perms %}
                <a href='/delete/{{ obj.model_name }}/{{ obj.id }}'>{% trans 'delete' %}</a>|
            {% endifperm %}
        {% endif %}

        {% ifperm 'edit' 'permission' in obj.perms %}
            <a href='/edit_specific_perms/{{ obj.model_name }}/{{ obj.id }}'>{% trans 'permissions' %}</a>|
        {% endifperm %}

    </div>

    <!-- CHANGE STATUS -->

    {% ifperm 'change status' 'obj' in obj.perms %}

        <div class="line">

            {% if obj.model_name == 'folder' and obj.id == 1 %}

                <!-- nothing to do: is 'home' folder -->

            {% else %}

                <b>{% trans 'status' %}:</b>

                {% for s in statuses %}

                    <a class="status_button" id="change_status_link" href="" onclick="change_status('{{ s }}', '{{ obj.model_name }}', '{{ obj.id }}', '{{ request.path }}');">
                        {% if s == obj.status %}
                            <span class='current'>{% trans s %}</span>
                        {% else %}
                            {% trans s %}
                        {% endif %}
                    </a>|

                {% endfor %}

                &nbsp;( {% trans 'recursive' %} <input id='this_folder_recursive' type='checkbox'> )

            {% endif %}

        </div>

    {% endifperm %}

    <!-- ADDABLE OBJS -->

    {% if obj.addable %}

        <div class="line">

            <b>{% trans 'add' %}:</b>

            {% for a in obj.addable %}

                <a href='/add/{{ obj.model_name }}/{{ obj.id }}/{{ a }}?next={{ request.path }}'>{% trans a %}</a>|

            {% endfor %}

        </div>

    {% endif %}

    <!-- CLIPBOARD TO PASTE -->

    {% if clipboard_copy or clipboard_cut %}

        <div class="line">

            <b>{% trans 'clipboard' %}:</b>

            <a href="/paste/{{ obj.model_name }}/{{ obj.id }}?next={{ request.path }}">{% trans 'paste' %}</a>|

        </div>

    {% endif %}

</div>