lingo/lingo/pricing/templates/lingo/pricing/manager_pricing_detail.html

103 lines
4.3 KiB
HTML

{% extends "lingo/pricing/manager_pricing_list.html" %}
{% load i18n %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'lingo-manager-pricing-detail' object.pk %}">{{ object }}</a>
{% endblock %}
{% block appbar %}
<h2>
{{ object }}
<span class="identifier">[{% trans "identifier:" %} {{ object.slug }}]</span>
</h2>
<span class="actions">
<a class="extra-actions-menu-opener"></a>
<ul class="extra-actions-menu">
<li><a rel="popup" href="{% url 'lingo-manager-pricing-edit' pk=object.pk %}">{% trans 'Options' %}</a></li>
<li><a rel="popup" class="action-duplicate" href="{% url 'lingo-manager-pricing-duplicate' pk=object.pk %}">{% trans 'Duplicate' %}</a></li>
<li><a href="{% url 'lingo-manager-pricing-export' pk=object.pk %}">{% trans 'Export' %}</a></li>
<li><a rel="popup" href="{% url 'lingo-manager-pricing-delete' pk=object.pk %}">{% trans 'Delete' %}</a></li>
</ul>
</span>
{% endblock %}
{% block content %}
<div class="section">
<div class="pk-tabs">
<div class="pk-tabs--tab-list" role="tablist">
<button aria-controls="panel-variables" aria-selected="true" id="tab-variables" role="tab" tabindex="0">{% trans "Variables" %}</button>
<button aria-controls="panel-criterias" aria-selected="false" id="tab-criterias" role="tab" tabindex="-1">{% trans "Criterias" %}</button>
<button aria-controls="panel-usage" aria-selected="false" id="tab-usage" role="tab" tabindex="-1">{% trans "Used in agendas" %}</button>
</div>
<div class="pk-tabs--container">
<div aria-labelledby="tab-variables" id="panel-variables" role="tabpanel" tabindex="0">
{% if object.extra_variables %}
<label>{% trans 'Extra variables:' %}</label>
{% for key in object.get_extra_variables_keys %}<i>{{ key }}</i>{% if not forloop.last %}, {% endif %}{% endfor %}
{% endif %}
<div class="panel--buttons">
<a class="pk-button" rel="popup" href="{% url 'lingo-manager-pricing-variable-edit' pk=object.pk %}">{% trans 'Define variables' %}</a>
</div>
</div>
<div aria-labelledby="tab-criterias" hidden="" id="panel-criterias" role="tabpanel" tabindex="0">
{% with criterias=object.criterias.all categories=object.categories.all %}
{% if categories %}
<div>
{% blocktrans %}Use drag and drop with the ⣿ handles to reorder categories.{% endblocktrans %}
</div>
{% endif %}
<div class="sortable" data-order-url="{% url 'lingo-manager-pricing-criteria-category-order' object.pk %}">
{% for category in categories %}
<div class="paragraph sortable-item" data-item-id="{{ category.pk }}">
<h4><span class="handle"></span>{% trans "Category:" %} {{ category }}</h4>
<p>{% trans "Selected criterias:" %}</p>
<ul>
{% for criteria in criterias %}
{% if criteria.category == category %}
<li>{{ criteria }}</li>
{% endif %}
{% endfor %}
</ul>
<p>
<a rel="popup" class="pk-button" href="{% url 'lingo-manager-pricing-criteria-category-edit' pk=object.pk category_pk=category.pk %}">{% trans "Change criterias selection" %}</a>
<a rel="popup" class="pk-button" href="{% url 'lingo-manager-pricing-criteria-category-delete' pk=object.pk category_pk=category.pk %}">{% trans "Remove this category" %}</a>
</p>
</div>
{% endfor %}
{% if object.categories.count < 3 %}
<div class="panel--buttons">
<a rel="popup" class="pk-button" href="{% url 'lingo-manager-pricing-criteria-category-add' pk=object.pk %}">{% trans "Add a category" %} <span class="extra-info">({% trans "max 3 categories" %})</span></a>
</div>
{% endif %}
</div>
{% endwith %}
</div>
<div aria-labelledby="tab-usage" hidden="" id="panel-usage" role="tabpanel" tabindex="0">
{% if agendas %}
<ul class="objects-list single-links">
{% for agenda in agendas %}
<li>
<a href="{% url 'lingo-manager-agenda-detail' pk=agenda.pk %}">
{{ agenda.label }}
</a>
</li>
{% endfor %}
</ul>
{% else %}
<div class="big-msg-info">
{% blocktrans %}
This Pricing model is not used yet.
{% endblocktrans %}
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock %}