misc: apply djhtml (#69709)

This commit is contained in:
Valentin Deniaud 2022-09-29 11:51:33 +02:00
parent 964461e27e
commit 4784a3990e
131 changed files with 3215 additions and 3215 deletions

View File

@ -2,16 +2,16 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Delete Asset' %}</h2>
<h2>{% trans 'Delete Asset' %}</h2>
{% endblock %}
{% block content %}
<form method="post">
{% csrf_token %}
{% blocktrans %}Are you sure you want to delete this?{% endblocktrans %}
<div class="buttons">
<button class="delete-button">{% trans 'Delete' %}</button>
<a class="cancel" href="{% url 'combo-manager-assets' %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post">
{% csrf_token %}
{% blocktrans %}Are you sure you want to delete this?{% endblocktrans %}
<div class="buttons">
<button class="delete-button">{% trans 'Delete' %}</button>
<a class="cancel" href="{% url 'combo-manager-assets' %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,20 +2,20 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans "Overwrite Asset" %}</h2>
<h2>{% trans "Overwrite Asset" %}</h2>
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
<p>
{% trans "This will erase the existing file and replace it with a new one." %}
</p>
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Upload" %}</button>
<a class="cancel" href="{% url 'combo-manager-assets' %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
<p>
{% trans "This will erase the existing file and replace it with a new one." %}
</p>
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Upload" %}</button>
<a class="cancel" href="{% url 'combo-manager-assets' %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,17 +2,17 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans "Asset Upload" %}</h2>
<h2>{% trans "Asset Upload" %}</h2>
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Upload" %}</button>
<a class="cancel" href="{% url 'combo-manager-assets' %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Upload" %}</button>
<a class="cancel" href="{% url 'combo-manager-assets' %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,49 +2,49 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Assets' %}</h2>
<span class="actions">
<a class="extra-actions-menu-opener"></a>
<a href="{% url 'combo-manager-asset-upload' %}" rel="popup">{% trans 'Upload' %}</a>
<ul class="extra-actions-menu">
<li><a href="{% url 'combo-manager-assets-export' %}">{% trans 'Export Assets' %}</a></li>
<li><a rel="popup" href="{% url 'combo-manager-assets-import' %}">{% trans 'Import Assets' %}</a></li>
</ul>
</span>
<h2>{% trans 'Assets' %}</h2>
<span class="actions">
<a class="extra-actions-menu-opener"></a>
<a href="{% url 'combo-manager-asset-upload' %}" rel="popup">{% trans 'Upload' %}</a>
<ul class="extra-actions-menu">
<li><a href="{% url 'combo-manager-assets-export' %}">{% trans 'Export Assets' %}</a></li>
<li><a rel="popup" href="{% url 'combo-manager-assets-import' %}">{% trans 'Import Assets' %}</a></li>
</ul>
</span>
{% endblock %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'combo-manager-assets' %}">{% trans 'Assets' %}</a>
{{ block.super }}
<a href="{% url 'combo-manager-assets' %}">{% trans 'Assets' %}</a>
{% endblock %}
{% block content %}
{% if not object_list and not query %}
<div class="big-msg-info">
{% blocktrans %}
This site doesn't have any asset yet. You can add some directly when editing
pages, in the "Upload Image" dialog.
{% endblocktrans %}
</div>
{% if not object_list and not query %}
<div class="big-msg-info">
{% blocktrans %}
This site doesn't have any asset yet. You can add some directly when editing
pages, in the "Upload Image" dialog.
{% endblocktrans %}
</div>
{% else %}
{% else %}
<form>
<p><input name="q" type="search" value="{{query}}"> <button>{% trans 'Search' %}</button>
<span class="help_text">{% trans "(case insensitive search over filenames)" %}</span>
</p>
</form>
<form>
<p><input name="q" type="search" value="{{query}}"> <button>{% trans 'Search' %}</button>
<span class="help_text">{% trans "(case insensitive search over filenames)" %}</span>
</p>
</form>
<div id="assets-browser">
<div id="assets-listing">
{% include "combo/manager_assets_fragment.html" %}
</div>
<div id="asset-preview"></div>
</div>
<div id="assets-browser">
<div id="assets-listing">
{% include "combo/manager_assets_fragment.html" %}
</div>
<div id="asset-preview"></div>
</div>
{% include "gadjo/pagination.html" %}
{% include "gadjo/pagination.html" %}
{% endif %}
{% endif %}
{% endblock %}

View File

@ -2,11 +2,11 @@
{% load static i18n %}
{% block css %}
<link rel="stylesheet" type="text/css" media="all" href="{% static "css/combo.manager.css" %}"/>
<link rel="stylesheet" type="text/css" media="all" href="{% static "css/combo.manager.css" %}"/>
{% endblock %}
{% block extrascripts %}
<script src="{% static "js/combo.manager.js" %}"></script>
<script src="{% static "js/combo.manager.js" %}"></script>
{% endblock %}
{% block user-links %}{% endblock %}
@ -16,61 +16,61 @@
{% block footer %}{% endblock %}
{% block appbar %}
<h2>{% trans "Browse for the file you want, then click 'Embed File' to continue..." %}</h2>
<h2>{% trans "Browse for the file you want, then click 'Embed File' to continue..." %}</h2>
{% endblock %}
{% block content %}
{% if not object_list and not query %}
<div class="big-msg-info">
{% trans "No files found. Upload files using the 'Image Button' or 'Link Button' dialog's 'Upload' tab." %}
</div>
{% if not object_list and not query %}
<div class="big-msg-info">
{% trans "No files found. Upload files using the 'Image Button' or 'Link Button' dialog's 'Upload' tab." %}
</div>
{% else %}
{% else %}
<form>
{% for k, v in request.GET.items %}
{% if k != 'q' %}<input type="hidden" name="{{ k }}" value="{{ v }}" />{% endif %}
{% endfor %}
<p><input name="q" type="search" value="{{query}}"> <button>{% trans 'Search' %}</button>
<span class="help_text">{% trans "(case insensitive search over filenames)" %}</span>
</p>
</form>
<form>
{% for k, v in request.GET.items %}
{% if k != 'q' %}<input type="hidden" name="{{ k }}" value="{{ v }}" />{% endif %}
{% endfor %}
<p><input name="q" type="search" value="{{query}}"> <button>{% trans 'Search' %}</button>
<span class="help_text">{% trans "(case insensitive search over filenames)" %}</span>
</p>
</form>
<div id="assets-browser" class="assets-ckeditor">
<div id="assets-listing">
{% with asset_for_ckeditor=True %}
{% include "combo/manager_assets_fragment.html" %}
{% endwith %}
</div>
<div id="asset-preview"></div>
</div>
<div id="assets-browser" class="assets-ckeditor">
<div id="assets-listing">
{% with asset_for_ckeditor=True %}
{% include "combo/manager_assets_fragment.html" %}
{% endwith %}
</div>
<div id="asset-preview"></div>
</div>
{% include "gadjo/pagination.html" %}
{% include "gadjo/pagination.html" %}
<div class="buttons">
<input href="" id="asset-ckeditor-embed" type="submit" name="_embed" value="{% trans "Embed File" %}" disabled />
</div>
<div class="buttons">
<input href="" id="asset-ckeditor-embed" type="submit" name="_embed" value="{% trans "Embed File" %}" disabled />
</div>
{% endif %}
<script type="text/javascript">
{% endif %}
<script type="text/javascript">
// helper functions
function getUrlParam(paramName) {
var reParam = new RegExp('(?:[\?&]|&amp;)' + paramName + '=([^&]+)', 'i') ;
var match = window.location.search.match(reParam) ;
var reParam = new RegExp('(?:[\?&]|&amp;)' + paramName + '=([^&]+)', 'i') ;
var match = window.location.search.match(reParam) ;
return (match && match.length > 1) ? match[1] : '' ;
return (match && match.length > 1) ? match[1] : '' ;
}
// embedder
$(document).on('click', '#asset-ckeditor-embed', function() {
var funcNum = getUrlParam('CKEditorFuncNum');
var fileUrl = $(this).attr('href');
console.log(funcNum)
console.log(fileUrl)
window.opener.CKEDITOR.tools.callFunction(funcNum, fileUrl);
window.close();
var funcNum = getUrlParam('CKEditorFuncNum');
var fileUrl = $(this).attr('href');
console.log(funcNum)
console.log(fileUrl)
window.opener.CKEDITOR.tools.callFunction(funcNum, fileUrl);
window.close();
});
console.log(window.opener.CKEDITOR)
</script>
</script>
{% endblock %}

View File

@ -6,41 +6,41 @@
<th>{% trans "Size" %}</th>
<th></th>
{% if not asset_for_ckeditor %}
<th></th>
<th></th>
{% endif %}
</tr>
</thead>
<tbody>
{% for asset in object_list %}
<tr class="{{ asset.css_classes }}" data-href="{{ asset.src }}">
<td>
{% if asset_for_ckeditor %}
{{ asset.name }}
{% elif asset.src %}
<a href="{{ asset.src }}">{{ asset.name }}</a>
{% else %}
{{ asset.name }} <span class="not-defined">({% trans "not defined" %})</span>
{% endif %}
<td>{% if asset.size %}{{ asset.size|filesizeformat }}{% else %}-{% endif %}</td>
<td class="image">{% if asset.is_image %}<img data-href="{{ asset.src }}" src="{{ asset.thumb }}"/>{% endif %}</td>
{% if not asset_for_ckeditor %}
<td class="actions">
{% if asset.key %}{# theme asset #}
<a href="{% url 'combo-manager-slot-asset-upload' key=asset.key %}{% if cell_reference %}?cell_reference={{ cell_reference }}{% endif %}"
class="overwrite" rel="popup">{% trans 'Overwrite' %}</a>
{% if asset.asset %}
<a href="{% url 'combo-manager-slot-asset-delete' key=asset.key %}{% if cell_reference %}?cell_reference={{ cell_reference }}{% endif %}"
class="delete" rel="popup">{% trans 'Delete' %}</a>
{% endif %}
{% else %}
<a href="{% url 'combo-manager-asset-overwrite' %}?img={{asset.filepath|iriencode}}"
class="overwrite" rel="popup">{% trans 'Overwrite' %}</a>
<a href="{% url 'combo-manager-asset-delete' %}?img={{asset.filepath|iriencode}}"
class="delete" rel="popup">{% trans 'Delete' %}</a>
{% endif %}
</td>
{% endif %}
</tr>
<tr class="{{ asset.css_classes }}" data-href="{{ asset.src }}">
<td>
{% if asset_for_ckeditor %}
{{ asset.name }}
{% elif asset.src %}
<a href="{{ asset.src }}">{{ asset.name }}</a>
{% else %}
{{ asset.name }} <span class="not-defined">({% trans "not defined" %})</span>
{% endif %}
<td>{% if asset.size %}{{ asset.size|filesizeformat }}{% else %}-{% endif %}</td>
<td class="image">{% if asset.is_image %}<img data-href="{{ asset.src }}" src="{{ asset.thumb }}"/>{% endif %}</td>
{% if not asset_for_ckeditor %}
<td class="actions">
{% if asset.key %}{# theme asset #}
<a href="{% url 'combo-manager-slot-asset-upload' key=asset.key %}{% if cell_reference %}?cell_reference={{ cell_reference }}{% endif %}"
class="overwrite" rel="popup">{% trans 'Overwrite' %}</a>
{% if asset.asset %}
<a href="{% url 'combo-manager-slot-asset-delete' key=asset.key %}{% if cell_reference %}?cell_reference={{ cell_reference }}{% endif %}"
class="delete" rel="popup">{% trans 'Delete' %}</a>
{% endif %}
{% else %}
<a href="{% url 'combo-manager-asset-overwrite' %}?img={{asset.filepath|iriencode}}"
class="overwrite" rel="popup">{% trans 'Overwrite' %}</a>
<a href="{% url 'combo-manager-asset-delete' %}?img={{asset.filepath|iriencode}}"
class="delete" rel="popup">{% trans 'Delete' %}</a>
{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>

View File

@ -2,20 +2,20 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans "Assets Import" %}</h2>
<h2>{% trans "Assets Import" %}</h2>
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
<p>
{% trans "Assets import allows you to integrate assets exported from another site." %}
</p>
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Import" %}</button>
<a class="cancel" href="{% url 'combo-manager-assets' %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
<p>
{% trans "Assets import allows you to integrate assets exported from another site." %}
</p>
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Import" %}</button>
<a class="cancel" href="{% url 'combo-manager-assets' %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,18 +2,18 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Assets' %}</h2>
<h2>{% trans 'Assets' %}</h2>
{% endblock %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'combo-manager-assets' %}">{% trans 'Assets' %}</a>
{{ block.super }}
<a href="{% url 'combo-manager-assets' %}">{% trans 'Assets' %}</a>
{% endblock %}
{% block content %}
<div id="assets-listing">
{% include "combo/manager_assets_fragment.html" %}
</div>
<div id="assets-listing">
{% include "combo/manager_assets_fragment.html" %}
</div>
{% endblock %}

View File

@ -1,27 +1,27 @@
{% load i18n calendar %}
{% block cell-content %}
{% if cell.title %}
<h2>
<span>{{cell.title}}</span>
{% if calendar %}
<span class="calinfo">
{% with calendar.get_first_available_slot as slot %}
({% if slot %}{% trans "Next available slot:" %} {{ slot.date_time|date:"DATETIME_FORMAT"}}{% else %}{% trans "No available slots." %}{% endif %})
{% endwith %}
</span>
{% endif %}
</h2>
{% endif %}
{% if cell.title %}
<h2>
<span>{{cell.title}}</span>
{% if calendar %}
<span class="calinfo">
{% with calendar.get_first_available_slot as slot %}
({% if slot %}{% trans "Next available slot:" %} {{ slot.date_time|date:"DATETIME_FORMAT"}}{% else %}{% trans "No available slots." %}{% endif %})
{% endwith %}
</span>
{% endif %}
</h2>
{% endif %}
{% if error %}
{% if error %}
<div><p>{{ error }}</p></div>
{% else %}
{% else %}
<div class="calcontent">
{% include 'calendar/booking_calendar_content.html' %}
{% include 'calendar/booking_calendar_content.html' %}
</div>
{% endif %}
{% endif %}
<style>.calinfo { font-style: italic; font-size: 80%; }</style>
<style>.calinfo { font-style: italic; font-size: 80%; }</style>
{% endblock %}

View File

@ -1,57 +1,57 @@
{% load i18n calendar %}
{% if calendar_days.has_other_pages %}
<p class="paginator">
<p class="paginator">
{% if calendar_days.has_previous %}
<a class="previous calchunk" href="?chunk_{{ cell.pk }}={{ calendar_days.previous_page_number }}" data-content-url="{% url 'ajax-calendar-content' pk=cell.pk %}?chunk_{{cell.pk}}={{ calendar_days.previous_page_number }}">{% trans "previous" %}</a>
{% else %}
<span class="previous">{% trans "previous" %}</span>
{% endif %}
<span class="current">
{{ calendar_days.number }} / {{ calendar_days.paginator.num_pages }}
</span>
{% if calendar_days.has_next %}
<a class="next calchunk" href="?chunk_{{ cell.pk }}={{ calendar_days.next_page_number }}" data-content-url="{% url 'ajax-calendar-content' pk=cell.pk %}?chunk_{{cell.pk}}={{ calendar_days.next_page_number }}">{% trans "next" %}</a>
{% else %}
<span class="next">{% trans "next" %}</span>
{% endif %}
</p>
{% if calendar_days.has_previous %}
<a class="previous calchunk" href="?chunk_{{ cell.pk }}={{ calendar_days.previous_page_number }}" data-content-url="{% url 'ajax-calendar-content' pk=cell.pk %}?chunk_{{cell.pk}}={{ calendar_days.previous_page_number }}">{% trans "previous" %}</a>
{% else %}
<span class="previous">{% trans "previous" %}</span>
{% endif %}
<span class="current">
{{ calendar_days.number }} / {{ calendar_days.paginator.num_pages }}
</span>
{% if calendar_days.has_next %}
<a class="next calchunk" href="?chunk_{{ cell.pk }}={{ calendar_days.next_page_number }}" data-content-url="{% url 'ajax-calendar-content' pk=cell.pk %}?chunk_{{cell.pk}}={{ calendar_days.next_page_number }}">{% trans "next" %}</a>
{% else %}
<span class="next">{% trans "next" %}</span>
{% endif %}
</p>
{% endif %}
{% if calendar_days %}
<form method="POST" action="{% url 'calendar-booking' pk=cell.pk %}?chunk_{{cell.pk}}={{calendar_days.number}}">
<form method="POST" action="{% url 'calendar-booking' pk=cell.pk %}?chunk_{{cell.pk}}={{calendar_days.number}}">
{% csrf_token %}
<table id="cal-table-{{cell.pk}}">
<thead>
<tr>
<th></th>
{% for day in calendar_days %}
<th>{{day|date:"SHORT_DATE_FORMAT"}}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for slot in calendar_slots %}
<tr>
<th>{{slot|date:"TIME_FORMAT"}}</th>
{% for day in calendar_days %}
{% get_day_slot calendar day=day slot=slot as value %}
{% if not value.exist %}
<thead>
<tr>
<th></th>
{% for day in calendar_days %}
<th>{{day|date:"SHORT_DATE_FORMAT"}}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for slot in calendar_slots %}
<tr>
<th>{{slot|date:"TIME_FORMAT"}}</th>
{% for day in calendar_days %}
{% get_day_slot calendar day=day slot=slot as value %}
{% if not value.exist %}
<td class="absent"></td>
{% elif value.available %}
{% elif value.available %}
<td class="available">
<input type="checkbox" name="slots" value="{{value.label}}" id="slot-{{cell.pk}}-{{value.label}}"/>
<label for="slot-{{cell.pk}}-{{value.label}}"></label>
<input type="checkbox" name="slots" value="{{value.label}}" id="slot-{{cell.pk}}-{{value.label}}"/>
<label for="slot-{{cell.pk}}-{{value.label}}"></label>
</td>
{% else %}
{% else %}
<td class="unavailable"></td>
{% endif %}
{% endfor %}
</tr>
{% endif %}
{% endfor %}
</tbody>
</tr>
{% endfor %}
</tbody>
</table>
<button class="submit-button">{% trans "Book" context "booking" %}</button>
</form>
</form>
{% endif %}

View File

@ -1,18 +1,18 @@
{% load i18n dashboard %}
{% block content %}
{% if user.is_authenticated %}
<span class="dashboard-cell-icons">
{% if not in_dashboard %}
{% with tile=cell|as_dashboard_cell:request.user %}
{% if tile %}
<a class="remove-from-dashboard" href="{% url 'combo-dashboard-remove-tile' cell_reference=tile.cell.get_reference %}"></a>
{% else %}
<a class="add-to-dashboard" href="{% url 'combo-dashboard-add-tile' cell_reference=cell.get_reference %}"></a>
{% endif %}
{% endwith %}
{% else %}
<a class="remove-from-dashboard" href="{% url 'combo-dashboard-remove-tile' cell_reference=cell.get_reference %}"></a>
{% endif %}
</span>
{% endif %}
{% if user.is_authenticated %}
<span class="dashboard-cell-icons">
{% if not in_dashboard %}
{% with tile=cell|as_dashboard_cell:request.user %}
{% if tile %}
<a class="remove-from-dashboard" href="{% url 'combo-dashboard-remove-tile' cell_reference=tile.cell.get_reference %}"></a>
{% else %}
<a class="add-to-dashboard" href="{% url 'combo-dashboard-add-tile' cell_reference=cell.get_reference %}"></a>
{% endif %}
{% endwith %}
{% else %}
<a class="remove-from-dashboard" href="{% url 'combo-dashboard-remove-tile' cell_reference=cell.get_reference %}"></a>
{% endif %}
</span>
{% endif %}
{% endblock %}

View File

@ -1,14 +1,14 @@
{% load i18n %}
{% block cell-content %}
{% for tile in tiles %}
{% with cell=tile.cell %}
<div class="cell {{ cell.css_class_names }} {% if cell.slug %}{{cell.slug}}{% endif %}"
data-ajax-cell-url="{{ site_base }}{{ cell.get_ajax_url }}"
data-ajax-cell-loading-message="{{ cell.loading_message }}"
data-ajax-cell-error-message="{% trans "Loading error" %}"
{% if cell.ajax_refresh %}
data-ajax-cell-refresh="{{ cell.ajax_refresh }}"
{% endif %}><div>{% render_cell cell %}</div></div>
{% endwith %}
{% endfor %}
{% for tile in tiles %}
{% with cell=tile.cell %}
<div class="cell {{ cell.css_class_names }} {% if cell.slug %}{{cell.slug}}{% endif %}"
data-ajax-cell-url="{{ site_base }}{{ cell.get_ajax_url }}"
data-ajax-cell-loading-message="{{ cell.loading_message }}"
data-ajax-cell-error-message="{% trans "Loading error" %}"
{% if cell.ajax_refresh %}
data-ajax-cell-refresh="{{ cell.ajax_refresh }}"
{% endif %}><div>{% render_cell cell %}</div></div>
{% endwith %}
{% endfor %}
{% endblock %}

View File

