mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-23 15:33:45 +00:00
Merge branch 'better_frontend' into 'master'
Better frontend See merge request nounous/re2o!17
This commit is contained in:
commit
72e70e74d9
10 changed files with 61 additions and 16 deletions
|
@ -90,7 +90,8 @@ from topologie.models import (
|
|||
Room,
|
||||
Stack,
|
||||
ModelSwitch,
|
||||
ConstructorSwitch
|
||||
ConstructorSwitch,
|
||||
AccessPoint
|
||||
)
|
||||
from preferences.models import GeneralOption
|
||||
from re2o.views import form
|
||||
|
@ -360,6 +361,7 @@ def stats_models(request):
|
|||
},
|
||||
'Topologie': {
|
||||
'switch': [Switch.PRETTY_NAME, Switch.objects.count()],
|
||||
'bornes': [AccessPoint.PRETTY_NAME, AccessPoint.objects.count()],
|
||||
'port': [Port.PRETTY_NAME, Port.objects.count()],
|
||||
'chambre': [Room.PRETTY_NAME, Room.objects.count()],
|
||||
'stack': [Stack.PRETTY_NAME, Stack.objects.count()],
|
||||
|
|
|
@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
{% load acl %}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -38,7 +39,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</tr>
|
||||
</thead>
|
||||
{% for extension in extension_list %}
|
||||
<tr>
|
||||
<tr>
|
||||
<td>{{ extension.name }}</td>
|
||||
<td>{{ extension.need_infra }}</td>
|
||||
<td>{{ extension.soa}}</td>
|
||||
|
@ -55,4 +56,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -23,15 +23,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% endcomment %}
|
||||
|
||||
{% load acl %}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Type d'ip</th>
|
||||
<th>Extension</th>
|
||||
<th>Nécessite l'autorisation infra</th>
|
||||
<th>Début</th>
|
||||
<th>Fin</th>
|
||||
<th>Plage ipv4</th>
|
||||
<th>Préfixe v6</th>
|
||||
<th>Sur vlan</th>
|
||||
<th>Ouverture ports par défault</th>
|
||||
|
@ -44,8 +43,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<td>{{ type.type }}</td>
|
||||
<td>{{ type.extension }}</td>
|
||||
<td>{{ type.need_infra }}</td>
|
||||
<td>{{ type.domaine_ip_start }}</td>
|
||||
<td>{{ type.domaine_ip_stop }}</td>
|
||||
<td>{{ type.domaine_ip_start }}-{{ type.domaine_ip_stop }}</td>
|
||||
<td>{{ type.prefix_v6 }}</td>
|
||||
<td>{{ type.vlan }}</td>
|
||||
<td>{{ type.ouverture_ports }}</td>
|
||||
|
@ -58,4 +56,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
{% load acl %}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -49,4 +50,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -190,6 +190,10 @@ class SortTable:
|
|||
'white_end': ['date_end'],
|
||||
'default': ['-date_end']
|
||||
}
|
||||
USERS_INDEX_SCHOOL = {
|
||||
'school_name': ['name'],
|
||||
'default': ['name']
|
||||
}
|
||||
MACHINES_INDEX = {
|
||||
'machine_name': ['name'],
|
||||
'default': ['pk']
|
||||
|
|
|
@ -83,9 +83,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-users"></i> Adhérents<span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
{% can_view_app users %}
|
||||
<li><a href="{% url 'users:index' %}"><i class="fa fa-users"></i> Gérer les adhérents</a></li>
|
||||
{% acl_end %}
|
||||
{% can_view_app machines %}
|
||||
<li><a href="{% url 'users:index' %}"><i class="fa fa-user"></i> Gérer les adhérents</a></li>
|
||||
<li><a href="{% url 'users:index-clubs' %}"><i class="fa fa-users"></i> Gérer les clubs</a></li>
|
||||
{% acl_end %}
|
||||
{% can_view_app machines %}
|
||||
<li><a href="{% url 'machines:index' %}"><i class="fa fa-desktop"></i> Gérer les machines</a></li>
|
||||
{% acl_end %}
|
||||
{% can_view_app cotisations %}
|
||||
|
@ -95,7 +96,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</li>
|
||||
{% acl_end %}
|
||||
{% can_view_app topologie %}
|
||||
<li><a href="{% url "topologie:index" %}"><i class="fa fa-sitemap"></i> Topologie</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-sitemap"></i> Topologie<span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{% url "topologie:index" %}"><i class="fa fa-microchip"></i> Switchs</a></li>
|
||||
<li><a href="{% url "topologie:index-ap" %}"><i class="fa fa-wifi"></i> Bornes WiFi</a></li>
|
||||
<li><a href="{% url "topologie:index-room" %}"><i class="fa fa-home"></i> Chambres et locaux</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% acl_end %}
|
||||
{% can_view_app logs %}
|
||||
<li><a href="{% url "logs:index" %}"><i class="fa fa-chart-area"></i> Statistiques</a></li>
|
||||
|
|
|
@ -47,7 +47,7 @@ from django.db import IntegrityError
|
|||
from django.db import transaction
|
||||
from reversion import revisions as reversion
|
||||
|
||||
from machines.models import Machine, Interface
|
||||
from machines.models import Machine, Interface, regen
|
||||
|
||||
class Stack(models.Model):
|
||||
"""Un objet stack. Regrouppe des switchs en foreign key
|
||||
|
|
|
@ -22,10 +22,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
{% endcomment %}
|
||||
{% load acl %}
|
||||
|
||||
<div class="table-responsive">
|
||||
|
||||
{% if school_list.paginator %}
|
||||
{% include "pagination.html" with list=school_list %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Etablissement</th>
|
||||
<th>{% include "buttons/sort.html" with prefix='school' col='name' text='Etablissement' %}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -42,3 +50,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% endfor %}
|
||||
</table>
|
||||
|
||||
{% if school_list.paginator %}
|
||||
{% include "pagination.html" with list=school_list %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-school' %}"><i class="fa fa-plus"></i> Ajouter un établissement</a>
|
||||
{% acl_end %}
|
||||
<a class="btn btn-danger btn-sm" role="button" href="{% url 'users:del-school' %}"><i class="fa fa-trash"></i> Supprimer un ou plusieurs établissements</a>
|
||||
<hr>
|
||||
{% include "users/aff_schools.html" with school_list=school_list %}
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -747,6 +747,23 @@ def index_white(request):
|
|||
def index_school(request):
|
||||
""" Affiche l'ensemble des établissement"""
|
||||
school_list = School.objects.order_by('name')
|
||||
pagination_number = GeneralOption.get_cached_value('pagination_number')
|
||||
school_list = SortTable.sort(
|
||||
school_list,
|
||||
request.GET.get('col'),
|
||||
request.GET.get('order'),
|
||||
SortTable.USERS_INDEX_SCHOOL
|
||||
)
|
||||
paginator = Paginator(school_list, pagination_number)
|
||||
page = request.GET.get('page')
|
||||
try:
|
||||
school_list = paginator.page(page)
|
||||
except PageNotAnInteger:
|
||||
# If page isn't an integer, deliver first page
|
||||
school_list = paginator.page(1)
|
||||
except EmptyPage:
|
||||
# If page is out of range (e.g. 9999), deliver last page of results.
|
||||
school_list = paginator.page(paginator.num_pages)
|
||||
return render(
|
||||
request,
|
||||
'users/index_schools.html',
|
||||
|
|
Loading…
Reference in a new issue