lingo/lingo/pricing/templates/lingo/pricing/manager_agenda_pricing_deta...

93 lines
3.1 KiB
HTML

{% extends "lingo/pricing/manager_agenda_pricing_list.html" %}
{% load i18n %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'lingo-manager-agenda-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-agenda-pricing-edit' object.pk %}">{% trans 'Options' %}</a></li>
<li><a href="{% url 'lingo-manager-agenda-pricing-export' pk=object.pk %}">{% trans 'Export' %}</a></li>
<li><a rel="popup" href="{% url 'lingo-manager-agenda-pricing-delete' object.pk %}">{% trans 'Delete' %}</a></li>
</ul>
</span>
{% endblock %}
{% block content %}
<div class="section">
<h3>{% trans "Options" %}</h3>
<div>
<ul>
<li>{% trans "Pricing model:" %} <a href="{% url 'lingo-manager-pricing-detail' object.pricing.pk %}">{{ object.pricing }}</a></li>
<li>{% blocktrans with start=object.date_start|date:'d/m/Y' end=object.date_end|date:'d/m/Y' %}From {{ start }} to {{ end }}{% endblocktrans %}</li>
</ul>
</div>
</div>
<div class="section">
<h3>{% trans "Test tool" %}</h3>
<div>
<form method="get" enctype="multipart/form-data">
{{ test_tool_form.as_p }}
<div class="buttons">
<button class="submit-button">{% trans "Compute" %}</button>
</div>
</form>
{% if request.GET and test_tool_form.is_valid %}
{% with test_tool_form.compute as pricing_data %}
<div class="test-tool-result">
<div class="infonotice">
<h3>{% trans "Computed pricing data" %}</h3>
{% if pricing_data.pricing is not None %}<p>{% trans "Pricing:" %} {{ pricing_data.pricing|stringformat:".2f" }}</p>{% endif %}
<pre>{{ pricing_data|pprint }}</pre>
</div>
</div>
{% endwith %}
{% endif %}
</div>
</div>
{% for matrix in object.iter_pricing_matrix %}
<div class="section pricing-matrix">
{% if matrix.criteria %}<h3>{{ matrix.criteria.label }}</h3>{% endif %}
<div>
<table class="main pricing-matrix-{{ matrix.criteria.slug }}">
{% if matrix.rows.0.cells.0.criteria %}
<thead>
<tr>
<th></th>
{% for cell in matrix.rows.0.cells %}<th scope="col">{{ cell.criteria.label }}</th>{% endfor %}
</tr>
</thead>
{% endif %}
<tbody>
{% for row in matrix.rows %}
<tr class="pricing-row-{{ row.criteria.slug }}">
<th scope="row">{{ row.criteria.label }}</th>
{% for cell in row.cells %}<td class="pricing-cell-{{ cell.criteria.slug }}">{{ cell.value|floatformat:"2"|default_if_none:"" }}</td>{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
<p>
<a class="pk-button" href="{% if matrix.criteria %}{% url 'lingo-manager-agenda-pricing-matrix-slug-edit' object.pk matrix.criteria.slug %}{% else %}{% url 'lingo-manager-agenda-pricing-matrix-edit' object.pk %}{% endif %}">{% trans "Edit pricing" %}</a>
</p>
</div>
</div>
{% empty %}
<div class="big-msg-info">
{% blocktrans %}
This pricing model is misconfigured.
{% endblocktrans %}
</div>
{% endfor %}
{% endblock %}