summaryrefslogtreecommitdiffstats
path: root/combo/manager/templates/combo/page_view.html
blob: c1fa61fed6ef992ac93f81c8efc01d173d715de0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{% 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 href="{{ object.get_online_url }}">{% trans 'see online' %}</a>
<ul class="extra-actions-menu">
  <li><a href="{% url 'combo-manager-page-history' pk=object.id %}">{% trans 'history' %}</a></li>
  <li><a download href="{% url 'combo-manager-page-export' pk=object.id %}">{% trans 'export' %}</a></li>
  <li><a 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 '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 %}
  {% 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>

</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>
                </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 %}