You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

97 lines
3.8 KiB

{% extends 'base.html' %}
{% load i18n %}
{% block main %}
<ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li>
<li class="active">{% trans 'Tarifs' %}</li>
</ol>
{% include 'message_block.html' %}
<h3>{% trans 'Service list' %}</h3>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>
<a href="{% url 'tarifs:home' %}?order_by=title&dir={{ dir|default:"down" }}">
{% trans 'tariff' %}
</a>
{% if order_by == 'title' %}<span class="glyphicon glyphicon-filter"></span>{% endif %}
</th>
<th>
<a href="{% url 'tarifs:home' %}?order_by=speedIn&dir={{ dir|default:"down" }}">
{% trans 'Speed In' %}
</a>
{% if order_by == 'speedIn' %}<span class="glyphicon glyphicon-filter"></span>{% endif %}
</th>
<th>
<a href="{% url 'tarifs:home' %}?order_by=speedOut&dir={{ dir|default:"down" }}">
{% trans 'Speed Out' %}
</a>
{% if order_by == 'speedOut' %}<span class="glyphicon glyphicon-filter"></span>{% endif %}
</th>
<th>
<a href="{% url 'tarifs:home' %}?order_by=amount&dir={{ dir|default:"down" }}">
{% trans 'Price' %}
</a>
{% if order_by == 'amount' %}<span class="glyphicon glyphicon-filter"></span>{% endif %}
</th>
<th width="250">{% trans 'Script' %}</th>
<th width="50">Do</th>
</tr>
</thead>
<tbody>
{% with can_ch_trf=perms.tariff_app.change_tariff can_del_trf=perms.tariff_app.delete_tariff %}
{% for tar in tariflist %}
<tr>
<td>
{% if can_ch_trf %}
<a href="{% url 'tarifs:edit' tar.id %}"><b>{{ tar.title }}</b></a>
{% else %}
{{ tar.title }}
{% endif %}
</td>
<td>{{ tar.speedIn }}</td>
<td>{{ tar.speedOut }}</td>
<td>{{ tar.amount }} {% trans 'currency' %}</td>
<td>{{ tar.get_calc_type_display }}</td>
<td>
{% if can_del_trf %}
<a href="{% url 'tarifs:del' tar.id %}" class="btn btn-sm btn-danger btn-modal">
<span class="glyphicon glyphicon-remove-circle"></span>
</a>
{% endif %}
</td>
</tr>
{% empty %}
<tr>
<td colspan="6">{% trans 'Услуги пока не существуют' %}.
{% if perms.tariff_app.add_tariff %}
<a href="{% url 'tarifs:add' %}" class="lgtbx">{% trans 'Create' %}</a>
{% endif %}
</td>
</tr>
{% endfor %}
{% endwith %}
</tbody>
{% if perms.tariff_app.add_tariff %}
<tfoot>
<tr>
<td colspan="6">
<a href="{% url 'tarifs:add' %}" class="btn btn-sm btn-success">
<span class="glyphicon glyphicon-plus"></span> {% trans 'Add' %}
</a>
</td>
</tr>
</tfoot>
{% endif %}
</table>
</div>
{% include 'toolbar_page.html' with pag=tariflist %}
{% endblock %}