mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-05 01:16:27 +00:00
Mark strings for translation in topologie
This commit is contained in:
parent
6522051728
commit
207c8ba206
18 changed files with 84 additions and 83 deletions
|
@ -41,6 +41,6 @@ def can_view(user):
|
|||
can = user.has_module_perms("topologie")
|
||||
return (
|
||||
can,
|
||||
None if can else _("You don't have the right to view this" " application."),
|
||||
None if can else _("You don't have the right to view this application."),
|
||||
("topologie",),
|
||||
)
|
||||
|
|
|
@ -84,7 +84,7 @@ class Stack(AclMixin, RevMixin, models.Model):
|
|||
""" Verification que l'id_max < id_min"""
|
||||
if self.member_id_max < self.member_id_min:
|
||||
raise ValidationError(
|
||||
{"member_id_max": _("The maximum ID is less than the" " minimum ID.")}
|
||||
{"member_id_max": _("The maximum ID is less than the minimum ID.")}
|
||||
)
|
||||
|
||||
|
||||
|
@ -96,7 +96,7 @@ class AccessPoint(AclMixin, Machine):
|
|||
|
||||
location = models.CharField(
|
||||
max_length=255,
|
||||
help_text=_("Details about the AP's location"),
|
||||
help_text=_("Details about the AP's location."),
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
|
@ -187,7 +187,7 @@ class Switch(AclMixin, Machine):
|
|||
Validation au save que l'id du stack est bien dans le range id_min
|
||||
id_max de la stack parente"""
|
||||
|
||||
number = models.PositiveIntegerField(help_text=_("Number of ports"))
|
||||
number = models.PositiveIntegerField(help_text=_("Number of ports."))
|
||||
stack = models.ForeignKey(
|
||||
"topologie.Stack", blank=True, null=True, on_delete=models.SET_NULL
|
||||
)
|
||||
|
@ -197,7 +197,7 @@ class Switch(AclMixin, Machine):
|
|||
blank=True,
|
||||
null=True,
|
||||
on_delete=models.SET_NULL,
|
||||
help_text=_("Switch model"),
|
||||
help_text=_("Switch model."),
|
||||
)
|
||||
switchbay = models.ForeignKey(
|
||||
"topologie.SwitchBay", blank=True, null=True, on_delete=models.SET_NULL
|
||||
|
@ -207,17 +207,17 @@ class Switch(AclMixin, Machine):
|
|||
blank=True,
|
||||
null=True,
|
||||
on_delete=models.PROTECT,
|
||||
help_text=_("RADIUS key of the switch"),
|
||||
help_text=_("RADIUS key of the switch."),
|
||||
)
|
||||
management_creds = models.ForeignKey(
|
||||
"preferences.SwitchManagementCred",
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=models.PROTECT,
|
||||
help_text=_("Management credentials for the switch"),
|
||||
help_text=_("Management credentials for the switch."),
|
||||
)
|
||||
automatic_provision = models.BooleanField(
|
||||
default=False, help_text=_("Automatic provision for the switch")
|
||||
default=False, help_text=_("Automatic provision for the switch.")
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
@ -245,14 +245,14 @@ class Switch(AclMixin, Machine):
|
|||
)
|
||||
else:
|
||||
raise ValidationError(
|
||||
{"stack_member_id": _("The stack member ID can't be" " void.")}
|
||||
{"stack_member_id": _("The stack member ID can't be void.")}
|
||||
)
|
||||
|
||||
def create_ports(self, begin, end):
|
||||
""" Crée les ports de begin à end si les valeurs données
|
||||
sont cohérentes. """
|
||||
if end < begin:
|
||||
raise ValidationError(_("The end port is less than the start" " port."))
|
||||
raise ValidationError(_("The end port is less than the start port."))
|
||||
ports_to_create = range(begin, end + 1)
|
||||
existing_ports = Port.objects.filter(switch=self.switch).values_list(
|
||||
"port", flat=True
|
||||
|
@ -262,7 +262,7 @@ class Switch(AclMixin, Machine):
|
|||
if len(non_existing_ports) + existing_ports.count() > self.number:
|
||||
raise ValidationError(_("This switch can't have that many ports."))
|
||||
with transaction.atomic(), reversion.create_revision():
|
||||
reversion.set_comment(_("Creation"))
|
||||
reversion.set_comment("Creation")
|
||||
Port.objects.bulk_create(
|
||||
[
|
||||
Port(switch=self.switch, port=port_id)
|
||||
|
@ -491,15 +491,15 @@ class ModuleSwitch(AclMixin, RevMixin, models.Model):
|
|||
|
||||
reference = models.CharField(
|
||||
max_length=255,
|
||||
help_text=_("Reference of a module"),
|
||||
verbose_name=_("Module reference"),
|
||||
help_text=_("Reference of a module."),
|
||||
verbose_name=_("module reference"),
|
||||
)
|
||||
comment = models.CharField(
|
||||
max_length=255,
|
||||
null=True,
|
||||
blank=True,
|
||||
help_text=_("Comment"),
|
||||
verbose_name=_("Comment"),
|
||||
help_text=_("Comment."),
|
||||
verbose_name=_("comment"),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
@ -517,14 +517,14 @@ class ModuleOnSwitch(AclMixin, RevMixin, models.Model):
|
|||
module = models.ForeignKey("ModuleSwitch", on_delete=models.CASCADE)
|
||||
switch = models.ForeignKey("Switch", on_delete=models.CASCADE)
|
||||
slot = models.CharField(
|
||||
max_length=15, help_text=_("Slot on switch"), verbose_name=_("Slot")
|
||||
max_length=15, help_text=_("Slot on switch."), verbose_name=_("slot")
|
||||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
(
|
||||
"view_moduleonswitch",
|
||||
_("Can view a link between switch and" " module object"),
|
||||
_("Can view a link between switch and module object"),
|
||||
),
|
||||
)
|
||||
verbose_name = _("link between switch and module")
|
||||
|
@ -532,7 +532,7 @@ class ModuleOnSwitch(AclMixin, RevMixin, models.Model):
|
|||
unique_together = ["slot", "switch"]
|
||||
|
||||
def __str__(self):
|
||||
return _("On slot ") + str(self.slot) + _(" of ") + str(self.switch)
|
||||
return _("On slot %(slot)s of %(switch)s").format(slot=str(self.slot), switch=str(self.switch))
|
||||
|
||||
|
||||
class ConstructorSwitch(AclMixin, RevMixin, models.Model):
|
||||
|
@ -542,10 +542,10 @@ class ConstructorSwitch(AclMixin, RevMixin, models.Model):
|
|||
|
||||
class Meta:
|
||||
permissions = (
|
||||
("view_constructorswitch", _("Can view a switch constructor" " object")),
|
||||
("view_constructorswitch", _("Can view a switch constructor object")),
|
||||
)
|
||||
verbose_name = _("switch constructor")
|
||||
verbose_name_plural = "switch constructors"
|
||||
verbose_name_plural = _("switch constructors")
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
@ -655,8 +655,8 @@ class Port(AclMixin, RevMixin, models.Model):
|
|||
)
|
||||
state = models.BooleanField(
|
||||
default=True,
|
||||
help_text=_("Port state Active"),
|
||||
verbose_name=_("Port state Active"),
|
||||
help_text=_("Port state Active."),
|
||||
verbose_name=_("port state Active"),
|
||||
)
|
||||
details = models.CharField(max_length=255, blank=True)
|
||||
|
||||
|
@ -809,13 +809,13 @@ class PortProfile(AclMixin, RevMixin, models.Model):
|
|||
("asso_machine", _("Organisation machine")),
|
||||
("nothing", _("Nothing")),
|
||||
)
|
||||
name = models.CharField(max_length=255, verbose_name=_("Name"))
|
||||
name = models.CharField(max_length=255, verbose_name=_("name"))
|
||||
profil_default = models.CharField(
|
||||
max_length=32,
|
||||
choices=PROFIL_DEFAULT,
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name=_("Default profile"),
|
||||
verbose_name=_("default profile"),
|
||||
)
|
||||
on_dormitory = models.ForeignKey(
|
||||
"topologie.Dormitory",
|
||||
|
@ -823,7 +823,7 @@ class PortProfile(AclMixin, RevMixin, models.Model):
|
|||
on_delete=models.SET_NULL,
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name=_("Profil on dormitory"),
|
||||
verbose_name=_("profile on dormitory"),
|
||||
)
|
||||
vlan_untagged = models.ForeignKey(
|
||||
"machines.Vlan",
|
||||
|
@ -843,7 +843,7 @@ class PortProfile(AclMixin, RevMixin, models.Model):
|
|||
max_length=32,
|
||||
choices=TYPES,
|
||||
help_text=_(
|
||||
"Type of RADIUS authentication : inactive, MAC-address or" " 802.1X"
|
||||
"Type of RADIUS authentication: inactive, MAC-address or 802.1X."
|
||||
),
|
||||
verbose_name=_("RADIUS type"),
|
||||
)
|
||||
|
@ -852,44 +852,44 @@ class PortProfile(AclMixin, RevMixin, models.Model):
|
|||
choices=MODES,
|
||||
default="COMMON",
|
||||
help_text=_(
|
||||
"In case of MAC-authentication : mode COMMON or STRICT on" " this port"
|
||||
"In case of MAC-authentication: mode COMMON or STRICT on this port."
|
||||
),
|
||||
verbose_name=_("RADIUS mode"),
|
||||
)
|
||||
speed = models.CharField(
|
||||
max_length=32, choices=SPEED, default="auto", help_text=_("Port speed limit")
|
||||
max_length=32, choices=SPEED, default="auto", help_text=_("Port speed limit.")
|
||||
)
|
||||
mac_limit = models.IntegerField(
|
||||
null=True,
|
||||
blank=True,
|
||||
help_text=_("Limit of MAC-address on this port"),
|
||||
help_text=_("Limit of MAC-address on this port."),
|
||||
verbose_name=_("MAC limit"),
|
||||
)
|
||||
flow_control = models.BooleanField(default=False, help_text=_("Flow control"))
|
||||
flow_control = models.BooleanField(default=False, help_text=_("Flow control."))
|
||||
dhcp_snooping = models.BooleanField(
|
||||
default=False,
|
||||
help_text=_("Protect against rogue DHCP"),
|
||||
help_text=_("Protect against rogue DHCP."),
|
||||
verbose_name=_("DHCP snooping"),
|
||||
)
|
||||
dhcpv6_snooping = models.BooleanField(
|
||||
default=False,
|
||||
help_text=_("Protect against rogue DHCPv6"),
|
||||
help_text=_("Protect against rogue DHCPv6."),
|
||||
verbose_name=_("DHCPv6 snooping"),
|
||||
)
|
||||
arp_protect = models.BooleanField(
|
||||
default=False,
|
||||
help_text=_("Check if IP adress is DHCP assigned"),
|
||||
help_text=_("Check if IP address is DHCP assigned."),
|
||||
verbose_name=_("ARP protection"),
|
||||
)
|
||||
ra_guard = models.BooleanField(
|
||||
default=False,
|
||||
help_text=_("Protect against rogue RA"),
|
||||
help_text=_("Protect against rogue RA."),
|
||||
verbose_name=_("RA guard"),
|
||||
)
|
||||
loop_protect = models.BooleanField(
|
||||
default=False,
|
||||
help_text=_("Protect against loop"),
|
||||
verbose_name=_("Loop protection"),
|
||||
help_text=_("Protect against loop."),
|
||||
verbose_name=_("loop protection"),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
@ -933,7 +933,7 @@ class PortProfile(AclMixin, RevMixin, models.Model):
|
|||
raise ValidationError(
|
||||
{
|
||||
"profil_default": _(
|
||||
"A default profile for all dormitory of that type already exists."
|
||||
"A default profile for all dormitories of that type already exists."
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
|
@ -35,7 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<tr>
|
||||
{% trans "Dormitory" as tr_dormitory %}
|
||||
<th>{% include 'buttons/sort.html' with prefix='dormitory' col='name' text=tr_dormitory %}</th>
|
||||
<th>{% trans "Building" %}</th>
|
||||
<th>{% trans "Buildings" %}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
|
@ -36,7 +36,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% trans "Reference" as tr_ref %}
|
||||
<th>{% include 'buttons/sort.html' with prefix='model-switch' col='reference' text=tr_ref %}</th>
|
||||
<th>{% trans "Commercial name" %}</th>
|
||||
<th>Firmware</th>
|
||||
<th>{% trans "Firmware" %}</th>
|
||||
{% trans "Switch constructor" as tr_constructor %}
|
||||
<th>{% include 'buttons/sort.html' with prefix='model-switch' col='constructor' text=tr_constructor %}</th>
|
||||
<th>{% trans "Switches" %}
|
||||
|
|
|
@ -35,7 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Name" %}</th>
|
||||
<th>{% trans "Default for and place" %}</th>
|
||||
<th>{% trans "Default for" %}</th>
|
||||
<th>{% trans "VLANs" %}</th>
|
||||
<th>{% trans "RADIUS settings" %}</th>
|
||||
<th>{% trans "Speed limit" %}</th>
|
||||
|
@ -47,7 +47,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% for port_profile in port_profile_list %}
|
||||
<tr>
|
||||
<td>{{ port_profile.name }}</td>
|
||||
<td>{{ port_profile.profil_default }} {% if port_profile.profil_default%}<b> - {% if port_profile.on_dormitory %} on {{ port_profile.on_dormitory }} {% else %} Everywhere {% endif %}</b>{% endif %}</td>
|
||||
<td>{{ port_profile.profil_default }} {% if port_profile.profil_default%}<b> - {% if port_profile.on_dormitory %}{% blocktrans with dorm=port_profile.on_dormitory %} on {{ dorm }}{% endblocktrans %}{% else %}{% trans "Everywhere" %}{% endif %}</b>{% endif %}</td>
|
||||
<td>
|
||||
{% if port_profile.vlan_untagged %}
|
||||
<b>{% trans "Untagged: " %}</b>{{ port_profile.vlan_untagged }}
|
||||
|
|
|
@ -44,7 +44,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<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>{% trans "Stack ID" %}</th>
|
||||
<th>{% trans "Stack member ID" %}</th>
|
||||
<th>{% trans "Switch model" %}</th>
|
||||
<th>{% trans "Details" %}</th>
|
||||
<th></th>
|
||||
|
|
|
@ -65,7 +65,7 @@ function toggle_graph() {
|
|||
|
||||
<h2>{% trans "Switches" %}</h2>
|
||||
{% can_create Switch %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-switch' %}"><i class="fa fa-plus"></i>{% trans " Add a switch" %}</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-switch' %}"><i class="fa fa-plus"></i> {% trans "Add a switch" %}</a>
|
||||
<hr>
|
||||
{% acl_end %}
|
||||
{% include 'topologie/aff_switch.html' with switch_list=switch_list %}
|
||||
|
|
|
@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>{% trans "Access points" %}</h2>
|
||||
{% can_create AccessPoint %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-ap' %}"><i class="fa fa-plus"></i>{% trans " Add an access point" %}</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-ap' %}"><i class="fa fa-plus"></i> {% trans "Add an access point" %}</a>
|
||||
<hr>
|
||||
{% acl_end %}
|
||||
{% include 'topologie/aff_ap.html' with ap_list=ap_list %}
|
||||
|
|
|
@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<h2>{% trans "Switch models" %}</h2>
|
||||
{% can_create ModelSwitch %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-model-switch' %}">
|
||||
<i class="fa fa-plus"></i>{% trans " Add a switch model" %}
|
||||
<i class="fa fa-plus"></i> {% trans "Add a switch model" %}
|
||||
</a>
|
||||
<hr>
|
||||
{% acl_end %}
|
||||
|
@ -42,7 +42,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<h2>{% trans "Switch constructors" %}</h2>
|
||||
{% can_create ConstructorSwitch %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-constructor-switch' %}">
|
||||
<i class="fa fa-plus"></i>{% trans " Add a switch constructor" %}
|
||||
<i class="fa fa-plus"></i> {% trans "Add a switch constructor" %}
|
||||
</a>
|
||||
<hr>
|
||||
{% acl_end %}
|
||||
|
|
|
@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>{% trans "Switch modules" %}</h2>
|
||||
{% can_create ModuleSwitch %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:add-module' %}"><i class="fa fa-plus"></i>{% trans " Add a module" %}</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:add-module' %}"><i class="fa fa-plus"></i> {% trans "Add a module" %}</a>
|
||||
<hr>
|
||||
{% acl_end %}
|
||||
{% include 'topologie/aff_modules.html' with module_list=module_list modular_switchs=modular_switchs %}
|
||||
|
|
|
@ -48,8 +48,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<hr>
|
||||
{% include 'buttons/edit.html' with href='topologie:edit-switch' id=id_switch %}
|
||||
{% can_create Port %}
|
||||
{% include 'buttons/add.html' with href='topologie:new-port' id=id_switch %}
|
||||
{% include 'buttons/add.html' with href='topologie:create-ports' id=id_switch %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-port' id_switch %}"><i class="fa fa-plus"></i> {% trans "Add a port" %}</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:create-ports' id_switch %}"><i class="fa fa-plus"></i> {% trans "Add ports to the port list" %}</a>
|
||||
{% acl_end %}
|
||||
<hr>
|
||||
{% include 'topologie/aff_repr_switch.html' with port_list=port_list %}
|
||||
|
|
|
@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<h2>{% trans "Stacks" %}</h2>
|
||||
{% can_create Stack %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-stack' %}">
|
||||
<i class="fa fa-plus"></i>{% trans " Add a stack" %}
|
||||
<i class="fa fa-plus"></i> {% trans "Add a stack" %}
|
||||
</a>
|
||||
{% acl_end %}
|
||||
{% include 'topologie/aff_stacks.html' with stack_list=stack_list %}
|
||||
|
@ -41,7 +41,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<h2>{% trans "Switch bays" %}</h2>
|
||||
{% can_create SwitchBay %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-switch-bay' %}">
|
||||
<i class="fa fa-plus"></i>{% trans " Add a switch bay" %}
|
||||
<i class="fa fa-plus"></i> {% trans "Add a switch bay" %}
|
||||
</a>
|
||||
<hr>
|
||||
{% acl_end %}
|
||||
|
@ -50,7 +50,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<h2>{% trans "Buildings" %}</h2>
|
||||
{% can_create Building %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-building' %}">
|
||||
<i class="fa fa-plus"></i>{% trans " Add a building" %}
|
||||
<i class="fa fa-plus"></i> {% trans "Add a building" %}
|
||||
</a>
|
||||
<hr>
|
||||
{% acl_end %}
|
||||
|
@ -60,7 +60,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<h2>{% trans "Dormitories" %}</h2>
|
||||
{% can_create Dormitory %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-dormitory' %}">
|
||||
<i class="fa fa-plus"></i>{% trans " Add a dormitory" %}
|
||||
<i class="fa fa-plus"></i> {% trans "Add a dormitory" %}
|
||||
</a>
|
||||
<hr>
|
||||
{% acl_end %}
|
||||
|
|
|
@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
<h2>{% trans "Port profiles" %}</h2>
|
||||
{% can_create PortProfile %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-port-profile' %}"><i class="fa fa-plus"></i>{% trans " Add a port profile" %}</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-port-profile' %}"><i class="fa fa-plus"></i> {% trans "Add a port profile" %}</a>
|
||||
<hr>
|
||||
{% acl_end %}
|
||||
{% include 'topologie/aff_port_profile.html' with port_profile_list=port_profile_list %}
|
||||
|
|
|
@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% block content %}
|
||||
<h2>{% trans "Rooms" %}</h2>
|
||||
{% can_create Room %}
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-room' %}"><i class="fa fa-plus"></i>{% trans " Add a room" %}</a>
|
||||
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:new-room' %}"><i class="fa fa-plus"></i> {% trans "Add a room" %}</a>
|
||||
<hr>
|
||||
{% acl_end %}
|
||||
{% include 'topologie/aff_chambres.html' with room_list=room_list %}
|
||||
|
|
|
@ -36,15 +36,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
|
||||
|
||||
|
||||
<a class="btn btn-primary" href="{% url 'topologie:index-port' id_switch %}" role="button">{% bootstrap_icon "list" %}{% trans " Go to the ports list" %}</a>
|
||||
<a class="btn btn-primary" href="{% url 'topologie:index-port' id_switch %}" role="button">{% bootstrap_icon "list" %} {% trans "Go to the ports list" %}</a>
|
||||
<form class="form" method="post">
|
||||
{% csrf_token %}
|
||||
{% if topoform %}
|
||||
<h3>{% trans "Specific settings for the switch" %}</h3>
|
||||
{% massive_bootstrap_form topoform 'switch_interface' %}
|
||||
{% endif %}
|
||||
{% trans "Create" as tr_create %}
|
||||
{% bootstrap_button tr_create button_type="submit" icon='ok' button_class='btn-success' %}
|
||||
{% trans "Confirm" as tr_confirm %}
|
||||
{% bootstrap_button tr_confirm button_type="submit" icon='ok' button_class='btn-success' %}
|
||||
</form>
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
{% bootstrap_form_errors topoform %}
|
||||
|
||||
{% if id_switch %}
|
||||
<a class="btn btn-primary" href="{% url 'topologie:index-port' id_switch %}" role="button">{% bootstrap_icon "list" %}{% trans " Go to the ports list" %}</a>
|
||||
<a class="btn btn-primary" href="{% url 'topologie:index-port' id_switch %}" role="button">{% bootstrap_icon "list" %} {% trans "Go to the ports list" %}</a>
|
||||
{% endif %}
|
||||
<form class="form" method="post">
|
||||
{% csrf_token %}
|
||||
|
|
|
@ -56,8 +56,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
<h3>{% trans "DNS name" %}</h3>
|
||||
{% bootstrap_form domainform %}
|
||||
{% endif %}
|
||||
{% trans "Create or edit" as tr_create_or_edit %}
|
||||
{% bootstrap_button tr_create_or_edit button_type="submit" icon='ok' button_class='btn-success' %}
|
||||
{% trans "Confirm" as tr_confirm %}
|
||||
{% bootstrap_button tr_confirm button_type="submit" icon='ok' button_class='btn-success' %}
|
||||
</form>
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -442,7 +442,7 @@ def new_stack(request):
|
|||
messages.success(request, _("The stack was created."))
|
||||
return redirect(reverse("topologie:index-physical-grouping"))
|
||||
return form(
|
||||
{"topoform": stack, "action_name": _("Create")}, "topologie/topo.html", request
|
||||
{"topoform": stack, "action_name": _("Add")}, "topologie/topo.html", request
|
||||
)
|
||||
|
||||
|
||||
|
@ -454,6 +454,7 @@ def edit_stack(request, stack, **_kwargs):
|
|||
if stack.is_valid():
|
||||
if stack.changed_data:
|
||||
stack.save()
|
||||
messages.success(request, _("The stack was edited."))
|
||||
return redirect(reverse("topologie:index-physical-grouping"))
|
||||
return form(
|
||||
{"topoform": stack, "action_name": _("Edit")}, "topologie/topo.html", request
|
||||
|
@ -538,7 +539,7 @@ def new_switch(request):
|
|||
"machineform": switch,
|
||||
"domainform": domain,
|
||||
"i_mbf_param": i_mbf_param,
|
||||
"device": "switch",
|
||||
"device": _("switch"),
|
||||
},
|
||||
"topologie/topo_more.html",
|
||||
request,
|
||||
|
@ -611,7 +612,7 @@ def edit_switch(request, switch, switchid):
|
|||
"machineform": switch_form,
|
||||
"domainform": domain_form,
|
||||
"i_mbf_param": i_mbf_param,
|
||||
"device": "switch",
|
||||
"device": _("switch"),
|
||||
},
|
||||
"topologie/topo_more.html",
|
||||
request,
|
||||
|
@ -660,7 +661,7 @@ def new_ap(request):
|
|||
"machineform": ap,
|
||||
"domainform": domain,
|
||||
"i_mbf_param": i_mbf_param,
|
||||
"device": "wifi ap",
|
||||
"device": _("access point"),
|
||||
},
|
||||
"topologie/topo_more.html",
|
||||
request,
|
||||
|
@ -712,7 +713,7 @@ def edit_ap(request, ap, **_kwargs):
|
|||
"machineform": ap_form,
|
||||
"domainform": domain_form,
|
||||
"i_mbf_param": i_mbf_param,
|
||||
"device": "wifi ap",
|
||||
"device": _("access point"),
|
||||
},
|
||||
"topologie/topo_more.html",
|
||||
request,
|
||||
|
@ -729,7 +730,7 @@ def new_room(request):
|
|||
messages.success(request, _("The room was created."))
|
||||
return redirect(reverse("topologie:index-room"))
|
||||
return form(
|
||||
{"topoform": room, "action_name": _("Create")}, "topologie/topo.html", request
|
||||
{"topoform": room, "action_name": _("Add")}, "topologie/topo.html", request
|
||||
)
|
||||
|
||||
|
||||
|
@ -769,7 +770,7 @@ def del_room(request, room, **_kwargs):
|
|||
)
|
||||
return redirect(reverse("topologie:index-room"))
|
||||
return form(
|
||||
{"objet": room, "objet_name": _("Room")}, "topologie/delete.html", request
|
||||
{"objet": room, "objet_name": _("room")}, "topologie/delete.html", request
|
||||
)
|
||||
|
||||
|
||||
|
@ -783,7 +784,7 @@ def new_model_switch(request):
|
|||
messages.success(request, _("The switch model was created."))
|
||||
return redirect(reverse("topologie:index-model-switch"))
|
||||
return form(
|
||||
{"topoform": model_switch, "action_name": _("Create")},
|
||||
{"topoform": model_switch, "action_name": _("Add")},
|
||||
"topologie/topo.html",
|
||||
request,
|
||||
)
|
||||
|
@ -828,7 +829,7 @@ def del_model_switch(request, model_switch, **_kwargs):
|
|||
)
|
||||
return redirect(reverse("topologie:index-model-switch"))
|
||||
return form(
|
||||
{"objet": model_switch, "objet_name": _("Switch model")},
|
||||
{"objet": model_switch, "objet_name": _("switch model")},
|
||||
"topologie/delete.html",
|
||||
request,
|
||||
)
|
||||
|
@ -844,7 +845,7 @@ def new_switch_bay(request):
|
|||
messages.success(request, _("The switch bay was created."))
|
||||
return redirect(reverse("topologie:index-physical-grouping"))
|
||||
return form(
|
||||
{"topoform": switch_bay, "action_name": _("Create")},
|
||||
{"topoform": switch_bay, "action_name": _("Add")},
|
||||
"topologie/topo.html",
|
||||
request,
|
||||
)
|
||||
|
@ -888,7 +889,7 @@ def del_switch_bay(request, switch_bay, **_kwargs):
|
|||
)
|
||||
return redirect(reverse("topologie:index-physical-grouping"))
|
||||
return form(
|
||||
{"objet": switch_bay, "objet_name": _("Switch bay")},
|
||||
{"objet": switch_bay, "objet_name": _("switch bay")},
|
||||
"topologie/delete.html",
|
||||
request,
|
||||
)
|
||||
|
@ -905,7 +906,7 @@ def new_building(request):
|
|||
messages.success(request, _("The building was created."))
|
||||
return redirect(reverse("topologie:index-physical-grouping"))
|
||||
return form(
|
||||
{"topoform": building, "action_name": _("Create")},
|
||||
{"topoform": building, "action_name": _("Add")},
|
||||
"topologie/topo.html",
|
||||
request,
|
||||
)
|
||||
|
@ -949,7 +950,7 @@ def del_building(request, building, **_kwargs):
|
|||
)
|
||||
return redirect(reverse("topologie:index-physical-grouping"))
|
||||
return form(
|
||||
{"objet": building, "objet_name": _("Building")},
|
||||
{"objet": building, "objet_name": _("building")},
|
||||
"topologie/delete.html",
|
||||
request,
|
||||
)
|
||||
|
@ -966,7 +967,7 @@ def new_dormitory(request):
|
|||
messages.success(request, _("The dormitory was created."))
|
||||
return redirect(reverse("topologie:index-physical-grouping"))
|
||||
return form(
|
||||
{"topoform": dormitory, "action_name": _("Create")},
|
||||
{"topoform": dormitory, "action_name": _("Add")},
|
||||
"topologie/topo.html",
|
||||
request,
|
||||
)
|
||||
|
@ -1012,7 +1013,7 @@ def del_dormitory(request, dormitory, **_kwargs):
|
|||
)
|
||||
return redirect(reverse("topologie:index-physical-grouping"))
|
||||
return form(
|
||||
{"objet": dormitory, "objet_name": _("Dormitory")},
|
||||
{"objet": dormitory, "objet_name": _("dormitory")},
|
||||
"topologie/delete.html",
|
||||
request,
|
||||
)
|
||||
|
@ -1028,7 +1029,7 @@ def new_constructor_switch(request):
|
|||
messages.success(request, _("The switch constructor was created."))
|
||||
return redirect(reverse("topologie:index-model-switch"))
|
||||
return form(
|
||||
{"topoform": constructor_switch, "action_name": _("Create")},
|
||||
{"topoform": constructor_switch, "action_name": _("Add")},
|
||||
"topologie/topo.html",
|
||||
request,
|
||||
)
|
||||
|
@ -1075,7 +1076,7 @@ def del_constructor_switch(request, constructor_switch, **_kwargs):
|
|||
)
|
||||
return redirect(reverse("topologie:index-model-switch"))
|
||||
return form(
|
||||
{"objet": constructor_switch, "objet_name": _("Switch constructor")},
|
||||
{"objet": constructor_switch, "objet_name": _("switch constructor")},
|
||||
"topologie/delete.html",
|
||||
request,
|
||||
)
|
||||
|
@ -1091,7 +1092,7 @@ def new_port_profile(request):
|
|||
messages.success(request, _("The port profile was created."))
|
||||
return redirect(reverse("topologie:index-port-profile"))
|
||||
return form(
|
||||
{"topoform": port_profile, "action_name": _("Create")},
|
||||
{"topoform": port_profile, "action_name": _("Add")},
|
||||
"topologie/topo.html",
|
||||
request,
|
||||
)
|
||||
|
@ -1126,7 +1127,7 @@ def del_port_profile(request, port_profile, **_kwargs):
|
|||
messages.success(request, _("Impossible to delete the port profile."))
|
||||
return redirect(reverse("topologie:index-port-profile"))
|
||||
return form(
|
||||
{"objet": port_profile, "objet_name": _("Port profile")},
|
||||
{"objet": port_profile, "objet_name": _("port profile")},
|
||||
"topologie/delete.html",
|
||||
request,
|
||||
)
|
||||
|
@ -1142,7 +1143,7 @@ def add_module(request):
|
|||
messages.success(request, _("The module was created."))
|
||||
return redirect(reverse("topologie:index-module"))
|
||||
return form(
|
||||
{"topoform": module, "action_name": _("Create")}, "topologie/topo.html", request
|
||||
{"topoform": module, "action_name": _("Add")}, "topologie/topo.html", request
|
||||
)
|
||||
|
||||
|
||||
|
@ -1182,7 +1183,7 @@ def del_module(request, module, **_kwargs):
|
|||
)
|
||||
return redirect(reverse("topologie:index-module"))
|
||||
return form(
|
||||
{"objet": module, "objet_name": _("Module")}, "topologie/delete.html", request
|
||||
{"objet": module, "objet_name": _("module")}, "topologie/delete.html", request
|
||||
)
|
||||
|
||||
|
||||
|
@ -1238,7 +1239,7 @@ def del_module_on(request, module, **_kwargs):
|
|||
)
|
||||
return redirect(reverse("topologie:index-module"))
|
||||
return form(
|
||||
{"objet": module, "objet_name": _("Module")}, "topologie/delete.html", request
|
||||
{"objet": module, "objet_name": _("module")}, "topologie/delete.html", request
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue