chrono/chrono/pricing/templates/chrono/pricing/manager_agenda_pricing_deta...

62 lines
2.1 KiB
HTML

{% extends "chrono/manager_agenda_settings.html" %}
{% load i18n %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'chrono-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>
{% if user_can_manage %}
<span class="actions">
<a class="extra-actions-menu-opener"></a>
<ul class="extra-actions-menu">
<li><a rel="popup" href="{% url 'chrono-manager-agenda-pricing-edit' agenda.pk object.pk %}">{% trans 'Options' %}</a></li>
<li><a rel="popup" href="{% url 'chrono-manager-agenda-pricing-delete' agenda.pk object.pk %}">{% trans 'Delete' %}</a></li>
</ul>
</span>
{% endif %}
{% endblock %}
{% block content %}
{% for matrix in object.iter_pricing_matrix %}
<div class="section">
{% 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>
{% if user_can_manage %}
<p>
<a class="pk-button" href="{% if matrix.criteria %}{% url 'chrono-manager-agenda-pricing-matrix-slug-edit' agenda.pk object.pk matrix.criteria.slug %}{% else %}{% url 'chrono-manager-agenda-pricing-matrix-edit' agenda.pk object.pk %}{% endif %}">{% trans "Edit Pricing" %}</a>
</p>
{% endif %}
</div>
</div>
{% empty %}
<div class="big-msg-info">
{% blocktrans %}
This pricing model is misconfigured.
{% endblocktrans %}
</div>
{% endfor %}
{% endblock %}