81 lines
2.7 KiB
HTML
81 lines
2.7 KiB
HTML
{% extends "lingo/pricing/manager_agenda_detail.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block breadcrumb %}
|
|
{{ block.super }}
|
|
<a href="{% url 'lingo-manager-agenda-pricing-detail' agenda.pk object.pk %}">{{ object.pricing }}</a>
|
|
{% endblock %}
|
|
|
|
{% block appbar %}
|
|
<h2>
|
|
{{ object.pricing }} ({{ object.date_start|date:'d/m/Y' }} - {{ object.date_end|date:'d/m/Y' }})
|
|
</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' agenda.pk object.pk %}">{% trans 'Options' %}</a></li>
|
|
<li><a rel="popup" href="{% url 'lingo-manager-agenda-pricing-delete' agenda.pk object.pk %}">{% trans 'Delete' %}</a></li>
|
|
</ul>
|
|
</span>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<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' agenda.pk object.pk matrix.criteria.slug %}{% else %}{% url 'lingo-manager-agenda-pricing-matrix-edit' agenda.pk 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 %}
|