@ -1,61 +1,61 @@
{% load i18n %}
{% block cell-content %}
<h2>{{ cell.title }}</h2>
<h2>{{ cell.title }}</h2>
<div>
{% if form.fields %}
<form method='get' enctype='multipart/form-data' id='chart-filters'>
{{ form.as_p }}
<div class='buttons'>
<button class='submit-button'>{% trans 'Refresh' %}</button>
</div>
</form>
{% else %}
<p>
{% blocktrans trimmed %}
No filters are available. Note that only filters that are shared between all chart cells will appear. Furthermore, in case they have a value, it must be the same accross all cells.
{% endblocktrans %}
</p>
{% endif %}
</div>
<div>
{% if form.fields %}
<form method='get' enctype='multipart/form-data' id='chart-filters'>
{{ form.as_p }}
<div class='buttons'>
<button class='submit-button'>{% trans 'Refresh' %}</button>
</div>
</form>
{% else %}
<p>
{% blocktrans trimmed %}
No filters are available. Note that only filters that are shared between all chart cells will appear. Furthermore, in case they have a value, it must be the same accross all cells.
{% endblocktrans %}
</p>
{% endif %}
</div>
<script>
$(function () {
if (!$('body').data('filters-cell-id')) {
$('body').data('filters-cell-id', Math.random().toString(36).slice(2, 7));
<script>
$(function () {
if (!$('body').data('filters-cell-id')) {
$('body').data('filters-cell-id', Math.random().toString(36).slice(2, 7));
var loaded_cell_count = 0;
document.querySelectorAll('div.chartngcell embed').forEach(graph => {
graph.addEventListener('load', function() {
var loaded_cell_count = 0;
document.querySelectorAll('div.chartngcell embed').forEach(graph => {
graph.addEventListener('load', function() {
if (++loaded_cell_count == $('div.chartngcell embed').length) {
combo_load_cell($('.chart-filters-cell'));
loaded_cell_count = 0;
}
}
});
});
});
}
start_field = $('#id_time_range_start');
end_field = $('#id_time_range_end');
$('#id_time_range').change(function() {
if(this.value == 'range') {
start_field.parent().show();
end_field.parent().show();
} else {
start_field.parent().hide();
end_field.parent().hide();
}
}).change();
$('#chart-filters').submit(function(e) {
e.preventDefault();
$(window).trigger('combo:refresh-graphs');
chart_cell = $(this).parents('.cell');
ajax_cell_url = "{{ site_base }}{{ cell.get_ajax_url }}";
new_url = ajax_cell_url + '?filters_cell_id=' + $('body').data('filters-cell-id') + '&' + $(this).serialize();
chart_cell.data('ajax-cell-url', new_url);
start_field = $('#id_time_range_start');
end_field = $('#id_time_range_end');
$('#id_time_range').change(function() {
if(this.value == 'range') {
start_field.parent().show();
end_field.parent().show();
} else {
start_field.parent().hide();
end_field.parent().hide();
}
}).change();
$('#chart-filters').submit(function(e) {
e.preventDefault();
$(window).trigger('combo:refresh-graphs');
chart_cell = $(this).parents('.cell');
ajax_cell_url = "{{ site_base }}{{ cell.get_ajax_url }}";
new_url = ajax_cell_url + '?filters_cell_id=' + $('body').data('filters-cell-id') + '&' + $(this).serialize();
chart_cell.data('ajax-cell-url', new_url);
});
});
});
</script>
</script>
{% endblock %}

View File

@ -1,41 +1,41 @@
{% load i18n %}
{% if cell.title %}<h2>{{cell.title}}</h2>{% endif %}
{% if cell.chart_type == "table" or cell.chart_type == "table-inverted" %}
<div id="chart-{{cell.id}}"></div>
<script>
$(function() {
var extra_context = $('#chart-{{cell.id}}').parents('.cell').data('extra-context');
$(window).on('combo:refresh-graphs', function() {
$.ajax({
url : "{% url 'combo-dataviz-graph' cell=cell.id %}" + get_graph_querystring(extra_context),
type: 'GET',
success: function(data) {
$('#chart-{{cell.id}}').html(data);
}
<div id="chart-{{cell.id}}"></div>
<script>
$(function() {
var extra_context = $('#chart-{{cell.id}}').parents('.cell').data('extra-context');
$(window).on('combo:refresh-graphs', function() {
$.ajax({
url : "{% url 'combo-dataviz-graph' cell=cell.id %}" + get_graph_querystring(extra_context),
type: 'GET',
success: function(data) {
$('#chart-{{cell.id}}').html(data);
}
});
}).trigger('combo:refresh-graphs');
});
}).trigger('combo:refresh-graphs');
});
</script>
</script>
{% else %}
<div style="min-height: {{cell.height}}px">
<embed id="chart-{{cell.id}}" type="image/svg+xml" style="width: 100%"/>
</div>
<script>
$(function() {
var last_width = 1;
var extra_context = $('#chart-{{cell.id}}').parents('.cell').data('extra-context');
$(window).on('load resize gadjo:sidepage-toggled combo:resize-graphs', function() {
var chart_cell = $('#chart-{{cell.id}}').parent();
var new_width = Math.floor($(chart_cell).width());
var ratio = new_width / last_width;
if (ratio > 1.2 || ratio < 0.8) {
$('#chart-{{cell.id}}').attr('src', "{% url 'combo-dataviz-graph' cell=cell.id %}" + get_graph_querystring(extra_context, new_width));
last_width = new_width;
}
}).trigger('combo:resize-graphs');
$(window).on('combo:refresh-graphs', function() {
$('#chart-{{cell.id}}').attr('src', "{% url 'combo-dataviz-graph' cell=cell.id %}" + get_graph_querystring(extra_context, last_width));
});
});
</script>
<div style="min-height: {{cell.height}}px">
<embed id="chart-{{cell.id}}" type="image/svg+xml" style="width: 100%"/>
</div>
<script>
$(function() {
var last_width = 1;
var extra_context = $('#chart-{{cell.id}}').parents('.cell').data('extra-context');
$(window).on('load resize gadjo:sidepage-toggled combo:resize-graphs', function() {
var chart_cell = $('#chart-{{cell.id}}').parent();
var new_width = Math.floor($(chart_cell).width());
var ratio = new_width / last_width;
if (ratio > 1.2 || ratio < 0.8) {
$('#chart-{{cell.id}}').attr('src', "{% url 'combo-dataviz-graph' cell=cell.id %}" + get_graph_querystring(extra_context, new_width));
last_width = new_width;
}
}).trigger('combo:resize-graphs');
$(window).on('combo:refresh-graphs', function() {
$('#chart-{{cell.id}}').attr('src', "{% url 'combo-dataviz-graph' cell=cell.id %}" + get_graph_querystring(extra_context, last_width));
});
});
</script>
{% endif %}

View File

@ -1,33 +1,33 @@
<div style="position: relative">
{{ form.as_p }}
{% if cell.statistic and cell.chart_type != "table" and cell.chart_type != "table-inverted" %}
<div style="position: absolute; right: 0; top: 0; width: 300px; height: 150px">
<embed type="image/svg+xml" src="{% url 'combo-dataviz-graph' cell=cell.id %}?width=300&height=150"/>
</div>
{% endif %}
{{ form.as_p }}
{% if cell.statistic and cell.chart_type != "table" and cell.chart_type != "table-inverted" %}
<div style="position: absolute; right: 0; top: 0; width: 300px; height: 150px">
<embed type="image/svg+xml" src="{% url 'combo-dataviz-graph' cell=cell.id %}?width=300&height=150"/>
</div>
{% endif %}
</div>
<script>
$(function () {
start_field = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_start');
end_field = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_end');
start_field_template = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_start_template');
end_field_template = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_end_template');
$('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range').change(function() {
if(this.value == 'range') {
start_field.parent().show();
end_field.parent().show();
} else {
start_field.parent().hide();
end_field.parent().hide();
}
if(this.value == 'range-template') {
start_field_template.parent().show();
end_field_template.parent().show();
} else {
start_field_template.parent().hide();
end_field_template.parent().hide();
}
}).change();
});
$(function () {
start_field = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_start');
end_field = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_end');
start_field_template = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_start_template');
end_field_template = $('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range_end_template');
$('#id_cdataviz_chartngcell-{{ cell.pk }}-time_range').change(function() {
if(this.value == 'range') {
start_field.parent().show();
end_field.parent().show();
} else {
start_field.parent().hide();
end_field.parent().hide();
}
if(this.value == 'range-template') {
start_field_template.parent().show();
end_field_template.parent().show();
} else {
start_field_template.parent().hide();
end_field_template.parent().hide();
}
}).change();
});
</script>

View File

@ -1,16 +1,16 @@
{% block cell-content %}
<div
data-combo-gauge="true"
{% if jsonp %}
data-gauge-count-jsonp-url="{{data_source_url}}"
{% else %}
data-gauge-count-url="{% url 'combo-ajax-gauge-count' cell=cell.id %}"
{% endif %}
data-gauge-max-value="{{max_value|default_if_none:100}}" class="bo-block">
<canvas style="width: 100%;">
</canvas>
{% if title %}
{% if url %}<a href="{{url}}">{% endif %}{{title}}{% if url %}</a>{% endif %}
{% endif %}
</div>
<div
data-combo-gauge="true"
{% if jsonp %}
data-gauge-count-jsonp-url="{{data_source_url}}"
{% else %}
data-gauge-count-url="{% url 'combo-ajax-gauge-count' cell=cell.id %}"
{% endif %}
data-gauge-max-value="{{max_value|default_if_none:100}}" class="bo-block">
<canvas style="width: 100%;">
</canvas>
{% if title %}
{% if url %}<a href="{{url}}">{% endif %}{{title}}{% if url %}</a>{% endif %}
{% endif %}
</div>
{% endblock %}

View File

@ -1,17 +1,17 @@
{% extends "combo/cell_form.html" %}
{% block cell-form %}
{{ block.super }}
<script>
$('#id_cfamily_weeklyagendacell-{{ cell.pk }}-agenda_type').on('change', function() {
if ($(this).val() == 'manual') {
$('#id_cfamily_weeklyagendacell-{{ cell.pk }}-agenda_references_template').parent().show();
$('#id_cfamily_weeklyagendacell-{{ cell.pk }}-agenda_categories').parent().hide();
} else {
$('#id_cfamily_weeklyagendacell-{{ cell.pk }}-agenda_references_template').parent().hide();
$('#id_cfamily_weeklyagendacell-{{ cell.pk }}-agenda_categories').parent().show();
}
});
$('#id_cfamily_weeklyagendacell-{{ cell.pk }}-agenda_type').change();
</script>
{{ block.super }}
<script>
$('#id_cfamily_weeklyagendacell-{{ cell.pk }}-agenda_type').on('change', function() {
if ($(this).val() == 'manual') {
$('#id_cfamily_weeklyagendacell-{{ cell.pk }}-agenda_references_template').parent().show();
$('#id_cfamily_weeklyagendacell-{{ cell.pk }}-agenda_categories').parent().hide();
} else {
$('#id_cfamily_weeklyagendacell-{{ cell.pk }}-agenda_references_template').parent().hide();
$('#id_cfamily_weeklyagendacell-{{ cell.pk }}-agenda_categories').parent().show();
}
});
$('#id_cfamily_weeklyagendacell-{{ cell.pk }}-agenda_type').change();
</script>
{% endblock %}

View File

@ -1,58 +1,58 @@
{% load i18n %}
{% block cell-content %}
{% if json.data %}
{% if json.data %}
{% if cell.title %}
<h2>
{{ cell.title }}
</h2>
{% endif %}
{% if cell.title %}
<h2>
{{ cell.title }}
</h2>
{% endif %}
<div class="weekly-agenda-cell weekly-agenda-cell-{{ cell.pk }}" data-cell-id="{{ cell.pk }}">
{% with first_monday=json.data.0.date|date|adjust_to_week_monday last_item=json.data|last %}
{% with last_day=last_item.date|date|adjust_to_week_monday|add_days:6 %}
{% now 'Y-m-W' as current_week %}
{% spaceless %}
<button class="weekly-agenda-cell--previous-week"></button>
<div class="weekly-agenda-cell--week-list">
<div class="weekly-agenda-cell--slider">
{% for day in first_monday|iterate_days_until:last_day %}
{% if day.weekday == 0 %}
{% with sunday=day|add_days:6 %}
<div class="weekly-agenda-cell--week-title {% if current_week == day|date:'Y-m-W' %}current{% endif %}"
{% if booking_form_url %}data-edit-url="{{ booking_form_url }}{% if '?' in booking_form_url %}&{% else %}?{% endif %}current={{ day|adjust_to_week_monday|date:'Y-m-d' }}"{% endif %}>
{% blocktrans with day_date=day|date:'d/m' sunday_date=sunday|date:'d/m' %}Week<br class="weekbreak"> of {{ day_date }} to {{ sunday_date }}{% endblocktrans %}
</div>
{% endwith %}
{% endif %}
<div class="weekly-agenda-cell--day-item" data-weekday="{{ day.weekday }}">
<div class="weekly-agenda-cell--day-title" >
{{ day|date:"l d/m" }}
</div>
{% with day_str=day|date:"Y-m-d" %}
{% for item in json.data %}
{% if item.date == day_str %}
<div class="weekly-agenda-cell--activity-item {% if item.disabled %}disabled{% endif %}">
<div class="weekly-agenda-cell--activity-status {{ item.status }}"/></div>
<div class="weekly-agenda-cell--activity-label"/>{{ item.label }}</div>
</div>
<div class="weekly-agenda-cell weekly-agenda-cell-{{ cell.pk }}" data-cell-id="{{ cell.pk }}">
{% with first_monday=json.data.0.date|date|adjust_to_week_monday last_item=json.data|last %}
{% with last_day=last_item.date|date|adjust_to_week_monday|add_days:6 %}
{% now 'Y-m-W' as current_week %}
{% spaceless %}
<button class="weekly-agenda-cell--previous-week"></button>
<div class="weekly-agenda-cell--week-list">
<div class="weekly-agenda-cell--slider">
{% for day in first_monday|iterate_days_until:last_day %}
{% if day.weekday == 0 %}
{% with sunday=day|add_days:6 %}
<div class="weekly-agenda-cell--week-title {% if current_week == day|date:'Y-m-W' %}current{% endif %}"
{% if booking_form_url %}data-edit-url="{{ booking_form_url }}{% if '?' in booking_form_url %}&{% else %}?{% endif %}current={{ day|adjust_to_week_monday|date:'Y-m-d' }}"{% endif %}>
{% blocktrans with day_date=day|date:'d/m' sunday_date=sunday|date:'d/m' %}Week<br class="weekbreak"> of {{ day_date }} to {{ sunday_date }}{% endblocktrans %}
</div>
{% endwith %}
{% endif %}
<div class="weekly-agenda-cell--day-item" data-weekday="{{ day.weekday }}">
<div class="weekly-agenda-cell--day-title" >
{{ day|date:"l d/m" }}
</div>
{% with day_str=day|date:"Y-m-d" %}
{% for item in json.data %}
{% if item.date == day_str %}
<div class="weekly-agenda-cell--activity-item {% if item.disabled %}disabled{% endif %}">
<div class="weekly-agenda-cell--activity-status {{ item.status }}"/></div>
<div class="weekly-agenda-cell--activity-label"/>{{ item.label }}</div>
</div>
{% endif %}
{% endfor %}
{% endwith %}
<div class="weekly-agenda-cell--day-no-activity">{% trans "No activity this week" %}</div>
</div>
{% endfor %}
{% endwith %}
<div class="weekly-agenda-cell--day-no-activity">{% trans "No activity this week" %}</div>
</div>
</div>
{% endfor %}
</div>
</div>
<button class="weekly-agenda-cell--next-week"></button>
{% if booking_form_url %}
<a class="pk-button weekly-agenda-cell--edit-btn">
{% trans "Update bookings" %}
</a>
{% endif %}
{% endspaceless %}
{% endwith %}
{% endwith %}
</div>
{% endif %}
<button class="weekly-agenda-cell--next-week"></button>
{% if booking_form_url %}
<a class="pk-button weekly-agenda-cell--edit-btn">
{% trans "Update bookings" %}
</a>
{% endif %}
{% endspaceless %}
{% endwith %}
{% endwith %}
</div>
{% endif %}
{% endblock %}

View File

@ -1,15 +1,15 @@
{% load i18n %}
{% block cell-content %}
<div class="recent-documents links-list">
<h2>{% trans 'Recent Documents' %}</h2>
{% if results %}
<ul>
{% for object in results %}
<li><a href="{{object.url}}">{{object.label}}</a></li>
{% endfor %}
</ul>
{% else %}
<p>{% trans "You don't have any recent document." %}</p>
{% endif %}
</div>
<div class="recent-documents links-list">
<h2>{% trans 'Recent Documents' %}</h2>
{% if results %}
<ul>
{% for object in results %}
<li><a href="{{object.url}}">{{object.label}}</a></li>
{% endfor %}
</ul>
{% else %}
<p>{% trans "You don't have any recent document." %}</p>
{% endif %}
</div>
{% endblock %}

View File

@ -2,25 +2,25 @@
{% load i18n %}
{% block appbar %}
{% if object.id %}
<h2>{% trans "Edit Image" %}</h2>
{% else %}
<h2>{% trans "New Image" %}</h2>
{% endif %}
{% if object.id %}
<h2>{% trans "Edit Image" %}</h2>
{% else %}
<h2>{% trans "New Image" %}</h2>
{% endif %}
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button>{% trans "Save" %}</button>
{% if object.id %}
<a class="cancel" href="{{ object.get_absolute_url }}">{% trans 'Cancel' %}</a>
{% else %}
<a class="cancel" href="{% url 'combo-manager-homepage' %}">{% trans 'Cancel' %}</a>
{% endif %}
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button>{% trans "Save" %}</button>
{% if object.id %}
<a class="cancel" href="{{ object.get_absolute_url }}">{% trans 'Cancel' %}</a>
{% else %}
<a class="cancel" href="{% url 'combo-manager-homepage' %}">{% trans 'Cancel' %}</a>
{% endif %}
</div>
</form>
{% endblock %}

View File

@ -2,26 +2,26 @@
{% load static thumbnail i18n %}
{% block cell-form %}
<ul class="gallery" id="gallery-{{cell.id}}" data-order-url="{% url 'combo-gallery-image-order' gallery_pk=cell.id %}">
{% for image in cell.image_set.all %}
<li data-object-id="{{image.id}}">
{% thumbnail image.image "120x120" crop="50% 25%" as im %}
<img height="120" src="{{ im.url }}"/>
{% endthumbnail %}
<span class="image-actions">
<a rel="popup" class="image-edit icon-edit" href="{% url 'combo-gallery-image-edit' gallery_pk=cell.id pk=image.id %}"></a>
<a class="image-delete icon-remove-sign" href="{% url 'combo-gallery-image-delete' gallery_pk=cell.id pk=image.id %}"></a>
</span>
</li>
{% endfor %}
<li><a class="button" rel="popup" href="{% url 'combo-gallery-image-add' gallery_pk=cell.id %}">{% trans 'Add an Image' %}</a></li>
</ul>
<ul class="gallery" id="gallery-{{cell.id}}" data-order-url="{% url 'combo-gallery-image-order' gallery_pk=cell.id %}">
{% for image in cell.image_set.all %}
<li data-object-id="{{image.id}}">
{% thumbnail image.image "120x120" crop="50% 25%" as im %}
<img height="120" src="{{ im.url }}"/>
{% endthumbnail %}
<span class="image-actions">
<a rel="popup" class="image-edit icon-edit" href="{% url 'combo-gallery-image-edit' gallery_pk=cell.id pk=image.id %}"></a>
<a class="image-delete icon-remove-sign" href="{% url 'combo-gallery-image-delete' gallery_pk=cell.id pk=image.id %}"></a>
</span>
</li>
{% endfor %}
<li><a class="button" rel="popup" href="{% url 'combo-gallery-image-add' gallery_pk=cell.id %}">{% trans 'Add an Image' %}</a></li>
</ul>
<script src="{% static "js/combo.gallery.js" %}"></script>
<script>gallery($('#gallery-{{cell.id}}'));</script>
<script src="{% static "js/combo.gallery.js" %}"></script>
<script>gallery($('#gallery-{{cell.id}}'));</script>
<div class="edit-form">
{{form.as_p}}
</div>
<div class="edit-form">
{{form.as_p}}
</div>
{% endblock %}

View File

@ -1,37 +1,37 @@
{% load thumbnail %}
{% block cell-content %}
{% if cell.title %}
<h2>{{ cell.title }}</h2>
{% endif %}
<div class="gallery" id="gallery-{{cell.id}}">
{% for image in cell.image_set.all %}
{% if forloop.first %}
{% thumbnail image.image "640x480" crop="50% 25%" as im %}
<div class="main-image">
<img src="{{ im.url }}" title="{{ image.title }}"/>
</div>
<div>
{% endthumbnail %}
{% if cell.title %}
<h2>{{ cell.title }}</h2>
{% endif %}
{% thumbnail image.image "60x60" crop="50% 25%" as im %}
{% thumbnail image.image "640x480" crop="50% 25%" as im_large %}
<a data-image-large="{{ im_large.url }}" class="image-switch" href=""><img src="{{ im.url }}"
{% if image.title %} title="{{image.title}}" {% endif %}/></a>
{% endthumbnail %}
{% endthumbnail %}
{% endfor %}
</div>
</div>
<script type="text/javascript">
$(function() {
var $gallery = $('#gallery-{{cell.id}}');
$gallery.find('.image-switch').on('click', function() {
$gallery.find('div.main-image img').attr('src', $(this).data('image-large'));
var $title = $(this).find('img').attr('title') || '';
$gallery.find('div.main-image img').attr('title', $title);
return false;
});
});
</script>
<div class="gallery" id="gallery-{{cell.id}}">
{% for image in cell.image_set.all %}
{% if forloop.first %}
{% thumbnail image.image "640x480" crop="50% 25%" as im %}
<div class="main-image">
<img src="{{ im.url }}" title="{{ image.title }}"/>
</div>
<div>
{% endthumbnail %}
{% endif %}
{% thumbnail image.image "60x60" crop="50% 25%" as im %}
{% thumbnail image.image "640x480" crop="50% 25%" as im_large %}
<a data-image-large="{{ im_large.url }}" class="image-switch" href=""><img src="{{ im.url }}"
{% if image.title %} title="{{image.title}}" {% endif %}/></a>
{% endthumbnail %}
{% endthumbnail %}
{% endfor %}
</div>
</div>
<script type="text/javascript">
$(function() {
var $gallery = $('#gallery-{{cell.id}}');
$gallery.find('.image-switch').on('click', function() {
$gallery.find('div.main-image img').attr('src', $(this).data('image-large'));
var $title = $(this).find('img').attr('title') || '';
$gallery.find('div.main-image img').attr('title', $title);
return false;
});
});
</script>
{% endblock %}

View File

@ -1,22 +1,22 @@
{% load i18n %}
{% block cell-content %}
<h2>{% trans "Latest Page Updates" %}</h2>
<div class="links-list">
<ul class="latest-page-updates-cell--list">
{% for page in pages %}
<li class="latest-page-updates-cell--item">
<a href="{{ page.get_online_url }}">
<span class="latest-page-updates-cell--item-title">{{ page.title }}</span>
<time
class="latest-page-updates-cell--item-date"
datetime="{{ page.last_update_timestamp|datetime|date:"c" }}"
>{% trans "on" %} {{ page.last_update_timestamp }}</time>
{% if page.is_new %}
<span class="latest-page-updates-cell--item-isnew">{% trans "(new page)" %}</span>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
</div>
<h2>{% trans "Latest Page Updates" %}</h2>
<div class="links-list">
<ul class="latest-page-updates-cell--list">
{% for page in pages %}
<li class="latest-page-updates-cell--item">
<a href="{{ page.get_online_url }}">
<span class="latest-page-updates-cell--item-title">{{ page.title }}</span>
<time
class="latest-page-updates-cell--item-date"
datetime="{{ page.last_update_timestamp|datetime|date:"c" }}"
>{% trans "on" %} {{ page.last_update_timestamp }}</time>
{% if page.is_new %}
<span class="latest-page-updates-cell--item-isnew">{% trans "(new page)" %}</span>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
</div>
{% endblock %}

View File

@ -2,57 +2,57 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Payments in error' %}</h2>
<h2>{% trans 'Payments in error' %}</h2>
{% endblock %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'lingo-manager-payment-error-list' %}">{% trans 'Payments in error' %}</a>
{{ block.super }}
<a href="{% url 'lingo-manager-payment-error-list' %}">{% trans 'Payments in error' %}</a>
{% endblock %}
{% block content %}
<div>
<form>
<p><input name="q" type="search" value="{{ query }}"> <button>{% trans 'Search' %}</button></p>
</form>
<div>
<form>
<p><input name="q" type="search" value="{{ query }}"> <button>{% trans 'Search' %}</button></p>
</form>
{% if object_list %}
<table class="main">
<thead>
<tr>
<th>{% trans 'Item' %}</th>
<th>{% trans 'Amount' %}</th>
<th colspan="2">{% trans 'Date' %}</th>
</tr>
</thead>
<tbody>
{% for object in object_list %}
<tr>
<td>{% if object.source_url %}<a href="{{ object.source_url }}">{{ object.subject }}</a>{% else %}{{ object.subject }}{% endif %}</td>
<td class="price">{{ object.amount }} €</td>
<td>{{ object.payment_date }}</td>
<td>
{% if object.transaction_status != 99 %}
<a href="{% url 'lingo-manager-homepage' %}?q={{ object.bank_transaction_id }}">{% trans "See transaction" %}</a>
{% if object.source_url %}
<br />
<a href="{% url 'lingo-manager-basket-item-mark-as-notified' object.pk %}">{% trans "Mark as notified" %}</a>
{% endif %}
{% if object_list %}
<table class="main">
<thead>
<tr>
<th>{% trans 'Item' %}</th>
<th>{% trans 'Amount' %}</th>
<th colspan="2">{% trans 'Date' %}</th>
</tr>
</thead>
<tbody>
{% for object in object_list %}
<tr>
<td>{% if object.source_url %}<a href="{{ object.source_url }}">{{ object.subject }}</a>{% else %}{{ object.subject }}{% endif %}</td>
<td class="price">{{ object.amount }} €</td>
<td>{{ object.payment_date }}</td>
<td>
{% if object.transaction_status != 99 %}
<a href="{% url 'lingo-manager-homepage' %}?q={{ object.bank_transaction_id }}">{% trans "See transaction" %}</a>
{% if object.source_url %}
<br />
<a href="{% url 'lingo-manager-basket-item-mark-as-notified' object.pk %}">{% trans "Mark as notified" %}</a>
{% endif %}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% include "gadjo/pagination.html" %}
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This site doesn't have any payment in error.
{% endblocktrans %}
</div>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% include "gadjo/pagination.html" %}
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This site doesn't have any payment in error.
{% endblocktrans %}
</div>
{% endif %}
</div>
</div>
{% endblock %}

View File

@ -1,40 +1,40 @@
{% load i18n %}
{% block cell-content %}
{% if regies %}
<h2>{% trans "Basket" %}</h2>
<div class="lingo-basket-cell--content">
{% for regie_info in regies %}
<div class="lingo-basket-cell--regie">
{% if regies|length != 1 %}<h3 class="lingo-basket-cell--regie-name">{{regie_info.regie.label}}</h3>{% endif %}
<ul class="lingo-basket-cell--list">
{% for item in regie_info.items %}
<li class="lingo-basket-cell--item">
<a class="lingo-basket-cell--item-label" {% if item.source_url %}href="{{ item.source_url }}{% endif %}">{{ item.subject }}</a>
<span class="lingo-basket-cell--item-price">{{ item.amount }} €</span>
<span class="lingo-basket-cell--item-actions">
{% if regie_info.regie.can_pay_only_one_basket_item %}
<a id="{{ item.pk }}" class="lingo-basket-cell--item-pay" href="{{ item.payment_url }}?next_url={{ cell.page.get_online_url }}">{% trans "Pay" %}</a>
{% endif %}
{% if item.user_cancellable %}
<a class="lingo-basket-cell--item-remove" role="button" rel="popup" href="{% url 'lingo-cancel-item' pk=item.id %}">{% trans 'remove' %}</a>
{% endif %}
</span>
</li>
{% endfor %}
</ul>
</div>
{% if regies %}
<h2>{% trans "Basket" %}</h2>
<div class="lingo-basket-cell--content">
{% for regie_info in regies %}
<div class="lingo-basket-cell--regie">
{% if regies|length != 1 %}<h3 class="lingo-basket-cell--regie-name">{{regie_info.regie.label}}</h3>{% endif %}
<ul class="lingo-basket-cell--list">
{% for item in regie_info.items %}
<li class="lingo-basket-cell--item">
<a class="lingo-basket-cell--item-label" {% if item.source_url %}href="{{ item.source_url }}{% endif %}">{{ item.subject }}</a>
<span class="lingo-basket-cell--item-price">{{ item.amount }} €</span>
<span class="lingo-basket-cell--item-actions">
{% if regie_info.regie.can_pay_only_one_basket_item %}
<a id="{{ item.pk }}" class="lingo-basket-cell--item-pay" href="{{ item.payment_url }}?next_url={{ cell.page.get_online_url }}">{% trans "Pay" %}</a>
{% endif %}
{% if item.user_cancellable %}
<a class="lingo-basket-cell--item-remove" role="button" rel="popup" href="{% url 'lingo-cancel-item' pk=item.id %}">{% trans 'remove' %}</a>
{% endif %}
</span>
</li>
{% endfor %}
</ul>
</div>
{% if not regie_info.regie.can_pay_only_one_basket_item %}
<form action="{% url 'lingo-pay' %}" method="POST">
{% csrf_token %}
<p class="lingo-basket-cell--total"><strong>{% trans "Total:" %}</strong> {{ regie_info.total }} €</p>
<input type="hidden" name="next_url" value="{{ cell.page.get_online_url }}" />
<input type="hidden" name="regie" value="{{regie_info.regie.id}}" />
<button class="lingo-basket-cell--pay">{% trans "Pay" %}</button>
</form>
{% endif %}
{% if not regie_info.regie.can_pay_only_one_basket_item %}
<form action="{% url 'lingo-pay' %}" method="POST">
{% csrf_token %}
<p class="lingo-basket-cell--total"><strong>{% trans "Total:" %}</strong> {{ regie_info.total }} €</p>
<input type="hidden" name="next_url" value="{{ cell.page.get_online_url }}" />
<input type="hidden" name="regie" value="{{regie_info.regie.id}}" />
<button class="lingo-basket-cell--pay">{% trans "Pay" %}</button>
</form>
{% endif %}
{% endfor %}
{% endif %}
</div>
{% endfor %}
{% endif %}
</div>
{% endblock %}

View File

@ -1,13 +1,13 @@
{% load i18n %}
{% block cell-content %}
{% if total %}
<p><a href="{{site_base}}{{basket_url}}">{% trans 'Basket:' %}
{% blocktrans count counter=items|length %}
{{counter}} item
{% plural %}
{{counter}} items
{% endblocktrans %}
({{ total }} €)</a></p>
</form>
{% endif %}
{% if total %}
<p><a href="{{site_base}}{{basket_url}}">{% trans 'Basket:' %}
{% blocktrans count counter=items|length %}
{{counter}} item
{% plural %}
{{counter}} items
{% endblocktrans %}
({{ total }} €)</a></p>
</form>
{% endif %}
{% endblock %}

View File

@ -3,18 +3,18 @@
<head>
<meta charset="utf-8"/>
</head>
<body>
<div>
<form method="POST" action="{% url 'lingo-cancel-item' pk=object.id %}">
{% csrf_token %}
{% blocktrans with subject=object.subject %}
Are you really sure you want to remove "{{subject}}"?
{% endblocktrans %}
<div class="buttons">
<button>{% trans 'Remove' %}</button>
<a class="cancel" href="{{ basket_url }}">{% trans 'Cancel' %}</a>
</div>
</form>
<body>
<div>
<form method="POST" action="{% url 'lingo-cancel-item' pk=object.id %}">
{% csrf_token %}
{% blocktrans with subject=object.subject %}
Are you really sure you want to remove "{{subject}}"?
{% endblocktrans %}
<div class="buttons">
<button>{% trans 'Remove' %}</button>
<a class="cancel" href="{{ basket_url }}">{% trans 'Cancel' %}</a>
</div>
</body>
</form>
</div>
</body>
</html>

View File

@ -4,15 +4,15 @@
<body style="max-width: 60em">
<p>{% blocktrans with id=invoice.id creation_date=invoice.creation_date|date:"DATE_FORMAT" amount=invoice.amount %}
We inform you that your invoice nr. {{ id }} issued on {{ creation_date }} of amount of {{ amount }}€ is available.
{% endblocktrans %}</p>
{% endblocktrans %}</p>
{% if invoice.online_payment %}
<p>{% blocktrans %}You can <a href="{{ payment_url }}">view and pay it online</a>.{% endblocktrans %}</p>
<p>{% blocktrans %}You can <a href="{{ payment_url }}">view and pay it online</a>.{% endblocktrans %}</p>
{% else %}
<p>{% blocktrans %}You can view it on the <a href="{{ portal_url }}">portal</a>.{% endblocktrans %}</p>
{% if invoice.no_online_payment_reason == 'autobilling' %}
<p>{% blocktrans with debit_date=invoice.payment_limit_date|date:"DATE_FORMAT" %}The amount of this invoice will be debited from your account at {{ debit_date }}.{% endblocktrans %}
</p>
{% endif %}
<p>{% blocktrans %}You can view it on the <a href="{{ portal_url }}">portal</a>.{% endblocktrans %}</p>
{% if invoice.no_online_payment_reason == 'autobilling' %}
<p>{% blocktrans with debit_date=invoice.payment_limit_date|date:"DATE_FORMAT" %}The amount of this invoice will be debited from your account at {{ debit_date }}.{% endblocktrans %}
</p>
{% endif %}
{% endif %}
</body>
</html>

View File

@ -1,21 +1,21 @@
{% load i18n %}<!DOCTYPE html>
<html>
<head>
<head>
<meta charset="UTF-8">
<title>{% blocktrans %}Invoice number {{ number }}{% endblocktrans %}</title>
</head>
<body class="invoice_fullpage">
</head>
<body class="invoice_fullpage">
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
<div class="invoice">
{% include 'lingo/combo/item.html' %}
</div>
</body>
<div class="invoice">
{% include 'lingo/combo/item.html' %}
</div>
</body>
</html>

View File

@ -2,76 +2,76 @@
<div id="content">
<div id="appbar">
{% if item %}
<h2>
{% blocktrans with number=item.display_id %}
Item nr. {{ number }}
{% endblocktrans %}
</h2>
<form action="{% url 'lingo-pay' %}" method="POST">
<div id="item">
{% if item.subject %}
<h4 class="label">
{% blocktrans with label=item.subject %}
Label: {{ label }}
{% endblocktrans %}
</h4>
{% endif %}
<div class="total_amount">
{% blocktrans with amount=item.total_amount|floatformat:"2" %}
Total amount: <span class="amount">{{ amount }}€</span>
{% endblocktrans %}
</div>
{% if item.amount %}
<div class="amount">
{% blocktrans with amount=item.amount|floatformat:"2" %}
Amount to pay: <span class="amount">{{ amount }}€</span>
{% endblocktrans %}
</div>
{% endif %}
{% if item.amount_paid %}
<div class="amount_paid">
{% blocktrans with amount=item.amount_paid|floatformat:"2" %}
Amount already paid: <span class="amount">{{ amount }}€</span>
{% endblocktrans %}
</div>
{% endif %}
<div class="issued">{% trans "Issue date:" %} <span class="timestamp">{{ item.creation_date|date:"SHORT_DATE_FORMAT" }}</span></div>
{% if item.payment_limit_date %}
<div class="invoice-payment-limit-date">{% trans "Payment due date:" %}
<span class="timestamp">{{ item.payment_limit_date|date:"SHORT_DATE_FORMAT" }} {% trans "(up to and including)" %}</span></div>
{% endif %}
{% if item.payment_date %}
<div class="paid paid-info">{% trans "Invoice paid on" %} <span class="timestamp">{{ item.payment_date|date:"SHORT_DATE_FORMAT" }}</span></div>
{% elif item.paid %}
<div class="paid paid-info">{% trans "Invoice has been paid." %}</div>
{% endif %}
{% if item.no_online_payment_reason_details %}
<div class="no-online-payment-reason"><span>{{ item.no_online_payment_reason_details }}</span></div>
{% endif %}
{% if item.waiting_date and not item.paid %}
<div class="paid paid-info">{% trans "Waiting for payment." %}</div>
{% endif %}
{% if not item.paid and item.online_payment and item.amount >= regie.payment_min_amount and not item.waiting_date %}
{% csrf_token %}
{% if not user.is_authenticated %}
<div class="email">
<label for="email">{% trans 'Email:' %}</label>
<input type="email" id="email" name="email" required/>
<h2>
{% blocktrans with number=item.display_id %}
Item nr. {{ number }}
{% endblocktrans %}
</h2>
<form action="{% url 'lingo-pay' %}" method="POST">
<div id="item">
{% if item.subject %}
<h4 class="label">
{% blocktrans with label=item.subject %}
Label: {{ label }}
{% endblocktrans %}
</h4>
{% endif %}
<div class="total_amount">
{% blocktrans with amount=item.total_amount|floatformat:"2" %}
Total amount: <span class="amount">{{ amount }}€</span>
{% endblocktrans %}
</div>
{% endif %}
{% if item.amount %}
<div class="amount">
{% blocktrans with amount=item.amount|floatformat:"2" %}
Amount to pay: <span class="amount">{{ amount }}€</span>
{% endblocktrans %}
</div>
{% endif %}
{% if item.amount_paid %}
<div class="amount_paid">
{% blocktrans with amount=item.amount_paid|floatformat:"2" %}
Amount already paid: <span class="amount">{{ amount }}€</span>
{% endblocktrans %}
</div>
{% endif %}
<div class="issued">{% trans "Issue date:" %} <span class="timestamp">{{ item.creation_date|date:"SHORT_DATE_FORMAT" }}</span></div>
{% if item.payment_limit_date %}
<div class="invoice-payment-limit-date">{% trans "Payment due date:" %}
<span class="timestamp">{{ item.payment_limit_date|date:"SHORT_DATE_FORMAT" }} {% trans "(up to and including)" %}</span></div>
{% endif %}
{% if item.payment_date %}
<div class="paid paid-info">{% trans "Invoice paid on" %} <span class="timestamp">{{ item.payment_date|date:"SHORT_DATE_FORMAT" }}</span></div>
{% elif item.paid %}
<div class="paid paid-info">{% trans "Invoice has been paid." %}</div>
{% endif %}
{% if item.no_online_payment_reason_details %}
<div class="no-online-payment-reason"><span>{{ item.no_online_payment_reason_details }}</span></div>
{% endif %}
{% if item.waiting_date and not item.paid %}
<div class="paid paid-info">{% trans "Waiting for payment." %}</div>
{% endif %}
{% if not item.paid and item.online_payment and item.amount >= regie.payment_min_amount and not item.waiting_date %}
{% csrf_token %}
{% if not user.is_authenticated %}
<div class="email">
<label for="email">{% trans 'Email:' %}</label>
<input type="email" id="email" name="email" required/>
</div>
{% endif %}
<input type="hidden" name="regie" value="{{ regie.pk }}"/>
<input type="hidden" name="item" value="{{ item.id }}"/>
<input type="hidden" name="next_url" value="{{ page.get_online_url }}" />
{% if item_url %}
<input type="hidden" name="item_url" value="{{ item_url }}"/>
{% endif %}
<div class="buttons">
<button>{% trans "Pay" %}</button>
<input type="hidden" name="regie" value="{{ regie.pk }}"/>
<input type="hidden" name="item" value="{{ item.id }}"/>
<input type="hidden" name="next_url" value="{{ page.get_online_url }}" />
{% if item_url %}
<input type="hidden" name="item_url" value="{{ item_url }}"/>
{% endif %}
<div class="buttons">
<button>{% trans "Pay" %}</button>
</div>
{% endif %}
</div>
{% endif %}
</div>
</form>
</form>
{% else %}
<h2>{{ err_desc }}</h2>
<form></form>

View File

@ -1,73 +1,73 @@
{% load i18n %}
{% block cell-content %}
{% if errors or items or not cell.hide_if_empty %}
{% if title %}<h2>{{ title|safe }}</h2>{% endif %}
<div>
{% if text %}{{ text|safe }}{% endif %}
{% if errors %}
<ul class="errorlist">
{% for error in errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
{% if items %}
<div class="pk-table-wrapper">
<table class="invoices">
<thead>
<tr>
<th class="invoice-id">{% trans "Number" %}</th>
<th class="invoice-subject">{% trans "Label" %}</th>
<th class="invoice-creation-date">{% trans "Issue date" %}</th>
{% if with_payment_limit_date %}<th class="invoice-payment-limit-date">{% trans "Payment limit date" %}</th>{% endif %}
<th class="invoice-amount">{% trans "Amount" %}</th>
{% if with_amount_paid %}
<th class="invoice-amount-paid">{% trans "Amount already paid" %}</th>
{% if errors or items or not cell.hide_if_empty %}
{% if title %}<h2>{{ title|safe }}</h2>{% endif %}
<div>
{% if text %}{{ text|safe }}{% endif %}
{% if errors %}
<ul class="errorlist">
{% for error in errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
<td></td>
</tr>
</thead>
<tbody>
{% for item in items %}
<tr{% if item.no_online_payment_reason %} class='{{ item.no_online_payment_reason }}-invoice'{% endif %}>
<td class="invoice-id">{{ item.display_id }}</td>
<td class="invoice-subject">{{ item.subject }}</td>
<td class="invoice-creation-date">{{ item.creation_date|date:"SHORT_DATE_FORMAT" }}</td>
{% if with_payment_limit_date %}<td class="invoice-payment-limit-date">{{ item.payment_limit_date|date:"SHORT_DATE_FORMAT" }}</td>{% endif %}
{% if with_amount_paid %}
<td class="invoice-amount amount">{% if item.amount %}{% blocktrans with amount=item.amount|floatformat:"2" %}
{{ amount }}€
{% endblocktrans %}{% endif %}
</td>
<td class="invoice-amount-paid amount">{% if item.amount_paid %}{% blocktrans with amount=item.amount_paid|floatformat:"2" %}
{{ amount }}€
{% endblocktrans %}{% endif %}
</td>
{% else %}
<td class="invoice-amount amount">{% blocktrans with amount=item.total_amount|floatformat:"2" %}
{{ amount }}€
{% endblocktrans %}
</td>
{% endif %}
{% if item.regie.is_remote %}
<td>
<a href="{% url 'view-item' regie_id=item.regie.pk item_crypto_id=item.crypto_id %}?page={{ cell.page.pk }}" rel="popup" class="icon-view">{% trans "View" %}
{% if item.online_payment and item.amount >= item.regie.payment_min_amount and not item.waiting_date %}{% trans "and pay" %}{% endif %}
</a>
{% if item.has_pdf %}
<br/><a href="{% url 'download-item-pdf' regie_id=item.regie.pk item_crypto_id=item.crypto_id %}" class="icon-pdf"
>{% trans "Download" %}</a>
{% if items %}
<div class="pk-table-wrapper">
<table class="invoices">
<thead>
<tr>
<th class="invoice-id">{% trans "Number" %}</th>
<th class="invoice-subject">{% trans "Label" %}</th>
<th class="invoice-creation-date">{% trans "Issue date" %}</th>
{% if with_payment_limit_date %}<th class="invoice-payment-limit-date">{% trans "Payment limit date" %}</th>{% endif %}
<th class="invoice-amount">{% trans "Amount" %}</th>
{% if with_amount_paid %}
<th class="invoice-amount-paid">{% trans "Amount already paid" %}</th>
{% endif %}
<td></td>
</tr>
</thead>
<tbody>
{% for item in items %}
<tr{% if item.no_online_payment_reason %} class='{{ item.no_online_payment_reason }}-invoice'{% endif %}>
<td class="invoice-id">{{ item.display_id }}</td>
<td class="invoice-subject">{{ item.subject }}</td>
<td class="invoice-creation-date">{{ item.creation_date|date:"SHORT_DATE_FORMAT" }}</td>
{% if with_payment_limit_date %}<td class="invoice-payment-limit-date">{{ item.payment_limit_date|date:"SHORT_DATE_FORMAT" }}</td>{% endif %}
{% if with_amount_paid %}
<td class="invoice-amount amount">{% if item.amount %}{% blocktrans with amount=item.amount|floatformat:"2" %}
{{ amount }}€
{% endblocktrans %}{% endif %}
</td>
<td class="invoice-amount-paid amount">{% if item.amount_paid %}{% blocktrans with amount=item.amount_paid|floatformat:"2" %}
{{ amount }}€
{% endblocktrans %}{% endif %}
</td>
{% else %}
<td class="invoice-amount amount">{% blocktrans with amount=item.total_amount|floatformat:"2" %}
{{ amount }}€
{% endblocktrans %}
</td>
{% endif %}
{% if item.regie.is_remote %}
<td>
<a href="{% url 'view-item' regie_id=item.regie.pk item_crypto_id=item.crypto_id %}?page={{ cell.page.pk }}" rel="popup" class="icon-view">{% trans "View" %}
{% if item.online_payment and item.amount >= item.regie.payment_min_amount and not item.waiting_date %}{% trans "and pay" %}{% endif %}
</a>
{% if item.has_pdf %}
<br/><a href="{% url 'download-item-pdf' regie_id=item.regie.pk item_crypto_id=item.crypto_id %}" class="icon-pdf"
>{% trans "Download" %}</a>
{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
{% trans "No items yet" %}
{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
{% trans "No items yet" %}
{% endif %}
</div>
{% endif %}
</div>
{% endif %}
{% endblock %}

View File

@ -2,52 +2,52 @@
{% load static i18n %}
{% block combo-content %}
{% block wait-js %}
<script>
function display_error(message) {
$('#transaction-error').text(message);
$('#transaction-error').show();
$("#wait-msg").hide();
}
{% block wait-js %}
<script>
function display_error(message) {
$('#transaction-error').text(message);
$('#transaction-error').show();
$("#wait-msg").hide();
}
$(function() {
var next_url = '{{next_url}}';
var transaction_id = '{{transaction_id}}';
if (transaction_id === "") {
display_error($('#transaction-error').data('error'));
}
else {
$.ajax({
$(function() {
var next_url = '{{next_url}}';
var transaction_id = '{{transaction_id}}';
if (transaction_id === "") {
display_error($('#transaction-error').data('error'));
}
else {
$.ajax({
url: `/api/lingo/transaction-status/${transaction_id}/`,
success: function(data, status) {
if (!data.wait) {
$('#wait-msg').text($('#wait-msg').data('continue'))
// wait a little to show messages
setTimeout(function(){location.href=next_url}, 3000);
} else if (data.error) {
display_error(data.error_msg)
} else {
setTimeout(wait_payment, 3000, next_url, transaction_id);
}
if (!data.wait) {
$('#wait-msg').text($('#wait-msg').data('continue'))
// wait a little to show messages
setTimeout(function(){location.href=next_url}, 3000);
} else if (data.error) {
display_error(data.error_msg)
} else {
setTimeout(wait_payment, 3000, next_url, transaction_id);
}
},
error: function(error) {
display_error($('#transaction-status').data('error'));
window.console && console.log(':(', error);
display_error($('#transaction-status').data('error'));
window.console && console.log(':(', error);
}
});
}
});
</script>
{% endblock %}
{% block wait-content%}
<div>
{% block wait-message %}
<h2 id="wait-msg" data-continue="{% trans "Wait a moment or click on 'Continue'." %}">{% trans "Please wait while your request is being processed..." %}</h2>
});
}
});
</script>
{% endblock %}
{% block wait-content%}
<div>
{% block wait-message %}
<h2 id="wait-msg" data-continue="{% trans "Wait a moment or click on 'Continue'." %}">{% trans "Please wait while your request is being processed..." %}</h2>
{% endblock %}
<div id="transaction-error" class="errornotice" data-error="{% trans 'An error occured' %}" style="display: none;"></div>
<p><a id="next-url" href="{{next_url}}">{% trans "Continue" %}</a></p>
</p>
</div>
{% endblock %}
<div id="transaction-error" class="errornotice" data-error="{% trans 'An error occured' %}" style="display: none;"></div>
<p><a id="next-url" href="{{next_url}}">{% trans "Continue" %}</a></p>
</p>
</div>
{% endblock %}
{% endblock %}

View File

@ -1,20 +1,20 @@
{% load i18n %}
{% block cell-content %}
<h2>{% trans "Recent Transactions" %}</h2>
<ul>
{% for transaction in transactions %}
<li>{{ transaction.start_date|date:"d E o H:i"|lower }}
{% if transaction.is_paid %}
<ul>
{% for item in transaction.items.all %}
<li>{{ item.subject }}: {{ item.amount }} €
{% if item.source_url and item.user == request.user %}(<a href="{{ item.source_url}}">{% trans 'open' %}</a>){% endif %}</li>
<h2>{% trans "Recent Transactions" %}</h2>
<ul>
{% for transaction in transactions %}
<li>{{ transaction.start_date|date:"d E o H:i"|lower }}
{% if transaction.is_paid %}
<ul>
{% for item in transaction.items.all %}
<li>{{ item.subject }}: {{ item.amount }} €
{% if item.source_url and item.user == request.user %}(<a href="{{ item.source_url}}">{% trans 'open' %}</a>){% endif %}</li>
{% endfor %}
</ul>
{% else %}
{{ transaction.get_status_label }}
{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
{{ transaction.get_status_label }}
{% endif %}
</li>
{% endfor %}
</ul>
</ul>
{% endblock %}

View File

@ -1,31 +1,31 @@
{% load i18n %}
{% block cell-content %}
{% if title %}<h2>{{ title }}</h2>{% endif %}
<div>
{% if text %}<p>{{ text|safe }}</p>{% endif %}
<form class="quixote" action="{% url 'lingo-self-invoice' cell_id=cell.id %}">
<div class="widget">
<div class="title">
{% trans 'Invoice Number' %}
<span class="required">*</span>
</div>
<div class="content">
<input type="text" name="invoice-number" required="required">
</div>
{% if title %}<h2>{{ title }}</h2>{% endif %}
<div>
{% if text %}<p>{{ text|safe }}</p>{% endif %}
<form class="quixote" action="{% url 'lingo-self-invoice' cell_id=cell.id %}">
<div class="widget">
<div class="title">
{% trans 'Invoice Number' %}
<span class="required">*</span>
</div>
<div class="content">
<input type="text" name="invoice-number" required="required">
</div>
</div>
<div class="widget">
<div class="title">
{% trans 'Invoice Amount' %}
<span class="required">*</span>
</div>
<div class="content">
<input type="text" name="invoice-amount" required="required" pattern="[1-9][0-9]*([,\.]?[0-9]+)?">
</div>
</div>
<input type="hidden" name="page_path" value="{{page_path}}">
<div class="buttons">
<button>{% trans "Pay" %}</button>
</div>
</form>
</div>
<div class="widget">
<div class="title">
{% trans 'Invoice Amount' %}
<span class="required">*</span>
</div>
<div class="content">
<input type="text" name="invoice-amount" required="required" pattern="[1-9][0-9]*([,\.]?[0-9]+)?">
</div>
</div>
<input type="hidden" name="page_path" value="{{page_path}}">
<div class="buttons">
<button>{% trans "Pay" %}</button>
</div>
</form>
</div>
{% endblock %}

View File

@ -2,10 +2,10 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Online Payment' %}</h2>
<h2>{% trans 'Online Payment' %}</h2>
{% endblock %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'lingo-manager-homepage' %}">{% trans 'Online Payment' %}</a>
{{ block.super }}
<a href="{% url 'lingo-manager-homepage' %}">{% trans 'Online Payment' %}</a>
{% endblock %}

View File

@ -1,16 +1,16 @@
{% load i18n %}
<html>
<head>
</head>
<body onload="document.forms[0].submit()">
<p>
{% trans "Please wait while your browser is being redirected to the payment website..." %}
</p>
<form action="{{ form.url }}" method="{{ form.method }}" style="display: none">
{% for field in form.fields %}
<input type="{{ field.type }}" name="{{ field.name }}" value="{{ field.value }}"/>
{% endfor %}
<input type="submit">
</form>
</body>
<head>
</head>
<body onload="document.forms[0].submit()">
<p>
{% trans "Please wait while your browser is being redirected to the payment website..." %}
</p>
<form action="{{ form.url }}" method="{{ form.method }}" style="display: none">
{% for field in form.fields %}
<input type="{{ field.type }}" name="{{ field.name }}" value="{{ field.value }}"/>
{% endfor %}
<input type="submit">
</form>
</body>
</html>

View File

@ -2,16 +2,16 @@
{% load i18n %}
{% block appbar %}
<h2>{{ view.model.get_verbose_name }}</h2>
<h2>{{ view.model.get_verbose_name }}</h2>
{% endblock %}
{% block content %}
<form method="post">
{% csrf_token %}
{% blocktrans %}Are you sure you want to delete this?{% endblocktrans %}
<div class="buttons">
<button class="delete-button">{% trans 'Delete' %}</button>
<a class="cancel" href="{% url 'lingo-manager-paymentbackend-list' %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post">
{% csrf_token %}
{% blocktrans %}Are you sure you want to delete this?{% endblocktrans %}
<div class="buttons">
<button class="delete-button">{% trans 'Delete' %}</button>
<a class="cancel" href="{% url 'lingo-manager-paymentbackend-list' %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,20 +2,20 @@
{% load i18n %}
{% block appbar %}
{% if object.id %}
<h2>{% trans "Edit Payment backend" %}</h2>
{% else %}
<h2>{% trans "New Payment backend" %}</h2>
{% endif %}
{% if object.id %}
<h2>{% trans "Edit Payment backend" %}</h2>
{% else %}
<h2>{% trans "New Payment backend" %}</h2>
{% endif %}
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'lingo-manager-paymentbackend-list' %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'lingo-manager-paymentbackend-list' %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,37 +2,37 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Payment backends' %}</h2>
<span class="actions">
<a rel="popup" href="{% url 'lingo-manager-paymentbackend-add' %}">{% trans 'New' %}</a>
</span>
<h2>{% trans 'Payment backends' %}</h2>
<span class="actions">
<a rel="popup" href="{% url 'lingo-manager-paymentbackend-add' %}">{% trans 'New' %}</a>
</span>
{% endblock %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'lingo-manager-paymentbackend-list' %}">{% trans 'Payment backends' %}</a>
{{ block.super }}
<a href="{% url 'lingo-manager-paymentbackend-list' %}">{% trans 'Payment backends' %}</a>
{% endblock %}
{% block content %}
{% if object_list %}
<ul class="objects-list single-links">
{% for payment_backend in object_list %}
<li>
<a href="{% url 'lingo-manager-paymentbackend-edit' pk=payment_backend.id %}">{{ payment_backend.label }}
<span>({{payment_backend.service}})</span>
</a>
<a rel="popup" class="delete" href="{% url 'lingo-manager-paymentbackend-delete' pk=payment_backend.id %}">{% trans "remove" %}</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This site doesn't have any payment backend yet. Click on the "New" button in the top
right of the page to add a first one.
{% endblocktrans %}
</div>
{% endif %}
{% if object_list %}
<ul class="objects-list single-links">
{% for payment_backend in object_list %}
<li>
<a href="{% url 'lingo-manager-paymentbackend-edit' pk=payment_backend.id %}">{{ payment_backend.label }}
<span>({{payment_backend.service}})</span>
</a>
<a rel="popup" class="delete" href="{% url 'lingo-manager-paymentbackend-delete' pk=payment_backend.id %}">{% trans "remove" %}</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This site doesn't have any payment backend yet. Click on the "New" button in the top
right of the page to add a first one.
{% endblocktrans %}
</div>
{% endif %}
{% endblock %}

View File

@ -2,16 +2,16 @@
{% load i18n %}
{% block appbar %}
<h2>{{ view.model.get_verbose_name }}</h2>
<h2>{{ view.model.get_verbose_name }}</h2>
{% endblock %}
{% block content %}
<form method="post">
{% csrf_token %}
{% blocktrans %}Are you sure you want to delete this?{% endblocktrans %}
<div class="buttons">
<button class="delete-button">{% trans 'Delete' %}</button>
<a class="cancel" href="{% url 'lingo-manager-homepage' %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post">
{% csrf_token %}
{% blocktrans %}Are you sure you want to delete this?{% endblocktrans %}
<div class="buttons">
<button class="delete-button">{% trans 'Delete' %}</button>
<a class="cancel" href="{% url 'lingo-manager-homepage' %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,24 +2,24 @@
{% load i18n %}
{% block appbar %}
{% if object.id %}
<h2>{% trans "Edit Regie" %}</h2>
{% else %}
<h2>{% trans "New Regie" %}</h2>
{% endif %}
{% if object.id %}
<h2>{% trans "Edit Regie" %}</h2>
{% else %}
<h2>{% trans "New Regie" %}</h2>
{% endif %}
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% if object.pk %}
{% if callback_url %}<p><label>{% trans "Callback URL:" %}</label> {{ callback_url }}</p>{% endif %}
{% if return_url %}<p><label>{% trans "Return URL:" %}</label> {{ return_url }}</p>{% endif %}
{% endif %}
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'lingo-manager-regie-list' %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% if object.pk %}
{% if callback_url %}<p><label>{% trans "Callback URL:" %}</label> {{ callback_url }}</p>{% endif %}
{% if return_url %}<p><label>{% trans "Return URL:" %}</label> {{ return_url }}</p>{% endif %}
{% endif %}
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'lingo-manager-regie-list' %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,38 +2,38 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Regies' %}</h2>
<span class="actions">
<a rel="popup" href="{% url 'lingo-manager-regie-add' %}">{% trans 'New' %}</a>
</span>
<h2>{% trans 'Regies' %}</h2>
<span class="actions">
<a rel="popup" href="{% url 'lingo-manager-regie-add' %}">{% trans 'New' %}</a>
</span>
{% endblock %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'lingo-manager-regie-list' %}">{% trans 'Regies' %}</a>
{{ block.super }}
<a href="{% url 'lingo-manager-regie-list' %}">{% trans 'Regies' %}</a>
{% endblock %}
{% block content %}
{% if object_list %}
<ul class="objects-list single-links">
{% for regie in object_list %}
<li>
<a href="{% url 'lingo-manager-regie-edit' pk=regie.id %}">{{ regie.label }}
<span>({{regie.payment_backend.label}})</span>
{% if regie.is_default %}<span class="extra-info">{% trans "(default regie)" %}</span>{% endif %}
</a>
<a rel="popup" class="delete" href="{% url 'lingo-manager-regie-delete' pk=regie.id %}">{% trans "remove" %}</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This site doesn't have any regie yet. Click on the "New" button in the top
right of the page to add a first one.
{% endblocktrans %}
</div>
{% endif %}
{% if object_list %}
<ul class="objects-list single-links">
{% for regie in object_list %}
<li>
<a href="{% url 'lingo-manager-regie-edit' pk=regie.id %}">{{ regie.label }}
<span>({{regie.payment_backend.label}})</span>
{% if regie.is_default %}<span class="extra-info">{% trans "(default regie)" %}</span>{% endif %}
</a>
<a rel="popup" class="delete" href="{% url 'lingo-manager-regie-delete' pk=regie.id %}">{% trans "remove" %}</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This site doesn't have any regie yet. Click on the "New" button in the top
right of the page to add a first one.
{% endblocktrans %}
</div>
{% endif %}
{% endblock %}

View File

@ -9,15 +9,15 @@
<li>{% trans "Your browser is blocking popups but they are required to start the payment, make sure they are allowed for this site." %}</li>
</ul>
{% if regies|length > 1 %}
<p><label>{% trans "Community identifier" %}</label>
<select id="numcli">
{% for regie in regies %}
<option value="{{ regie.0 }}">{{ regie.1 }}</option>
{% endfor %}
</select>
</p>
<p><label>{% trans "Community identifier" %}</label>
<select id="numcli">
{% for regie in regies %}
<option value="{{ regie.0 }}">{{ regie.1 }}</option>
{% endfor %}
</select>
</p>
{% else %}
<input type="hidden" id="numcli" value="{{ regies.0.0 }}" />
<input type="hidden" id="numcli" value="{{ regies.0.0 }}" />
{% endif %}
<ul class="errorlist" id="refdet_error" style="display: none">
<li>{% trans "invalid reference" %}</li>
@ -26,11 +26,11 @@
<label>{% trans "Reference" %}</label>
{% regroup reference_fields by protocol as fields %}
{% for field in fields %}
{% for f in field.list %}
{% if field.grouper == control_protocol or field.grouper == 'any' %}
<input type="text" id="{{ f.name }}" required pattern="{{ f.pattern }}" maxlength="{{ f.length }}" size="{{ f.length }}" placeholder="{{ f.placeholder }}" {% if f.default %}value="{{ f.default }}" readonly {% endif %}/>{% if field.grouper == 'any' or not forloop.last %} - {% endif %}
{% endif %}
{% endfor %}
{% for f in field.list %}
{% if field.grouper == control_protocol or field.grouper == 'any' %}
<input type="text" id="{{ f.name }}" required pattern="{{ f.pattern }}" maxlength="{{ f.length }}" size="{{ f.length }}" placeholder="{{ f.placeholder }}" {% if f.default %}value="{{ f.default }}" readonly {% endif %}/>{% if field.grouper == 'any' or not forloop.last %} - {% endif %}
{% endif %}
{% endfor %}
{% endfor %}
</p>
<ul class="errorlist" id="montant_error" style="display: none">

View File

@ -2,16 +2,16 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans "download CSV" %}</h2>
<h2>{% trans "download CSV" %}</h2>
{% endblock %}
{% block content %}
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans 'Download' %}</button>
<a class="cancel" href="{% url 'lingo-manager-homepage' %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans 'Download' %}</button>
<a class="cancel" href="{% url 'lingo-manager-homepage' %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,66 +2,66 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Transactions' %}</h2>
<span class="actions">
<a href="{% url 'lingo-manager-payment-error-list' %}">{% trans 'Payments in error' %}</a>
<a href="{% url 'lingo-manager-paymentbackend-list' %}">{% trans 'Payment backends' %}</a>
<a href="{% url 'lingo-manager-regie-list' %}">{% trans 'Regies' %}</a>
<a rel="popup" href="{% url 'lingo-manager-transactions-download' %}" data-autoclose-dialog="true">{% trans 'download CSV' %}</a>
</span>
<h2>{% trans 'Transactions' %}</h2>
<span class="actions">
<a href="{% url 'lingo-manager-payment-error-list' %}">{% trans 'Payments in error' %}</a>
<a href="{% url 'lingo-manager-paymentbackend-list' %}">{% trans 'Payment backends' %}</a>
<a href="{% url 'lingo-manager-regie-list' %}">{% trans 'Regies' %}</a>
<a rel="popup" href="{% url 'lingo-manager-transactions-download' %}" data-autoclose-dialog="true">{% trans 'download CSV' %}</a>
</span>
{% endblock %}
{% block content %}
<div>
<form>
<p>
{{ form.regie }} <input name="q" type="search" value="{{ form.cleaned_data.q }}"> <button>{% trans 'Search' %}</button>
<span class="help_text">{% trans "(supports order identifiers, transaction identifiers, and dates)" %}</span>
</p>
</form>
<div>
<form>
<p>
{{ form.regie }} <input name="q" type="search" value="{{ form.cleaned_data.q }}"> <button>{% trans 'Search' %}</button>
<span class="help_text">{% trans "(supports order identifiers, transaction identifiers, and dates)" %}</span>
</p>
</form>
{% if object_list %}
<table class="main">
<thead>
<tr>
<th>{% trans 'Order Identifier' %}</th>
<th>{% trans 'Transaction Identifier' %}</th>
<th>{% trans 'Date' %}</th>
<th>{% trans 'User' %}</th>
<th>{% trans 'Amount' %}</th>
<th colspan="2">{% trans 'Items' %}</th>
</tr>
</thead>
<tbody>
{% for object in object_list %}
{% with object.prefetched_items|length|default:1 as nb_items %}
<tr>
<td rowspan="{{ nb_items }}">{{object.order_id}}</td>
<td rowspan="{{ nb_items }}">{{object.bank_transaction_id}}</td>
<td rowspan="{{ nb_items }}">{{object.start_date}}</td>
<td rowspan="{{ nb_items }}">{{object.get_user_name}}</td>
<td rowspan="{{ nb_items }}">{{object.amount}} €</td>
{% for item in object.prefetched_items %}
{% if not forloop.first %}<tr>{% endif %}
<td style="font-size: smaller">{{item.subject}}</td> <td style="font-size: smaller" class="price">{{item.amount}} €</td></tr>
{% empty %}
</tr>
{% endfor %}
{% endwith %}
{% endfor %}
</tbody>
</table>
{% if object_list %}
<table class="main">
<thead>
<tr>
<th>{% trans 'Order Identifier' %}</th>
<th>{% trans 'Transaction Identifier' %}</th>
<th>{% trans 'Date' %}</th>
<th>{% trans 'User' %}</th>
<th>{% trans 'Amount' %}</th>
<th colspan="2">{% trans 'Items' %}</th>
</tr>
</thead>
<tbody>
{% for object in object_list %}
{% with object.prefetched_items|length|default:1 as nb_items %}
<tr>
<td rowspan="{{ nb_items }}">{{object.order_id}}</td>
<td rowspan="{{ nb_items }}">{{object.bank_transaction_id}}</td>
<td rowspan="{{ nb_items }}">{{object.start_date}}</td>
<td rowspan="{{ nb_items }}">{{object.get_user_name}}</td>
<td rowspan="{{ nb_items }}">{{object.amount}} €</td>
{% for item in object.prefetched_items %}
{% if not forloop.first %}<tr>{% endif %}
<td style="font-size: smaller">{{item.subject}}</td> <td style="font-size: smaller" class="price">{{item.amount}} €</td></tr>
{% empty %}
</tr>
{% endfor %}
{% endwith %}
{% endfor %}
</tbody>
</table>
{% include "gadjo/pagination.html" %}
{% include "gadjo/pagination.html" %}
{% else %}
<div class="big-msg-info">
{% if form.cleaned_data.q or form.cleaned_data.regie %}
{% trans "No transactions found matching the current search." %}
{% else %}
{% trans "This site doesn't have any transaction yet." %}
{% endif %}
</div>
{% endif %}
</div>
{% else %}
<div class="big-msg-info">
{% if form.cleaned_data.q or form.cleaned_data.regie %}
{% trans "No transactions found matching the current search." %}
{% else %}
{% trans "This site doesn't have any transaction yet." %}
{% endif %}
</div>
{% endif %}
</div>
{% endblock %}

View File

@ -1,29 +1,29 @@
{% load i18n %}
{% with widget_value=widget.value|stringformat:'s' %}
{% spaceless %}
<span id="{{ widget.name }}-joined-buttons" class="gadjo-joined-buttons">
<button data-mode="color" aria-pressed="{% if widget.value is None or widget_value|slice:":1" == '#' %}true{% else %}false{% endif %}" role="button">{% trans "Fixed" %}</button>
<button data-mode="text" aria-pressed="{% if widget.value != None and widget_value|slice:":1" != '#' %}true{% else %}false{% endif %}" role="button">{% trans "Variable" %}</button>
</span>
{% endspaceless %}
<input id="{{ widget.name }}-input" {% if widget.value is None or widget_value|slice:":1" == '#' %}type="color"{% else %}type="text"{% endif %} name="{{ widget.name }}"{% if widget.value != None %} value="{{ widget_value }}"{% endif %}{% include "django/forms/widgets/attrs.html" %}>
{% spaceless %}
<span id="{{ widget.name }}-joined-buttons" class="gadjo-joined-buttons">
<button data-mode="color" aria-pressed="{% if widget.value is None or widget_value|slice:":1" == '#' %}true{% else %}false{% endif %}" role="button">{% trans "Fixed" %}</button>
<button data-mode="text" aria-pressed="{% if widget.value != None and widget_value|slice:":1" != '#' %}true{% else %}false{% endif %}" role="button">{% trans "Variable" %}</button>
</span>
{% endspaceless %}
<input id="{{ widget.name }}-input" {% if widget.value is None or widget_value|slice:":1" == '#' %}type="color"{% else %}type="text"{% endif %} name="{{ widget.name }}"{% if widget.value != None %} value="{{ widget_value }}"{% endif %}{% include "django/forms/widgets/attrs.html" %}>
{% endwith %}
<script>
$(function() {
$('#{{ widget.name }}-joined-buttons button').on('click', function() {
var $current_mode = $('#{{ widget.name }}-joined-buttons button[aria-pressed=true]');
$current_mode.data('previous-value', $('#{{ widget.name }}-input').val());
if ($(this).is('[aria-pressed=true]')) {
$('#{{ widget.name }}-joined-buttons button').attr('aria-pressed', 'true');
$(this).attr('aria-pressed', 'false');
} else {
$('#{{ widget.name }}-joined-buttons button').attr('aria-pressed', 'false');
$(this).attr('aria-pressed', 'true');
}
var $new_mode = $('#{{ widget.name }}-joined-buttons button[aria-pressed=true]');
var mode = $new_mode.data('mode');
$('#{{ widget.name }}-input').prop('type', mode).val($new_mode.data('previous-value'));
return false;
$(function() {
$('#{{ widget.name }}-joined-buttons button').on('click', function() {
var $current_mode = $('#{{ widget.name }}-joined-buttons button[aria-pressed=true]');
$current_mode.data('previous-value', $('#{{ widget.name }}-input').val());
if ($(this).is('[aria-pressed=true]')) {
$('#{{ widget.name }}-joined-buttons button').attr('aria-pressed', 'true');
$(this).attr('aria-pressed', 'false');
} else {
$('#{{ widget.name }}-joined-buttons button').attr('aria-pressed', 'false');
$(this).attr('aria-pressed', 'true');
}
var $new_mode = $('#{{ widget.name }}-joined-buttons button[aria-pressed=true]');
var mode = $new_mode.data('mode');
$('#{{ widget.name }}-input').prop('type', mode).val($new_mode.data('previous-value'));
return false;
});
});
});
</script>

View File

@ -2,21 +2,21 @@
{% load i18n %}
{% block appbar %}
{% if form.instance.pk %}
<h2>{% if form.kind == 'geojson' %}{% trans "Edit GeoJSON layer" %}{% else %}{% trans "Edit tiles layer" %}{% endif %}</h2>
{% else %}
<h2>{% if form.kind == 'geojson' %}{% trans "New GeoJSON layer" %}{% else %}{% trans "New tiles layer" %}{% endif %}</h2>
{% endif %}
{% if form.instance.pk %}
<h2>{% if form.kind == 'geojson' %}{% trans "Edit GeoJSON layer" %}{% else %}{% trans "Edit tiles layer" %}{% endif %}</h2>
{% else %}
<h2>{% if form.kind == 'geojson' %}{% trans "New GeoJSON layer" %}{% else %}{% trans "New tiles layer" %}{% endif %}</h2>
{% endif %}
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'combo-manager-page-view' pk=form.instance.map_cell.page_id %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'combo-manager-page-view' pk=form.instance.map_cell.page_id %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,10 +2,10 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Maps' %}</h2>
<h2>{% trans 'Maps' %}</h2>
{% endblock %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'maps-manager-homepage' %}">{% trans 'Maps' %}</a>
{{ block.super }}
<a href="{% url 'maps-manager-homepage' %}">{% trans 'Maps' %}</a>
{% endblock %}

View File

@ -2,53 +2,53 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Maps' %}</h2>
<span class="actions">
<a rel="popup" href="{% url 'maps-manager-layer-add' kind='geojson' %}">{% trans 'New GeoJSON layer' %}</a>
<a rel="popup" href="{% url 'maps-manager-layer-add' kind='tiles' %}">{% trans 'New tiles layer' %}</a>
</span>
<h2>{% trans 'Maps' %}</h2>
<span class="actions">
<a rel="popup" href="{% url 'maps-manager-layer-add' kind='geojson' %}">{% trans 'New GeoJSON layer' %}</a>
<a rel="popup" href="{% url 'maps-manager-layer-add' kind='tiles' %}">{% trans 'New tiles layer' %}</a>
</span>
{% endblock %}
{% block content %}
{% if object_list %}
<ul class="objects-list single-links layers">
{% for layer in object_list %}
<li>
<a class="layer-icon-{{ layer.icon }}" href="{% url 'maps-manager-layer-edit' slug=layer.slug %}">{{ layer.label }} {% if layer.kind == 'tiles' %}({{ layer.get_kind_display }}{% if layer.tiles_default %}, {% trans "default layer" %}{% endif %}){% endif %}</a>
<a rel="popup" class="delete" href="{% url 'maps-manager-layer-delete' slug=layer.slug %}">{% trans "remove" %}</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This site doesn't have any layer yet. Click on the "New" button in the top
right of the page to add a first one.
{% endblocktrans %}
</div>
{% endif %}
{% if object_list %}
<ul class="objects-list single-links layers">
{% for layer in object_list %}
<li>
<a class="layer-icon-{{ layer.icon }}" href="{% url 'maps-manager-layer-edit' slug=layer.slug %}">{{ layer.label }} {% if layer.kind == 'tiles' %}({{ layer.get_kind_display }}{% if layer.tiles_default %}, {% trans "default layer" %}{% endif %}){% endif %}</a>
<a rel="popup" class="delete" href="{% url 'maps-manager-layer-delete' slug=layer.slug %}">{% trans "remove" %}</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This site doesn't have any layer yet. Click on the "New" button in the top
right of the page to add a first one.
{% endblocktrans %}
</div>
{% endif %}
<h2>{% trans 'Maps on site' %}</h2>
<h2>{% trans 'Maps on site' %}</h2>
{% if map_list %}
<ul class="objects-list single-links maps">
{% for map in map_list %}
<li>
<a href="{% url 'combo-manager-page-view' pk=map.page_id %}#cell-{{ map.get_reference }}">
{% if map.title %}
{% blocktrans with map_title=map.title page_title=map.page.title %}Map "{{ map_title }}" on page "{{ page_title }}"{% endblocktrans %}
{% else %}
{% blocktrans with page_title=map.page.title %}Unnamed map on page "{{ page_title }}"{% endblocktrans %}
{% endif %}
</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This site doesn't have any map yet.
{% endblocktrans %}
</div>
{% endif %}
{% if map_list %}
<ul class="objects-list single-links maps">
{% for map in map_list %}
<li>
<a href="{% url 'combo-manager-page-view' pk=map.page_id %}#cell-{{ map.get_reference }}">
{% if map.title %}
{% blocktrans with map_title=map.title page_title=map.page.title %}Map "{{ map_title }}" on page "{{ page_title }}"{% endblocktrans %}
{% else %}
{% blocktrans with page_title=map.page.title %}Unnamed map on page "{{ page_title }}"{% endblocktrans %}
{% endif %}
</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This site doesn't have any map yet.
{% endblocktrans %}
</div>
{% endif %}
{% endblock %}

View File

@ -1,41 +1,41 @@
{% load l10n %}
{% block cell-content %}
{% if title %}<h2>{{ title }}</h2>{% endif %}
{% localize off %}
<div class="combo-cell-map"
{% block map-attributes %}
{% if title %}<h2>{{ title }}</h2>{% endif %}
{% localize off %}
<div class="combo-cell-map"
{% block map-attributes %}
data-init-state="{{ initial_state }}"
data-init-zoom="{{ initial_zoom }}" data-min-zoom="{{ min_zoom }}"
data-max-zoom="{{ max_zoom }}" data-init-lat="{{ init_lat }}"
data-init-lng="{{ init_lng }}"
{% block map-include-geoloc-button %}
data-include-geoloc-button="true"
data-include-geoloc-button="true"
{% endblock %}
{% if group_markers %}data-group-markers="1"{% endif %}
data-marker-behaviour-onclick="{{ cell.marker_behaviour_onclick }}"
{% if max_bounds.corner1.lat %}
data-max-bounds-lat1="{{ max_bounds.corner1.lat }}"
data-max-bounds-lng1="{{ max_bounds.corner1.lng }}"
data-max-bounds-lat2="{{ max_bounds.corner2.lat }}"
data-max-bounds-lng2="{{ max_bounds.corner2.lng }}"
data-max-bounds-lat1="{{ max_bounds.corner1.lat }}"
data-max-bounds-lng1="{{ max_bounds.corner1.lng }}"
data-max-bounds-lat2="{{ max_bounds.corner2.lat }}"
data-max-bounds-lng2="{{ max_bounds.corner2.lng }}"
{% endif %}
{% endblock %}
data-cell-id="{{ cell.pk }}"
>
{% endlocalize %}
<script>
var tiles_{{ cell.pk }} = [];
{% for layer in tiles_layers %}
tiles_{{ cell.pk }}.push({
tile_urltemplate: {{ layer.tile_urltemplate|as_json|safe }},
map_attribution: {{ layer.map_attribution|as_json|safe }},
opacity: {{ layer.opacity|as_json|safe }}
});
{% endfor %}
var geojson_{{ cell.pk }} = Object();
{% for layer in geojson_layers %}
geojson_{{ cell.pk }}[{{ layer.slug|as_json|safe }}] = {{layer|as_json|safe}};
{% endfor %}
</script>
</div>
{% endblock %}
data-cell-id="{{ cell.pk }}"
>
{% endlocalize %}
<script>
var tiles_{{ cell.pk }} = [];
{% for layer in tiles_layers %}
tiles_{{ cell.pk }}.push({
tile_urltemplate: {{ layer.tile_urltemplate|as_json|safe }},
map_attribution: {{ layer.map_attribution|as_json|safe }},
opacity: {{ layer.opacity|as_json|safe }}
});
{% endfor %}
var geojson_{{ cell.pk }} = Object();
{% for layer in geojson_layers %}
geojson_{{ cell.pk }}[{{ layer.slug|as_json|safe }}] = {{layer|as_json|safe}};
{% endfor %}
</script>
</div>
{% endblock %}

View File

@ -2,33 +2,33 @@
{% load i18n %}
{% block cell-form %}
{{ form.as_p }}
{% with cell.get_maplayer_options as options %}
{% if options %}
<p><label>{% trans "Layers:" %}</label></p>
<div>
<ul class="objects-list list-of-layers">
{% for option in options %}
<li>
<span>{{ option.map_layer.label }} {% if option.map_layer.kind == 'tiles' %}({{ option.map_layer.get_kind_display }}){% endif %}</span>
<a rel="popup" title="{% trans "Edit" %}" class="link-action-icon edit" href="{% url 'maps-manager-cell-edit-layer' page_pk=page.pk cell_reference=cell.get_reference layeroptions_pk=option.pk %}">{% trans "Edit" %}</a>
<a rel="popup" title="{% trans "Delete" %}" class="link-action-icon delete" href="{% url 'maps-manager-cell-delete-layer' page_pk=page.pk cell_reference=cell.get_reference layeroptions_pk=option.pk %}">{% trans "Delete" %}</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endwith %}
{% with cell.get_free_geojson_layers.exists as free_geojson and cell.get_free_tiles_layers.exists as free_tiles %}
{% if free_geojson or free_tiles %}
<div class="buttons">
{% if free_geojson %}
<a rel="popup" href="{% url 'maps-manager-cell-add-layer' page_pk=page.pk cell_reference=cell.get_reference kind='geojson' %}">{% trans "Add a GeoJSON layer" %}</a>
{{ form.as_p }}
{% with cell.get_maplayer_options as options %}
{% if options %}
<p><label>{% trans "Layers:" %}</label></p>
<div>
<ul class="objects-list list-of-layers">
{% for option in options %}
<li>
<span>{{ option.map_layer.label }} {% if option.map_layer.kind == 'tiles' %}({{ option.map_layer.get_kind_display }}){% endif %}</span>
<a rel="popup" title="{% trans "Edit" %}" class="link-action-icon edit" href="{% url 'maps-manager-cell-edit-layer' page_pk=page.pk cell_reference=cell.get_reference layeroptions_pk=option.pk %}">{% trans "Edit" %}</a>
<a rel="popup" title="{% trans "Delete" %}" class="link-action-icon delete" href="{% url 'maps-manager-cell-delete-layer' page_pk=page.pk cell_reference=cell.get_reference layeroptions_pk=option.pk %}">{% trans "Delete" %}</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if free_tiles %}
{% if free_geojson %}|{% endif%} <a rel="popup" href="{% url 'maps-manager-cell-add-layer' page_pk=page.pk cell_reference=cell.get_reference kind='tiles' %}">{% trans "Add a tiles layer" %}</a>
{% endwith %}
{% with cell.get_free_geojson_layers.exists as free_geojson and cell.get_free_tiles_layers.exists as free_tiles %}
{% if free_geojson or free_tiles %}
<div class="buttons">
{% if free_geojson %}
<a rel="popup" href="{% url 'maps-manager-cell-add-layer' page_pk=page.pk cell_reference=cell.get_reference kind='geojson' %}">{% trans "Add a GeoJSON layer" %}</a>
{% endif %}
{% if free_tiles %}
{% if free_geojson %}|{% endif%} <a rel="popup" href="{% url 'maps-manager-cell-add-layer' page_pk=page.pk cell_reference=cell.get_reference kind='tiles' %}">{% trans "Add a tiles layer" %}</a>
{% endif %}
</div>
{% endif %}
</div>
{% endif %}
{% endwith %}
{% endwith %}
{% endblock %}

View File

@ -2,16 +2,16 @@
{% load i18n %}
{% block appbar %}
<h2>{{ view.model.get_verbose_name }}</h2>
<h2>{{ view.model.get_verbose_name }}</h2>
{% endblock %}
{% block content %}
<form method="post">
{% csrf_token %}
{% blocktrans %}Are you sure you want to delete this?{% endblocktrans %}
<div class="buttons">
<button class="delete-button">{% trans 'Delete' %}</button>
<a class="cancel" href="{% url 'maps-manager-homepage' %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post">
{% csrf_token %}
{% blocktrans %}Are you sure you want to delete this?{% endblocktrans %}
<div class="buttons">
<button class="delete-button">{% trans 'Delete' %}</button>
<a class="cancel" href="{% url 'maps-manager-homepage' %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,35 +2,35 @@
{% load i18n %}
{% block appbar %}
{% if object.id %}
<h2>{% trans "Edit Map Layer" %}</h2>
{% if object.kind == 'geojson' %}
<span class="actions">
<a rel="popup" href="{% url 'maps-manager-layer-edit-request-parameters' slug=object.slug %}">{% trans 'Request parameters' %}</a>
</span>
{% endif %}
{% else %}
<h2>{% trans "New Map Layer" %}</h2>
{% endif %}
{% if object.id %}
<h2>{% trans "Edit Map Layer" %}</h2>
{% if object.kind == 'geojson' %}
<span class="actions">
<a rel="popup" href="{% url 'maps-manager-layer-edit-request-parameters' slug=object.slug %}">{% trans 'Request parameters' %}</a>
</span>
{% endif %}
{% else %}
<h2>{% trans "New Map Layer" %}</h2>
{% endif %}
{% endblock %}
{% block breadcrumb %}
{{ block.super }}
{% if object.id %}
<a href="{% url 'maps-manager-layer-edit' slug=object.slug %}">{% trans 'Edit Map Layer' %}</a>
{% else %}
<a href="#">{% trans "New Map Layer" %}</a>
{% endif %}
{{ block.super }}
{% if object.id %}
<a href="{% url 'maps-manager-layer-edit' slug=object.slug %}">{% trans 'Edit Map Layer' %}</a>
{% else %}
<a href="#">{% trans "New Map Layer" %}</a>
{% endif %}
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'maps-manager-homepage' %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'maps-manager-homepage' %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,10 +2,10 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans "Edit request parameters" %}</h2>
<h2>{% trans "Edit request parameters" %}</h2>
{% endblock %}
{% block breadcrumb %}
{{ block.super }}
<a rel="popup" href="{% url 'maps-manager-layer-edit-request-parameters' slug=object.slug %}">{% trans "Edit request parameters" %}</a>
{{ block.super }}
<a rel="popup" href="{% url 'maps-manager-layer-edit-request-parameters' slug=object.slug %}">{% trans "Edit request parameters" %}</a>
{% endblock %}

View File

@ -1,58 +1,58 @@
{% load i18n %}
{% block cell-content %}
<h2>{% trans "Notifications" %}</h2>
{% if notifications %}
<div class="links-list">
<ul>
{% for notification in notifications %}
<li class="combo-notification {% if notification.acked %}combo-notification-acked{% endif %}"
data-combo-notification-id="{{ notification.public_id }}">
<a href="{{ notification.url|default:"#" }}">{{ notification.summary }}</a>
{% if notification.body %}
<div class="description">
{{ notification.body|linebreaks }}
<h2>{% trans "Notifications" %}</h2>
{% if notifications %}
<div class="links-list">
<ul>
{% for notification in notifications %}
<li class="combo-notification {% if notification.acked %}combo-notification-acked{% endif %}"
data-combo-notification-id="{{ notification.public_id }}">
<a href="{{ notification.url|default:"#" }}">{{ notification.summary }}</a>
{% if notification.body %}
<div class="description">
{{ notification.body|linebreaks }}
</div>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% else %}
<div class="cell--body">
<p>{% trans 'No notifications.' %}</p>
</div>
{% endif %}
{% else %}
<div class="cell--body">
<p>{% trans 'No notifications.' %}</p>
</div>
{% endif %}
{% if push_notifications_enabled %}
<div class="cell--body notification-buttons">
<div class="notification-push-on" style="display: none"><a href="#" class="pk-button">Activer les notifications</a></div>
<div class="notification-push-off" style="display: none"><a href="#" class="pk-button">Désactiver les notifications</a></div>
</div>
{% if push_notifications_enabled %}
<div class="cell--body notification-buttons">
<div class="notification-push-on" style="display: none"><a href="#" class="pk-button">Activer les notifications</a></div>
<div class="notification-push-off" style="display: none"><a href="#" class="pk-button">Désactiver les notifications</a></div>
</div>
<script>
$(function() {
$('.notification-push-on a').on('click', function() {
$('.notification-push-on').hide();
$('.notification-push-off').hide();
combo_pwa_subscribe_user();
return false;
});
$('.notification-push-off a').on('click', function() {
$('.notification-push-on').hide();
$('.notification-push-off').hide();
combo_pwa_unsubscribe_user();
return false;
});
$(document).on('combo:pwa-user-info', function() {
if (COMBO_PWA_USER_SUBSCRIPTION) {
$('.notification-push-off').show();
} else {
$('.notification-push-on').show();
}
});
}
);
</script>
{% endif %}
<script>
$(function() {
$('.notification-push-on a').on('click', function() {
$('.notification-push-on').hide();
$('.notification-push-off').hide();
combo_pwa_subscribe_user();
return false;
});
$('.notification-push-off a').on('click', function() {
$('.notification-push-on').hide();
$('.notification-push-off').hide();
combo_pwa_unsubscribe_user();
return false;
});
$(document).on('combo:pwa-user-info', function() {
if (COMBO_PWA_USER_SUBSCRIPTION) {
$('.notification-push-off').show();
} else {
$('.notification-push-on').show();
}
});
}
);
</script>
{% endif %}
{% endblock %}

View File

@ -2,15 +2,15 @@
{% load static i18n %}
{% block css %}
{{ block.super }}
<link rel="stylesheet" type="text/css" media="all" href="{% static "css/combo.manager.pwa.css" %}"/>
{{ block.super }}
<link rel="stylesheet" type="text/css" media="all" href="{% static "css/combo.manager.pwa.css" %}"/>
{% endblock %}
{% block appbar %}
<h2>{% trans 'Mobile Application' %}</h2>
<h2>{% trans 'Mobile Application' %}</h2>
{% endblock %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'pwa-manager-homepage' %}">{% trans 'Mobile Application' %}</a>
{{ block.super }}
<a href="{% url 'pwa-manager-homepage' %}">{% trans 'Mobile Application' %}</a>
{% endblock %}

View File

@ -2,16 +2,16 @@
{% load i18n %}
{% block appbar %}
<h2></h2>
<h2></h2>
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'pwa-manager-homepage' %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'pwa-manager-homepage' %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,104 +2,104 @@
{% load i18n thumbnail %}
{% block content %}
<div class="manager-mobile-home-layout">
<div id="mobile-case">
<div class="screen" style="background: {{ theme_color }};">
<div class="mobile-top-bar"><span class="clock">--:--</span></div>
<div class="mobile-app-content">
<div class="splash">
<div class="appicon">
{% if pwa_settings.application_icon %}
{% thumbnail pwa_settings.application_icon '512x512' crop='center' format='PNG' as im %}
<img src="{{ im.url }}" alt="">
{% endthumbnail %}
{% endif %}
<div class="manager-mobile-home-layout">
<div id="mobile-case">
<div class="screen" style="background: {{ theme_color }};">
<div class="mobile-top-bar"><span class="clock">--:--</span></div>
<div class="mobile-app-content">
<div class="splash">
<div class="appicon">
{% if pwa_settings.application_icon %}
{% thumbnail pwa_settings.application_icon '512x512' crop='center' format='PNG' as im %}
<img src="{{ im.url }}" alt="">
{% endthumbnail %}
{% endif %}
</div>
<div class="applabel">{{ pwa_settings.get_application_name }}</div>
</div>
<iframe scrolling="no"></iframe>
</div>
</div>
<div class="applabel">{{ pwa_settings.get_application_name }}</div>
</div>
<div class="sections">
<div class="section pwa-navigation">
<h3>{% trans "Navigation" %}</h3>
<div>
{% if navigation_entries|length %}
<p class="hint">
{% blocktrans %}
Use drag and drop with the ⣿ handles to reorder navigation entries.
{% endblocktrans %}
</p>
{% endif %}
<ul class="objects-list single-links navigation-entries"
data-order-url="{% url 'pwa-manager-navigation-order' %}">
{% for entry in navigation_entries %}
<li data-pk="{{entry.pk}}"><span class="handle"></span>
<a rel="popup" href="{% url 'pwa-manager-navigation-edit' pk=entry.pk %}">{{ entry.get_label }}</a>
<a rel="popup" class="delete" href="{% url 'pwa-manager-navigation-delete' pk=entry.pk %}">{% trans "remove" %}</a>
</li>
{% endfor %}
</ul>
{% if navigation_entries|length < 5 %}
<ul class="objects-list single-links">
<li><a class="add" rel="popup" href="{% url 'pwa-manager-navigation-add' %}">{% trans 'Add a navigation entry' %}</a></li>
</ul>
{% endif %}
</div>
</div>
<iframe scrolling="no"></iframe>
</div>
</div>
</div>
<div class="sections">
<div class="section settings">
<h3>{% trans "Settings" %}</h3>
<div>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
</div>
</form>
</div>
</div>
<div class="section pwa-navigation">
<h3>{% trans "Navigation" %}</h3>
<div>
</div> {# .sections #}
</div> {# .manager-mobile-home-layout #}
{% if navigation_entries|length %}
<p class="hint">
{% blocktrans %}
Use drag and drop with the ⣿ handles to reorder navigation entries.
{% endblocktrans %}
</p>
{% endif %}
<script>
setInterval(function() {
var $clock = $('#mobile-case .clock');
var date = new Date();
$clock.text(('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2));
}, 500);
<ul class="objects-list single-links navigation-entries"
data-order-url="{% url 'pwa-manager-navigation-order' %}">
{% for entry in navigation_entries %}
<li data-pk="{{entry.pk}}"><span class="handle"></span>
<a rel="popup" href="{% url 'pwa-manager-navigation-edit' pk=entry.pk %}">{{ entry.get_label }}</a>
<a rel="popup" class="delete" href="{% url 'pwa-manager-navigation-delete' pk=entry.pk %}">{% trans "remove" %}</a>
</li>
{% endfor %}
</ul>
{% if navigation_entries|length < 5 %}
<ul class="objects-list single-links">
<li><a class="add" rel="popup" href="{% url 'pwa-manager-navigation-add' %}">{% trans 'Add a navigation entry' %}</a></li>
</ul>
{% endif %}
$(function() {
$('.mobile-app-content .splash').on('click', function() {
$('.mobile-app-content iframe').attr('src', '/');
$('.mobile-app-content').addClass('splash-off');
});
if ($('#id_maskable_icon').is(':checked')) {
$('.appicon').addClass('with-maskable-area');
}
$('#id_maskable_icon').on('change', function() {
$('.appicon').toggleClass('with-maskable-area');
});
</div>
</div>
<div class="section settings">
<h3>{% trans "Settings" %}</h3>
<div>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
</div>
</form>
</div>
</div>
</div> {# .sections #}
</div> {# .manager-mobile-home-layout #}
<script>
setInterval(function() {
var $clock = $('#mobile-case .clock');
var date = new Date();
$clock.text(('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2));
}, 500);
$(function() {
$('.mobile-app-content .splash').on('click', function() {
$('.mobile-app-content iframe').attr('src', '/');
$('.mobile-app-content').addClass('splash-off');
});
if ($('#id_maskable_icon').is(':checked')) {
$('.appicon').addClass('with-maskable-area');
}
$('#id_maskable_icon').on('change', function() {
$('.appicon').toggleClass('with-maskable-area');
});
$('.navigation-entries').sortable({
handle: '.handle',
update: function(event, ui) {
var new_order = $('.navigation-entries li').map(function() { return $(this).data('pk'); }).get().join();
$.ajax({
url: $('.navigation-entries').data('order-url'),
data: {'new-order': new_order}
});
}
});
});
</script>
$('.navigation-entries').sortable({
handle: '.handle',
update: function(event, ui) {
var new_order = $('.navigation-entries li').map(function() { return $(this).data('pk'); }).get().join();
$.ajax({
url: $('.navigation-entries').data('order-url'),
data: {'new-order': new_order}
});
}
});
});
</script>
{% endblock %}

View File

@ -1,39 +1,39 @@
{% if entries|length %}
<div class="pwa-navigation" id="pwa-navigation"
{% if include_user_name %}data-pwa-user-name="{% skeleton_extra_placeholder user-name %}{{user.get_full_name}}{% end_skeleton_extra_placeholder %}"{% endif %}>
<div>
<ul>
{% for entry in entries %}
<li class="{{ entry.css_class_names }}{% if entry.link_page in page.get_parents_and_self %} selected{% endif %}" data-entry-pk="{{ entry.pk }}"
{% if entry.notification_count %}data-notification-count-url="{{site_base}}/api/notification/count/"{% endif %}
{% if entry.use_user_name_as_label %}data-include-user-name{% endif %}>
<a href="{{ entry.get_url }}"
{% if entry.icon %}style="background-image: url({{site_base}}{{entry.icon.url}});"{% endif %}
><span>{{ entry.get_label }}</span></a></li>
{% endfor %}
</ul>
</div>
<div class="pwa-navigation" id="pwa-navigation"
{% if include_user_name %}data-pwa-user-name="{% skeleton_extra_placeholder user-name %}{{user.get_full_name}}{% end_skeleton_extra_placeholder %}"{% endif %}>
<div>
<ul>
{% for entry in entries %}
<li class="{{ entry.css_class_names }}{% if entry.link_page in page.get_parents_and_self %} selected{% endif %}" data-entry-pk="{{ entry.pk }}"
{% if entry.notification_count %}data-notification-count-url="{{site_base}}/api/notification/count/"{% endif %}
{% if entry.use_user_name_as_label %}data-include-user-name{% endif %}>
<a href="{{ entry.get_url }}"
{% if entry.icon %}style="background-image: url({{site_base}}{{entry.icon.url}});"{% endif %}
><span>{{ entry.get_label }}</span></a></li>
{% endfor %}
</ul>
</div>
</div>
<script>
$('li[data-include-user-name]').each(function(idx, elem) {
var user_name = $(this).parents('#pwa-navigation').data('pwa-user-name');
if (user_name) {
$(this).find('span').text(user_name);
}
});
$('body.authenticated-user li[data-notification-count-url]').each(function(idx, elem) {
var $entry = $(this);
$.ajax({
url: $entry.data('notification-count-url'),
xhrFields: { withCredentials: true },
async: true,
dataType: 'json',
crossDomain: true,
success: function(data) {
if (data.new) {
$entry.find('span').append(' <span class="badge">' + data.new + '</span>');
}
}});
});
$('li[data-include-user-name]').each(function(idx, elem) {
var user_name = $(this).parents('#pwa-navigation').data('pwa-user-name');
if (user_name) {
$(this).find('span').text(user_name);
}
});
$('body.authenticated-user li[data-notification-count-url]').each(function(idx, elem) {
var $entry = $(this);
$.ajax({
url: $entry.data('notification-count-url'),
xhrFields: { withCredentials: true },
async: true,
dataType: 'json',
crossDomain: true,
success: function(data) {
if (data.new) {
$entry.find('span').append(' <span class="badge">' + data.new + '</span>');
}
}});
});
</script>
{% endif %}

View File

@ -1,60 +1,60 @@
{% load i18n thumbnail %}<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
html, body {
margin: 0; padding: 1rem;
font-family: sans-serif;
background: {{theme_color}};
}
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
html, body {
margin: 0; padding: 1rem;
font-family: sans-serif;
background: {{theme_color}};
}
div.info-text {
background: white;
padding: 1rem;
border-radius: 3px;
max-width: 25rem;
text-align: center;
margin: auto;
}
div.info-text {
background: white;
padding: 1rem;
border-radius: 3px;
max-width: 25rem;
text-align: center;
margin: auto;
}
img {
max-width: 100%;
margin: 0 auto;
display: block;
}
img {
max-width: 100%;
margin: 0 auto;
display: block;
}
p.retry {
margin-top: 2rem;
}
p.retry {
margin-top: 2rem;
}
p.retry a {
border: 1px solid {{theme_color}};
text-decoration: none;
background: white;
padding: 0.5rem 1rem;
border-radius: 3px;
color: inherit;
}
p.retry a {
border: 1px solid {{theme_color}};
text-decoration: none;
background: white;
padding: 0.5rem 1rem;
border-radius: 3px;
color: inherit;
}
</style>
</head>
<body>
<div class="info-text">
{% if pwa_settings.application_icon %}
{% thumbnail pwa_settings.application_icon '512x512' crop='center' format='PNG' as im %}
<img src="{{ im.url }}" alt="">
{% endthumbnail %}
{% endif %}
</style>
</head>
<body>
<div class="info-text">
{% if pwa_settings.application_icon %}
{% thumbnail pwa_settings.application_icon '512x512' crop='center' format='PNG' as im %}
<img src="{{ im.url }}" alt="">
{% endthumbnail %}
{% endif %}
{{ pwa_settings.offline_text|safe }}
{{ pwa_settings.offline_text|safe }}
{% if pwa_settings.offline_retry_button %}
<p class="retry">
<a href=".">{% trans "Retry" %}</a>
</p>
{% endif %}
</div>
</body>
{% if pwa_settings.offline_retry_button %}
<p class="retry">
<a href=".">{% trans "Retry" %}</a>
</p>
{% endif %}
</div>
</body>
</html>

View File

@ -2,17 +2,17 @@
{% load i18n %}
{% block appbar %}
<h2>{{ form.get_title }}</h2>
<h2>{{ form.get_title }}</h2>
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'combo-manager-page-view' pk=cell.page_id %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'combo-manager-page-view' pk=cell.page_id %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,60 +2,60 @@
{% load i18n %}
{% block cell-form %}
{% if cell.has_text_search_service and cell.missing_index %}
<div class="infonotice">
<p>
{% blocktrans %}
Content indexing has been scheduled and should happen within an hour; search
results will then be available.
{% endblocktrans %}
</p>
</div>
{% endif %}
{{ form.as_p }}
{% with cell.get_search_services_for_display as engines %}
{% if engines %}
<p><label>{% trans "Engines:" %}</label></p>
<div>
<ul class="objects-list list-of-links" id="list-of-links-{{ cell.pk }}"
data-link-list-order-url="{% url 'combo-manager-search-engines-order' page_pk=page.pk cell_reference=cell.get_reference %}">
{% for engine in engines %}
<li data-link-item-id="{{ engine.0 }}"><span class="handle"></span>
<span>{{ engine.1 }}{% if engine.2.title %} ({% trans "Custom title:"%}{{ engine.2.title }}){% endif %}</span>
{% if engine.0 == '_text' or engine.0 == 'users' or engine.0|startswith:'cards:' %}
<a rel="popup" title="{% trans "Edit" %}" class="link-action-icon edit" href="{% url 'combo-manager-page-search-cell-update-engine' page_pk=page.pk cell_reference=cell.get_reference engine_slug=engine.0 %}">{% trans "Edit" %}</a>
{% endif %}
<a title="{% trans "Delete" %}" class="link-action-icon delete" href="{% url 'combo-manager-page-search-cell-delete-engine' page_pk=page.pk cell_reference=cell.get_reference engine_slug=engine.0 %}">{% trans "Delete" %}</a>
</li>
{% endfor %}
</ul>
</div>
<script>
$(function () {
$('#list-of-links-{{ cell.pk }}').sortable({
handle: '.handle',
update: function(event, ui) {
var new_order = Object();
$(this).find('li').each(function(i, x) {
var suffix = $(x).data('link-item-id');
new_order['pos_' + suffix] = i;
});
$.ajax({
url: $(this).data('link-list-order-url'),
data: new_order
});
}
});
});
</script>
{% endif %}
{% endwith %}
{% if cell.available_engines %}
<div class="search-engine-add">
{% trans "Add an engine:" %}
{% for key, engine in cell.available_engines.items %}
<a {% if key == '_text' or key == 'users' or key|startswith:'cards:' %}rel="popup"{% endif %} href="{% url 'combo-manager-page-search-cell-add-engine' page_pk=page.pk cell_reference=cell.get_reference engine_slug=key %}">{{ engine.label }}</a> {% if not forloop.last %}|{% endif %}
{% endfor %}
</div>
{% endif %}
{% if cell.has_text_search_service and cell.missing_index %}
<div class="infonotice">
<p>
{% blocktrans %}
Content indexing has been scheduled and should happen within an hour; search
results will then be available.
{% endblocktrans %}
</p>
</div>
{% endif %}
{{ form.as_p }}
{% with cell.get_search_services_for_display as engines %}
{% if engines %}
<p><label>{% trans "Engines:" %}</label></p>
<div>
<ul class="objects-list list-of-links" id="list-of-links-{{ cell.pk }}"
data-link-list-order-url="{% url 'combo-manager-search-engines-order' page_pk=page.pk cell_reference=cell.get_reference %}">
{% for engine in engines %}
<li data-link-item-id="{{ engine.0 }}"><span class="handle"></span>
<span>{{ engine.1 }}{% if engine.2.title %} ({% trans "Custom title:"%}{{ engine.2.title }}){% endif %}</span>
{% if engine.0 == '_text' or engine.0 == 'users' or engine.0|startswith:'cards:' %}
<a rel="popup" title="{% trans "Edit" %}" class="link-action-icon edit" href="{% url 'combo-manager-page-search-cell-update-engine' page_pk=page.pk cell_reference=cell.get_reference engine_slug=engine.0 %}">{% trans "Edit" %}</a>
{% endif %}
<a title="{% trans "Delete" %}" class="link-action-icon delete" href="{% url 'combo-manager-page-search-cell-delete-engine' page_pk=page.pk cell_reference=cell.get_reference engine_slug=engine.0 %}">{% trans "Delete" %}</a>
</li>
{% endfor %}
</ul>
</div>
<script>
$(function () {
$('#list-of-links-{{ cell.pk }}').sortable({
handle: '.handle',
update: function(event, ui) {
var new_order = Object();
$(this).find('li').each(function(i, x) {
var suffix = $(x).data('link-item-id');
new_order['pos_' + suffix] = i;
});
$.ajax({
url: $(this).data('link-list-order-url'),
data: new_order
});
}
});
});
</script>
{% endif %}
{% endwith %}
{% if cell.available_engines %}
<div class="search-engine-add">
{% trans "Add an engine:" %}
{% for key, engine in cell.available_engines.items %}
<a {% if key == '_text' or key == 'users' or key|startswith:'cards:' %}rel="popup"{% endif %} href="{% url 'combo-manager-page-search-cell-add-engine' page_pk=page.pk cell_reference=cell.get_reference engine_slug=key %}">{{ engine.label }}</a> {% if not forloop.last %}|{% endif %}
{% endfor %}
</div>
{% endif %}
{% endblock %}

View File

@ -1,19 +1,19 @@
{% load i18n %}
{% if query %}
{% if cell.has_multiple_search_services %}<p class="search-service-label">{{ search_service_label }}</p>{% endif %}
{% if results.data %}
<div class="links-list">
<ul>
{% for item in results.data %}
<li><a href="{{ item.url }}">{{ item.text }}</a>
{% if item.description %}<div>{{ item.description|safe }}</div>{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% else %}
<div class="infonotice">
{% trans "…no result found." %}
</div>
{% endif %}
{% if cell.has_multiple_search_services %}<p class="search-service-label">{{ search_service_label }}</p>{% endif %}
{% if results.data %}
<div class="links-list">
<ul>
{% for item in results.data %}
<li><a href="{{ item.url }}">{{ item.text }}</a>
{% if item.description %}<div>{{ item.description|safe }}</div>{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% else %}
<div class="infonotice">
{% trans "…no result found." %}
</div>
{% endif %}
{% endif %}

View File

@ -1,83 +1,83 @@
{% load i18n %}
{% block cell-content %}
{% if cell.title %}
<h2>{{ cell.title }}</h2>
{% endif %}
{% block search-form-pre %}
{% endblock %}
{% block search-form %}
<form id="combo-search-form-{{ cell.pk }}" class="combo-search-form">
<input type="search" name="q" autocomplete="off" id="combo-search-input-{{ cell.pk }}" class="combo-search-input" {% if cell.autofocus %}autofocus {% endif %}{% if cell.input_placeholder %}placeholder="{{ cell.input_placeholder }}" {% endif %}/>
<button class="submit-button combo-search--button" aria-label="{% trans 'Search' %}">
<span class="combo-search--button-label">{% block submit-content %}{% trans 'Search' %}{% endblock %}</span>
</button>
</form>
{% endblock %}
{% block search-results %}
{% for search_service in cell.search_services %}
<div id="combo-search-results-{{ cell.pk }}-{{ forloop.counter }}" class="combo-search-results combo-search-results-{{ search_service.slug }}"></div>
{% endfor %}
{% endblock %}
{% block search-js %}
<script>
$(function() {
var timeout;
var last_search = null;
var $form = $('#combo-search-form-{{ cell.pk }}');
var $input = $('#combo-search-input-{{ cell.pk }}');
{% for search_service in cell.search_services %}
var $results_{{ forloop.counter }} = $('#combo-search-results-{{ cell.pk }}-{{ forloop.counter }}');
var xhr_{{ forloop.counter }} = null;
var url_{{ forloop.counter }} = '{% url 'combo-search-ajax-results' cell_pk=cell.pk service_slug=search_service.slug %}{% if initial_query_string %}?{{ initial_query_string }}{% endif %}';
{% endfor %}
function update() {
var new_search = $input.val();
if (new_search == last_search) return;
last_search = new_search;
$form.addClass('searching');
var count = {{ cell.search_services|length }};
{% for search_service in cell.search_services %}
if (xhr_{{ forloop.counter }}) xhr_{{ forloop.counter }}.abort();
xhr_{{ forloop.counter }} = $.get(url_{{ forloop.counter }},
{'q': new_search},
function (response) {
xhr_{{ forloop.counter }} = null;
$results_{{ forloop.counter }}.html(response);
count--;
if (count == 0) {
$form.removeClass('searching');
}
}
);
{% endfor %}
};
$input.on('paste keyup', function() {
clearTimeout(timeout);
timeout = setTimeout(update, 300);
});
$input.on('change', function() {
clearTimeout(timeout);
update(this);
});
$form.on('submit', function() {
last_search = null; // make explicit submit search in all cases
clearTimeout(timeout);
update();
return false;
});
{% if initial_q %}
$input.val('{{ initial_q }}');
update();
{% if cell.title %}
<h2>{{ cell.title }}</h2>
{% endif %}
});
</script>
{% endblock %}
{% block search-form-pre %}
{% endblock %}
{% block search-form %}
<form id="combo-search-form-{{ cell.pk }}" class="combo-search-form">
<input type="search" name="q" autocomplete="off" id="combo-search-input-{{ cell.pk }}" class="combo-search-input" {% if cell.autofocus %}autofocus {% endif %}{% if cell.input_placeholder %}placeholder="{{ cell.input_placeholder }}" {% endif %}/>
<button class="submit-button combo-search--button" aria-label="{% trans 'Search' %}">
<span class="combo-search--button-label">{% block submit-content %}{% trans 'Search' %}{% endblock %}</span>
</button>
</form>
{% endblock %}
{% block search-results %}
{% for search_service in cell.search_services %}
<div id="combo-search-results-{{ cell.pk }}-{{ forloop.counter }}" class="combo-search-results combo-search-results-{{ search_service.slug }}"></div>
{% endfor %}
{% endblock %}
{% block search-js %}
<script>
$(function() {
var timeout;
var last_search = null;
var $form = $('#combo-search-form-{{ cell.pk }}');
var $input = $('#combo-search-input-{{ cell.pk }}');
{% for search_service in cell.search_services %}
var $results_{{ forloop.counter }} = $('#combo-search-results-{{ cell.pk }}-{{ forloop.counter }}');
var xhr_{{ forloop.counter }} = null;
var url_{{ forloop.counter }} = '{% url 'combo-search-ajax-results' cell_pk=cell.pk service_slug=search_service.slug %}{% if initial_query_string %}?{{ initial_query_string }}{% endif %}';
{% endfor %}
function update() {
var new_search = $input.val();
if (new_search == last_search) return;
last_search = new_search;
$form.addClass('searching');
var count = {{ cell.search_services|length }};
{% for search_service in cell.search_services %}
if (xhr_{{ forloop.counter }}) xhr_{{ forloop.counter }}.abort();
xhr_{{ forloop.counter }} = $.get(url_{{ forloop.counter }},
{'q': new_search},
function (response) {
xhr_{{ forloop.counter }} = null;
$results_{{ forloop.counter }}.html(response);
count--;
if (count == 0) {
$form.removeClass('searching');
}
}
);
{% endfor %}
};
$input.on('paste keyup', function() {
clearTimeout(timeout);
timeout = setTimeout(update, 300);
});
$input.on('change', function() {
clearTimeout(timeout);
update(this);
});
$form.on('submit', function() {
last_search = null; // make explicit submit search in all cases
clearTimeout(timeout);
update();
return false;
});
{% if initial_q %}
$input.val('{{ initial_q }}');
update();
{% endif %}
});
</script>
{% endblock %}
{% endblock %}

View File

@ -1,22 +1,22 @@
{% load i18n %}
{% block cell-content %}
{% if all_formdefs %}
<h2>{% trans "New Form" %}</h2>
{% for site_formdefs in all_formdefs.values %}
<div class="links-list">
{% if all_formdefs.keys|length > 1 %}<h3>{{ site_formdefs.title }}</h3>{% endif %}
<ul>
{% regroup site_formdefs.data|dictsort:"category" by category as categories_formdefs %}
{% for category_formdefs in categories_formdefs %}
<li><h4>{{ category_formdefs.grouper }}</h4></li>
{% for formdef in category_formdefs.list|dictsort:"title" %}
<li><a class="wcs-bo-submission-link" href="{{formdef.backoffice_submission_url}}?{% if name_id %}NameID={{name_id}}&{% endif %}ReturnURL={{ absolute_uri|iriencode }}">{{formdef.title}}</a></li>
{% if all_formdefs %}
<h2>{% trans "New Form" %}</h2>
{% for site_formdefs in all_formdefs.values %}
<div class="links-list">
{% if all_formdefs.keys|length > 1 %}<h3>{{ site_formdefs.title }}</h3>{% endif %}
<ul>
{% regroup site_formdefs.data|dictsort:"category" by category as categories_formdefs %}
{% for category_formdefs in categories_formdefs %}
<li><h4>{{ category_formdefs.grouper }}</h4></li>
{% for formdef in category_formdefs.list|dictsort:"title" %}
<li><a class="wcs-bo-submission-link" href="{{formdef.backoffice_submission_url}}?{% if name_id %}NameID={{name_id}}&{% endif %}ReturnURL={{ absolute_uri|iriencode }}">{{formdef.title}}</a></li>
{% endfor %}
{% endfor %}
</ul>
</div>
{% endfor %}
{% endfor %}
</ul>
</div>
{% endfor %}
{% elif not combo_hide_empty_message %}
<div class="cell--body"><p class="empty-message">{% trans "There are no possible backoffice submissions." %}</p></div>
{% endif %}
{% elif not combo_hide_empty_message %}
<div class="cell--body"><p class="empty-message">{% trans "There are no possible backoffice submissions." %}</p></div>
{% endif %}
{% endblock %}

View File

@ -1,29 +1,29 @@
{% load combo %}{% spaceless %}
{% if field.type == "text" and field.display_mode == 'rich' and value %}
{% if cell.display_mode == 'table' or cell.display_mode == 'card' and item.display_mode == 'text' %}
<div class="value">{{ value|safe }}</div>
{% if field.type == "text" and field.display_mode == 'rich' and value %}
{% if cell.display_mode == 'table' or cell.display_mode == 'card' and item.display_mode == 'text' %}
<div class="value">{{ value|safe }}</div>
{% else %}
{{ value|striptags }}
{% endif %}
{% elif field.type == "text" and mode != 'inline' and value %}
<div class="value">{{ field|format_text:value }}</div>
{% else %}
{{ value|striptags }}
{% if not mode == 'inline' %}<div class="value">{% endif %}
{% if field.type == "date" %}
{{ value|date }}
{% elif field.type == "bool" and value is not None %}
{{ value|yesno }}
{% elif field.type == "email" and value is not None %}
<a class="pk-card-field-email" href="mailto:{{ value }}">{{ value }}</a>
{% elif field.type == 'file' and value %}
{% if value.content_type|startswith:"image/" %}
<img alt="" src="{% make_public_url url=value.url %}">
{% else %}
<a class="pk-card-field-filename" href="{% make_public_url url=value.url %}" download="{{ value.filename }}">{{ value.filename }}</a>
{% endif %}
{% else %}
{{ value|default:""|urlize }}
{% endif %}
{% if not mode == 'inline' %}</div>{% endif %}
{% endif %}
{% elif field.type == "text" and mode != 'inline' and value %}
<div class="value">{{ field|format_text:value }}</div>
{% else %}
{% if not mode == 'inline' %}<div class="value">{% endif %}
{% if field.type == "date" %}
{{ value|date }}
{% elif field.type == "bool" and value is not None %}
{{ value|yesno }}
{% elif field.type == "email" and value is not None %}
<a class="pk-card-field-email" href="mailto:{{ value }}">{{ value }}</a>
{% elif field.type == 'file' and value %}
{% if value.content_type|startswith:"image/" %}
<img alt="" src="{% make_public_url url=value.url %}">
{% else %}
<a class="pk-card-field-filename" href="{% make_public_url url=value.url %}" download="{{ value.filename }}">{{ value.filename }}</a>
{% endif %}
{% else %}
{{ value|default:""|urlize }}
{% endif %}
{% if not mode == 'inline' %}</div>{% endif %}
{% endif %}
{% endspaceless %}

View File

@ -1,103 +1,103 @@
{% load i18n %}
{% block cell-content %}
{% if not card_not_found %}
{% if not card_not_found %}
{% block cell-header %}
{% if title %}<h2>{{ title|force_escape }}</h2>{% endif %}
{% include "combo/asset_picture_fragment.html" %}
{% endblock %}
{% block cell-header %}
{% if title %}<h2>{{ title|force_escape }}</h2>{% endif %}
{% include "combo/asset_picture_fragment.html" %}
{% endblock %}
{% if card.id %}
{% spaceless %}
{% if cell.custom_schema %}
{% if cell.custom_schema.cells %}
<div class="cell--body">
{% with cell.get_custom_schema as custom_schema %}
<div class="{{ custom_schema.grid_class }}">
{% for item in custom_schema.cells %}
{% if item.varname == "@custom@" %}
{% if item.template %}
<div class="{{ item.cell_size|default:"" }}">
{% with card.custom_fields|get:item.template|force_escape as value %}
{% if item.display_mode == "title" %}
<h3>{{ value }}</h3>
{% elif item.display_mode == "subtitle" %}
<h4>{{ value }}</h4>
{% elif item.display_mode == "label" %}
<div class="label">{{ value }}</div>
{% elif item.display_mode == "text" %}
<div class="value">{{ value }}</div>
{% endif %}
{% endwith %}
</div>
{% endif %}
{% elif item.varname == "@link@" %}
{% if item.template and item.page|default:item.url_template %}
<div class="{{ item.cell_size|default:"" }}">
{% with item.page|default:item.url_template as url_key %}
{% with card.custom_fields|get:item.template|force_escape as link_label and card.urls|get:url_key|force_escape as link_url %}
{% if link_label and link_url %}
<div class="value"><a href="{{ link_url }}"{% if item.display_mode == 'button' %} class="pk-button"{% endif %}>{{ link_label }}</a></div>
{% endif %}
{% endwith %}
{% endwith %}
</div>
{% if card.id %}
{% spaceless %}
{% if cell.custom_schema %}
{% if cell.custom_schema.cells %}
<div class="cell--body">
{% with cell.get_custom_schema as custom_schema %}
<div class="{{ custom_schema.grid_class }}">
{% for item in custom_schema.cells %}
{% if item.varname == "@custom@" %}
{% if item.template %}
<div class="{{ item.cell_size|default:"" }}">
{% with card.custom_fields|get:item.template|force_escape as value %}
{% if item.display_mode == "title" %}
<h3>{{ value }}</h3>
{% elif item.display_mode == "subtitle" %}
<h4>{{ value }}</h4>
{% elif item.display_mode == "label" %}
<div class="label">{{ value }}</div>
{% elif item.display_mode == "text" %}
<div class="value">{{ value }}</div>
{% endif %}
{% endwith %}
</div>
{% endif %}
{% elif item.varname == "@link@" %}
{% if item.template and item.page|default:item.url_template %}
<div class="{{ item.cell_size|default:"" }}">
{% with item.page|default:item.url_template as url_key %}
{% with card.custom_fields|get:item.template|force_escape as link_label and card.urls|get:url_key|force_escape as link_url %}
{% if link_label and link_url %}
<div class="value"><a href="{{ link_url }}"{% if item.display_mode == 'button' %} class="pk-button"{% endif %}>{{ link_label }}</a></div>
{% endif %}
{% endwith %}
{% endwith %}
</div>
{% endif %}
{% else %}
{% if item.varname %}
{% with fields_by_varnames|get:item.varname as field %}
{% if field %}
{% with card.fields|get:item.varname as value %}
{% if value or item.empty_value != '@skip@' %}
<div class="{{ item.cell_size|default:"" }}">
{% if item.display_mode == "title" %}
{% include "combo/wcs/card-field-as-title.html" with title_tag="h3" %}
{% elif item.display_mode == "subtitle" %}
{% include "combo/wcs/card-field-as-title.html" with title_tag="h4" %}
{% elif item.display_mode == "text" %}
{% if value or item.empty_value == '@empty@' %}
{% include "combo/wcs/card-field-as-text.html" %}
{% else %}
{% with item.empty_value as value %}
{% include "combo/wcs/card-field-as-text.html" %}
{% endwith %}
{% endif %}
{% endif %}
</div>
{% endif %}
{% endwith %}
{% endif %}
{% endwith %}
{% endif %}
{% endif %}
{% endfor%}
</div>
{% endwith %}
</div>
{% endif %}
{% else %}
{% if item.varname %}
{% with fields_by_varnames|get:item.varname as field %}
{% if field %}
{% with card.fields|get:item.varname as value %}
{% if value or item.empty_value != '@skip@' %}
<div class="{{ item.cell_size|default:"" }}">
{% if item.display_mode == "title" %}
{% include "combo/wcs/card-field-as-title.html" with title_tag="h3" %}
{% elif item.display_mode == "subtitle" %}
{% include "combo/wcs/card-field-as-title.html" with title_tag="h4" %}
{% elif item.display_mode == "text" %}
{% if value or item.empty_value == '@empty@' %}
{% include "combo/wcs/card-field-as-text.html" %}
{% else %}
{% with item.empty_value as value %}
{% include "combo/wcs/card-field-as-text.html" %}
<div class="cell--body">
{% for field in schema.fields %}
{% if 'varname' in field and field.varname %}
{% with card.fields|get:field.varname as value %}
<div class="card--auto-field">
<div class="label">{{ field.label }}</div>
{% include "combo/wcs/card-field-value.html" %}
</div>
{% endwith %}
{% endif %}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% endwith %}
{% endif %}
{% endwith %}
{% endif %}
{% endif %}
{% endfor%}
</div>
{% endwith %}
</div>
{% endif %}
{% endspaceless %}
{% else %}
<div class="cell--body">
<p>{% trans 'Unknown Card' %}</p>
</div>
{% endif %}
{% else %}
<div class="cell--body">
{% for field in schema.fields %}
{% if 'varname' in field and field.varname %}
{% with card.fields|get:field.varname as value %}
<div class="card--auto-field">
<div class="label">{{ field.label }}</div>
{% include "combo/wcs/card-field-value.html" %}
</div>
{% endwith %}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% endspaceless %}
{% else %}
<div class="cell--body">
<p>{% trans 'Unknown Card' %}</p>
</div>
{% endif %}
{% endif %}
{% endblock %}

View File

@ -1,35 +1,35 @@
{% spaceless %}
{% if item.varname == "@custom@" %}
{% if item.template %}
{% with card.custom_fields|get:item.template|force_escape as value %}
{% if not ul_display %}<td>{% endif %}{{ value }}{% if not ul_display %}</td>{% endif %}
{% endwith %}
{% endif %}
{% elif item.varname == "@link@" %}
{% if item.template and item.page|default:item.url_template %}
{% with item.page|default:item.url_template as url_key %}
{% with card.custom_fields|get:item.template|force_escape as link_label and card.urls|get:url_key|force_escape as link_url %}
{% if not ul_display %}<td>{% endif %}
{% if link_label and link_url %}
<a href="{{ link_url }}"{% if item.display_mode == 'button' %} class="pk-button"{% endif %}>{{ link_label }}</a>
{% if item.varname == "@custom@" %}
{% if item.template %}
{% with card.custom_fields|get:item.template|force_escape as value %}
{% if not ul_display %}<td>{% endif %}{{ value }}{% if not ul_display %}</td>{% endif %}
{% endwith %}
{% endif %}
{% elif item.varname == "@link@" %}
{% if item.template and item.page|default:item.url_template %}
{% with item.page|default:item.url_template as url_key %}
{% with card.custom_fields|get:item.template|force_escape as link_label and card.urls|get:url_key|force_escape as link_url %}
{% if not ul_display %}<td>{% endif %}
{% if link_label and link_url %}
<a href="{{ link_url }}"{% if item.display_mode == 'button' %} class="pk-button"{% endif %}>{{ link_label }}</a>
{% endif %}
{% if not ul_display %}</td>{% endif %}
{% endwith %}
{% endwith %}
{% endif %}
{% if not ul_display %}</td>{% endif %}
{% endwith %}
{% endwith %}
{% endif %}
{% else %}
{% if item.varname %}
{% with fields_by_varnames|get:item.varname as field %}
{% if field %}
{% with card.fields|get:item.varname as value %}
{% if value %}
{% if not ul_display %}<td>{% endif %}{% include "combo/wcs/card-field-value.html" with mode='inline' %}{% if not ul_display %}</td>{% endif %}
{% else %}
{% if not ul_display %}<td>{% endif %}{% include "combo/wcs/card-field-value.html" with mode='inline' value=item.empty_value %}{% if not ul_display %}</td>{% endif %}
{% if item.varname %}
{% with fields_by_varnames|get:item.varname as field %}
{% if field %}
{% with card.fields|get:item.varname as value %}
{% if value %}
{% if not ul_display %}<td>{% endif %}{% include "combo/wcs/card-field-value.html" with mode='inline' %}{% if not ul_display %}</td>{% endif %}
{% else %}
{% if not ul_display %}<td>{% endif %}{% include "combo/wcs/card-field-value.html" with mode='inline' value=item.empty_value %}{% if not ul_display %}</td>{% endif %}
{% endif %}
{% endwith %}
{% endif %}
{% endwith %}
{% endif %}
{% endif %}
{% endwith %}
{% endif %}
{% endwith %}
{% endif %}
{% endif %}
{% endspaceless %}

View File

@ -2,71 +2,71 @@
{% block cell-content %}
{% block cell-header %}
{% if title %}<h2>{{ title|force_escape }}</h2>{% endif %}
{% include "combo/asset_picture_fragment.html" %}
{% endblock %}
{% block cell-header %}
{% if title %}<h2>{{ title|force_escape }}</h2>{% endif %}
{% include "combo/asset_picture_fragment.html" %}
{% endblock %}
{% if card_objects %}
{% with cell.get_custom_schema as custom_schema %}
{% if cell.custom_schema and cell.custom_schema.cells|length > 1 %}
<div class="pk-table-wrapper">
<table class="pk-data-table pk-table-headers">
{% if custom_schema.grid_headers %}
<thead>
{% for item in custom_schema.cells %}
{% if item.varname == "@custom@" %}
{% if item.template %}
<th>{{ item.header|default:"" }}</th>
{% if card_objects %}
{% with cell.get_custom_schema as custom_schema %}
{% if cell.custom_schema and cell.custom_schema.cells|length > 1 %}
<div class="pk-table-wrapper">
<table class="pk-data-table pk-table-headers">
{% if custom_schema.grid_headers %}
<thead>
{% for item in custom_schema.cells %}
{% if item.varname == "@custom@" %}
{% if item.template %}
<th>{{ item.header|default:"" }}</th>
{% endif %}
{% elif item.varname == "@link@" %}
{% if item.template and item.page|default:item.url_template %}
<th>{{ item.header|default:"" }}</th>
{% endif %}
{% else %}
{% if item.varname %}
{% with fields_by_varnames|get:item.varname as field %}
{% if field %}
<th>{{ field.label }}</th>
{% endif %}
{% endwith %}
{% endif %}
{% endif %}
{% endfor %}
</thead>
{% endif %}
<tbody>
{% for card in card_objects %}
<tr>
{% for item in custom_schema.cells %}
{% include "combo/wcs/cards-field.html" %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="links-list cards-{{ cell.card_slug }} list-of-cards">
<ul>
{% for card in card_objects %}
<li>
{% spaceless %}
{% if custom_schema %}
{% include "combo/wcs/cards-field.html" with item=custom_schema.cells.0 ul_display=True %}
{% else %}
<a href="{% if card_page_base_url %}{{ card_page_base_url }}{{ card.id }}/{% else %}{{ card.url }}{% endif %}"><span class="card-title">{{ card.text }}</span></a>
{% endif %}
{% endspaceless %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% elif item.varname == "@link@" %}
{% if item.template and item.page|default:item.url_template %}
<th>{{ item.header|default:"" }}</th>
{% endif %}
{% else %}
{% if item.varname %}
{% with fields_by_varnames|get:item.varname as field %}
{% if field %}
<th>{{ field.label }}</th>
{% endif %}
{% endwith %}
{% endif %}
{% endif %}
{% endfor %}
</thead>
{% include "combo/pagination.html" %}
{% endwith %}
{% else %}
<div class="cell--body"><p class="empty-message">{% trans "There are no cards." %}</p></div>
{% endif %}
<tbody>
{% for card in card_objects %}
<tr>
{% for item in custom_schema.cells %}
{% include "combo/wcs/cards-field.html" %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="links-list cards-{{ cell.card_slug }} list-of-cards">
<ul>
{% for card in card_objects %}
<li>
{% spaceless %}
{% if custom_schema %}
{% include "combo/wcs/cards-field.html" with item=custom_schema.cells.0 ul_display=True %}
{% else %}
<a href="{% if card_page_base_url %}{{ card_page_base_url }}{{ card.id }}/{% else %}{{ card.url }}{% endif %}"><span class="card-title">{{ card.text }}</span></a>
{% endif %}
{% endspaceless %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% include "combo/pagination.html" %}
{% endwith %}
{% else %}
<div class="cell--body"><p class="empty-message">{% trans "There are no cards." %}</p></div>
{% endif %}
{% endblock %}

View File

@ -1,37 +1,37 @@
{% load i18n combo %}
{% block cell-content %}
{% for slug, forms in care_forms.items %}
<h2>{% if cell.custom_title %}{{ cell.custom_title }}{% else %}{% trans "Forms to process" %} - {{ forms.title }}{% endif %}</h2>
{% if forms.data %}
<table id="listing" class="main clickable-rows">
<thead>
<tr>
<th><span>{% trans "Form" %}</span></th>
<th><span>{% trans "Reference" %}</span></th>
<th><span>{% trans "Created" %}</span></th>
<th><span>{% trans "Last Modified" %}</span></th>
<th><span>{% trans "Status" %}</span></th>
</tr>
</thead>
<tbody>
{% for data in forms.data|dictsortreversed:"form_receipt_datetime" %}
<tr>
<td>{{ data.name }} {% if data.form_digest %}<br><small>{{ data.form_digest }}</small>{% endif %}</td>
{% if is_portal_agent %}
<td><a href="{{ data.form_url_backoffice }}">{{ data.form_number }}</a></td>
{% else %}
<td><a href="{{ data.form_url }}">{{ data.form_number }}</a></td>
{% endif %}
<td>{{ data.datetime|strptime:"%Y-%m-%d %H:%M:%S" }}</td>
<td>{{ data.last_update_time|strptime:"%Y-%m-%d %H:%M:%S" }}</td>
<td>{{ data.status }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if is_portal_agent %}
<p><a class="pk-button" href="{{ forms.url }}backoffice/management/listing{% if forms.categories %}?category_slugs={{ forms.categories|join:"," }}{% endif %}">{% trans "See all forms" %}</a></p>
{% endif %}
{% endfor %}
{% for slug, forms in care_forms.items %}
<h2>{% if cell.custom_title %}{{ cell.custom_title }}{% else %}{% trans "Forms to process" %} - {{ forms.title }}{% endif %}</h2>
{% if forms.data %}
<table id="listing" class="main clickable-rows">
<thead>
<tr>
<th><span>{% trans "Form" %}</span></th>
<th><span>{% trans "Reference" %}</span></th>
<th><span>{% trans "Created" %}</span></th>
<th><span>{% trans "Last Modified" %}</span></th>
<th><span>{% trans "Status" %}</span></th>
</tr>
</thead>
<tbody>
{% for data in forms.data|dictsortreversed:"form_receipt_datetime" %}
<tr>
<td>{{ data.name }} {% if data.form_digest %}<br><small>{{ data.form_digest }}</small>{% endif %}</td>
{% if is_portal_agent %}
<td><a href="{{ data.form_url_backoffice }}">{{ data.form_number }}</a></td>
{% else %}
<td><a href="{{ data.form_url }}">{{ data.form_number }}</a></td>
{% endif %}
<td>{{ data.datetime|strptime:"%Y-%m-%d %H:%M:%S" }}</td>
<td>{{ data.last_update_time|strptime:"%Y-%m-%d %H:%M:%S" }}</td>
<td>{{ data.status }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if is_portal_agent %}
<p><a class="pk-button" href="{{ forms.url }}backoffice/management/listing{% if forms.categories %}?category_slugs={{ forms.categories|join:"," }}{% endif %}">{% trans "See all forms" %}</a></p>
{% endif %}
{% endfor %}
{% endblock %}

View File

@ -1,6 +1,6 @@
{% block cell-content %}
<div class="wcs-category-{{slug}}">
<h2><a href="{{ url }}">{{ title }}</a></h2>
{{ description|safe }}
</div>
<div class="wcs-category-{{slug}}">
<h2><a href="{{ url }}">{{ title }}</a></h2>
{{ description|safe }}
</div>
{% endblock %}

View File

@ -1,24 +1,24 @@
{% load i18n %}
{% block cell-content %}
<h2>{% trans 'Current Drafts' %}</h2>
{% if drafts %}
{% for slug, forms in current_drafts.items %}
<div class="links-list current-drafts-{{ slug }} current-drafts list-of-forms">
{% if forms.data %}
<ul>
{% for data in forms.data %}
{% if data.url and data.title and not data.form_status_is_endpoint %}
<li class="{{data.status_css_class}} {% if data.form_status_is_endpoint %}done{% endif %}"><a
href="{{ data.url }}"><span class="form-title">{{ data.name }}</span>
<span class="form-number">{{data.datetime|strptime:"%Y-%m-%d %H:%M:%S"}}</span>
<span class="form-status">{% trans 'draft' %}</span></a></li>
{% endif %}
<h2>{% trans 'Current Drafts' %}</h2>
{% if drafts %}
{% for slug, forms in current_drafts.items %}
<div class="links-list current-drafts-{{ slug }} current-drafts list-of-forms">
{% if forms.data %}
<ul>
{% for data in forms.data %}
{% if data.url and data.title and not data.form_status_is_endpoint %}
<li class="{{data.status_css_class}} {% if data.form_status_is_endpoint %}done{% endif %}"><a
href="{{ data.url }}"><span class="form-title">{{ data.name }}</span>
<span class="form-number">{{data.datetime|strptime:"%Y-%m-%d %H:%M:%S"}}</span>
<span class="form-status">{% trans 'draft' %}</span></a></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</div>
{% endfor %}
</ul>
{% endif %}
</div>
{% endfor %}
{% include "combo/pagination.html" %}
{% else %}
<div class="cell--body"><p class="empty-message">{% trans "There are no current drafts." %}</p></div>{% endif %}
{% include "combo/pagination.html" %}
{% else %}
<div class="cell--body"><p class="empty-message">{% trans "There are no current drafts." %}</p></div>{% endif %}
{% endblock %}

View File

@ -1,14 +1,14 @@
{% load i18n %}
{% block cell-content %}
<h2>{{ cell.custom_title|default:_('Current Forms') }}</h2>
{% if forms %}
{% for slug, forms in current_forms.items %}
<div class="links-list current-forms-{{ slug }} current-forms list-of-forms">
{% include "combo/wcs/list_of_forms.html" %}
</div>
{% endfor %}
{% include "combo/pagination.html" %}
{% else %}
<div class="cell--body"><p class="empty-message">{% trans "There are no current forms." %}</p></div>
{% endif %}
<h2>{{ cell.custom_title|default:_('Current Forms') }}</h2>
{% if forms %}
{% for slug, forms in current_forms.items %}
<div class="links-list current-forms-{{ slug }} current-forms list-of-forms">
{% include "combo/wcs/list_of_forms.html" %}
</div>
{% endfor %}
{% include "combo/pagination.html" %}
{% else %}
<div class="cell--body"><p class="empty-message">{% trans "There are no current forms." %}</p></div>
{% endif %}
{% endblock %}

View File

@ -1,5 +1,5 @@
{% block cell-content %}
<div class="wcs-form-{{slug}}">
{% include "combo/wcs/form_link_fragment.html" %}
</div>
<div class="wcs-form-{{slug}}">
{% include "combo/wcs/form_link_fragment.html" %}
</div>
{% endblock %}

View File

@ -1,14 +1,14 @@
{% load i18n %}
{% block cell-content %}
<h2>{% trans 'Form Categories' %}</h2>
{% for slug, categories in form_categories.items %}
<div class="categories-{{ slug }}">
<h3>{{ categories.title }}</h3>
<ul>
{% for data in categories.data %}
<li><a href="{{ data.url }}">{{ data.title }}</a></li>
{% endfor %}
</ul>
</div>
{% endfor %}
<h2>{% trans 'Form Categories' %}</h2>
{% for slug, categories in form_categories.items %}
<div class="categories-{{ slug }}">
<h3>{{ categories.title }}</h3>
<ul>
{% for data in categories.data %}
<li><a href="{{ data.url }}">{{ data.title }}</a></li>
{% endfor %}
</ul>
</div>
{% endfor %}
{% endblock %}

View File

@ -1,14 +1,14 @@
{% firstof form.url url as form_url %}
{% firstof form.title title as form_title %}
{% autoescape off %}
{% firstof form.description description as form_description %}
{% firstof form.description description as form_description %}
{% endautoescape %}
{% block form-link-pre %}{% endblock %}
<a href="{{ form_url }}{% if not request_is_a_bot %}tryauth?cancelurl={{ absolute_uri|urlencode|iriencode }}{% endif %}">{% block form-link-title %}{{ form_title }}{% endblock %}</a>
{% if form_description %}
<div class="description">{% block form-link-description %}{{ form_description|safe }}{% endblock %}</div>
<div class="description">{% block form-link-description %}{{ form_description|safe }}{% endblock %}</div>
{% endif %}
{% block form-link-post %}{% endblock %}

View File

@ -1,38 +1,38 @@
{% load assets i18n %}
{% block cell-content %}
{% if forms or combo_display_even_empty_categories %}
{% block cell-header %}
<h2>{{ title }}</h2>
{% include "combo/asset_picture_fragment.html" %}
{% if description %}
<div class="intro">
{{ description|safe }}
</div>
{% endif %}
{% endblock %}
{% if forms or combo_display_even_empty_categories %}
{% block cell-header %}
<h2>{{ title }}</h2>
{% include "combo/asset_picture_fragment.html" %}
{% if description %}
<div class="intro">
{{ description|safe }}
</div>
{% endif %}
{% endblock %}
<div class="wcs-forms-of-category-{{slug}} links-list">
{% block cell-top-content %}{% endblock cell-top-content %}
<ul>
{% for form in forms %}
<li class="{{ form.css_classes|join:" " }}">{% include "combo/wcs/form_link_fragment.html" %}</li>
{% endfor %}
{% if more_forms %}
<li class="add-more-items">
<a role="button" tabindex="0" aria-expanded="false" aria-controls="more-items-{{ cell.get_reference }}" aria-label="{% trans 'More items' %}" id="btn-more-items-{{ cell.get_reference }}" class="add-more-items--button">{% block cell-more-items-btn-label %}+{% endblock %}</a>
</li>
{% endif %}
</ul>
<div class="wcs-forms-of-category-{{slug}} links-list">
{% block cell-top-content %}{% endblock cell-top-content %}
<ul>
{% for form in forms %}
<li class="{{ form.css_classes|join:" " }}">{% include "combo/wcs/form_link_fragment.html" %}</li>
{% endfor %}
{% if more_forms %}
<li class="add-more-items">
<a role="button" tabindex="0" aria-expanded="false" aria-controls="more-items-{{ cell.get_reference }}" aria-label="{% trans 'More items' %}" id="btn-more-items-{{ cell.get_reference }}" class="add-more-items--button">{% block cell-more-items-btn-label %}+{% endblock %}</a>
</li>
{% endif %}
</ul>
{% if more_forms %}
<ul style="display: none" class="more-items" id="more-items-{{ cell.get_reference }}" aria-labelledby="btn-wcs-more-items-{{ cell.get_reference }}">
{% for form in more_forms %}
<li class="more-items--item {{ form.css_classes|join:" " }}">
{% include "combo/wcs/form_link_fragment.html" %}
</li>
{% endfor %}
{% endif %}
</ul>
</div>
{% endif %}
{% if more_forms %}
<ul style="display: none" class="more-items" id="more-items-{{ cell.get_reference }}" aria-labelledby="btn-wcs-more-items-{{ cell.get_reference }}">
{% for form in more_forms %}
<li class="more-items--item {{ form.css_classes|join:" " }}">
{% include "combo/wcs/form_link_fragment.html" %}
</li>
{% endfor %}
{% endif %}
</ul>
</div>
{% endif %}
{% endblock %}

View File

@ -1,21 +1,21 @@
{% load combo %}
{% block cell-content %}
{% if forms %}
<ul>
{% for data in forms.data|dictsortreversed:"form_receipt_datetime" %}
{% if data.url and data.title %}
<li class="{{data.status_css_class}} {% if data.form_status_is_endpoint %}done{% endif %}"><a
{% if data.readable %}href="{{ data.url }}"{% endif %}><span class="form-title">{{data.name}}</span>
{% if data.draft %}
<span class="form-number">{{data.datetime|strptime:"%Y-%m-%d %H:%M:%S"}}</span>
{% else %}
<span class="form-number">{{data.form_number}}
{% if data.form_digest %}<span class="form-digest">({{data.form_digest}})</span>{% endif %}
</span>
{% endif %}
<span class="form-status">{{data.status}}</span></a></li>
{% if forms %}
<ul>
{% for data in forms.data|dictsortreversed:"form_receipt_datetime" %}
{% if data.url and data.title %}
<li class="{{data.status_css_class}} {% if data.form_status_is_endpoint %}done{% endif %}"><a
{% if data.readable %}href="{{ data.url }}"{% endif %}><span class="form-title">{{data.name}}</span>
{% if data.draft %}
<span class="form-number">{{data.datetime|strptime:"%Y-%m-%d %H:%M:%S"}}</span>
{% else %}
<span class="form-number">{{data.form_number}}
{% if data.form_digest %}<span class="form-digest">({{data.form_digest}})</span>{% endif %}
</span>
{% endif %}
<span class="form-status">{{data.status}}</span></a></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% endblock %}

View File

@ -3,300 +3,300 @@
{{ display_form.as_p }}
{% if card_schema %}
{{ card_schema|json_script:card_schema_id }}
{{ card_schema|json_script:card_schema_id }}
{# display mode as card #}
{# display mode as card #}
{# UI to customize content layout #}
<div class="as-card wcs-cards-cell--grid">
<div class="as-card wcs-cards-cell--grid-options">
<span class="as-card wcs-cards-cell--grid-layout-label">{% trans "Grid Layout:" %}</span>
<span class="as-card wcs-cards-cell--grid-layout-mode"></span>
<a role="button" class="as-card wcs-cards-cell--grid-layout-btn">
{% trans "Edit" %}
</a>
{# UI to customize content layout #}
<div class="as-card wcs-cards-cell--grid">
<div class="as-card wcs-cards-cell--grid-options">
<span class="as-card wcs-cards-cell--grid-layout-label">{% trans "Grid Layout:" %}</span>
<span class="as-card wcs-cards-cell--grid-layout-mode"></span>
<a role="button" class="as-card wcs-cards-cell--grid-layout-btn">
{% trans "Edit" %}
</a>
</div>
<div class="as-card wcs-cards-cell--grid-cells">
</div>
<div class="as-card wcs-cards-cell--grid-buttons">
<button type="button" class="as-card wcs-cards-cell--add-grid-cell-btn">{% trans "Add" %}</button>
</div>
</div>
<div class="as-card wcs-cards-cell--grid-cells">
</div>
<div class="as-card wcs-cards-cell--grid-buttons">
<button type="button" class="as-card wcs-cards-cell--add-grid-cell-btn">{% trans "Add" %}</button>
</div>
</div>
{# templates for JS #}
<script type="text/template" class="as-card wcs-cards-cell--grid-form-tpl">
<form>
<p>
{% trans "Layout" %}
<select name="grid-layout">
<option value="fx-grid--auto">{% trans "Automatic" %}</option>
<option value="fx-grid">{% trans "1 column" %}</option>
<option value="fx-grid--t2">{% trans "2 columns" %}</option>
<option value="fx-grid--t3">{% trans "3 columns" %}</option>
</select>
</p>
</form>
</script>
<script type="text/template" class="as-card wcs-cards-cell--grid-cell-form-tpl">
<form>
<p>
<label>
{% trans "Content type" %}
<select name="entry_type" data-dynamic-display-parent="true">
<option value="@field@">{% trans "Card field" %}</option>
<option value="@custom@">{% trans "Custom" %}</option>
<option value="@link@">{% trans "Link" %}</option>
{# templates for JS #}
<script type="text/template" class="as-card wcs-cards-cell--grid-form-tpl">
<form>
<p>
{% trans "Layout" %}
<select name="grid-layout">
<option value="fx-grid--auto">{% trans "Automatic" %}</option>
<option value="fx-grid">{% trans "1 column" %}</option>
<option value="fx-grid--t2">{% trans "2 columns" %}</option>
<option value="fx-grid--t3">{% trans "3 columns" %}</option>
</select>
</label>
</p>
</p>
</form>
</script>
<script type="text/template" class="as-card wcs-cards-cell--grid-cell-form-tpl">
<form>
<p>
<label>
{% trans "Content type" %}
<select name="entry_type" data-dynamic-display-parent="true">
<option value="@field@">{% trans "Card field" %}</option>
<option value="@custom@">{% trans "Custom" %}</option>
<option value="@link@">{% trans "Link" %}</option>
</select>
</label>
</p>
{# fields group for "content type == @field@ " #}
<div data-dynamic-display-child-of="entry_type" data-dynamic-display-value="@field@">
<p>
<label>
{% trans "Card Fields" %}
<select name="field_varname"></select>
</label>
</p>
<p>
<label>
{% trans "Field content" %}
<select name="field_content" data-dynamic-display-parent="true">
<option value="label-and-value">{% trans "Label & Value" %}</option>
<option value="label">{% trans "Label only" %}</option>
<option value="value">{% trans "Value only" %}</option>
</select>
</label>
</p>
<p data-dynamic-display-child-of="field_content" data-dynamic-display-value-in="label value">
<label>
{% trans "Display mode" %}
<select name="field_display_mode">
<option value="text">{% trans "Text" %}</option>
<option value="title">{% trans "Title" %}</option>
<option value="subtitle">{% trans "Subtitle" %}</option>
</select>
</label>
</p>
<p>
<label>
{% trans "Empty value display mode" %}
<select name="field_empty_display_mode" data-dynamic-display-parent="true">
<option value="@empty@">{% trans "Display as empty" %}</option>
<option value="@skip@">{% trans "Hide" %}</option>
<option value="@custom@">{% trans "Display a custom text" %}</option>
</select>
</label>
</p>
<p data-dynamic-display-child-of="field_empty_display_mode" data-dynamic-display-value="@custom@">
<label>
{% trans "Empty value custom text" %}
<input name="field_empty_text" />
</label>
</p>
</div>
{# fields group for "content type == @custom@" #}
<div data-dynamic-display-child-of="entry_type" data-dynamic-display-value="@custom@">
<p>
<label>
{% trans "Value template" %}
<textarea name="custom_template" style="resize: vertical;"></textarea>
</label>
</p>
<p>
<label>
{% trans "Display mode" %}
<select name="custom_display_mode">
<option value="label">{% trans "Label" %}</option>
<option value="text">{% trans "Text" %}</option>
<option value="title">{% trans "Title" %}</option>
<option value="subtitle">{% trans "Subtitle" %}</option>
</select>
</label>
</p>
</div>
{# fields group for "content type == @link@" #}
<div data-dynamic-display-child-of="entry_type" data-dynamic-display-value="@link@">
<p>
<label>
{% trans "Label template" %}
<textarea name="link_label_template" style="resize: vertical;"></textarea>
</label>
</p>
<p>
<label>
{% trans "URL" %}
<select name="link_page" data-dynamic-display-parent="true">
{% for page in cell.get_matching_pages %}
<option value="{{ page.pk }}">{{ page.get_full_path_titles }}</option>
{% endfor %}
<option value="">{% trans "URL template" %}</option>
</select>
</label>
</p>
<p data-dynamic-display-child-of="link_page" data-dynamic-display-value="">
<label>
<textarea name="link_url_template" style="resize: vertical;"></textarea>
</label>
</p>
<p>
<label>
{% trans "Display mode" %}
<select name="link_display_mode">
<option value="link">{% trans "Link" %}</option>
<option value="button">{% trans "Button" %}</option>
</select>
</label>
</p>
</div>
{# fields group for "content type == @field@ " #}
<div data-dynamic-display-child-of="entry_type" data-dynamic-display-value="@field@">
<p>
<label>
{% trans "Card Fields" %}
<select name="field_varname"></select>
</label>
</p>
<p>
<label>
{% trans "Field content" %}
<select name="field_content" data-dynamic-display-parent="true">
<option value="label-and-value">{% trans "Label & Value" %}</option>
<option value="label">{% trans "Label only" %}</option>
<option value="value">{% trans "Value only" %}</option>
{% trans "Size" %}
<select name="cell_size">
<option value="">{% trans "Automatic" %}</option>
<option value="size--1-1">1/1</option>
<option value="size--t1-2">1/2</option>
<option value="size--t1-3">1/3</option>
<option value="size--t2-3">2/3</option>
</select>
</label>
</p>
<p data-dynamic-display-child-of="field_content" data-dynamic-display-value-in="label value">
<label>
{% trans "Display mode" %}
<select name="field_display_mode">
<option value="text">{% trans "Text" %}</option>
<option value="title">{% trans "Title" %}</option>
<option value="subtitle">{% trans "Subtitle" %}</option>
</select>
</label>
</p>
<p>
<label>
{% trans "Empty value display mode" %}
<select name="field_empty_display_mode" data-dynamic-display-parent="true">
<option value="@empty@">{% trans "Display as empty" %}</option>
<option value="@skip@">{% trans "Hide" %}</option>
<option value="@custom@">{% trans "Display a custom text" %}</option>
</select>
</label>
</p>
<p data-dynamic-display-child-of="field_empty_display_mode" data-dynamic-display-value="@custom@">
<label>
{% trans "Empty value custom text" %}
<input name="field_empty_text" />
</label>
</p>
</form>
</script>
<script type="text/template" class="as-card wcs-cards-cell--grid-cell-tpl">
<div class="as-card wcs-cards-cell--grid-cell">
<div class="as-card wcs-cards-cell--grid-cell-content"></div>
<div class="as-card wcs-cards-cell--grid-cell-buttons">
<a role="button" class="as-card wcs-cards-cell--grid-cell-edit">{% trans "Edit" %}</a>
<a role="button" class="as-card wcs-cards-cell--grid-cell-delete">{% trans "Delete" %}</a>
</div>
</div>
</script>
{# fields group for "content type == @custom@" #}
<div data-dynamic-display-child-of="entry_type" data-dynamic-display-value="@custom@">
<p>
<label>
{% trans "Value template" %}
<textarea name="custom_template" style="resize: vertical;"></textarea>
</label>
</p>
<p>
<label>
{% trans "Display mode" %}
<select name="custom_display_mode">
<option value="label">{% trans "Label" %}</option>
<option value="text">{% trans "Text" %}</option>
<option value="title">{% trans "Title" %}</option>
<option value="subtitle">{% trans "Subtitle" %}</option>
</select>
</label>
</p>
{# display mode as table #}
{# UI to customize content layout #}
<div class="as-table wcs-cards-cell--grid">
<div class="as-table wcs-cards-cell--grid-options">
<span class="as-table wcs-cards-cell--grid-headers-label">{% trans "Display headers:" %}</span>
<span class="as-table wcs-cards-cell--grid-headers-mode"></span>
<a role="button" class="as-table wcs-cards-cell--grid-headers-btn">
{% trans "Edit" %}
</a>
</div>
{# fields group for "content type == @link@" #}
<div data-dynamic-display-child-of="entry_type" data-dynamic-display-value="@link@">
<p>
<label>
{% trans "Label template" %}
<textarea name="link_label_template" style="resize: vertical;"></textarea>
</label>
</p>
<p>
<label>
{% trans "URL" %}
<select name="link_page" data-dynamic-display-parent="true">
{% for page in cell.get_matching_pages %}
<option value="{{ page.pk }}">{{ page.get_full_path_titles }}</option>
{% endfor %}
<option value="">{% trans "URL template" %}</option>
</select>
</label>
</p>
<p data-dynamic-display-child-of="link_page" data-dynamic-display-value="">
<label>
<textarea name="link_url_template" style="resize: vertical;"></textarea>
</label>
</p>
<p>
<label>
{% trans "Display mode" %}
<select name="link_display_mode">
<option value="link">{% trans "Link" %}</option>
<option value="button">{% trans "Button" %}</option>
</select>
</label>
</p>
<div class="as-table wcs-cards-cell--grid-cells">
</div>
<p>
<label>
{% trans "Size" %}
<select name="cell_size">
<option value="">{% trans "Automatic" %}</option>
<option value="size--1-1">1/1</option>
<option value="size--t1-2">1/2</option>
<option value="size--t1-3">1/3</option>
<option value="size--t2-3">2/3</option>
</select>
</label>
</p>
</form>
</script>
<script type="text/template" class="as-card wcs-cards-cell--grid-cell-tpl">
<div class="as-card wcs-cards-cell--grid-cell">
<div class="as-card wcs-cards-cell--grid-cell-content"></div>
<div class="as-card wcs-cards-cell--grid-cell-buttons">
<a role="button" class="as-card wcs-cards-cell--grid-cell-edit">{% trans "Edit" %}</a>
<a role="button" class="as-card wcs-cards-cell--grid-cell-delete">{% trans "Delete" %}</a>
<div class="as-table wcs-cards-cell--grid-buttons">
<button type="button" class="as-table wcs-cards-cell--add-grid-cell-btn">{% trans "Add" %}</button>
</div>
</div>
</script>
{# display mode as table #}
{# UI to customize content layout #}
<div class="as-table wcs-cards-cell--grid">
<div class="as-table wcs-cards-cell--grid-options">
<span class="as-table wcs-cards-cell--grid-headers-label">{% trans "Display headers:" %}</span>
<span class="as-table wcs-cards-cell--grid-headers-mode"></span>
<a role="button" class="as-table wcs-cards-cell--grid-headers-btn">
{% trans "Edit" %}
</a>
</div>
<div class="as-table wcs-cards-cell--grid-cells">
</div>
<div class="as-table wcs-cards-cell--grid-buttons">
<button type="button" class="as-table wcs-cards-cell--add-grid-cell-btn">{% trans "Add" %}</button>
</div>
</div>
{# templates for JS #}
<script type="text/template" class="as-table wcs-cards-cell--grid-form-tpl">
<form>
<p>
{% trans "Display headers" %}
<input name="grid-headers" type="checkbox" />
</p>
</form>
</script>
<script type="text/template" class="as-table wcs-cards-cell--grid-cell-form-tpl">
<form>
<p>
<label>
{% trans "Content type" %}
<select name="entry_type" data-dynamic-display-parent="true">
<option value="@field@">{% trans "Card field" %}</option>
<option value="@custom@">{% trans "Custom" %}</option>
<option value="@link@">{% trans "Link" %}</option>
</select>
</label>
</p>
{# fields group for "content type == @field@ " #}
<div data-dynamic-display-child-of="entry_type" data-dynamic-display-value="@field@">
{# templates for JS #}
<script type="text/template" class="as-table wcs-cards-cell--grid-form-tpl">
<form>
<p>
<label>
{% trans "Card Fields" %}
<select name="field_varname"></select>
</label>
{% trans "Display headers" %}
<input name="grid-headers" type="checkbox" />
</p>
</form>
</script>
<script type="text/template" class="as-table wcs-cards-cell--grid-cell-form-tpl">
<form>
<p>
<label>
{% trans "Custom text to replace empty value" %}
<input name="field_empty_text" />
</label>
</p>
</div>
{# fields group for "content type == @custom@" #}
<div data-dynamic-display-child-of="entry_type" data-dynamic-display-value="@custom@">
<p>
<label>
{% trans "Header" %}
<input name="custom_header" />
</label>
</p>
<p>
<label>
{% trans "Value template" %}
<textarea name="custom_template" style="resize: vertical;"></textarea>
</label>
</p>
</div>
{# fields group for "content type == @link@" #}
<div data-dynamic-display-child-of="entry_type" data-dynamic-display-value="@link@">
<p>
<label>
{% trans "Header" %}
<input name="link_header" />
</label>
</p>
<p>
<label>
{% trans "Label template" %}
<textarea name="link_label_template" style="resize: vertical;"></textarea>
</label>
</p>
<p>
<label>
{% trans "URL" %}
<select name="link_page" data-dynamic-display-parent="true">
{% for page in cell.get_matching_pages %}
<option value="{{ page.pk }}">{{ page.get_full_path_titles }}</option>
{% endfor %}
<option value="">{% trans "URL template" %}</option>
</select>
</label>
</p>
<p data-dynamic-display-child-of="link_page" data-dynamic-display-value="">
<label>
<textarea name="link_url_template" style="resize: vertical;"></textarea>
</label>
</p>
<p>
<label>
{% trans "Display mode" %}
<select name="link_display_mode">
<option value="link">{% trans "Link" %}</option>
<option value="button">{% trans "Button" %}</option>
{% trans "Content type" %}
<select name="entry_type" data-dynamic-display-parent="true">
<option value="@field@">{% trans "Card field" %}</option>
<option value="@custom@">{% trans "Custom" %}</option>
<option value="@link@">{% trans "Link" %}</option>
</select>
</label>
</p>
{# fields group for "content type == @field@ " #}
<div data-dynamic-display-child-of="entry_type" data-dynamic-display-value="@field@">
<p>
<label>
{% trans "Card Fields" %}
<select name="field_varname"></select>
</label>
</p>
<p>
<label>
{% trans "Custom text to replace empty value" %}
<input name="field_empty_text" />
</label>
</p>
</div>
{# fields group for "content type == @custom@" #}
<div data-dynamic-display-child-of="entry_type" data-dynamic-display-value="@custom@">
<p>
<label>
{% trans "Header" %}
<input name="custom_header" />
</label>
</p>
<p>
<label>
{% trans "Value template" %}
<textarea name="custom_template" style="resize: vertical;"></textarea>
</label>
</p>
</div>
{# fields group for "content type == @link@" #}
<div data-dynamic-display-child-of="entry_type" data-dynamic-display-value="@link@">
<p>
<label>
{% trans "Header" %}
<input name="link_header" />
</label>
</p>
<p>
<label>
{% trans "Label template" %}
<textarea name="link_label_template" style="resize: vertical;"></textarea>
</label>
</p>
<p>
<label>
{% trans "URL" %}
<select name="link_page" data-dynamic-display-parent="true">
{% for page in cell.get_matching_pages %}
<option value="{{ page.pk }}">{{ page.get_full_path_titles }}</option>
{% endfor %}
<option value="">{% trans "URL template" %}</option>
</select>
</label>
</p>
<p data-dynamic-display-child-of="link_page" data-dynamic-display-value="">
<label>
<textarea name="link_url_template" style="resize: vertical;"></textarea>
</label>
</p>
<p>
<label>
{% trans "Display mode" %}
<select name="link_display_mode">
<option value="link">{% trans "Link" %}</option>
<option value="button">{% trans "Button" %}</option>
</select>
</label>
</p>
</div>
</form>
</script>
<script type="text/template" class="as-table wcs-cards-cell--grid-cell-tpl">
<div class="as-table wcs-cards-cell--grid-cell">
<div class="as-table wcs-cards-cell--grid-cell-content"></div>
<div class="as-table wcs-cards-cell--grid-cell-buttons">
<a role="button" class="as-table wcs-cards-cell--grid-cell-edit">{% trans "Edit" %}</a>
<a role="button" class="as-table wcs-cards-cell--grid-cell-delete">{% trans "Delete" %}</a>
</div>
</div>
</form>
</script>
<script type="text/template" class="as-table wcs-cards-cell--grid-cell-tpl">
<div class="as-table wcs-cards-cell--grid-cell">
<div class="as-table wcs-cards-cell--grid-cell-content"></div>
<div class="as-table wcs-cards-cell--grid-cell-buttons">
<a role="button" class="as-table wcs-cards-cell--grid-cell-edit">{% trans "Edit" %}</a>
<a role="button" class="as-table wcs-cards-cell--grid-cell-delete">{% trans "Delete" %}</a>
</div>
</div>
</script>
</script>
{% endif %}

View File

@ -1,46 +1,46 @@
{% load i18n %}
{% block cell-content %}
<div class="wcs-tracking-code-input">
{% block title %}
<h2>{% trans 'Tracking Code' %}</h2>
{% endblock %}
<div>
{% block form-pre %}{% endblock %}
<form data-wcs-url="{{ url }}" method="post" action="{{ site_base }}{% url 'wcs-tracking-code' %}">
{% block form-top %}
{% block intro-text %}
<p>
{% blocktrans trimmed %}
A tracking code is attached to all your forms, it is there to help you in
dealing with the administration.
{% endblocktrans %}
</p>
<p>
{% blocktrans trimmed %}
To find the details of a form linked to a tracking code, you can enter the
code in the entry below:
{% endblocktrans %}
</p>
{% endblock %}
{% endblock %}
<input id="_cell_url_{{ cell.id }}" name="url" value="" type="hidden"/>
<input name="cell" value="{{ cell.id }}" type="hidden"/>
<div id="_cell_error_{{ cell.id }}" class="errornotice" style="display: none">
{% trans "The tracking code could not been found." %}
<div class="wcs-tracking-code-input">
{% block title %}
<h2>{% trans 'Tracking Code' %}</h2>
{% endblock %}
<div>
{% block form-pre %}{% endblock %}
<form data-wcs-url="{{ url }}" method="post" action="{{ site_base }}{% url 'wcs-tracking-code' %}">
{% block form-top %}
{% block intro-text %}
<p>
{% blocktrans trimmed %}
A tracking code is attached to all your forms, it is there to help you in
dealing with the administration.
{% endblocktrans %}
</p>
<p>
{% blocktrans trimmed %}
To find the details of a form linked to a tracking code, you can enter the
code in the entry below:
{% endblocktrans %}
</p>
{% endblock %}
{% endblock %}
<input id="_cell_url_{{ cell.id }}" name="url" value="" type="hidden"/>
<input name="cell" value="{{ cell.id }}" type="hidden"/>
<div id="_cell_error_{{ cell.id }}" class="errornotice" style="display: none">
{% trans "The tracking code could not been found." %}
</div>
<input aria-label="{% trans "Tracking Code" %}" required id="tracking-code" name="code" placeholder="{% block input-placeholder-content %}{% trans 'ex: CNPHNTFB' %}{% endblock %}"/>
<button aria-label="{% trans 'Submit' %}">{% block submit-content %}{% trans 'Submit' %}{% endblock %}</button>
<script>
$(function() {
$('#_cell_url_{{ cell.id }}').val(window.location);
if (window.location.search.indexOf('unknown-tracking-code') != -1) {
$('#_cell_error_{{ cell.id }}').show();
}
});
</script>
{% block form-bottom %}{% endblock %}
</form>
{% block form-post %}{% endblock %}
</div>
</div>
<input aria-label="{% trans "Tracking Code" %}" required id="tracking-code" name="code" placeholder="{% block input-placeholder-content %}{% trans 'ex: CNPHNTFB' %}{% endblock %}"/>
<button aria-label="{% trans 'Submit' %}">{% block submit-content %}{% trans 'Submit' %}{% endblock %}</button>
<script>
$(function() {
$('#_cell_url_{{ cell.id }}').val(window.location);
if (window.location.search.indexOf('unknown-tracking-code') != -1) {
$('#_cell_error_{{ cell.id }}').show();
}
});
</script>
{% block form-bottom %}{% endblock %}
</form>
{% block form-post %}{% endblock %}
</div>
</div>
{% endblock %}

View File

@ -1,14 +1,14 @@
{% load i18n %}
{% block cell-content %}
<h2>{{ cell.custom_title|default:_('All Forms') }}</h2>
{% if forms %}
{% for slug, forms in user_forms.items %}
<div class="links-list user-forms-{{ slug }} user-all-forms list-of-forms">
{% include "combo/wcs/list_of_forms.html" %}
</div>
{% endfor %}
{% include "combo/pagination.html" %}
{% else %}
<div class="cell--body"><p class="empty-message">{% trans "There are no forms." %}</p></div>
{% endif %}
<h2>{{ cell.custom_title|default:_('All Forms') }}</h2>
{% if forms %}
{% for slug, forms in user_forms.items %}
<div class="links-list user-forms-{{ slug }} user-all-forms list-of-forms">
{% include "combo/wcs/list_of_forms.html" %}
</div>
{% endfor %}
{% include "combo/pagination.html" %}
{% else %}
<div class="cell--body"><p class="empty-message">{% trans "There are no forms." %}</p></div>
{% endif %}
{% endblock %}

View File

@ -1,14 +1,14 @@
{% load i18n %}
{% block cell-content %}
<h2>{{ cell.custom_title|default:_('Done Forms') }}</h2>
{% if forms %}
{% for slug, forms in user_forms.items %}
<div class="links-list user-forms-{{ slug }} list-of-forms">
{% include "combo/wcs/list_of_forms.html" %}
</div>
{% endfor %}
{% include "combo/pagination.html" %}
{% else %}
<div class="cell--body"><p class="empty-message">{% trans "There are no done forms or they have been removed." %}</p></div>
{% endif %}
<h2>{{ cell.custom_title|default:_('Done Forms') }}</h2>
{% if forms %}
{% for slug, forms in user_forms.items %}
<div class="links-list user-forms-{{ slug }} list-of-forms">
{% include "combo/wcs/list_of_forms.html" %}
</div>
{% endfor %}
{% include "combo/pagination.html" %}
{% else %}
<div class="cell--body"><p class="empty-message">{% trans "There are no done forms or they have been removed." %}</p></div>
{% endif %}
{% endblock %}

View File

@ -2,61 +2,61 @@
{% load i18n %}
{% block cell-form %}
{{ form.as_p }}
{% with cell.get_items_with_prefetch as links %}
{% if links %}
<p><label>{% trans "Links:" %}</label></p>
<div>
<ul class="objects-list list-of-links" id="list-of-links-{{ cell.pk }}"
data-link-list-order-url="{% url 'combo-manager-link-list-order' page_pk=page.pk cell_reference=cell.get_reference %}">
{% for link in links %}
<li data-link-item-id="{{ link.pk }}"><span class="handle"></span>
<span title="{{ link }}">
{{ link|truncatechars:100 }}
{% with link.get_invalid_reason as invalid_reason %}
{% if link.extra_css_class %}
<span class="extra-css-class">[{{ link.extra_css_class }}]</span>
{% endif %}
{% if invalid_reason %}
<span class="invalid">{{ invalid_reason }} -
{% if cell.get_validity_info.invalid_datetime|datetime_in_past %}
{% blocktrans with link.get_validity_info.invalid_datetime|date:"DATETIME_FORMAT" as invalidity_date %}This link is no longer displayed since {{ invalidity_date }}.{% endblocktrans %}
{% else %}
{% blocktrans with link.get_validity_info.invalid_datetime|timeuntil as invalidity_delay %}This link will no longer be displayed in {{ invalidity_delay }}.{% endblocktrans %}
{% endif %}
</span>
{% endif %}
{% endwith %}
</span>
<a rel="popup" title="{% trans "Edit" %}" class="link-action-icon edit" href="{% url 'combo-manager-page-list-cell-edit-link' page_pk=page.id cell_reference=cell.get_reference link_cell_reference=link.get_reference %}">{% trans "Edit" %}</a>
<a rel="popup" title="{% trans "Delete" %}" class="link-action-icon delete" href="{% url 'combo-manager-page-list-cell-delete-link' page_pk=page.id cell_reference=cell.get_reference link_cell_reference=link.get_reference %}">{% trans "Delete" %}</a>
</li>
{% endfor %}
</ul>
</div>
<script>
$(function () {
$('#list-of-links-{{ cell.pk }}').sortable({
handle: '.handle',
update: function(event, ui) {
var new_order = Object();
$(this).find('li').each(function(i, x) {
var suffix = $(x).data('link-item-id');
new_order['pos_' + suffix] = i;
});
$.ajax({
url: $(this).data('link-list-order-url'),
data: new_order
});
}
});
});
</script>
{% endif %}
{% endwith %}
<div class="buttons">
{% for klass in cell.get_link_cell_classes %}
<a rel="popup" href="{% url 'combo-manager-page-list-cell-add-link' page_pk=page.id cell_reference=cell.get_reference link_code=klass.add_as_link_code %}">{{ klass.add_as_link_label }}</a> {% if not forloop.last %}|{% endif %}
{% endfor %}
</div>
{{ form.as_p }}
{% with cell.get_items_with_prefetch as links %}
{% if links %}
<p><label>{% trans "Links:" %}</label></p>
<div>
<ul class="objects-list list-of-links" id="list-of-links-{{ cell.pk }}"
data-link-list-order-url="{% url 'combo-manager-link-list-order' page_pk=page.pk cell_reference=cell.get_reference %}">
{% for link in links %}
<li data-link-item-id="{{ link.pk }}"><span class="handle"></span>
<span title="{{ link }}">
{{ link|truncatechars:100 }}
{% with link.get_invalid_reason as invalid_reason %}
{% if link.extra_css_class %}
<span class="extra-css-class">[{{ link.extra_css_class }}]</span>
{% endif %}
{% if invalid_reason %}
<span class="invalid">{{ invalid_reason }} -
{% if cell.get_validity_info.invalid_datetime|datetime_in_past %}
{% blocktrans with link.get_validity_info.invalid_datetime|date:"DATETIME_FORMAT" as invalidity_date %}This link is no longer displayed since {{ invalidity_date }}.{% endblocktrans %}
{% else %}
{% blocktrans with link.get_validity_info.invalid_datetime|timeuntil as invalidity_delay %}This link will no longer be displayed in {{ invalidity_delay }}.{% endblocktrans %}
{% endif %}
</span>
{% endif %}
{% endwith %}
</span>
<a rel="popup" title="{% trans "Edit" %}" class="link-action-icon edit" href="{% url 'combo-manager-page-list-cell-edit-link' page_pk=page.id cell_reference=cell.get_reference link_cell_reference=link.get_reference %}">{% trans "Edit" %}</a>
<a rel="popup" title="{% trans "Delete" %}" class="link-action-icon delete" href="{% url 'combo-manager-page-list-cell-delete-link' page_pk=page.id cell_reference=cell.get_reference link_cell_reference=link.get_reference %}">{% trans "Delete" %}</a>
</li>
{% endfor %}
</ul>
</div>
<script>
$(function () {
$('#list-of-links-{{ cell.pk }}').sortable({
handle: '.handle',
update: function(event, ui) {
var new_order = Object();
$(this).find('li').each(function(i, x) {
var suffix = $(x).data('link-item-id');
new_order['pos_' + suffix] = i;
});
$.ajax({
url: $(this).data('link-list-order-url'),
data: new_order
});
}
});
});
</script>
{% endif %}
{% endwith %}
<div class="buttons">
{% for klass in cell.get_link_cell_classes %}
<a rel="popup" href="{% url 'combo-manager-page-list-cell-add-link' page_pk=page.id cell_reference=cell.get_reference link_code=klass.add_as_link_code %}">{{ klass.add_as_link_label }}</a> {% if not forloop.last %}|{% endif %}
{% endfor %}
</div>
{% endblock %}

View File

@ -2,7 +2,7 @@
<select name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>{% for group_name, group_choices, group_index in widget.optgroups %}{% if group_name %}
<optgroup label="{{ group_name }}">{% endif %}{% for option in group_choices %}
{% include option.template_name with widget=option %}{% endfor %}{% if group_name %}
</optgroup>{% endif %}{% endfor %}
<!-- "other" option: --> <option value="" data-other="true">{% trans "Other:" %}</option>
{% include option.template_name with widget=option %}{% endfor %}{% if group_name %}
</optgroup>{% endif %}{% endfor %}
<!-- "other" option: --> <option value="" data-other="true">{% trans "Other:" %}</option>
</select>

View File

@ -1,8 +1,8 @@
{% load i18n %}
{% block cell-form-appearance %}
{{ appearance_form.as_p }}
{% if cell.can_have_assets %}
<p><a rel="popup" data-selector="div#assets-listing" href="{% url 'combo-manager-slot-assets' cell_reference=cell.get_reference %}"
>{% trans 'Assets' %}</a></p>
{% endif %}
{{ appearance_form.as_p }}
{% if cell.can_have_assets %}
<p><a rel="popup" data-selector="div#assets-listing" href="{% url 'combo-manager-slot-assets' cell_reference=cell.get_reference %}"
>{% trans 'Assets' %}</a></p>
{% endif %}
{% endblock %}

View File

@ -2,17 +2,17 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans "Duplicate Cell" %}</h2>
<h2>{% trans "Duplicate Cell" %}</h2>
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'combo-manager-page-view' pk=current_page.pk %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'combo-manager-page-view' pk=current_page.pk %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -1,3 +1,3 @@
{% block cell-form %}
{{form.as_p}}
{{form.as_p}}
{% endblock %}

View File

@ -2,21 +2,21 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Cell Options' %}</h2>
<h2>{% trans 'Cell Options' %}</h2>
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
{% if object.id %}
<a class="cancel" href="{{ object.get_absolute_url }}">{% trans 'Cancel' %}</a>
{% else %}
<a class="cancel" href="{% url 'combo-manager-homepage' %}">{% trans 'Cancel' %}</a>
{% endif %}
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
{% if object.id %}
<a class="cancel" href="{{ object.get_absolute_url }}">{% trans 'Cancel' %}</a>
{% else %}
<a class="cancel" href="{% url 'combo-manager-homepage' %}">{% trans 'Cancel' %}</a>
{% endif %}
</div>
</form>
{% endblock %}

View File

@ -1,18 +1,18 @@
<div id="visibility-form-{{cell.get_reference}}">
{{ visibility_form.as_p }}
<script>
$(function() {
var $form = $('#visibility-form-{{cell.get_reference}}');
$form.find('select').first().on('change', function() {
var val = $(this).val();
var $groups = $form.find('select').last().parent('p');
if (val == 'groups-any' || val == 'groups-none') {
$groups.show();
} else {
$groups.hide();
}
$(function() {
var $form = $('#visibility-form-{{cell.get_reference}}');
$form.find('select').first().on('change', function() {
var val = $(this).val();
var $groups = $form.find('select').last().parent('p');
if (val == 'groups-any' || val == 'groups-none') {
$groups.show();
} else {
$groups.hide();
}
});
$form.find('select').first().trigger('change');
});
$form.find('select').first().trigger('change');
});
</script>
</div>

View File

@ -2,26 +2,26 @@
{% load i18n %}
{% block appbar %}
<h2>{{ view.model.get_verbose_name }}</h2>
<h2>{{ view.model.get_verbose_name }}</h2>
{% endblock %}
{% block content %}
<form method="post">
{% csrf_token %}
<p>
{% if display_choice %}
{% blocktrans %}This page has subpages, what do you want to do with them?{% endblocktrans %}
<ul class="choices">
<li><label><input type="radio" name="choice" checked="checked" value="delete-one">{% trans 'Delete only this page' %}</label></li>
<li><label><input type="radio" name="choice" value="delete-all">{% trans 'Delete this page and all subpages' %}</label></li>
</ul>
{% else %}
{% blocktrans %}Are you sure you want to delete this page?{% endblocktrans %}
{% endif %}
</p>
<div class="buttons">
<button class="delete-button">{% trans 'Delete' %}</button>
<a class="cancel" href="{{ object.get_absolute_url }}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post">
{% csrf_token %}
<p>
{% if display_choice %}
{% blocktrans %}This page has subpages, what do you want to do with them?{% endblocktrans %}
<ul class="choices">
<li><label><input type="radio" name="choice" checked="checked" value="delete-one">{% trans 'Delete only this page' %}</label></li>
<li><label><input type="radio" name="choice" value="delete-all">{% trans 'Delete this page and all subpages' %}</label></li>
</ul>
{% else %}
{% blocktrans %}Are you sure you want to delete this page?{% endblocktrans %}
{% endif %}
</p>
<div class="buttons">
<button class="delete-button">{% trans 'Delete' %}</button>
<a class="cancel" href="{{ object.get_absolute_url }}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,16 +2,16 @@
{% load i18n %}
{% block appbar %}
<h2>{{ view.model.get_verbose_name }}</h2>
<h2>{{ view.model.get_verbose_name }}</h2>
{% endblock %}
{% block content %}
<form method="post">
{% csrf_token %}
{% blocktrans %}Are you sure you want to delete this?{% endblocktrans %}
<div class="buttons">
<button class="delete-button">{% trans 'Delete' %}</button>
<a class="cancel" href="{{ object.get_absolute_url }}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post">
{% csrf_token %}
{% blocktrans %}Are you sure you want to delete this?{% endblocktrans %}
<div class="buttons">
<button class="delete-button">{% trans 'Delete' %}</button>
<a class="cancel" href="{{ object.get_absolute_url }}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,7 +2,7 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Invalid cells' %}</h2>
<h2>{% trans 'Invalid cells' %}</h2>
{% endblock %}
{% block breadcrumb %}
@ -11,18 +11,18 @@
{% endblock %}
{% block content %}
{% if object_list %}
<ul class="objects-list">
{% for cell in object_list %}
<li>
{% trans "Page:" %} <a href="{% url 'combo-manager-page-view' pk=cell.page_id %}">{{ cell.page.title }}</a> -
{% trans "Cell:" %} <a href="{% url 'combo-manager-page-view' pk=cell.page_id %}#cell-{{ cell.get_reference }}">{{ cell.get_label }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="big-msg-info">
{% trans "No invalid cell found." %}
</div>
{% endif %}
{% if object_list %}
<ul class="objects-list">
{% for cell in object_list %}
<li>
{% trans "Page:" %} <a href="{% url 'combo-manager-page-view' pk=cell.page_id %}">{{ cell.page.title }}</a> -
{% trans "Cell:" %} <a href="{% url 'combo-manager-page-view' pk=cell.page_id %}#cell-{{ cell.get_reference }}">{{ cell.get_label }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="big-msg-info">
{% trans "No invalid cell found." %}
</div>
{% endif %}
{% endblock %}

View File

@ -2,21 +2,21 @@
{% load i18n %}
{% block appbar %}
{% if form.instance.pk %}
<h2>{{ form.instance.edit_link_label }}</h2>
{% else %}
<h2>{{ form.instance.add_link_label }}</h2>
{% endif %}
{% if form.instance.pk %}
<h2>{{ form.instance.edit_link_label }}</h2>
{% else %}
<h2>{{ form.instance.add_link_label }}</h2>
{% endif %}
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'combo-manager-page-view' pk=form.instance.page_id %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'combo-manager-page-view' pk=form.instance.page_id %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,9 +2,9 @@
{% load static i18n %}
{% block css %}
<link rel="stylesheet" type="text/css" media="all" href="{% static "css/combo.manager.css" %}"/>
<link rel="stylesheet" type="text/css" media="all" href="{% static "xstatic/leaflet.css" %}"/>
<link rel="stylesheet" type="text/css" media="all" href="{% static "css/combo.map.css" %}"/>
<link rel="stylesheet" type="text/css" media="all" href="{% static "css/combo.manager.css" %}"/>
<link rel="stylesheet" type="text/css" media="all" href="{% static "xstatic/leaflet.css" %}"/>
<link rel="stylesheet" type="text/css" media="all" href="{% static "css/combo.map.css" %}"/>
{% endblock %}
{% block page-title %}{% firstof site_title "Combo" %}{% endblock %}
{% block site-title %}{% firstof site_title "Combo" %}{% endblock %}
@ -21,18 +21,18 @@
{% endblock %}
{% block breadcrumb %}
{{ block.super }}
{{ block.super }}
<a href="{% url 'combo-manager-homepage' %}">{% trans 'Portal Management' %}</a>
{% endblock %}
{% block logout-url %}{% url 'auth_logout' %}{% endblock %}
{% block extrascripts %}
{{ block.super }}
<script src="{% static "ckeditor/ckeditor/ckeditor.js" %}"></script>
<script type="text/javascript" src="{% static "ckeditor/ckeditor-init.js" %}"></script>
<script src="{% static "js/combo.manager.js" %}"></script>
<script src="{% static "xstatic/leaflet.js" %}"></script>
<script src="{% static "js/combo.map.js" %}"></script>
<script src="{% url "javascript-catalog" %}"></script>
{{ block.super }}
<script src="{% static "ckeditor/ckeditor/ckeditor.js" %}"></script>
<script type="text/javascript" src="{% static "ckeditor/ckeditor-init.js" %}"></script>
<script src="{% static "js/combo.manager.js" %}"></script>
<script src="{% static "xstatic/leaflet.js" %}"></script>
<script src="{% static "js/combo.map.js" %}"></script>
<script src="{% url "javascript-catalog" %}"></script>
{% endblock %}

View File

@ -1,40 +1,40 @@
{% load i18n %}
{% block cell-form %}
<div class="cell-properties pk-tabs">
<div class="pk-tabs--tab-list" role="tablist" aria-label="{% trans "Cell Properties" %}">
{% for tab in manager_tabs %}
<button role="tab"
aria-selected="{{ forloop.first|yesno:"true,false" }}"
aria-controls="panel-{{ cell.get_reference }}-{{ tab.slug }}"
id="tab-{{ cell.get_reference }}-{{ tab.slug }}"
tabindex="{{ forloop.first|yesno:"0,-1" }}"
{% if tab.is_not_default %}class="pk-tabs--button-marker"{% endif %}>{{ tab.name }}</button>
{% endfor %}
</div>
<div class="cell-properties pk-tabs">
<div class="pk-tabs--tab-list" role="tablist" aria-label="{% trans "Cell Properties" %}">
{% for tab in manager_tabs %}
<button role="tab"
aria-selected="{{ forloop.first|yesno:"true,false" }}"
aria-controls="panel-{{ cell.get_reference }}-{{ tab.slug }}"
id="tab-{{ cell.get_reference }}-{{ tab.slug }}"
tabindex="{{ forloop.first|yesno:"0,-1" }}"
{% if tab.is_not_default %}class="pk-tabs--button-marker"{% endif %}>{{ tab.name }}</button>
{% endfor %}
</div>
<form class="pk-tabs--container" action="{{ url }}" method="post">
{% csrf_token %}
{% for tab in manager_tabs %}
<div id="panel-{{ cell.get_reference }}-{{ tab.slug }}"
role="tabpanel" tabindex="0" {% if not forloop.first %}hidden{% endif %}
data-tab-slug="{{ tab.slug }}"
aria-labelledby="tab-{{ cell.get_reference }}-{{ tab.slug }}">
{% if tab.template %}{% include tab.template %}{% else %}{{ tab.form_instance.as_p }}{% endif %}
</div>
{% endfor %}
<div class="cell-properties--buttons">
{% block cell-buttons %}
<button class="submit-button save">{% trans 'Save' %}</button>
<span>
<a class="pk-button duplicate-button" rel="popup" title="{% trans 'Duplicate' %}"
href="{% url 'combo-manager-page-duplicate-cell' page_pk=page.id cell_reference=cell.get_reference %}"
><span>{% trans 'Duplicate' %}</span></a>
<a class="pk-button delete-button" rel="popup" title="{% trans 'Delete' %}"
href="{% url 'combo-manager-page-delete-cell' page_pk=page.id cell_reference=cell.get_reference %}"
><span>{% trans 'Delete' %}</span></a>
</span>
{% endblock %}
</div>
</form>
</div>
<form class="pk-tabs--container" action="{{ url }}" method="post">
{% csrf_token %}
{% for tab in manager_tabs %}
<div id="panel-{{ cell.get_reference }}-{{ tab.slug }}"
role="tabpanel" tabindex="0" {% if not forloop.first %}hidden{% endif %}
data-tab-slug="{{ tab.slug }}"
aria-labelledby="tab-{{ cell.get_reference }}-{{ tab.slug }}">
{% if tab.template %}{% include tab.template %}{% else %}{{ tab.form_instance.as_p }}{% endif %}
</div>
{% endfor %}
<div class="cell-properties--buttons">
{% block cell-buttons %}
<button class="submit-button save">{% trans 'Save' %}</button>
<span>
<a class="pk-button duplicate-button" rel="popup" title="{% trans 'Duplicate' %}"
href="{% url 'combo-manager-page-duplicate-cell' page_pk=page.id cell_reference=cell.get_reference %}"
><span>{% trans 'Duplicate' %}</span></a>
<a class="pk-button delete-button" rel="popup" title="{% trans 'Delete' %}"
href="{% url 'combo-manager-page-delete-cell' page_pk=page.id cell_reference=cell.get_reference %}"
><span>{% trans 'Delete' %}</span></a>
</span>
{% endblock %}
</div>
</form>
</div>
{% endblock %}

View File

@ -2,69 +2,69 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Pages' %}</h2>
<span class="actions">
{% if user.is_superuser %}
<a class="extra-actions-menu-opener"></a>
{% endif %}
{% if can_add_page %}
<a rel="popup" href="{% url 'combo-manager-page-add' %}">{% trans 'New' %}</a>
{% endif %}
{% if user.is_superuser %}
<ul class="extra-actions-menu">
<li><a href="{% url 'combo-manager-site-export' %}" rel="popup" data-autoclose-dialog="true">{% trans 'Export Site' %}</a></li>
<li><a href="{% url 'combo-manager-site-import' %}">{% trans 'Import Site' %}</a></li>
<li><a href="{% url 'combo-manager-invalid-cell-report' %}">{% trans 'Anomaly report' %}</a></li>
<li><a href="{% url 'combo-manager-site-settings' %}" rel="popup" data-autoclose-dialog="true">{% trans 'Site Settings' %}</a></li>
{% for extra_action in extra_actions %}
<li><a href="{{ extra_action.href }}">{{ extra_action.text }}</a></li>
{% endfor %}
</ul>
{% endif %}
</span>
<h2>{% trans 'Pages' %}</h2>
<span class="actions">
{% if user.is_superuser %}
<a class="extra-actions-menu-opener"></a>
{% endif %}
{% if can_add_page %}
<a rel="popup" href="{% url 'combo-manager-page-add' %}">{% trans 'New' %}</a>
{% endif %}
{% if user.is_superuser %}
<ul class="extra-actions-menu">
<li><a href="{% url 'combo-manager-site-export' %}" rel="popup" data-autoclose-dialog="true">{% trans 'Export Site' %}</a></li>
<li><a href="{% url 'combo-manager-site-import' %}">{% trans 'Import Site' %}</a></li>
<li><a href="{% url 'combo-manager-invalid-cell-report' %}">{% trans 'Anomaly report' %}</a></li>
<li><a href="{% url 'combo-manager-site-settings' %}" rel="popup" data-autoclose-dialog="true">{% trans 'Site Settings' %}</a></li>
{% for extra_action in extra_actions %}
<li><a href="{{ extra_action.href }}">{{ extra_action.text }}</a></li>
{% endfor %}
</ul>
{% endif %}
</span>
{% endblock %}
{% block content %}
{% if object_list %}
{% if object_list %}
<p class="hint">
{% blocktrans %}
Use drag and drop with the ⣿ handles to reorder and change hierarchy of pages.
{% endblocktrans %}
</p>
<p class="hint">
{% blocktrans %}
Use drag and drop with the ⣿ handles to reorder and change hierarchy of pages.
{% endblocktrans %}
</p>
<div class="objects-list" id="pages-list" data-page-order-url="{% url 'combo-manager-page-order' %}">
{% for page in object_list %}
<div class="page level-{{page.level}}{% if collapse_pages %} untoggled{% endif %}" data-page-id="{{page.id}}" data-level="{{page.level}}">
{% if user.is_superuser %}<span class="handle"></span>{% endif %}
<span class="group1">
<a href="{% url 'combo-manager-page-view' pk=page.id %}">
{{ page.title }}
{% for label in page.extra_labels %}{% if forloop.first %}<small>({% endif %}{{ label }}{% if forloop.last %})</small>{% else %}, {% endif %}{% endfor %}
</a>
</span>
{% if not page.public %}
<span class="visibility-summary" title="{% trans 'Restricted visibility' %}">
{% with page.groups.all as page_groups %}
{% for group in page_groups %}{{ group.name }}{% if not forloop.last %}, {% endif %}
{% empty %}
{% trans "logged users" %}
{% endfor %}
{% endwith %}
</span>
{% endif %}
{% if collapse_pages %}<span class="togglable"></span>{% endif %}
</div>
{% endfor %}
</div>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This site doesn't have any page yet. Click on the "New" button in the top
right of the page to add a first one.
{% endblocktrans %}
</div>
{% endif %}
<div class="objects-list" id="pages-list" data-page-order-url="{% url 'combo-manager-page-order' %}">
{% for page in object_list %}
<div class="page level-{{page.level}}{% if collapse_pages %} untoggled{% endif %}" data-page-id="{{page.id}}" data-level="{{page.level}}">
{% if user.is_superuser %}<span class="handle"></span>{% endif %}
<span class="group1">
<a href="{% url 'combo-manager-page-view' pk=page.id %}">
{{ page.title }}
{% for label in page.extra_labels %}{% if forloop.first %}<small>({% endif %}{{ label }}{% if forloop.last %})</small>{% else %}, {% endif %}{% endfor %}
</a>
</span>
{% if not page.public %}
<span class="visibility-summary" title="{% trans 'Restricted visibility' %}">
{% with page.groups.all as page_groups %}
{% for group in page_groups %}{{ group.name }}{% if not forloop.last %}, {% endif %}
{% empty %}
{% trans "logged users" %}
{% endfor %}
{% endwith %}
</span>
{% endif %}
{% if collapse_pages %}<span class="togglable"></span>{% endif %}
</div>
{% endfor %}
</div>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This site doesn't have any page yet. Click on the "New" button in the top
right of the page to add a first one.
{% endblocktrans %}
</div>
{% endif %}
{% endblock %}

View File

@ -2,27 +2,27 @@
{% load i18n %}
{% block appbar %}
{% if view.page_title %}
<h2>{{ view.page_title }}</h2>
{% elif object.id %}
<h2>{% trans "Edit Page" %}</h2>
{% else %}
<h2>{% trans "New Page" %}</h2>
{% endif %}
{% if view.page_title %}
<h2>{{ view.page_title }}</h2>
{% elif object.id %}
<h2>{% trans "Edit Page" %}</h2>
{% else %}
<h2>{% trans "New Page" %}</h2>
{% endif %}
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
{% if object.id %}
<a class="cancel" href="{% url 'combo-manager-page-view' pk=object.id %}">{% trans 'Cancel' %}</a>
{% else %}
<a class="cancel" href="{% url 'combo-manager-homepage' %}">{% trans 'Cancel' %}</a>
{% endif %}
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
{% if object.id %}
<a class="cancel" href="{% url 'combo-manager-page-view' pk=object.id %}">{% trans 'Cancel' %}</a>
{% else %}
<a class="cancel" href="{% url 'combo-manager-homepage' %}">{% trans 'Cancel' %}</a>
{% endif %}
</div>
</form>
{% endblock %}

View File

@ -2,17 +2,17 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans "Duplicate Page" %}</h2>
<h2>{% trans "Duplicate Page" %}</h2>
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'combo-manager-page-view' pk=page.id %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'combo-manager-page-view' pk=page.id %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,17 +2,17 @@
{% load i18n %}
{% block appbar %}
<h2>{% trans "Export Page" %}</h2>
<h2>{% trans "Export Page" %}</h2>
{% endblock %}
{% block content %}
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Export" %}</button>
<a class="cancel" href="{% url 'combo-manager-page-view' pk=page.pk %}">{% trans 'Cancel' %}</a>
</div>
</form>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Export" %}</button>
<a class="cancel" href="{% url 'combo-manager-page-view' pk=page.pk %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -2,34 +2,34 @@
{% load i18n %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.management_form }}
<table id="page-property-forms">
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.management_form }}
<table id="page-property-forms">
<thead>
<tr>
{% for field in form.0 %}
<th class="column-{{ field.name }}{% if field.required %} required{% endif %}">{{ field.label }}</th>
{% endfor %}
</tr>
<tr>
{% for field in form.0 %}
<th class="column-{{ field.name }}{% if field.required %} required{% endif %}">{{ field.label }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for sub_form in form %}
<tr class='page-property-form'>
{% for field in sub_form %}
<td class="field-{{ field.name }}">
{{ field.errors.as_ul }}
{{ field }}
</td>
{% endfor %}
</tr>
{% endfor %}
{% for sub_form in form %}
<tr class='page-property-form'>
{% for field in sub_form %}
<td class="field-{{ field.name }}">
{{ field.errors.as_ul }}
{{ field }}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
<button id="add-page-property-form" type="button">{% trans "Add another" %}</button>
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'combo-manager-page-view' pk=object.pk %}">{% trans 'Cancel' %}</a>
</div>
</form>
</table>
<button id="add-page-property-form" type="button">{% trans "Add another" %}</button>
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{% url 'combo-manager-page-view' pk=object.pk %}">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

Some files were not shown because too many files have changed in this diff Show More