100 lines
2.8 KiB
HTML
100 lines
2.8 KiB
HTML
{% extends "combo/pwa/manager_base.html" %}
|
|
{% load i18n thumbnail %}
|
|
|
|
{% block content %}
|
|
<div class="manager-mobile-home-layout">
|
|
<div id="mobile-case">
|
|
<div class="screen" style="background: {{ theme_color }};">
|
|
<div class="mobile-top-bar"><span class="clock">--:--</span></div>
|
|
<div class="mobile-app-content">
|
|
<div class="splash">
|
|
<div class="appicon">
|
|
{% if pwa_settings.application_icon %}
|
|
{% thumbnail pwa_settings.application_icon '512x512' crop='center' format='PNG' as im %}
|
|
<img src="{{ im.url }}" alt="">
|
|
{% endthumbnail %}
|
|
{% endif %}
|
|
</div>
|
|
<div class="applabel">{% firstof global_title "Compte Citoyen" %}</div>
|
|
</div>
|
|
<iframe scrolling="no"></iframe>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="sections">
|
|
|
|
<div class="section 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 class="section settings">
|
|
<h3>{% trans "Settings" %}</h3>
|
|
<div>
|
|
<form method="post" enctype="multipart/form-data">
|
|
{% csrf_token %}
|
|
{{ form.as_p }}
|
|
<div class="buttons">
|
|
<button class="submit-button">{% trans "Save" %}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
</div> {# .sections #}
|
|
</div> {# .manager-mobile-home-layout #}
|
|
|
|
<script>
|
|
setInterval(function() {
|
|
var $clock = $('#mobile-case .clock');
|
|
var date = new Date();
|
|
$clock.text(('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2));
|
|
}, 500);
|
|
|
|
$(function() {
|
|
$('.mobile-app-content .splash').on('click', function() {
|
|
$('.mobile-app-content iframe').attr('src', '/');
|
|
$('.mobile-app-content').addClass('splash-off');
|
|
});
|
|
|
|
$('.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 %}
|