8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-28 01:43:46 +00:00

Fix login next + display ap

This commit is contained in:
Gabriel Detraz 2018-10-14 20:17:51 +02:00 committed by detraz
parent f5638ca425
commit cbc2a63c2a
4 changed files with 8 additions and 2 deletions

View file

@ -29,7 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block title %}{% trans "Log in" %}{% endblock %}
{% block content %}
<form method="post" action="{% url 'login' %}">
<form method="post" action="{% url 'login' %}?next={{ next }}">
{% csrf_token %}
{% bootstrap_form form %}
<button class="btn btn-success" type="submit">

View file

@ -468,6 +468,10 @@ class Building(AclMixin, RevMixin, models.Model):
verbose_name = _("building")
verbose_name_plural = _("buildings")
def all_ap_in(self):
"""Returns all ap of the building"""
return AccessPoint.all_ap_in(self)
def __str__(self):
return self.name

View file

@ -35,12 +35,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
{% trans "Building" as tr_building %}
<th>{% include "buttons/sort.html" with prefix='building' col='name' text=tr_building %}</th>
<th>Wireless AP</th>
<th></th>
</tr>
</thead>
{% for building in building_list %}
<tr>
<td>{{ building.name }}</td>
<td>{% for ap in building.all_ap_in %} {{ ap.short_name }} {% endfor %}</td>
<td class="text-right">
{% can_edit building %}
<a class="btn btn-primary btn-sm" role="button" title={% trans "Edit" %} href="{% url 'topologie:edit-building' building.id %}">

View file

@ -230,7 +230,7 @@ def index_ap(request):
queryset=(Interface.objects
.select_related('ipv4__ip_type__extension')
.select_related('domain__extension'))
)))
)).distinct())
ap_list = SortTable.sort(
ap_list,
request.GET.get('col'),