combo/combo/manager/templates/combo/page_view.html

157 lines
5.5 KiB
HTML

{% extends "combo/manager_base.html" %}
{% load i18n %}
{% load cells %}
{% load thumbnail %}
{% block appbar %}
<h2>{% trans 'Page' %} - {{ object.title }}</h2>
<span class="actions">
<a href="{{ object.get_online_url }}">{% trans 'see online' %}</a>
<a href="{% url 'combo-manager-page-history' pk=object.id %}">{% trans 'history' %}</a>
<a download href="{% url 'combo-manager-page-export' pk=object.id %}">{% trans 'export' %}</a>
<a rel="popup" href="{% url 'combo-manager-page-delete' pk=object.id %}">{% trans 'delete' %}</a>
</span>
{% endblock %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'combo-manager-page-view' pk=object.id %}">{% trans 'Page' %} - {{object.title }}</a>
{% endblock %}
{% block sidebar %}
<aside id="sidebar">
<div class="page-options">
<h3>{% trans 'Parameters' %}</h3>
<p>
<label>{% trans 'Title:' %}</label>
{{object.title}}
(<a rel="popup" href="{% url 'combo-manager-page-edit-title' pk=object.id %}">{% trans 'change' %}</a>)
</p>
<p>
<label>{% trans 'Slug:' %}</label>
<tt>{{ object.slug }}{% if object.sub_slug %}/{{ object.sub_slug }}{% endif %}</tt>
(<a rel="popup" href="{% url 'combo-manager-page-edit-slug' pk=object.id %}">{% trans 'change' %}</a>)
</p>
<p>
<label>{% trans 'Description:' %}</label>
{% if object.description %}{{ object.description|truncatewords:32 }}{% else %}<i>{% trans 'none' %}</i>{% endif %}
(<a rel="popup" href="{% url 'combo-manager-page-edit-description' pk=object.id %}">{% trans 'change' %}</a>)
</p>
<p>
<label>{% trans 'Template:' %}</label>
{{ object.get_template_display_name }}
{% if object.missing_template %}<span class="error">({% trans "missing" %})</span>{% endif %}
(<a rel="popup" href="{% url 'combo-manager-page-select-template' pk=object.id %}">{% trans 'change' %}</a>)
</p>
<p>
<label>{% trans 'Visibility:' %}</label>
{{ object.visibility }}
(<a rel="popup" href="{% url 'combo-manager-page-visibility' pk=object.id %}">{% trans 'change' %}</a>)
</p>
<p>
<label>{% trans 'Exclude from navigation:' %}</label>
{% if object.exclude_from_navigation %}{% trans 'yes' %}{% else %}{% trans 'no' %}{% endif %}
(<a rel="popup" href="{% url 'combo-manager-page-edit-exclude-from-navigation' pk=object.id %}">{% trans 'change' %}</a>)
</p>
<p>
<label>{% trans 'Redirection:' %}</label>
{% if object.redirect_url %}{{ object.redirect_url }}{% else %}<i>{% trans 'none' %}</i>{% endif %}
(<a rel="popup" href="{% url 'combo-manager-page-edit-redirection' pk=object.id %}">{% trans 'change' %}</a>)
</p>
<p>
<label>{% trans 'Picture:' %}</label>
{% if object.picture %}
{% thumbnail object.picture "320x240" crop="50% 25%" as im %}
<img class="page-picture" src="{{im.url}}"/>
(<a href="{% url 'combo-manager-page-remove-picture' pk=object.id %}">{% trans 'remove' %}</a>)
{% endthumbnail %}
{% else %}<i>{% trans 'none' %}</i>{% endif %}
(<a rel="popup" href="{% url 'combo-manager-page-edit-picture' pk=object.id %}">{% trans 'change' %}</a>)
</p>
</div>
</aside>
{% endblock %} {# sidebar #}
{% block content %}
<div id="page-content">
<div id="placeholders"
data-cell-order-url="{% url 'combo-manager-cell-order' page_pk=object.id %}"
>
{% for placeholder in placeholders %}
<div class="placeholder" data-placeholder-key="{{ placeholder.key }}">
<h2>{{ placeholder.name }}</h2>
<div class="cell-list">
{% for cell in placeholder.cells %}
<div class="cell {{cell.class_name}}" data-cell-reference="{{ cell.get_reference }}">
<h3><span class="handle"></span>
<span class="group1">
{{ cell.get_label }}
{% if cell.slug %} [{{cell.slug}}] {% endif %}
{% if cell.extra_css_class %}
<span class="extra-css-class">[{{ cell.extra_css_class }}]</span>
{% endif %}
<span class="additional-label">
<i>{{cell.get_additional_label|default_if_none:""}}</i></span>
</span>
{% if not cell.public %}
<span class="visibility-summary
{% if cell.restricted_to_unlogged %}visibility-off{% endif %}" title="{% trans 'Restricted visibility' %}">
{% if cell.groups.all|length %}
{% for group in cell.groups.all %}{{group.name}}{% if not forloop.last %}, {% endif %}{% endfor %}
{% else %}
{% trans "logged users" %}
{% endif %}
</span>
{% elif cell.restricted_to_unlogged %}
<span class="visibility-summary" title="{% trans 'Restricted visibility' %}">
{% trans "unlogged users" %}
</span>
{% endif %}
</h3>
<div>{% cell_form cell %}</div>
</div>
{% endfor %}
</div>
<div class="manager-add-new-cell">
<a href="#">{% trans 'Add a new cell' %}</a>
<div style="display: none">
<select>
{% for label, celltypes in cell_type_groups %}
{% if label %}
<optgroup label="{{label}}">
{% endif %}
{% for cell_type in celltypes %}
<option data-add-url="{% url 'combo-manager-page-add-cell' page_pk=object.id cell_type=cell_type.cell_type_str variant=cell_type.variant ph_key=placeholder.key %}"
>{{cell_type.name}}</option>
{% endfor %}
{% if label %}
</optgroup>
{% endif %}
{% endfor %}
</select>
<button>ok</button>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}