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.
175 lines
9.8 KiB
175 lines
9.8 KiB
{% extends 'base.html' %}
|
|
{% load i18n dpagination %}
|
|
|
|
{% block breadcrumb %}
|
|
<ol class="breadcrumb">
|
|
<li><span class="glyphicon glyphicon-home"></span></li>
|
|
<li><a href="{% url 'abonapp:group_list' %}">{% trans 'User groups' %}</a></li>
|
|
<li class="active">{{ group.title }}</li>
|
|
</ol>
|
|
{% endblock %}
|
|
|
|
{% block page-header %}
|
|
{{ group.title }}
|
|
{% endblock %}
|
|
|
|
{% block main %}
|
|
<div class="row">
|
|
<div class="col-lg-10 col-md-8">
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<h2 class="panel-title">{% trans 'The people in the selected group' %}</h2>
|
|
</div>
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>#</th>
|
|
<th class="col-xs-1">
|
|
<a href="{% url 'abonapp:people_list' group.pk %}?{% url_order_by request order_by='username' %}">
|
|
{% trans 'Sub' %}
|
|
</a>
|
|
{% if order_by == 'username' %}<span class="glyphicon glyphicon-filter"></span>{% endif %}
|
|
</th>
|
|
<th class="hidden-xs">{% trans 'Last traffic' %}</th>
|
|
<th>{% trans 'Network' %}</th>
|
|
<th class="col-xs-3">
|
|
<a href="{% url 'abonapp:people_list' group.pk %}?{% url_order_by request order_by='fio' %}">
|
|
{% trans 'fio' %}
|
|
</a>
|
|
{% if order_by == 'fio' %}<span class="glyphicon glyphicon-filter"></span>{% endif %}
|
|
</th>
|
|
<th class="col-xs-2">
|
|
<a href="{% url 'abonapp:people_list' group.pk %}?{% url_order_by request order_by='street' %}">
|
|
{% trans 'Street' %}
|
|
</a>
|
|
{% if order_by == 'street' %}<span class="glyphicon glyphicon-filter"></span>{% endif %}
|
|
</th>
|
|
<th class="col-xs-1">
|
|
<a href="{% url 'abonapp:people_list' group.pk %}?{% url_order_by request order_by='house' %}">
|
|
{% trans 'Apartment' %}
|
|
</a>
|
|
{% if order_by == 'house' %}<span class="glyphicon glyphicon-filter"></span>{% endif %}
|
|
</th>
|
|
<th class="col-xs-1">{% trans 'Telephone' %}</th>
|
|
<th class="col-xs-2">{% trans 'Service' %}</th>
|
|
<th class="hidden-xs col-sm-1">
|
|
<a href="{% url 'abonapp:people_list' group.pk %}?{% url_order_by request order_by='ballance' %}">
|
|
{% trans 'Balance' %}
|
|
</a>
|
|
{% if order_by == 'ballance' %}<span class="glyphicon glyphicon-filter"></span>{% endif %}
|
|
</th>
|
|
<th class="hidden-xs">{% trans 'Markers' %}</th>
|
|
<th class="col-xs-1">#</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% with can_ch_trf=perms.tariff_app.change_tariff can_del_abon=perms.abonapp.delete_abon %}
|
|
{% for human in object_list %}
|
|
{% if human.is_active %}
|
|
<tr>
|
|
{% else %}
|
|
<tr class="danger">
|
|
{% endif %}
|
|
<td>{% if human.statcache.is_online %}
|
|
<span class="glyphicon glyphicon-ok text-success"></span>
|
|
{% else %}
|
|
<span class="glyphicon glyphicon-remove-sign text-muted"></span>
|
|
{% endif %}
|
|
</td>
|
|
<td class="col-xs-1">
|
|
<a href="{% url 'abonapp:abon_home' human.group_id human.username %}">{{ human.username }}</a>
|
|
</td>
|
|
<td class="hidden-xs">
|
|
{% if human.statcache %}
|
|
{% if human.statcache.is_today %}
|
|
{{ human.statcache.last_time|date:"H:i" }}
|
|
{% else %}
|
|
{{ human.statcache.last_time|date:"D H:i" }}
|
|
{% endif %}
|
|
{% endif %}
|
|
</td>
|
|
<td class="col-xs-1">{{ human.ip_address|default_if_none:'—' }}</td>
|
|
<td class="col-xs-2">{{ human.fio|default:'—' }}</td>
|
|
<td class="col-xs-1">{{ human.street|default:_('Not assigned') }}</td>
|
|
<td class="col-xs-1">{{ human.house|default:'—' }}</td>
|
|
<td class="col-xs-1"><a href="tel:{{ human.telephone }}">{{ human.telephone }}</a></td>
|
|
<td class="col-xs-2">
|
|
{% if human.current_tariff %}
|
|
{% if can_ch_trf %}
|
|
<a href="{% url 'tarifs:edit' human.current_tariff.tariff.pk %}">{{ human.current_tariff.tariff.title }}</a>
|
|
{% else %}
|
|
{{ human.current_tariff.tariff.title }}
|
|
{% endif %}
|
|
{% else %}———
|
|
{% endif %}
|
|
</td>
|
|
<td class="hidden-xs col-sm-1">{{ human.ballance|floatformat:2 }}</td>
|
|
<td class="hidden-xs">
|
|
{% for user_icon in human.get_flag_icons %}<span class="m-icon {{ user_icon }}"></span>
|
|
{% endfor %}
|
|
</td>
|
|
<td class="col-xs-1">
|
|
{% if can_del_abon %}
|
|
<a href="{% url 'abonapp:del_abon' group.pk human.username %}" class="btn btn-danger btn-sm btn-modal">
|
|
<span class="glyphicon glyphicon-remove"></span>
|
|
</a>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr>
|
|
<td colspan="12">
|
|
{% trans 'Subscribers not found' %}.
|
|
{% if perms.abonapp.add_abon %}
|
|
<a href="{% url 'abonapp:add_abon' group.pk %}">{% trans 'Add abon' %}</a>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
{% endwith %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="panel-footer">
|
|
<div class="btn-group btn-group-sm">
|
|
{% if perms.abonapp.add_abon %}
|
|
<a href="{% url 'abonapp:add_abon' group.pk %}" class="btn btn-default" title="{% trans 'Add' %}" data-toggle="tooltip">
|
|
<span class="glyphicon glyphicon-plus"></span> {% trans 'Add abon' %}
|
|
</a>
|
|
{% endif %}
|
|
<a href="{% url 'abonapp:ch_group_tariff' group.pk %}" class="btn btn-default" title="{% trans 'User groups' %}" data-toggle="tooltip">
|
|
<span class="glyphicon glyphicon-subscript"></span> {% trans 'Tariffs in groups' %}
|
|
</a>
|
|
<a href="{% url 'abonapp:phonebook' group.pk %}" class="btn btn-default btn-modal">
|
|
<span class="glyphicon glyphicon-earphone"></span> {% trans 'Phonebook' %}
|
|
</a>
|
|
<a href="{% url 'abonapp:abon_export' group.pk %}" class="btn btn-default btn-modal">
|
|
<span class="glyphicon glyphicon-export"></span> {% trans 'Export users' %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-2 col-md-4">
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">{% trans 'Streets' %}</div>
|
|
<div class="list-group">
|
|
{% for street in streets %}
|
|
<a href="{% url 'abonapp:people_list' group.pk %}?{% url_page_replace request 'street' street.pk %}" class="list-group-item{% if street_id == street.pk %} active{% endif %}">{{ street.name }}</a>
|
|
{% empty %}
|
|
<a href="#" class="list-group-item">{% trans 'No streets found for that group' %}</a>
|
|
{% endfor %}
|
|
<div class="btn-group btn-group-sm btn-group-justified">
|
|
<a href="{% url 'abonapp:street_add' group.pk %}" class="btn btn-success btn-modal" data-toggle="tooltip" title="{% trans 'Add street' %}">
|
|
<span class="glyphicon glyphicon-plus"></span> {% trans 'Add' %}
|
|
</a>
|
|
<a href="{% url 'abonapp:street_edit' group.pk %}" class="btn btn-primary btn-modal" data-toggle="tooltip" title="{% trans 'Edit streets' %}">
|
|
<span class="glyphicon glyphicon-edit"></span> {% trans 'Edit' %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|