Commit 69d80fcd authored by Laouen Fernet's avatar Laouen Fernet

add translations for topologie/

parent 4a8c161e
This diff is collapsed.
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2019-01-08 20:39
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('topologie', '0068_auto_20190102_1758'),
]
operations = [
migrations.AlterModelOptions(
name='moduleonswitch',
options={'permissions': (('view_moduleonswitch', 'Can view a link between switch and module object'),), 'verbose_name': 'link between switch and module', 'verbose_name_plural': 'links between switch and module'},
),
migrations.AlterModelOptions(
name='moduleswitch',
options={'permissions': (('view_moduleswitch', 'Can view a switch module object'),), 'verbose_name': 'switch module', 'verbose_name_plural': 'switch modules'},
),
migrations.AlterField(
model_name='modelswitch',
name='is_itself_module',
field=models.BooleanField(default=False, help_text='The switch is considered as a module.'),
),
migrations.AlterField(
model_name='modelswitch',
name='is_modular',
field=models.BooleanField(default=False, help_text='The switch model is modular.'),
),
migrations.AlterField(
model_name='portprofile',
name='profil_default',
field=models.CharField(blank=True, choices=[('room', 'Room'), ('access_point', 'Access point'), ('uplink', 'Uplink'), ('asso_machine', 'Organisation machine'), ('nothing', 'Nothing')], max_length=32, null=True, unique=True, verbose_name='Default profile'),
),
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='switch',
name='automatic_provision',
field=models.BooleanField(default=False, help_text='Automatic provision for the switch'),
),
migrations.AlterField(
model_name='switch',
name='management_creds',
field=models.ForeignKey(blank=True, help_text='Management credentials for the switch', null=True, on_delete=django.db.models.deletion.PROTECT, to='preferences.SwitchManagementCred'),
),
migrations.AlterField(
model_name='switch',
name='radius_key',
field=models.ForeignKey(blank=True, help_text='RADIUS key of the switch', null=True, on_delete=django.db.models.deletion.PROTECT, to='preferences.RadiusKey'),
),
]
......@@ -238,18 +238,18 @@ class Switch(AclMixin, Machine):
blank=True,
null=True,
on_delete=models.PROTECT,
help_text="Clef radius du switch"
help_text=_("RADIUS key of the switch")
)
management_creds = models.ForeignKey(
'preferences.SwitchManagementCred',
blank=True,
null=True,
on_delete=models.PROTECT,
help_text="Identifiant de management de ce switch"
help_text=_("Management credentials for the switch")
)
automatic_provision = models.BooleanField(
default=False,
help_text='Provision automatique de ce switch',
help_text=_("Automatic provision for the switch")
)
......@@ -403,11 +403,11 @@ class ModelSwitch(AclMixin, RevMixin, models.Model):
)
is_modular = models.BooleanField(
default=False,
help_text=_("Is this switch model modular"),
help_text=_("The switch model is modular."),
)
is_itself_module = models.BooleanField(
default=False,
help_text=_("Is the switch, itself, considered as a module"),
help_text=_("The switch is considered as a module."),
)
class Meta:
......@@ -441,9 +441,10 @@ class ModuleSwitch(AclMixin, RevMixin, models.Model):
class Meta:
permissions = (
("view_moduleswitch", _("Can view a module object")),
("view_moduleswitch", _("Can view a switch module object")),
)
verbose_name = _("Module of a switch")
verbose_name = _("switch module")
verbose_name_plural = _("switch modules")
def __str__(self):
......@@ -462,13 +463,15 @@ class ModuleOnSwitch(AclMixin, RevMixin, models.Model):
class Meta:
permissions = (
("view_moduleonswitch", _("Can view a moduleonswitch object")),
("view_moduleonswitch", _("Can view a link between switch and"
" module object")),
)
verbose_name = _("link between switchs and modules")
verbose_name = _("link between switch and module")
verbose_name_plural = _("links between switch and module")
unique_together = ['slot', 'switch']
def __str__(self):
return 'On slot ' + str(self.slot) + ' of ' + str(self.switch)
return _("On slot ") + str(self.slot) + _(" of ") + str(self.switch)
class ConstructorSwitch(AclMixin, RevMixin, models.Model):
......@@ -582,7 +585,7 @@ class Port(AclMixin, RevMixin, models.Model):
)
state = models.BooleanField(
default=True,
help_text='Port state Active',
help_text=_("Port state Active"),
verbose_name=_("Port state Active")
)
details = models.CharField(max_length=255, blank=True)
......@@ -599,13 +602,13 @@ class Port(AclMixin, RevMixin, models.Model):
def pretty_name(self):
"""More elaborated name for label on switch conf"""
if self.related:
return "Uplink : " + self.related.switch.short_name
return _("Uplink: ") + self.related.switch.short_name
elif self.machine_interface:
return "Machine : " + str(self.machine_interface.domain)
return _("Machine: ") + str(self.machine_interface.domain)
elif self.room:
return "Chambre : " + str(self.room)
return _("Room: ") + str(self.room)
else:
return "Inconnue"
return _("Unknown")
@cached_property
def get_port_profile(self):
......@@ -720,7 +723,7 @@ class PortProfile(AclMixin, RevMixin, models.Model):
TYPES = (
('NO', 'NO'),
('802.1X', '802.1X'),
('MAC-radius', 'MAC-radius'),
('MAC-radius', _("MAC-RADIUS")),
)
MODES = (
('STRICT', 'STRICT'),
......@@ -737,11 +740,11 @@ class PortProfile(AclMixin, RevMixin, models.Model):
('auto-100', 'auto-100'),
)
PROFIL_DEFAULT = (
('room', 'room'),
('access_point', 'access_point'),
('uplink', 'uplink'),
('asso_machine', 'asso_machine'),
('nothing', 'nothing'),
('room', _("Room")),
('access_point', _("Access point")),
('uplink', _("Uplink")),
('asso_machine', _("Organisation machine")),
('nothing', _("Nothing")),
)
name = models.CharField(max_length=255, verbose_name=_("Name"))
profil_default = models.CharField(
......
......@@ -28,17 +28,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="table-responsive">
{% if ap_list.paginator %}
{% include "pagination.html" with list=ap_list %}
{% include 'pagination.html' with list=ap_list %}
{% endif %}
<table class="table table-striped">
<thead>
<tr>
{% trans "Access point" as tr_ap %}
<th>{% include "buttons/sort.html" with prefix='ap' col='name' text=tr_ap %}</th>
<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>
<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>{% include 'buttons/sort.html' with prefix='ap' col='ip' text=tr_ip %}</th>
<th>{% trans "Details" %}</th>
<th>{% trans "Location" %}</th>
<th></th>
......@@ -53,15 +53,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<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>
{% include 'buttons/edit.html' with href='topologie:edit-ap' id=ap.id %}
{% 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>
{% include 'buttons/suppr.html' with href='machines:del-machine' id=ap.id %}
{% acl_end %}
</td>
</tr>
......@@ -69,7 +65,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</table>
{% if ap_list.paginator %}
{% include "pagination.html" with list=ap_list %}
{% include 'pagination.html' with list=ap_list %}
{% endif %}
</div>
......@@ -27,15 +27,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load i18n %}
{% if building_list.paginator %}
{% include "pagination.html" with list=building_list %}
{% include 'pagination.html' with list=building_list %}
{% endif %}
<table class="table table-striped">
<thead>
<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>{% include 'buttons/sort.html' with prefix='building' col='name' text=tr_building %}</th>
<th>{% trans "Access points" %}</th>
<th></th>
</tr>
</thead>
......@@ -45,15 +45,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<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 %}">
<i class="fa fa-edit"></i>
</a>
{% include 'buttons/edit.html' with href='topologie:edit-building' id=building.id %}
{% acl_end %}
{% history_button building %}
{% can_delete building %}
<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>
{% include 'buttons/suppr.html' with href='topologie:del-building' id=building.id %}
{% acl_end %}
</td>
</tr>
......@@ -61,6 +57,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</table>
{% if building_list.paginator %}
{% include "pagination.html" with list=building_list %}
{% include 'pagination.html' with list=building_list %}
{% endif %}
......@@ -27,14 +27,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load i18n %}
{% if room_list.paginator %}
{% include "pagination.html" with list=room_list %}
{% include 'pagination.html' with list=room_list %}
{% endif %}
<table class="table table-striped">
<thead>
<tr>
{% trans "Room" as tr_room %}
<th>{% include "buttons/sort.html" with prefix='room' col='name' text=tr_room %}</th>
<th>{% include 'buttons/sort.html' with prefix='room' col='name' text=tr_room %}</th>
<th>{% trans "Details" %}</th>
<th></th>
</tr>
......@@ -45,15 +45,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ room.details }}</td>
<td class="text-right">
{% can_edit room %}
<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>
{% include 'buttons/edit.html' with href='topologie:edit-room' id=room.id %}
{% acl_end %}
{% history_button room %}
{% can_delete room %}
<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>
{% include 'buttons/suppr.html' with href='topologie:del-room' id=room.id %}
{% acl_end %}
</td>
</tr>
......@@ -61,6 +57,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</table>
{% if room_list.paginator %}
{% include "pagination.html" with list=room_list %}
{% include 'pagination.html' with list=room_list %}
{% endif %}
......@@ -27,14 +27,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load i18n %}
{% if constructor_switch_list.paginator %}
{% include "pagination.html" with list=constructor_switch_list %}
{% include 'pagination.html' with list=constructor_switch_list %}
{% endif %}
<table class="table table-striped">
<thead>
<tr>
{% trans "Switch constructor" as tr_constructor %}
<th>{% include "buttons/sort.html" with prefix='constructor-switch' col='name' text=tr_constructor %}</th>
<th>{% include 'buttons/sort.html' with prefix='constructor-switch' col='name' text=tr_constructor %}</th>
<th></th>
</tr>
</thead>
......@@ -43,15 +43,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ constructor_switch }}</td>
<td class="text-right">
{% can_edit constructor_switch %}
<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>
{% include 'buttons/edit.html' with href='topologie:edit-constructor-switch' id=constructor_switch.id %}
{% acl_end %}
{% history_button constructor_switch %}
{% can_delete constructor_switch %}
<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>
{% include 'buttons/suppr.html' with href='topologie:del-constructor-switch' id=constructor_switch.id %}
{% acl_end %}
</td>
</tr>
......@@ -59,6 +55,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</table>
{% if constructor_switch_list.paginator %}
{% include "pagination.html" with list=constructor_switch_list %}
{% include 'pagination.html' with list=constructor_switch_list %}
{% endif %}
......@@ -27,18 +27,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load i18n %}
{% if model_switch_list.paginator %}
{% include "pagination.html" with list=model_switch_list %}
{% include 'pagination.html' with list=model_switch_list %}
{% endif %}
<table class="table table-striped">
<thead>
<tr>
{% trans "Reference" as tr_ref %}
<th>{% include "buttons/sort.html" with prefix='model-switch' col='reference' text=tr_ref %}</th>
<th>{% include 'buttons/sort.html' with prefix='model-switch' col='reference' text=tr_ref %}</th>
<th>{% trans "Commercial name" %}</th>
<th>Firmware</th>
{% trans "Switch constructor" as tr_constructor %}
<th>{% include "buttons/sort.html" with prefix='model-switch' col='constructor' text=tr_constructor %}</th>
<th>{% include 'buttons/sort.html' with prefix='model-switch' col='constructor' text=tr_constructor %}</th>
<th>{% trans "Switches" %}
<th></th>
</tr>
......@@ -47,7 +47,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<td>{{ model_switch.reference }}</td>
<td>{{ model_switch.commercial_name }}</td>
<td>{{model_switch.firmware}}</td>
<td>{{ model_switch.firmware }}</td>
<td>{{ model_switch.constructor }}</td>
<td>
{% for switch in model_switch.switch_set.all %}
......@@ -58,15 +58,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</td>
<td class="text-right">
{% can_edit model_switch %}
<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>
{% include 'buttons/edit.html' with href='topologie:edit-model-switch' id=model_switch.id %}
{% acl_end %}
{% history_button model_switch %}
{% can_delete model_switch %}
<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>
{% include 'buttons/suppr.html' with href='topologie:del-model-switch' id=model_switch.id %}
{% acl_end %}
</td>
</tr>
......@@ -74,8 +70,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</table>
{% if model_switch_list.paginator %}
{% include "pagination.html" with list=model_switch_list %}
{% include 'pagination.html' with list=model_switch_list %}
{% endif %}
......@@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load i18n %}
{% if module_list.paginator %}
{% include "pagination.html" with list=module_list %}
{% include 'pagination.html' with list=module_list %}
{% endif %}
<table class="table table-striped">
......@@ -35,7 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<th>{% trans "Reference" %}</th>
<th>{% trans "Comment" %}</th>
<th>{% trans "Switchs" %}</th>
<th>{% trans "Switches" %}</th>
<th></th>
</tr>
</thead>
......@@ -45,34 +45,24 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ module.comment }}</td>
<td>
{% for module_switch in module.moduleonswitch_set.all %}
<b>Slot</b> {{ module_switch.slot }} <b>of</b> {{ module_switch.switch }}
<b>{% trans "Slot" %}</b> {{ module_switch.slot }} <b>{% trans "of" %}</b> {{ module_switch.switch }}
{% can_edit module_switch %}
<a class="btn btn-primary btn-xs" role="button" title={% trans "Edit" %} href="{% url 'topologie:edit-module-on' module_switch.id %}">
<i class="fa fa-edit"></i>
</a>
{% include 'buttons/edit.html' with href='topologie:edit-module-on' id=module_switch.id %}
{% acl_end %}
{% can_delete module_switch %}
<a class="btn btn-danger btn-xs" role="button" title={% trans "Delete" %} href="{% url 'topologie:del-module-on' module_switch.id %}">
<i class="fa fa-trash"></i>
</a>
{% include 'buttons/suppr.html' with href='topologie:del-module-on' id=module_switch.id %}
{% acl_end %}
<br>
{% endfor %}
</td>
<td class="text-right">
{% can_edit module %}
<a class="btn btn-primary btn-sm" role="button" title={% trans "Add" %} href="{% url 'topologie:add-module-on' %}">
<i class="fa fa-plus"></i>
</a>
<a class="btn btn-primary btn-sm" role="button" title={% trans "Edit" %} href="{% url 'topologie:edit-module' module.id %}">
<i class="fa fa-edit"></i>
</a>
{% include 'buttons/add.html' with href='topologie:add-module-on' %}
{% include 'buttons/edit.html' with href='topologie:edit-module' id=module.id %}
{% acl_end %}
{% history_button module %}
{% can_delete module %}
<a class="btn btn-danger btn-sm" role="button" title={% trans "Delete" %} href="{% url 'topologie:del-module' module.id %}">
<i class="fa fa-trash"></i>
</a>
{% include 'buttons/suppr.html' with href='topologie:del-module' id=module.id %}
{% acl_end %}
</td>
</tr>
......@@ -80,7 +70,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</table>
{% if module_list.paginator %}
{% include "pagination.html" with list=module_list %}
{% include 'pagination.html' with list=module_list %}
{% endif %}
<h4>{% trans "All modular switchs" %}</h4>
......
......@@ -31,16 +31,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<thead>
<tr>
{% trans "Port" as tr_port %}
<th>{% include "buttons/sort.html" with prefix='port' col='port' text=tr_port %}</th>
<th>{% include 'buttons/sort.html' with prefix='port' col='port' text=tr_port %}</th>
{% if search %}
<th>{% trans "Switch" %}</th>
{% endif %}
{% trans "Room" as tr_room %}
<th>{% include "buttons/sort.html" with prefix='port' col='room' text=tr_room %}</th>
<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>
<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>{% 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>
......@@ -96,15 +96,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<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>
{% include 'buttons/edit.html' with href='topologie:edit-port' id=port.id %}
{% 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>
{% include 'buttons/suppr.html' with href='topologie:del-port' id=port.id %}
{% acl_end %}
</td>
</tr>
......
......@@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="table-responsive">
{% if port_profile_list.paginator %}
{% include "pagination.html" with list=port_profile_list %}
{% include 'pagination.html' with list=port_profile_list %}
{% endif %}
......@@ -68,11 +68,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ port_profile.security_parameters_enabled|join:"<br>" }}</td>
<td class="text-right">
{% can_edit port_profile %}
{% include 'buttons/edit.html' with href='topologie:edit-port-profile' id=port_profile.pk %}
{% include 'buttons/edit.html' with href='topologie:edit-port-profile' id=port_profile.id %}
{% acl_end %}
{% history_button port_profile %}
{% can_delete port_profile %}
{% include 'buttons/suppr.html' with href='topologie:del-port-profile' id=port_profile.pk %}
{% include 'buttons/suppr.html' with href='topologie:del-port-profile' id=port_profile.id %}
{% acl_end %}
</td>
</tr>
......@@ -80,7 +80,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</table>
{% if port_profile_list.paginator %}
{% include "pagination.html" with list=port_profile_list %}
{% include 'pagination.html' with list=port_profile_list %}
{% endif %}
</div>
......
......@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load acl %}
{% load i18n %}
<div class="table-responsive" style="font-size: 12px">
<table class="table table-bordered text-center text-nowrap">
......@@ -63,7 +64,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</td>
{% else %}
<td class="p-3 mb-2 bg-info text-dark">
Vide
{% trans "Empty" %}
</td>
{% endif %}
{% endfor %}
......@@ -106,7 +107,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</td>
{% else %}
<td class="p-3 mb-2 bg-info text-dark">
Vide
{% trans "Empty" %}
</td>
{% endif %}
{% endfor %}
......
......@@ -30,9 +30,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<thead>
<tr>
{% trans "Stack" as tr_stack %}
<th>{% include "buttons/sort.html" with prefix='stack' col='name' text=tr_stack %}</th>
<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>{% include 'buttons/sort.html' with prefix='stack' col='id' text=id %}</th>
<th>{% trans "Details" %}</th>
<th>{% trans "Members" %}</th>
<th></th>
......@@ -45,22 +45,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ stack.details }}</td>
<td>
{% for switch in stack.switch_set.all %}
<a href="{% url 'topologie:index-port' switch.pk %}">
<a href="{% url 'topologie:index-port' switch.id %}">
{{ 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>
{% include 'buttons/edit.html' with href='topologie:edit-stack' id=stack.id %}
{% 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>
{% include 'buttons/suppr.html' with href='topologie:del-stack' id=stack.id %}
{% acl_end %}
</td>
</tr>
......
......@@ -28,22 +28,22 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="table-responsive">
{% if switch_list.paginator %}
{% include "pagination.html" with list=switch_list %}
{% include 'pagination.html' with list=switch_list %}
{% endif %}
<table class="table table-striped">
<thead>
<tr>
{% trans "DNS name" as tr_dns %}
<th>{% include "buttons/sort.html" with prefix='switch' col='dns' text=tr_dns %}</th>
<th>{% include 'buttons/sort.html' with prefix='switch' col='dns' text=tr_dns %}</th>
{% trans "IPv4 address" as tr_ip %}
<th>{% include "buttons/sort.html" with prefix='switch' col='ip' text=tr_ip %}</th>
<th>{% include 'buttons/sort.html' with prefix='switch' col='ip' text=tr_ip %}</th>
{% trans "Switch bay" as tr_bay %}
<th>{% include "buttons/sort.html" with prefix='switch' col='loc' text=tr_bay %}</th>
<th>{% include 'buttons/sort.html' with prefix='switch' col='loc' text=tr_bay %}</th>
{% trans "Ports" as tr_ports %}
<th>{% include "buttons/sort.html" with prefix='switch' col='ports' text=tr_ports %}</th>
<th>{% include 'buttons/sort.html' with prefix='switch' col='ports' text=tr_ports %}</th>
{% trans "Stack" as tr_stack %}
<th>{% include "buttons/sort.html" with prefix='switch' col='stack' text=tr_stack %}</th>
<th>{% include 'buttons/sort.html' with prefix='switch' col='stack' text=tr_stack %}</th>
<th>{% trans "Stack ID" %}</th>
<th>{% trans "Switch model" %}</th>
<th>{% trans "Details" %}</th>
......@@ -53,7 +53,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% for switch in switch_list %}
<tr>
<td>
<a href="{% url 'topologie:index-port' switch.pk %}">
<a href="{% url 'topologie:index-port' switch.id %}">
{{ switch }}
</a>
</td>
......@@ -66,7 +66,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ switch.interface_set.first.details }}</td>
<td class="text-right">
{% can_edit switch %}
{% include 'buttons/edit.html' with href='topologie:edit-switch' id=switch.pk %}
{% include 'buttons/edit.html' with href='topologie:edit-switch' id=switch.id %}
{% acl_end %}
{% history_button switch %}
{% can_delete switch %}
......@@ -74,7 +74,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% acl_end %}
{% can_create Port %}
{% trans "Creation of ports" as tr_creation %}
{% include 'buttons/add.html' with href='topologie:create-ports' id=switch.pk desc=tr_creation %}
{% include 'buttons/add.html' with href='topologie:create-ports' id=switch.id desc=tr_creation %}
{% acl_end %}
</td>
</tr>
......@@ -82,7 +82,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</table>
{% if switch_list.paginator %}
{% include "pagination.html" with list=switch_list %}
{% include 'pagination.html' with list=switch_list %}
{% endif %}
</div>
......@@ -27,16 +27,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load i18n %}
{% if switch_bay_list.paginator %}
{% include "pagination.html" with list=switch_bay_list %}
{% include 'pagination.html' with list=switch_bay_list %}
{% endif %}
<table class="table table-striped">
<thead>
<tr>
{% trans "Switch bay" as tr_bay %}
<th>{% include "buttons/sort.html" with prefix='switch-bay' col='name' text=tr_bay %}</th>
<th>{% include 'buttons/sort.html' with prefix='switch-bay' col='name' text=tr_bay %}</th>
{% trans "Building" as tr_building %}
<th>{% include "buttons/sort.html" with prefix='switch-bay' col='building' text=tr_building %}</th>
<th>{% include 'buttons/sort.html' with prefix='switch-bay' col='building' text=tr_building %}</th>
<th>{% trans "Information" %}</th>
<th>{% trans "Switches of the bay" %}</th>
<th></th>
......@@ -49,22 +49,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ switch_bay.info }}</td>
<td>
{% for switch in switch_bay.switch_set.all %}
<a href="{% url 'topologie:index-port' switch.pk %}">
<a href="{% url 'topologie:index-port' switch.id %}">
{{ switch }}
</a>
{% endfor %}
</td>
<td class="text-right">
{% can_edit switch_bay %}
<a class="btn btn-primary btn-sm" role="button" title={% trans "Edit" %} href="{% url 'topologie:edit-switch-bay' switch_bay.id %}">
<i class="fa fa-edit"></i>
</a>
{% include 'buttons/edit.html' with href='topologie:edit-switch-bay' id=switch_bay.id %}
{% acl_end %}
{% history_button switch_bay %}
{% can_delete switch_bay %}
<a class="btn btn-danger btn-sm" role="button" title={% trans "Delete" %} href="{% url 'topologie:del-switch-bay' switch_bay.id %}">
<i class="fa fa-trash"></i>
</a>
{% include 'buttons/suppr.html' with href='topologie:del-switch-bay' id=switch_bay.id %}
{% acl_end %}
</td>