Commit 2ecf6b86 authored by Laouen Fernet's avatar Laouen Fernet

Translation of topologie/ (front)

parent e27625dd
......@@ -25,6 +25,7 @@
Here are defined some functions to check acl on the application.
"""
from django.utils.translation import ugettext as _
def can_view(user):
......@@ -38,4 +39,6 @@ def can_view(user):
viewing is granted and msg is a message (can be None).
"""
can = user.has_module_perms('topologie')
return can, None if can else "Vous ne pouvez pas voir cette application."
return can, None if can else _("You don't have the right to view this"
" application.")
......@@ -176,8 +176,8 @@ class EditRoomForm(FormRevMixin, ModelForm):
class CreatePortsForm(forms.Form):
"""Permet de créer une liste de ports pour un switch."""
begin = forms.IntegerField(label="Début :", min_value=0)
end = forms.IntegerField(label="Fin :", min_value=0)
begin = forms.IntegerField(label=_("Start:"), min_value=0)
end = forms.IntegerField(label=_("End:"), min_value=0)
class EditModelSwitchForm(FormRevMixin, ModelForm):
......
This diff is collapsed.
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-08-15 17:18
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('topologie', '0061_portprofile'),
]
operations = [
migrations.AlterModelOptions(
name='accesspoint',
options={'permissions': (('view_accesspoint', 'Can view an access point object'),), 'verbose_name': 'access point', 'verbose_name_plural': 'access points'},
),
migrations.AlterModelOptions(
name='building',
options={'permissions': (('view_building', 'Can view a building object'),), 'verbose_name': 'building', 'verbose_name_plural': 'buildings'},
),
migrations.AlterModelOptions(
name='constructorswitch',
options={'permissions': (('view_constructorswitch', 'Can view a switch constructor object'),), 'verbose_name': 'switch constructor', 'verbose_name_plural': 'switch constructors'},
),
migrations.AlterModelOptions(
name='modelswitch',
options={'permissions': (('view_modelswitch', 'Can view a switch model object'),), 'verbose_name': 'switch model', 'verbose_name_plural': 'switch models'},
),
migrations.AlterModelOptions(
name='port',
options={'permissions': (('view_port', 'Can view a port object'),), 'verbose_name': 'port', 'verbose_name_plural': 'ports'},
),
migrations.AlterModelOptions(
name='portprofile',
options={'permissions': (('view_port_profile', 'Can view a port profile object'),), 'verbose_name': 'port profile', 'verbose_name_plural': 'port profiles'},
),
migrations.AlterModelOptions(
name='room',
options={'ordering': ['name'], 'permissions': (('view_room', 'Can view a room object'),), 'verbose_name': 'room', 'verbose_name_plural': 'rooms'},
),
migrations.AlterModelOptions(
name='stack',
options={'permissions': (('view_stack', 'Can view a stack object'),), 'verbose_name': 'switches stack', 'verbose_name_plural': 'switches stacks'},
),
migrations.AlterModelOptions(
name='switch',
options={'permissions': (('view_switch', 'Can view a switch object'),), 'verbose_name': 'switch', 'verbose_name_plural': 'switches'},
),
migrations.AlterModelOptions(
name='switchbay',
options={'permissions': (('view_switchbay', 'Can view a switch bay object'),), 'verbose_name': 'switch bay', 'verbose_name_plural': 'switch bays'},
),
migrations.AlterField(
model_name='accesspoint',
name='location',
field=models.CharField(blank=True, help_text="Details about the AP's location", max_length=255, null=True),
),
migrations.AlterField(
model_name='port',
name='state',
field=models.BooleanField(default=True, help_text='Port state Active', verbose_name='Port state Active'),
),
migrations.AlterField(
model_name='portprofile',
name='arp_protect',
field=models.BooleanField(default=False, help_text='Check if IP adress is DHCP assigned', verbose_name='ARP protection'),
),
migrations.AlterField(
model_name='portprofile',
name='dhcp_snooping',
field=models.BooleanField(default=False, help_text='Protect against rogue DHCP', verbose_name='DHCP snooping'),
),
migrations.AlterField(
model_name='portprofile',
name='dhcpv6_snooping',
field=models.BooleanField(default=False, help_text='Protect against rogue DHCPv6', verbose_name='DHCPv6 snooping'),
),
migrations.AlterField(
model_name='portprofile',
name='flow_control',
field=models.BooleanField(default=False, help_text='Flow control'),
),
migrations.AlterField(
model_name='portprofile',
name='loop_protect',
field=models.BooleanField(default=False, help_text='Protect against loop', verbose_name='Loop protection'),
),
migrations.AlterField(
model_name='portprofile',
name='mac_limit',
field=models.IntegerField(blank=True, help_text='Limit of MAC-address on this port', null=True, verbose_name='MAC limit'),
),
migrations.AlterField(
model_name='portprofile',
name='profil_default',
field=models.CharField(blank=True, choices=[('room', 'room'), ('accespoint', 'accesspoint'), ('uplink', 'uplink'), ('asso_machine', 'asso_machine'), ('nothing', 'nothing')], max_length=32, null=True, unique=True, verbose_name='Default profile'),
),
migrations.AlterField(
model_name='portprofile',
name='ra_guard',
field=models.BooleanField(default=False, help_text='Protect against rogue RA', verbose_name='RA guard'),
),
migrations.AlterField(
model_name='portprofile',
name='radius_mode',
field=models.CharField(choices=[('STRICT', 'STRICT'), ('COMMON', 'COMMON')], default='COMMON', help_text='In case of MAC-authentication : mode COMMON or STRICT on this port', max_length=32, verbose_name='RADIUS mode'),
),
migrations.AlterField(
model_name='portprofile',
name='radius_type',
field=models.CharField(choices=[('NO', 'NO'), ('802.1X', '802.1X'), ('MAC-radius', 'MAC-radius')], help_text='Type of RADIUS authentication : inactive, MAC-address or 802.1X', max_length=32, verbose_name='RADIUS type'),
),
migrations.AlterField(
model_name='portprofile',
name='speed',
field=models.CharField(choices=[('10-half', '10-half'), ('100-half', '100-half'), ('10-full', '10-full'), ('100-full', '100-full'), ('1000-full', '1000-full'), ('auto', 'auto'), ('auto-10', 'auto-10'), ('auto-100', 'auto-100')], default='auto', help_text='Port speed limit', max_length=32),
),
migrations.AlterField(
model_name='switch',
name='model',
field=models.ForeignKey(blank=True, help_text='Switch model', null=True, on_delete=django.db.models.deletion.SET_NULL, to='topologie.ModelSwitch'),
),
migrations.AlterField(
model_name='switch',
name='number',
field=models.PositiveIntegerField(help_text='Number of ports'),
),
migrations.AlterField(
model_name='switch',
name='stack_member_id',
field=models.PositiveIntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='switch',
name='switchbay',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='topologie.SwitchBay'),
),
migrations.AlterField(
model_name='switchbay',
name='info',
field=models.CharField(blank=True, max_length=255, null=True),
),
]
This diff is collapsed.
......@@ -24,50 +24,52 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load logs_extra %}
{% load i18n %}
<div class="table-responsive">
{% if ap_list.paginator %}
{% include "pagination.html" with list=ap_list %}
{% endif %}
<table class="table table-striped">
<thead>
<tr>
<th>{% include "buttons/sort.html" with prefix='ap' col='name' text='Borne' %}</th>
<th>{% include "buttons/sort.html" with prefix='ap' col='mac' text='Addresse mac' %}</th>
<th>{% include "buttons/sort.html" with prefix='ap' col='ip' text='Ipv4' %}</th>
<th>Commentaire</th>
<th>Localisation</th>
{% trans "Access point" as tr_ap %}
<th>{% include "buttons/sort.html" with prefix='ap' col='name' text=tr_ap %}</th>
{% trans "MAC address" as tr_mac %}
<th>{% include "buttons/sort.html" with prefix='ap' col='mac' text=tr_mac %}</th>
{% trans "IPv4 address" as tr_ip %}
<th>{% include "buttons/sort.html" with prefix='ap' col='ip' text=tr_ip %}</th>
<th>{% trans "Details" %}</th>
<th>{% trans "Location" %}</th>
<th></th>
</tr>
</thead>
{% for ap in ap_list %}
<tr>
<td>{{ap.interface_set.first}}</td>
<td>{{ap.interface_set.first.mac_address}}</td>
<td>{{ap.interface_set.first.ipv4}}</td>
<td>{{ap.interface_set.first.details}}</td>
<td>{{ap.location}}</td>
<td class="text-right">
{% history_button ap %}
{% can_edit ap %}
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-ap' ap.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
{% can_delete ap %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'machines:del-machine' ap.id %}">
<i class="fa fa-trash"></i>
</a>
{% acl_end %}
</td>
</tr>
<tr>
<td>{{ ap.interface_set.first }}</td>
<td>{{ ap.interface_set.first.mac_address }}</td>
<td>{{ ap.interface_set.first.ipv4 }}</td>
<td>{{ ap.interface_set.first.details }}</td>
<td>{{ ap.location }}</td>
<td class="text-right">
{% can_edit ap %}
<a class="btn btn-primary btn-sm" role="button" title={% trans "Edit" %} href="{% url 'topologie:edit-ap' ap.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
{% history_button ap %}
{% can_delete ap %}
<a class="btn btn-danger btn-sm" role="button" title={% trans "Delete" %} href="{% url 'machines:del-machine' ap.id %}">
<i class="fa fa-trash"></i>
</a>
{% acl_end %}
</td>
</tr>
{% endfor %}
</table>
{% if ap_list.paginator %}
{% include "pagination.html" with list=ap_list %}
{% endif %}
</div>
......@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load logs_extra %}
{% load i18n %}
{% if building_list.paginator %}
{% include "pagination.html" with list=building_list %}
......@@ -32,22 +33,23 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<table class="table table-striped">
<thead>
<tr>
<th>{% include "buttons/sort.html" with prefix='building' col='name' text='Bâtiment' %}</th>
{% trans "Building" as tr_building %}
<th>{% include "buttons/sort.html" with prefix='building' col='name' text=tr_building %}</th>
<th></th>
</tr>
</thead>
{% for building in building_list %}
<tr>
<td>{{building.name}}</td>
<td>{{ building.name }}</td>
<td class="text-right">
{% history_button building %}
{% can_edit building %}
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-building' building.id %}">
<a class="btn btn-primary btn-sm" role="button" title={% trans "Edit" %} href="{% url 'topologie:edit-building' building.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
{% history_button building %}
{% can_delete building %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-building' building.id %}">
<a class="btn btn-danger btn-sm" role="button" title={% trans "Delete" %} href="{% url 'topologie:del-building' building.id %}">
<i class="fa fa-trash"></i>
</a>
{% acl_end %}
......@@ -59,3 +61,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if building_list.paginator %}
{% include "pagination.html" with list=building_list %}
{% endif %}
......@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load logs_extra %}
{% load i18n %}
{% if room_list.paginator %}
{% include "pagination.html" with list=room_list %}
......@@ -32,24 +33,25 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<table class="table table-striped">
<thead>
<tr>
<th>{% include "buttons/sort.html" with prefix='room' col='name' text='Chambre' %}</th>
<th>Commentaire</th>
{% trans "Room" as tr_room %}
<th>{% include "buttons/sort.html" with prefix='room' col='name' text=tr_room %}</th>
<th>{% trans "Details" %}</th>
<th></th>
</tr>
</thead>
{% for room in room_list %}
<tr>
<td>{{room.name}}</td>
<td>{{room.details}}</td>
<td>{{ room.name }}</td>
<td>{{ room.details }}</td>
<td class="text-right">
{% history_button room %}
{% can_edit room %}
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-room' room.id %}">
<a class="btn btn-primary btn-sm" role="button" title={% trans "Edit" %} href="{% url 'topologie:edit-room' room.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
{% history_button room %}
{% can_delete room %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-room' room.id %}">
<a class="btn btn-danger btn-sm" role="button" title={% trans "Delete" %} href="{% url 'topologie:del-room' room.id %}">
<i class="fa fa-trash"></i>
</a>
{% acl_end %}
......@@ -61,3 +63,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if room_list.paginator %}
{% include "pagination.html" with list=room_list %}
{% endif %}
......@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load logs_extra %}
{% load i18n %}
{% if constructor_switch_list.paginator %}
{% include "pagination.html" with list=constructor_switch_list %}
......@@ -32,22 +33,23 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<table class="table table-striped">
<thead>
<tr>
<th>{% include "buttons/sort.html" with prefix='constructor-switch' col='name' text='Constructeur' %}</th>
{% trans "Switch constructor" as tr_constructor %}
<th>{% include "buttons/sort.html" with prefix='constructor-switch' col='name' text=tr_constructor %}</th>
<th></th>
</tr>
</thead>
{% for constructor_switch in constructor_switch_list %}
<tr>
<td>{{constructor_switch}}</td>
<td>{{ constructor_switch }}</td>
<td class="text-right">
{% history_button constructor_switch %}
{% can_edit constructor_switch %}
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-constructor-switch' constructor_switch.id %}">
<a class="btn btn-primary btn-sm" role="button" title={% trans "Edit" %} href="{% url 'topologie:edit-constructor-switch' constructor_switch.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
{% history_button constructor_switch %}
{% can_delete constructor_switch %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-constructor-switch' constructor_switch.id %}">
<a class="btn btn-danger btn-sm" role="button" title={% trans "Delete" %} href="{% url 'topologie:del-constructor-switch' constructor_switch.id %}">
<i class="fa fa-trash"></i>
</a>
{% acl_end %}
......@@ -59,3 +61,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if constructor_switch_list.paginator %}
{% include "pagination.html" with list=constructor_switch_list %}
{% endif %}
......@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load logs_extra %}
{% load i18n %}
{% if model_switch_list.paginator %}
{% include "pagination.html" with list=model_switch_list %}
......@@ -32,24 +33,26 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<table class="table table-striped">
<thead>
<tr>
<th>{% include "buttons/sort.html" with prefix='model-switch' col='reference' text='Référence' %}</th>
<th>{% include "buttons/sort.html" with prefix='model-switch' col='constructor' text='Constructeur' %}</th>
{% trans "Reference" as tr_ref %}
<th>{% include "buttons/sort.html" with prefix='model-switch' col='reference' text=tr_ref %}</th>
{% trans "Switch constructor" as tr_constructor %}
<th>{% include "buttons/sort.html" with prefix='model-switch' col='constructor' text=tr_constructor %}</th>
<th></th>
</tr>
</thead>
{% for model_switch in model_switch_list %}
<tr>
<td>{{model_switch.reference}}</td>
<td>{{model_switch.constructor}}</td>
<td>{{ model_switch.reference }}</td>
<td>{{ model_switch.constructor }}</td>
<td class="text-right">
{% history_button model_switch %}
{% can_edit model_switch %}
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-model-switch' model_switch.id %}">
<a class="btn btn-primary btn-sm" role="button" title={% trans "Edit" %} href="{% url 'topologie:edit-model-switch' model_switch.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
{% history_button model_switch %}
{% can_delete model_switch %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-model-switch' model_switch.id %}">
<a class="btn btn-danger btn-sm" role="button" title={% trans "Delete" %} href="{% url 'topologie:del-model-switch' model_switch.id %}">
<i class="fa fa-trash"></i>
</a>
{% acl_end %}
......@@ -61,3 +64,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if model_switch_list.paginator %}
{% include "pagination.html" with list=model_switch_list %}
{% endif %}
......@@ -24,62 +24,83 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load logs_extra %}
{% load i18n %}
<div class="table-responsive">
<table class="table table-striped">
<thead>
<th>{% include "buttons/sort.html" with prefix='port' col='port' text='Port' %}</th>
<th>{% include "buttons/sort.html" with prefix='port' col='room' text='Room' %}</th>
<th>{% include "buttons/sort.html" with prefix='port' col='interface' text='Interface machine' %}</th>
<th>{% include "buttons/sort.html" with prefix='port' col='related' text='Related' %}</th>
<th>Etat du port</th>
<th>Profil du port</th>
<th>Détails</th>
<th></th>
</tr>
</thead>
{% for port in port_list %}
<tr>
<td>{{ port.port }}</td>
<td>
{% if port.room %}{{ port.room }}{% endif %}
</td>
<td>
{% if port.machine_interface %}
{% can_view port.machine_interface.machine.user %}
<a href="{% url 'users:profil' userid=port.machine_interface.machine.user.id %}">
{{ port.machine_interface }}
{% acl_end %}
{% endif %}
</td>
<td>
{% if port.related %}
{% can_view port.related.switch %}
<a href="{% url 'topologie:index-port' switchid=port.related.switch.id %}">
<tr>
{% trans "Port" as tr_port %}
<th>{% include "buttons/sort.html" with prefix='port' col='port' text=tr_port %}</th>
{% trans "Room" as tr_room %}
<th>{% include "buttons/sort.html" with prefix='port' col='room' text=tr_room %}</th>
{% trans "Interface" as tr_interface %}
<th>{% include "buttons/sort.html" with prefix='port' col='interface' text=tr_interface %}</th>
{% trans "Related port" as tr_related_port %}
<th>{% include "buttons/sort.html" with prefix='port' col='related' text=tr_related_port %}</th>
<th>{% trans "Port state" %}</th>
<th>{% trans "Port profile" %}</th>
<th>{% trans "Details" %}</th>
<th></th>
</tr>
</thead>
{% for port in port_list %}
<tr>
<td>{{ port.port }}</td>
<td>
{% if port.room %}
{{ port.room }}
{% endif %}
</td>
<td>
{% if port.machine_interface %}
{% can_view port.machine_interface.machine.user %}
<a href="{% url 'users:profil' userid=port.machine_interface.machine.user.id %}">
{{ port.machine_interface }}
</a>
{% acl_end %}
{% endif %}
</td>
<td>
{% if port.related %}
{% can_view port.related.switch %}
<a href="{% url 'topologie:index-port' switchid=port.related.switch.id %}">
{{ port.related }}
</a>
{% acl_else %}
{{ port.related }}
</a>
{% acl_else %}
{{ port.related }}
{% acl_end %}
{% endif %}
</td>
<td>{% if port.state %} <i class="text-success">Actif</i>{% else %}<i class="text-danger">Désactivé</i>{% endif %}</td>
<td>{% if not port.custom_profil %}<u>Par défaut</u> : {% endif %}{{port.get_port_profil}}</td>
<td>{{ port.details }}</td>
<td class="text-right">
{% history_button port %}
{% can_edit port %}
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-port' port.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
{% can_delete port %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-port' port.pk %}">
<i class="fa fa-trash"></i>
</a>
{% acl_end %}
</td>
</tr>
{% acl_end %}
{% endif %}
</td>
<td>
{% if port.state %}
<i class="text-success">{% trans "Active" %}</i>
{% else %}
<i class="text-danger">{% trans "Disabled" %}</i>
{% endif %}
</td>
<td>
{% if not port.custom_profil %}
<u>{% trans "Default: " %}</u>
{% endif %}
{{ port.get_port_profil }}
</td>
<td>{{ port.details }}</td>
<td class="text-right">
{% can_edit port %}
<a class="btn btn-primary btn-sm" role="button" title={% trans "Edit" %} href="{% url 'topologie:edit-port' port.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
{% history_button port %}
{% can_delete port %}
<a class="btn btn-danger btn-sm" role="button" title={% trans "Delete" %} href="{% url 'topologie:del-port' port.pk %}">
<i class="fa fa-trash"></i>
</a>
{% acl_end %}
</td>
</tr>
{% endfor %}
</table>
</div>
......@@ -38,39 +38,39 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<th>{% trans "Default for" %}</th>
<th>{% trans "VLANs" %}</th>
<th>{% trans "RADIUS settings" %}</th>
<th>{% trans "Speed" %}</th>
<th>{% trans "Mac address limit" %}</th>
<th>{% trans "Speed limit" %}</th>
<th>{% trans "MAC address limit" %}</th>
<th>{% trans "Security" %}</th>
<th></th>
</tr>
</thead>
{% for port_profile in port_profile_list %}
<tr>
<td>{{port_profile.name}}</td>
<td>{{port_profile.profil_default}}</td>
<td>{{ port_profile.name }}</td>
<td>{{ port_profile.profil_default }}</td>
<td>
{% if port_profile.vlan_untagged %}
<b>Untagged : </b>{{port_profile.vlan_untagged}}
<b>{% trans "Untagged: " %}</b>{{ port_profile.vlan_untagged }}
<br>
{% endif %}
{% if port_profile.vlan_tagged.all %}
<b>Tagged : </b>{{port_profile.vlan_tagged.all|join:", "}}
<b>{% trans "Tagged: " %}</b>{{ port_profile.vlan_tagged.all|join:", " }}
{% endif %}
</td>
<td>
<b>Type : </b>{{port_profile.radius_type}}
<b>{% trans "RADIUS type: " %}</b>{{ port_profile.radius_type }}
{% if port_profile.radius_type == "MAC-radius" %}
<br>
<b>Mode : </b>{{port_profile.radius_mode}}</td>
<b>{% trans "RADIUS mode: " %}</b>{{ port_profile.radius_mode }}</td>
{% endif %}
<td>{{port_profile.speed}}</td>
<td>{{port_profile.mac_limit}}</td>
<td>{{port_profile.security_parameters_enabled|join:"<br>"}}</td>
<td>{{ port_profile.speed }}</td>
<td>{{ port_profile.mac_limit }}</td>
<td>{{ port_profile.security_parameters_enabled|join:"<br>" }}</td>
<td class="text-right">
{% history_button port_profile %}
{% can_edit port_profile %}
{% include 'buttons/edit.html' with href='topologie:edit-port-profile' id=port_profile.pk %}
{% acl_end %}
{% history_button port_profile %}
{% can_delete port_profile %}
{% include 'buttons/suppr.html' with href='topologie:del-port-profile' id=port_profile.pk %}
{% acl_end %}
......@@ -84,3 +84,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endif %}
</div>
......@@ -24,37 +24,46 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load logs_extra %}
{% load i18n %}
<table class="table table-striped">
<thead>
<tr>
<th>{% include "buttons/sort.html" with prefix='stack' col='name' text='Stack' %}</th>
<th>{% include "buttons/sort.html" with prefix='stack' col='id' text='ID' %}</th>
<th>Détails</th>
<th>Membres</th>
{% trans "Stack" as tr_stack %}
<th>{% include "buttons/sort.html" with prefix='stack' col='name' text=tr_stack %}</th>
{% trans "ID" as tr_id %}
<th>{% include "buttons/sort.html" with prefix='stack' col='id' text=id %}</th>
<th>{% trans "Details" %}</th>
<th>{% trans "Members" %}</th>
<th></th>
</tr>
</thead>
{% for stack in stack_list %}
<tr>
<td>{{ stack.name }}</td>
<td>{{stack.stack_id}}</td>
<td>{{stack.details}}</td>
<td>{% for switch in stack.switch_set.all %}<a href="{% url 'topologie:index-port' switch.pk %}">{{switch }} </a>{% endfor %}</td>
<td class="text-right">
{% history_button stack %}
{% can_edit stack %}
<a class="btn btn-primary btn-sm" role="button" title="Éditer" href="{% url 'topologie:edit-stack' stack.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
{% can_delete stack %}
<a class="btn btn-danger btn-sm" role="button" title="Supprimer" href="{% url 'topologie:del-stack' stack.pk %}">
<i class="fa fa-trash"></i>
</a>
{% acl_end %}
</td>
</tr>
<tr>
<td>{{ stack.name }}</td>
<td>{{ stack.stack_id }}</td>
<td>{{ stack.details }}</td>
<td>
{% for switch in stack.switch_set.all %}
<a href="{% url 'topologie:index-port' switch.pk %}">
{{ switch }}
</a>
{% endfor %}
</td>
<td class="text-right">
{% can_edit stack %}
<a class="btn btn-primary btn-sm" role="button" title={% trans "Edit" %} href="{% url 'topologie:edit-stack' stack.id %}">
<i class="fa fa-edit"></i>
</a>
{% acl_end %}
{% history_button stack %}
{% can_delete stack %}
<a class="btn btn-danger btn-sm" role="button" title={% trans "Delete" %} href="{% url 'topologie:del-stack' stack.pk %}">
<i class="fa fa-trash"></i>
</a>
{% acl_end %}
</td>
</tr>
{% endfor %}
</table>
......@@ -24,59 +24,65 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load acl %}
{% load logs_extra %}