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

211 lines
8.2 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 class="extra-actions-menu-opener"></a>
<a class="action-see-online" href="{{ object.get_online_url }}">{% trans 'See online' %}</a>
<ul class="extra-actions-menu">
<li><a class="action-history" href="{% url 'combo-manager-page-history' pk=object.id %}">{% trans 'History' %}</a></li>
<li><a class="action-export" download href="{% url 'combo-manager-page-export' pk=object.id %}">{% trans 'Export' %}</a></li>
<li><a class="action-add-child" rel="popup" href="{% url 'combo-manager-page-add-child' pk=object.id %}">{% trans 'Add a child page' %}</a></li>
<li><a rel="popup" class="action-duplicate" href="{% url 'combo-manager-page-duplicate' pk=object.id %}">{% trans 'Duplicate' %}</a></li>
<li><a class="action-delete" rel="popup" href="{% url 'combo-manager-page-delete' pk=object.id %}">{% trans 'Delete' %}</a></li>
</ul>
</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 'Include in navigation menus:' %}</label>
{% if object.exclude_from_navigation %}{% trans 'no' %}{% else %}{% trans 'yes' %}{% endif %}
(<a rel="popup" href="{% url 'combo-manager-page-edit-include-in-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 %}
{% if object.picture_extension != '.svg' %}
{% thumbnail object.picture "320x240" crop="50% 25%" as im %}
<img class="page-picture" src="{{im.url}}"/>
{% endthumbnail %}
{% else %}
<img class="page-picture" src="{{page.picture.url}}"/>
{% endif %}
(<a href="{% url 'combo-manager-page-remove-picture' pk=object.id %}">{% trans 'remove' %}</a>)
{% else %}<i>{% trans 'none' %}</i>{% endif %}
(<a rel="popup" href="{% url 'combo-manager-page-edit-picture' pk=object.id %}">{% trans 'change' %}</a>)
</p>
</div>
{% if object.parent_id or previous_page or next_page %}
<div class="page-options navigation">
<h3>{% trans 'Navigation' %}</h3>
<ul>
{% if object.parent_id %}
<li class="nav-up"><a href="{% url 'combo-manager-page-view' pk=object.parent_id %}">{{ object.parent.title }}</a></li>
{% endif %}
{% if previous_page %}
<li class="nav-left"><a href="{% url 'combo-manager-page-view' pk=previous_page.pk %}">{{ previous_page.title }}</a></li>
{% endif %}
{% if next_page %}
<li class="nav-right"><a href="{% url 'combo-manager-page-view' pk=next_page.pk %}">{{ next_page.title }}</a></li>
{% endif %}
</ul>
</div>
{% endif %}
{% if optional_placeholders %}
<div class="page-options">
<h3>{% trans 'Optional sections' %}</h3>
<ul>
{% for placeholder in optional_placeholders %}
<li>
{{ placeholder.name }} ({% if placeholder.is_empty %}{% trans "empty" %}{% else %}{% trans "like parent" %}{% endif %})
(<a href="{% url 'combo-manager-page-view' pk=object.id %}?include-section={{ placeholder.key }}">{% trans 'change' %}</a>)
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</aside>
{% endblock %} {# sidebar #}
{% block content %}
<div id="page-content">
{% if object.redirect_url %}
<div class="infonotice">
<p>{% blocktrans with redirect_url=object.redirect_url %}This page is configured as a redirection to the URL "{{ redirect_url }}", it can also be used as a template for the pages behind this URL.{% endblocktrans %}</p>
</div>
{% endif %}
<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 id="cell-{{cell.get_reference}}" 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>
{% if cell.get_invalid_reason %}
<span class="invalid">{{ cell.get_invalid_reason }} -
{% if cell.get_validity_info.invalid_datetime|datetime_in_past %}
{% blocktrans with cell.get_validity_info.invalid_datetime|date:"DATETIME_FORMAT" as invalidity_date %}This cell is no longer displayed since {{ invalidity_date }}.{% endblocktrans %}
{% else %}
{% blocktrans with cell.get_validity_info.invalid_datetime|timeuntil as invalidity_delay %}This cell will no longer be displayed in {{ invalidity_delay }}.{% endblocktrans %}
{% endif %}
</span>
{% endif %}
</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 %}