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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,61 +1,61 @@
{% load i18n %} {% load i18n %}
{% block cell-content %} {% block cell-content %}
<h2>{{ cell.title }}</h2> <h2>{{ cell.title }}</h2>
<div> <div>
{% if form.fields %} {% if form.fields %}
<form method='get' enctype='multipart/form-data' id='chart-filters'> <form method='get' enctype='multipart/form-data' id='chart-filters'>
{{ form.as_p }} {{ form.as_p }}
<div class='buttons'> <div class='buttons'>
<button class='submit-button'>{% trans 'Refresh' %}</button> <button class='submit-button'>{% trans 'Refresh' %}</button>
</div> </div>
</form> </form>
{% else %} {% else %}
<p> <p>
{% blocktrans trimmed %} {% 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. 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 %} {% endblocktrans %}
</p> </p>
{% endif %} {% endif %}
</div> </div>
<script> <script>
$(function () { $(function () {
if (!$('body').data('filters-cell-id')) { if (!$('body').data('filters-cell-id')) {
$('body').data('filters-cell-id', Math.random().toString(36).slice(2, 7)); $('body').data('filters-cell-id', Math.random().toString(36).slice(2, 7));
var loaded_cell_count = 0; var loaded_cell_count = 0;
document.querySelectorAll('div.chartngcell embed').forEach(graph => { document.querySelectorAll('div.chartngcell embed').forEach(graph => {
graph.addEventListener('load', function() { graph.addEventListener('load', function() {
if (++loaded_cell_count == $('div.chartngcell embed').length) { if (++loaded_cell_count == $('div.chartngcell embed').length) {
combo_load_cell($('.chart-filters-cell')); combo_load_cell($('.chart-filters-cell'));
loaded_cell_count = 0; 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) { start_field = $('#id_time_range_start');
e.preventDefault(); end_field = $('#id_time_range_end');
$(window).trigger('combo:refresh-graphs'); $('#id_time_range').change(function() {
chart_cell = $(this).parents('.cell'); if(this.value == 'range') {
ajax_cell_url = "{{ site_base }}{{ cell.get_ajax_url }}"; start_field.parent().show();
new_url = ajax_cell_url + '?filters_cell_id=' + $('body').data('filters-cell-id') + '&' + $(this).serialize(); end_field.parent().show();
chart_cell.data('ajax-cell-url', new_url); } 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 %} {% endblock %}

View File

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

View File

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

View File

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

View File

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

View File

@ -1,58 +1,58 @@
{% load i18n %} {% load i18n %}
{% block cell-content %} {% block cell-content %}
{% if json.data %} {% if json.data %}
{% if cell.title %} {% if cell.title %}
<h2> <h2>
{{ cell.title }} {{ cell.title }}
</h2> </h2>
{% endif %} {% endif %}
<div class="weekly-agenda-cell weekly-agenda-cell-{{ cell.pk }}" data-cell-id="{{ cell.pk }}"> <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 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 %} {% with last_day=last_item.date|date|adjust_to_week_monday|add_days:6 %}
{% now 'Y-m-W' as current_week %} {% now 'Y-m-W' as current_week %}
{% spaceless %} {% spaceless %}
<button class="weekly-agenda-cell--previous-week"></button> <button class="weekly-agenda-cell--previous-week"></button>
<div class="weekly-agenda-cell--week-list"> <div class="weekly-agenda-cell--week-list">
<div class="weekly-agenda-cell--slider"> <div class="weekly-agenda-cell--slider">
{% for day in first_monday|iterate_days_until:last_day %} {% for day in first_monday|iterate_days_until:last_day %}
{% if day.weekday == 0 %} {% if day.weekday == 0 %}
{% with sunday=day|add_days:6 %} {% with sunday=day|add_days:6 %}
<div class="weekly-agenda-cell--week-title {% if current_week == day|date:'Y-m-W' %}current{% endif %}" <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 %}> {% 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 %} {% 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> </div>
{% endwith %} {% 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 %} {% 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 %} {% endfor %}
{% endwith %} </div>
<div class="weekly-agenda-cell--day-no-activity">{% trans "No activity this week" %}</div>
</div> </div>
{% endfor %} <button class="weekly-agenda-cell--next-week"></button>
</div> {% if booking_form_url %}
</div> <a class="pk-button weekly-agenda-cell--edit-btn">
<button class="weekly-agenda-cell--next-week"></button> {% trans "Update bookings" %}
{% if booking_form_url %} </a>
<a class="pk-button weekly-agenda-cell--edit-btn"> {% endif %}
{% trans "Update bookings" %} {% endspaceless %}
</a> {% endwith %}
{% endif %} {% endwith %}
{% endspaceless %} </div>
{% endwith %} {% endif %}
{% endwith %}
</div>
{% endif %}
{% endblock %} {% endblock %}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,15 +4,15 @@
<body style="max-width: 60em"> <body style="max-width: 60em">
<p>{% blocktrans with id=invoice.id creation_date=invoice.creation_date|date:"DATE_FORMAT" amount=invoice.amount %} <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. 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 %} {% 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 %} {% else %}
<p>{% blocktrans %}You can view it on the <a href="{{ portal_url }}">portal</a>.{% endblocktrans %}</p> <p>{% blocktrans %}You can view it on the <a href="{{ portal_url }}">portal</a>.{% endblocktrans %}</p>
{% if invoice.no_online_payment_reason == 'autobilling' %} {% 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>{% 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> </p>
{% endif %} {% endif %}
{% endif %} {% endif %}
</body> </body>
</html> </html>

View File

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

View File

@ -2,76 +2,76 @@
<div id="content"> <div id="content">
<div id="appbar"> <div id="appbar">
{% if item %} {% if item %}
<h2> <h2>
{% blocktrans with number=item.display_id %} {% blocktrans with number=item.display_id %}
Item nr. {{ number }} Item nr. {{ number }}
{% endblocktrans %} {% endblocktrans %}
</h2> </h2>
<form action="{% url 'lingo-pay' %}" method="POST"> <form action="{% url 'lingo-pay' %}" method="POST">
<div id="item"> <div id="item">
{% if item.subject %} {% if item.subject %}
<h4 class="label"> <h4 class="label">
{% blocktrans with label=item.subject %} {% blocktrans with label=item.subject %}
Label: {{ label }} Label: {{ label }}
{% endblocktrans %} {% endblocktrans %}
</h4> </h4>
{% endif %} {% endif %}
<div class="total_amount"> <div class="total_amount">
{% blocktrans with amount=item.total_amount|floatformat:"2" %} {% blocktrans with amount=item.total_amount|floatformat:"2" %}
Total amount: <span class="amount">{{ amount }}€</span> Total amount: <span class="amount">{{ amount }}€</span>
{% endblocktrans %} {% 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/>
</div> </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="regie" value="{{ regie.pk }}"/>
<input type="hidden" name="item" value="{{ item.id }}"/> <input type="hidden" name="item" value="{{ item.id }}"/>
<input type="hidden" name="next_url" value="{{ page.get_online_url }}" /> <input type="hidden" name="next_url" value="{{ page.get_online_url }}" />
{% if item_url %} {% if item_url %}
<input type="hidden" name="item_url" value="{{ item_url }}"/> <input type="hidden" name="item_url" value="{{ item_url }}"/>
{% endif %} {% endif %}
<div class="buttons"> <div class="buttons">
<button>{% trans "Pay" %}</button> <button>{% trans "Pay" %}</button>
</div>
{% endif %}
</div> </div>
{% endif %} </form>
</div>
</form>
{% else %} {% else %}
<h2>{{ err_desc }}</h2> <h2>{{ err_desc }}</h2>
<form></form> <form></form>

View File

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

View File

@ -2,52 +2,52 @@
{% load static i18n %} {% load static i18n %}
{% block combo-content %} {% block combo-content %}
{% block wait-js %} {% block wait-js %}
<script> <script>
function display_error(message) { function display_error(message) {
$('#transaction-error').text(message); $('#transaction-error').text(message);
$('#transaction-error').show(); $('#transaction-error').show();
$("#wait-msg").hide(); $("#wait-msg").hide();
} }
$(function() { $(function() {
var next_url = '{{next_url}}'; var next_url = '{{next_url}}';
var transaction_id = '{{transaction_id}}'; var transaction_id = '{{transaction_id}}';
if (transaction_id === "") { if (transaction_id === "") {
display_error($('#transaction-error').data('error')); display_error($('#transaction-error').data('error'));
} }
else { else {
$.ajax({ $.ajax({
url: `/api/lingo/transaction-status/${transaction_id}/`, url: `/api/lingo/transaction-status/${transaction_id}/`,
success: function(data, status) { success: function(data, status) {
if (!data.wait) { if (!data.wait) {
$('#wait-msg').text($('#wait-msg').data('continue')) $('#wait-msg').text($('#wait-msg').data('continue'))
// wait a little to show messages // wait a little to show messages
setTimeout(function(){location.href=next_url}, 3000); setTimeout(function(){location.href=next_url}, 3000);
} else if (data.error) { } else if (data.error) {
display_error(data.error_msg) display_error(data.error_msg)
} else { } else {
setTimeout(wait_payment, 3000, next_url, transaction_id); setTimeout(wait_payment, 3000, next_url, transaction_id);
} }
}, },
error: function(error) { error: function(error) {
display_error($('#transaction-status').data('error')); display_error($('#transaction-status').data('error'));
window.console && console.log(':(', error); window.console && console.log(':(', error);
} }
}); });
} }
}); });
</script> </script>
{% endblock %} {% endblock %}
{% block wait-content%} {% block wait-content%}
<div> <div>
{% block wait-message %} {% 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> <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 %} {% 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 %} {% endblock %}

View File

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

View File

@ -1,31 +1,31 @@
{% load i18n %} {% load i18n %}
{% block cell-content %} {% block cell-content %}
{% if title %}<h2>{{ title }}</h2>{% endif %} {% if title %}<h2>{{ title }}</h2>{% endif %}
<div> <div>
{% if text %}<p>{{ text|safe }}</p>{% endif %} {% if text %}<p>{{ text|safe }}</p>{% endif %}
<form class="quixote" action="{% url 'lingo-self-invoice' cell_id=cell.id %}"> <form class="quixote" action="{% url 'lingo-self-invoice' cell_id=cell.id %}">
<div class="widget"> <div class="widget">
<div class="title"> <div class="title">
{% trans 'Invoice Number' %} {% trans 'Invoice Number' %}
<span class="required">*</span> <span class="required">*</span>
</div> </div>
<div class="content"> <div class="content">
<input type="text" name="invoice-number" required="required"> <input type="text" name="invoice-number" required="required">
</div> </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>
<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 %} {% endblock %}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,38 +2,38 @@
{% load i18n %} {% load i18n %}
{% block appbar %} {% block appbar %}
<h2>{% trans 'Regies' %}</h2> <h2>{% trans 'Regies' %}</h2>
<span class="actions"> <span class="actions">
<a rel="popup" href="{% url 'lingo-manager-regie-add' %}">{% trans 'New' %}</a> <a rel="popup" href="{% url 'lingo-manager-regie-add' %}">{% trans 'New' %}</a>
</span> </span>
{% endblock %} {% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
{{ block.super }} {{ block.super }}
<a href="{% url 'lingo-manager-regie-list' %}">{% trans 'Regies' %}</a> <a href="{% url 'lingo-manager-regie-list' %}">{% trans 'Regies' %}</a>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% if object_list %} {% if object_list %}
<ul class="objects-list single-links"> <ul class="objects-list single-links">
{% for regie in object_list %} {% for regie in object_list %}
<li> <li>
<a href="{% url 'lingo-manager-regie-edit' pk=regie.id %}">{{ regie.label }} <a href="{% url 'lingo-manager-regie-edit' pk=regie.id %}">{{ regie.label }}
<span>({{regie.payment_backend.label}})</span> <span>({{regie.payment_backend.label}})</span>
{% if regie.is_default %}<span class="extra-info">{% trans "(default regie)" %}</span>{% endif %} {% if regie.is_default %}<span class="extra-info">{% trans "(default regie)" %}</span>{% endif %}
</a> </a>
<a rel="popup" class="delete" href="{% url 'lingo-manager-regie-delete' pk=regie.id %}">{% trans "remove" %}</a> <a rel="popup" class="delete" href="{% url 'lingo-manager-regie-delete' pk=regie.id %}">{% trans "remove" %}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
{% else %} {% else %}
<div class="big-msg-info"> <div class="big-msg-info">
{% blocktrans %} {% blocktrans %}
This site doesn't have any regie yet. Click on the "New" button in the top 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. right of the page to add a first one.
{% endblocktrans %} {% endblocktrans %}
</div> </div>
{% endif %} {% endif %}
{% endblock %} {% 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> <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> </ul>
{% if regies|length > 1 %} {% if regies|length > 1 %}
<p><label>{% trans "Community identifier" %}</label> <p><label>{% trans "Community identifier" %}</label>
<select id="numcli"> <select id="numcli">
{% for regie in regies %} {% for regie in regies %}
<option value="{{ regie.0 }}">{{ regie.1 }}</option> <option value="{{ regie.0 }}">{{ regie.1 }}</option>
{% endfor %} {% endfor %}
</select> </select>
</p> </p>
{% else %} {% else %}
<input type="hidden" id="numcli" value="{{ regies.0.0 }}" /> <input type="hidden" id="numcli" value="{{ regies.0.0 }}" />
{% endif %} {% endif %}
<ul class="errorlist" id="refdet_error" style="display: none"> <ul class="errorlist" id="refdet_error" style="display: none">
<li>{% trans "invalid reference" %}</li> <li>{% trans "invalid reference" %}</li>
@ -26,11 +26,11 @@
<label>{% trans "Reference" %}</label> <label>{% trans "Reference" %}</label>
{% regroup reference_fields by protocol as fields %} {% regroup reference_fields by protocol as fields %}
{% for field in fields %} {% for field in fields %}
{% for f in field.list %} {% for f in field.list %}
{% if field.grouper == control_protocol or field.grouper == 'any' %} {% 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 %} <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 %} {% endif %}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
</p> </p>
<ul class="errorlist" id="montant_error" style="display: none"> <ul class="errorlist" id="montant_error" style="display: none">

View File

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

View File

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

View File

@ -1,29 +1,29 @@
{% load i18n %} {% load i18n %}
{% with widget_value=widget.value|stringformat:'s' %} {% with widget_value=widget.value|stringformat:'s' %}
{% spaceless %} {% spaceless %}
<span id="{{ widget.name }}-joined-buttons" class="gadjo-joined-buttons"> <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="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> <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> </span>
{% endspaceless %} {% 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" %}> <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 %} {% endwith %}
<script> <script>
$(function() { $(function() {
$('#{{ widget.name }}-joined-buttons button').on('click', function() { $('#{{ widget.name }}-joined-buttons button').on('click', function() {
var $current_mode = $('#{{ widget.name }}-joined-buttons button[aria-pressed=true]'); var $current_mode = $('#{{ widget.name }}-joined-buttons button[aria-pressed=true]');
$current_mode.data('previous-value', $('#{{ widget.name }}-input').val()); $current_mode.data('previous-value', $('#{{ widget.name }}-input').val());
if ($(this).is('[aria-pressed=true]')) { if ($(this).is('[aria-pressed=true]')) {
$('#{{ widget.name }}-joined-buttons button').attr('aria-pressed', 'true'); $('#{{ widget.name }}-joined-buttons button').attr('aria-pressed', 'true');
$(this).attr('aria-pressed', 'false'); $(this).attr('aria-pressed', 'false');
} else { } else {
$('#{{ widget.name }}-joined-buttons button').attr('aria-pressed', 'false'); $('#{{ widget.name }}-joined-buttons button').attr('aria-pressed', 'false');
$(this).attr('aria-pressed', 'true'); $(this).attr('aria-pressed', 'true');
} }
var $new_mode = $('#{{ widget.name }}-joined-buttons button[aria-pressed=true]'); var $new_mode = $('#{{ widget.name }}-joined-buttons button[aria-pressed=true]');
var mode = $new_mode.data('mode'); var mode = $new_mode.data('mode');
$('#{{ widget.name }}-input').prop('type', mode).val($new_mode.data('previous-value')); $('#{{ widget.name }}-input').prop('type', mode).val($new_mode.data('previous-value'));
return false; return false;
});
}); });
});
</script> </script>

View File

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

View File

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

View File

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

View File

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

View File

@ -2,33 +2,33 @@
{% load i18n %} {% load i18n %}
{% block cell-form %} {% block cell-form %}
{{ form.as_p }} {{ form.as_p }}
{% with cell.get_maplayer_options as options %} {% with cell.get_maplayer_options as options %}
{% if options %} {% if options %}
<p><label>{% trans "Layers:" %}</label></p> <p><label>{% trans "Layers:" %}</label></p>
<div> <div>
<ul class="objects-list list-of-layers"> <ul class="objects-list list-of-layers">
{% for option in options %} {% for option in options %}
<li> <li>
<span>{{ option.map_layer.label }} {% if option.map_layer.kind == 'tiles' %}({{ option.map_layer.get_kind_display }}){% endif %}</span> <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 "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> <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> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </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>
{% endif %} {% endif %}
{% if free_tiles %} {% endwith %}
{% 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> {% 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 %} {% endif %}
</div> {% endwith %}
{% endif %}
{% endwith %}
{% endblock %} {% endblock %}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,83 +1,83 @@
{% load i18n %} {% load i18n %}
{% block cell-content %} {% block cell-content %}
{% if cell.title %} {% if cell.title %}
<h2>{{ cell.title }}</h2> <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();
{% endif %} {% endif %}
});
</script> {% block search-form-pre %}
{% endblock %} {% 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 %} {% endblock %}

View File

@ -1,22 +1,22 @@
{% load i18n %} {% load i18n %}
{% block cell-content %} {% block cell-content %}
{% if all_formdefs %} {% if all_formdefs %}
<h2>{% trans "New Form" %}</h2> <h2>{% trans "New Form" %}</h2>
{% for site_formdefs in all_formdefs.values %} {% for site_formdefs in all_formdefs.values %}
<div class="links-list"> <div class="links-list">
{% if all_formdefs.keys|length > 1 %}<h3>{{ site_formdefs.title }}</h3>{% endif %} {% if all_formdefs.keys|length > 1 %}<h3>{{ site_formdefs.title }}</h3>{% endif %}
<ul> <ul>
{% regroup site_formdefs.data|dictsort:"category" by category as categories_formdefs %} {% regroup site_formdefs.data|dictsort:"category" by category as categories_formdefs %}
{% for category_formdefs in categories_formdefs %} {% for category_formdefs in categories_formdefs %}
<li><h4>{{ category_formdefs.grouper }}</h4></li> <li><h4>{{ category_formdefs.grouper }}</h4></li>
{% for formdef in category_formdefs.list|dictsort:"title" %} {% 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> <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 %}
{% endfor %} {% elif not combo_hide_empty_message %}
</ul> <div class="cell--body"><p class="empty-message">{% trans "There are no possible backoffice submissions." %}</p></div>
</div> {% endif %}
{% 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 %}
{% endblock %} {% endblock %}

View File

@ -1,29 +1,29 @@
{% load combo %}{% spaceless %} {% load combo %}{% spaceless %}
{% if field.type == "text" and field.display_mode == 'rich' and value %} {% 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' %} {% if cell.display_mode == 'table' or cell.display_mode == 'card' and item.display_mode == 'text' %}
<div class="value">{{ value|safe }}</div> <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 %} {% 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 %} {% 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 %} {% endspaceless %}

View File

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

View File

@ -1,35 +1,35 @@
{% spaceless %} {% spaceless %}
{% if item.varname == "@custom@" %} {% if item.varname == "@custom@" %}
{% if item.template %} {% if item.template %}
{% with card.custom_fields|get:item.template|force_escape as value %} {% with card.custom_fields|get:item.template|force_escape as value %}
{% if not ul_display %}<td>{% endif %}{{ value }}{% if not ul_display %}</td>{% endif %} {% if not ul_display %}<td>{% endif %}{{ value }}{% if not ul_display %}</td>{% endif %}
{% endwith %} {% endwith %}
{% endif %} {% endif %}
{% elif item.varname == "@link@" %} {% elif item.varname == "@link@" %}
{% if item.template and item.page|default:item.url_template %} {% if item.template and item.page|default:item.url_template %}
{% with item.page|default:item.url_template as url_key %} {% 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 %} {% 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 not ul_display %}<td>{% endif %}
{% if link_label and link_url %} {% if link_label and link_url %}
<a href="{{ link_url }}"{% if item.display_mode == 'button' %} class="pk-button"{% endif %}>{{ link_label }}</a> <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 %} {% 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 %} {% 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 %} {% endif %}
{% endwith %}
{% endif %}
{% endwith %}
{% endif %}
{% endif %}
{% endspaceless %} {% endspaceless %}

View File

@ -2,71 +2,71 @@
{% block cell-content %} {% block cell-content %}
{% block cell-header %} {% block cell-header %}
{% if title %}<h2>{{ title|force_escape }}</h2>{% endif %} {% if title %}<h2>{{ title|force_escape }}</h2>{% endif %}
{% include "combo/asset_picture_fragment.html" %} {% include "combo/asset_picture_fragment.html" %}
{% endblock %} {% endblock %}
{% if card_objects %} {% if card_objects %}
{% with cell.get_custom_schema as custom_schema %} {% with cell.get_custom_schema as custom_schema %}
{% if cell.custom_schema and cell.custom_schema.cells|length > 1 %} {% if cell.custom_schema and cell.custom_schema.cells|length > 1 %}
<div class="pk-table-wrapper"> <div class="pk-table-wrapper">
<table class="pk-data-table pk-table-headers"> <table class="pk-data-table pk-table-headers">
{% if custom_schema.grid_headers %} {% if custom_schema.grid_headers %}
<thead> <thead>
{% for item in custom_schema.cells %} {% for item in custom_schema.cells %}
{% if item.varname == "@custom@" %} {% if item.varname == "@custom@" %}
{% if item.template %} {% if item.template %}
<th>{{ item.header|default:"" }}</th> <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 %} {% endif %}
{% elif item.varname == "@link@" %} {% include "combo/pagination.html" %}
{% if item.template and item.page|default:item.url_template %} {% endwith %}
<th>{{ item.header|default:"" }}</th> {% else %}
{% endif %} <div class="cell--body"><p class="empty-message">{% trans "There are no cards." %}</p></div>
{% 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 %} {% 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 %} {% endblock %}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,14 +1,14 @@
{% firstof form.url url as form_url %} {% firstof form.url url as form_url %}
{% firstof form.title title as form_title %} {% firstof form.title title as form_title %}
{% autoescape off %} {% autoescape off %}
{% firstof form.description description as form_description %} {% firstof form.description description as form_description %}
{% endautoescape %} {% endautoescape %}
{% block form-link-pre %}{% endblock %} {% 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> <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 %} {% 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 %} {% endif %}
{% block form-link-post %}{% endblock %} {% block form-link-post %}{% endblock %}

View File

@ -1,38 +1,38 @@
{% load assets i18n %} {% load assets i18n %}
{% block cell-content %} {% block cell-content %}
{% if forms or combo_display_even_empty_categories %} {% if forms or combo_display_even_empty_categories %}
{% block cell-header %} {% block cell-header %}
<h2>{{ title }}</h2> <h2>{{ title }}</h2>
{% include "combo/asset_picture_fragment.html" %} {% include "combo/asset_picture_fragment.html" %}
{% if description %} {% if description %}
<div class="intro"> <div class="intro">
{{ description|safe }} {{ description|safe }}
</div> </div>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
<div class="wcs-forms-of-category-{{slug}} links-list"> <div class="wcs-forms-of-category-{{slug}} links-list">
{% block cell-top-content %}{% endblock cell-top-content %} {% block cell-top-content %}{% endblock cell-top-content %}
<ul> <ul>
{% for form in forms %} {% for form in forms %}
<li class="{{ form.css_classes|join:" " }}">{% include "combo/wcs/form_link_fragment.html" %}</li> <li class="{{ form.css_classes|join:" " }}">{% include "combo/wcs/form_link_fragment.html" %}</li>
{% endfor %} {% endfor %}
{% if more_forms %} {% if more_forms %}
<li class="add-more-items"> <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> <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> </li>
{% endif %} {% endif %}
</ul> </ul>
{% if more_forms %} {% 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 }}"> <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 %} {% for form in more_forms %}
<li class="more-items--item {{ form.css_classes|join:" " }}"> <li class="more-items--item {{ form.css_classes|join:" " }}">
{% include "combo/wcs/form_link_fragment.html" %} {% include "combo/wcs/form_link_fragment.html" %}
</li> </li>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</ul> </ul>
</div> </div>
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

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

View File

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

View File

@ -1,46 +1,46 @@
{% load i18n %} {% load i18n %}
{% block cell-content %} {% block cell-content %}
<div class="wcs-tracking-code-input"> <div class="wcs-tracking-code-input">
{% block title %} {% block title %}
<h2>{% trans 'Tracking Code' %}</h2> <h2>{% trans 'Tracking Code' %}</h2>
{% endblock %} {% endblock %}
<div> <div>
{% block form-pre %}{% endblock %} {% block form-pre %}{% endblock %}
<form data-wcs-url="{{ url }}" method="post" action="{{ site_base }}{% url 'wcs-tracking-code' %}"> <form data-wcs-url="{{ url }}" method="post" action="{{ site_base }}{% url 'wcs-tracking-code' %}">
{% block form-top %} {% block form-top %}
{% block intro-text %} {% block intro-text %}
<p> <p>
{% blocktrans trimmed %} {% blocktrans trimmed %}
A tracking code is attached to all your forms, it is there to help you in A tracking code is attached to all your forms, it is there to help you in
dealing with the administration. dealing with the administration.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<p> <p>
{% blocktrans trimmed %} {% blocktrans trimmed %}
To find the details of a form linked to a tracking code, you can enter the To find the details of a form linked to a tracking code, you can enter the
code in the entry below: code in the entry below:
{% endblocktrans %} {% endblocktrans %}
</p> </p>
{% endblock %} {% endblock %}
{% endblock %} {% endblock %}
<input id="_cell_url_{{ cell.id }}" name="url" value="" type="hidden"/> <input id="_cell_url_{{ cell.id }}" name="url" value="" type="hidden"/>
<input name="cell" value="{{ cell.id }}" type="hidden"/> <input name="cell" value="{{ cell.id }}" type="hidden"/>
<div id="_cell_error_{{ cell.id }}" class="errornotice" style="display: none"> <div id="_cell_error_{{ cell.id }}" class="errornotice" style="display: none">
{% trans "The tracking code could not been found." %} {% 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> </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 %} {% endblock %}

View File

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

View File

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

View File

@ -2,61 +2,61 @@
{% load i18n %} {% load i18n %}
{% block cell-form %} {% block cell-form %}
{{ form.as_p }} {{ form.as_p }}
{% with cell.get_items_with_prefetch as links %} {% with cell.get_items_with_prefetch as links %}
{% if links %} {% if links %}
<p><label>{% trans "Links:" %}</label></p> <p><label>{% trans "Links:" %}</label></p>
<div> <div>
<ul class="objects-list list-of-links" id="list-of-links-{{ cell.pk }}" <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 %}"> data-link-list-order-url="{% url 'combo-manager-link-list-order' page_pk=page.pk cell_reference=cell.get_reference %}">
{% for link in links %} {% for link in links %}
<li data-link-item-id="{{ link.pk }}"><span class="handle"></span> <li data-link-item-id="{{ link.pk }}"><span class="handle"></span>
<span title="{{ link }}"> <span title="{{ link }}">
{{ link|truncatechars:100 }} {{ link|truncatechars:100 }}
{% with link.get_invalid_reason as invalid_reason %} {% with link.get_invalid_reason as invalid_reason %}
{% if link.extra_css_class %} {% if link.extra_css_class %}
<span class="extra-css-class">[{{ link.extra_css_class }}]</span> <span class="extra-css-class">[{{ link.extra_css_class }}]</span>
{% endif %} {% endif %}
{% if invalid_reason %} {% if invalid_reason %}
<span class="invalid">{{ invalid_reason }} - <span class="invalid">{{ invalid_reason }} -
{% if cell.get_validity_info.invalid_datetime|datetime_in_past %} {% 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 %} {% 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 %} {% else %}
{% blocktrans with link.get_validity_info.invalid_datetime|timeuntil as invalidity_delay %}This link will no longer be displayed in {{ invalidity_delay }}.{% endblocktrans %} {% blocktrans with link.get_validity_info.invalid_datetime|timeuntil as invalidity_delay %}This link will no longer be displayed in {{ invalidity_delay }}.{% endblocktrans %}
{% endif %} {% endif %}
</span> </span>
{% endif %} {% endif %}
{% endwith %} {% endwith %}
</span> </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 "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> <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> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
<script> <script>
$(function () { $(function () {
$('#list-of-links-{{ cell.pk }}').sortable({ $('#list-of-links-{{ cell.pk }}').sortable({
handle: '.handle', handle: '.handle',
update: function(event, ui) { update: function(event, ui) {
var new_order = Object(); var new_order = Object();
$(this).find('li').each(function(i, x) { $(this).find('li').each(function(i, x) {
var suffix = $(x).data('link-item-id'); var suffix = $(x).data('link-item-id');
new_order['pos_' + suffix] = i; new_order['pos_' + suffix] = i;
}); });
$.ajax({ $.ajax({
url: $(this).data('link-list-order-url'), url: $(this).data('link-list-order-url'),
data: new_order data: new_order
}); });
} }
}); });
}); });
</script> </script>
{% endif %} {% endif %}
{% endwith %} {% endwith %}
<div class="buttons"> <div class="buttons">
{% for klass in cell.get_link_cell_classes %} {% 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 %} <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 %} {% endfor %}
</div> </div>
{% endblock %} {% 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 %} <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 %} <optgroup label="{{ group_name }}">{% endif %}{% for option in group_choices %}
{% include option.template_name with widget=option %}{% endfor %}{% if group_name %} {% include option.template_name with widget=option %}{% endfor %}{% if group_name %}
</optgroup>{% endif %}{% endfor %} </optgroup>{% endif %}{% endfor %}
<!-- "other" option: --> <option value="" data-other="true">{% trans "Other:" %}</option> <!-- "other" option: --> <option value="" data-other="true">{% trans "Other:" %}</option>
</select> </select>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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