8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-26 22:52:26 +00:00

Mark strings for translation in machines

This commit is contained in:
Laouen Fernet 2019-11-16 14:07:15 +00:00 committed by chirac
parent 07ce7bd8a7
commit ac5d8e2080
20 changed files with 129 additions and 122 deletions

View file

@ -41,6 +41,7 @@ def can_view(user):
can = user.has_module_perms("machines")
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."),
("machines",),
)

View file

@ -68,7 +68,7 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model):
user = models.ForeignKey("users.User", on_delete=models.CASCADE)
name = models.CharField(
max_length=255, help_text=_("Optional"), blank=True, null=True
max_length=255, help_text=_("Optional."), blank=True, null=True
)
active = models.BooleanField(default=True)
@ -157,7 +157,8 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model):
if user != user_request:
return (
False,
_("You don't have the right to add a machine" " to another user."),
_("You don't have the right to add a machine to another"
" user."),
("machines.add_machine",),
)
if user.user_interfaces().count() >= max_lambdauser_interfaces:
@ -185,7 +186,8 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model):
if not (user_request.has_perm("machines.change_interface") and can_user):
return (
False,
_("You don't have the right to edit a machine" " of another user."),
_("You don't have the right to edit a machine of another"
" user."),
("machines.change_interface",) + permissions,
)
return True, None, None
@ -223,7 +225,8 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model):
):
return (
False,
_("You don't have the right to view other machines" " than yours."),
_("You don't have the right to view other machines than"
" yours."),
("machines.view_machine",),
)
return True, None, None
@ -358,22 +361,22 @@ class IpType(RevMixin, AclMixin, models.Model):
protocol="IPv4",
null=True,
blank=True,
help_text=_("Network containing the domain's IPv4 range (optional)"),
help_text=_("Network containing the domain's IPv4 range (optional)."),
)
domaine_ip_netmask = models.IntegerField(
default=24,
validators=[MaxValueValidator(31), MinValueValidator(8)],
help_text=_("Netmask for the domain's IPv4 range"),
help_text=_("Netmask for the domain's IPv4 range."),
)
reverse_v4 = models.BooleanField(
default=False, help_text=_("Enable reverse DNS for IPv4")
default=False, help_text=_("Enable reverse DNS for IPv4.")
)
prefix_v6 = models.GenericIPAddressField(protocol="IPv6", null=True, blank=True)
prefix_v6_length = models.IntegerField(
default=64, validators=[MaxValueValidator(128), MinValueValidator(0)]
)
reverse_v6 = models.BooleanField(
default=False, help_text=_("Enable reverse DNS for IPv6")
default=False, help_text=_("Enable reverse DNS for IPv6.")
)
vlan = models.ForeignKey("Vlan", on_delete=models.PROTECT, blank=True, null=True)
ouverture_ports = models.ForeignKey("OuverturePortList", blank=True, null=True)
@ -553,7 +556,8 @@ class IpType(RevMixin, AclMixin, models.Model):
for element in IpType.objects.all().exclude(pk=self.pk):
if not self.ip_set.isdisjoint(element.ip_set):
raise ValidationError(
_("The specified range is not disjoint" " from existing ranges.")
_("The specified range is not disjoint from existing"
" ranges.")
)
# On formate le prefix v6
if self.prefix_v6:
@ -604,8 +608,8 @@ class Vlan(RevMixin, AclMixin, models.Model):
arp_protect = models.BooleanField(default=False)
dhcp_snooping = models.BooleanField(default=False)
dhcpv6_snooping = models.BooleanField(default=False)
igmp = models.BooleanField(default=False, help_text=_("v4 multicast management"))
mld = models.BooleanField(default=False, help_text=_("v6 multicast management"))
igmp = models.BooleanField(default=False, help_text=_("v4 multicast management."))
mld = models.BooleanField(default=False, help_text=_("v6 multicast management."))
class Meta:
permissions = (("view_vlan", _("Can view a VLAN object")),)
@ -653,30 +657,30 @@ class SOA(RevMixin, AclMixin, models.Model):
"""
name = models.CharField(max_length=255)
mail = models.EmailField(help_text=_("Contact email address for the zone"))
mail = models.EmailField(help_text=_("Contact email address for the zone."))
refresh = models.PositiveIntegerField(
default=86400, # 24 hours
help_text=_(
"Seconds before the secondary DNS have to ask the primary"
" DNS serial to detect a modification"
" DNS serial to detect a modification."
),
)
retry = models.PositiveIntegerField(
default=7200, # 2 hours
help_text=_(
"Seconds before the secondary DNS ask the serial again in"
" case of a primary DNS timeout"
" case of a primary DNS timeout."
),
)
expire = models.PositiveIntegerField(
default=3600000, # 1000 hours
help_text=_(
"Seconds before the secondary DNS stop answering requests"
" in case of primary DNS timeout"
" in case of primary DNS timeout."
),
)
ttl = models.PositiveIntegerField(
default=172800, help_text=_("Time to Live") # 2 days
default=172800, help_text=_("Time To Live.") # 2 days
)
class Meta:
@ -732,7 +736,7 @@ class Extension(RevMixin, AclMixin, models.Model):
name = models.CharField(
max_length=255,
unique=True,
help_text=_("Zone name, must begin with a dot (.example.org)"),
help_text=_("Zone name, must begin with a dot (.example.org)."),
)
need_infra = models.BooleanField(default=False)
origin = models.ForeignKey(
@ -740,17 +744,17 @@ class Extension(RevMixin, AclMixin, models.Model):
on_delete=models.PROTECT,
blank=True,
null=True,
help_text=_("A record associated with the zone"),
help_text=_("A record associated with the zone."),
)
origin_v6 = models.GenericIPAddressField(
protocol="IPv6",
null=True,
blank=True,
help_text=_("AAAA record associated with the zone"),
help_text=_("AAAA record associated with the zone."),
)
soa = models.ForeignKey("SOA", on_delete=models.CASCADE)
dnssec = models.BooleanField(
default=False, help_text=_("Should the zone be signed with DNSSEC")
default=False, help_text=_("Should the zone be signed with DNSSEC.")
)
class Meta:
@ -819,7 +823,7 @@ class Extension(RevMixin, AclMixin, models.Model):
can = user_request.has_perm("machines.use_all_extension")
return (
can,
_("You cannot use all extensions.") if not can else None,
_("You don't have the right to use all extensions.") if not can else None,
("machines.use_all_extension",),
)
@ -943,7 +947,7 @@ class Srv(RevMixin, AclMixin, models.Model):
)
extension = models.ForeignKey("Extension", on_delete=models.PROTECT)
ttl = models.PositiveIntegerField(
default=172800, help_text=_("Time to Live") # 2 days
default=172800, help_text=_("Time To Live.") # 2 days
)
priority = models.PositiveIntegerField(
default=0,
@ -951,7 +955,7 @@ class Srv(RevMixin, AclMixin, models.Model):
help_text=_(
"Priority of the target server (positive integer value,"
" the lower it is, the more the server will be used if"
" available)"
" available)."
),
)
weight = models.PositiveIntegerField(
@ -959,14 +963,14 @@ class Srv(RevMixin, AclMixin, models.Model):
validators=[MaxValueValidator(65535)],
help_text=_(
"Relative weight for records with the same priority"
" (integer value between 0 and 65535)"
" (integer value between 0 and 65535)."
),
)
port = models.PositiveIntegerField(
validators=[MaxValueValidator(65535)], help_text=_("TCP/UDP port")
validators=[MaxValueValidator(65535)], help_text=_("TCP/UDP port.")
)
target = models.ForeignKey(
"Domain", on_delete=models.PROTECT, help_text=_("Target server")
"Domain", on_delete=models.PROTECT, help_text=_("Target server.")
)
class Meta:
@ -1023,10 +1027,10 @@ class SshFp(RevMixin, AclMixin, models.Model):
)
machine = models.ForeignKey("Machine", on_delete=models.CASCADE)
pub_key_entry = models.TextField(help_text=_("SSH public key"), max_length=2048)
pub_key_entry = models.TextField(help_text=_("SSH public key."), max_length=2048)
algo = models.CharField(choices=ALGO, max_length=32)
comment = models.CharField(
help_text=_("Comment"), max_length=255, null=True, blank=True
help_text=_("Comment."), max_length=255, null=True, blank=True
)
@cached_property
@ -1128,7 +1132,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
oui = mac.oui
vendor = oui.registration().org
except NotRegisteredError:
vendor = "Unknown vendor"
vendor = _("Unknown vendor.")
return vendor
def sync_ipv6_dhcpv6(self):
@ -1201,7 +1205,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
self.ipv4 = free_ips[0]
else:
raise ValidationError(
_("There is no IP address available in the" " slash.")
_("There are no IP addresses available in the slash.")
)
return
@ -1214,7 +1218,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
"""Unassign ipv4 to multiple interfaces"""
with transaction.atomic(), reversion.create_revision():
interface_list.update(ipv4=None)
reversion.set_comment(_("IPv4 unassigning"))
reversion.set_comment("IPv4 unassignment")
@classmethod
def mass_assign_ipv4(cls, interface_list):
@ -1222,7 +1226,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
with transaction.atomic(), reversion.create_revision():
interface.assign_ipv4()
interface.save()
reversion.set_comment(_("IPv4 assigning"))
reversion.set_comment("IPv4 assignment")
def update_type(self):
""" Lorsque le machinetype est changé de type d'ip, on réassigne"""
@ -1267,7 +1271,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
)
if interfaces_similar and interfaces_similar.first() != self:
raise ValidationError(
_("Mac address already registered in this Machine Type/Subnet")
_("MAC address already registered in this machine type/subnet.")
)
def save(self, *args, **kwargs):
@ -1276,7 +1280,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
if self.ipv4:
if self.machine_type.ip_type != self.ipv4.ip_type:
raise ValidationError(
_("The IPv4 address and the machine type" " don't match.")
_("The IPv4 address and the machine type don't match.")
)
self.validate_unique()
super(Interface, self).save(*args, **kwargs)
@ -1296,7 +1300,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
if not (
preferences.models.OptionalMachine.get_cached_value("create_machine")
):
return False, _("You can't add a machine."), ("machines.add_interface",)
return False, _("You don't have the right to add a machine."), ("machines.add_interface",)
max_lambdauser_interfaces = preferences.models.OptionalMachine.get_cached_value(
"max_lambdauser_interfaces"
)
@ -1328,7 +1332,7 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
can = user_request.has_perm("machines.change_interface_machine")
return (
can,
_("Permission required to edit the machine.") if not can else None,
_("You don't have the right to edit the machine.") if not can else None,
("machines.change_interface_machine",),
)
@ -1345,7 +1349,8 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
if not (user_request.has_perm("machines.change_interface") and can_user):
return (
False,
_("You don't have the right to edit a machine of" " another user."),
_("You don't have the right to edit a machine of another"
" user."),
("machines.change_interface",) + permissions,
)
return True, None, None
@ -1363,7 +1368,8 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
if not (user_request.has_perm("machines.change_interface") and can_user):
return (
False,
_("You don't have the right to edit a machine of" " another user."),
_("You don't have the right to edit a machine of another"
" user."),
("machines.change_interface",) + permissions,
)
return True, None, None
@ -1411,7 +1417,7 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
("view_ipv6list", _("Can view an IPv6 addresses list object")),
(
"change_ipv6list_slaac_ip",
_("Can change the SLAAC value of an" " IPv6 addresses list"),
_("Can change the SLAAC value of an IPv6 addresses list"),
),
)
verbose_name = _("IPv6 addresses list")
@ -1446,7 +1452,7 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
can = user_request.has_perm("machines.change_ipv6list_slaac_ip")
return (
can,
_("Permission required to change the SLAAC value of an IPv6" " address")
_("You don't have the right to change the SLAAC value of an IPv6 address.")
if not can
else None,
("machines.change_ipv6list_slaac_ip",),
@ -1465,7 +1471,7 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
if not (user_request.has_perm("machines.change_ipv6list") and can_user):
return (
False,
_("You don't have the right to edit a machine of" " another user."),
_("You don't have the right to edit a machine of another user."),
("machines.change_ipv6list",),
)
return True, None, None
@ -1483,7 +1489,7 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
if not (user_request.has_perm("machines.change_ipv6list") and can_user):
return (
False,
_("You don't have the right to edit a machine of" " another user."),
_("You don't have the right to edit a machine of another user."),
("machines.change_ipv6list",) + permissions,
)
return True, None, None
@ -1587,7 +1593,7 @@ class Domain(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
unique_together = (("name", "extension"),)
permissions = (
("view_domain", _("Can view a domain object")),
("change_ttl", _("Can change TTL of a domain object")),
("change_ttl", _("Can change the TTL of a domain object")),
)
verbose_name = _("domain")
verbose_name_plural = _("domains")
@ -1612,20 +1618,20 @@ class Domain(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
if self.get_extension():
self.extension = self.get_extension()
if self.interface_parent and self.cname:
raise ValidationError(_("You can't create a both A and CNAME" " record."))
raise ValidationError(_("You can't create a both A and CNAME record."))
if self.cname == self:
raise ValidationError(
_("You can't create a CNAME record pointing" " to itself.")
_("You can't create a CNAME record pointing to itself.")
)
HOSTNAME_LABEL_PATTERN = re.compile(r"(?!-)[A-Z\d-]+(?<!-)$", re.IGNORECASE)
dns = self.name.lower()
if len(dns) > 63:
raise ValidationError(
_("The domain name %s is too long (over 63" " characters).") % dns
_("The domain name %s is too long (over 63 characters).") % dns
)
if not HOSTNAME_LABEL_PATTERN.match(dns):
raise ValidationError(
_("The domain name %s contains forbidden" " characters.") % dns
_("The domain name %s contains forbidden characters.") % dns
)
self.validate_unique()
super(Domain, self).clean()
@ -1753,7 +1759,8 @@ class Domain(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
):
return (
False,
_("You don't have the right to view machines other than yours."),
_("You don't have the right to view other machines than"
" yours."),
("machines.view_domain",),
)
return True, None, None
@ -1794,7 +1801,7 @@ class IpList(RevMixin, AclMixin, models.Model):
""" Erreur si l'ip_type est incorrect"""
if not str(self.ipv4) in self.ip_type.ip_set_as_str:
raise ValidationError(
_("The IPv4 address and the range of the IP" " type don't match.")
_("The IPv4 address and the range of the IP type don't match.")
)
return
@ -1970,7 +1977,8 @@ class OuverturePortList(RevMixin, AclMixin, models.Model):
class Meta:
permissions = (
("view_ouvertureportlist", _("Can view a ports opening list" " object")),
("view_ouvertureportlist", _("Can view a ports opening list"
" object")),
)
verbose_name = _("ports opening list")
verbose_name_plural = _("ports opening lists")

View file

@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<thead>
<tr>
<th>{% trans "Extension" %}</th>
<th>{% trans "'infra' right required" %}</th>
<th>{% blocktrans %}"infra" right required{% endblocktrans %}</th>
<th>{% trans "SOA record" %}</th>
<th>{% trans "A record origin" %}</th>
{% if ipv6_enabled %}

View file

@ -34,7 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<th>{% trans "IP type" %}</th>
<th>{% trans "Extension" %}</th>
<th>{% trans "'infra' right required" %}</th>
<th>{% blocktrans %}"infra" right required{% endblocktrans %}</th>
<th>{% trans "IPv4 range" %}</th>
<th>{% trans "v6 prefix" %}</th>
<th>{% trans "DNSSEC reverse v4/v6" %}</th>

View file

@ -123,7 +123,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<li>
<a href="{% url 'machines:edit-interface' interface.id %}">
<i class="fa fa-edit"></i>
{% trans " Edit" %}
{% trans "Edit" %}
</a>
</li>
{% acl_end %}
@ -131,7 +131,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<li>
<a href="{% url 'machines:index-alias' interface.id %}">
<i class="fa fa-edit"></i>
{% trans " Manage the aliases" %}
{% trans "Manage the aliases" %}
</a>
</li>
{% acl_end %}
@ -139,7 +139,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<li>
<a href="{% url 'machines:index-ipv6' interface.id %}">
<i class="fa fa-edit"></i>
{% trans " Manage the IPv6 addresses" %}
{% trans "Manage the IPv6 addresses" %}
</a>
</li>
{% acl_end %}
@ -147,7 +147,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<li>
<a href="{% url 'machines:index-sshfp' interface.machine.id %}">
<i class="fa fa-edit"></i>
{% trans " Manage the SSH fingerprints" %}
{% trans "Manage the SSH fingerprints" %}
</a>
</li>
{% acl_end %}
@ -155,7 +155,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<li>
<a href="{% url 'machines:port-config' interface.id %}">
<i class="fa fa-edit"></i>
{% trans " Manage the ports configuration" %}
{% trans "Manage the ports configuration" %}
</a>
</li>
{% acl_end %}

View file

@ -31,8 +31,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<th>{% trans "Service name" %}</th>
<th>{% trans "Server" %}</th>
<th>{% trans "Last regeneration" %}</th>
<th>{% trans "Regeneration required" %}</th>
<th>{% trans "Regeneration activated" %}</th>
<th>{% trans "Regeneration asked" %}</th>
<th>{% trans "Regeneration needed" %}</th>
</tr>
</thead>
{% for server in servers_list %}

View file

@ -47,11 +47,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</div>
<p>
{% trans "Add a port" as value %}
<input class="btn btn-primary btn-sm" role="button" value="value" id="add_one">
<input class="btn btn-primary btn-sm" role="button" value="{% trans "Add a port" %}" id="add_one">
</p>
{% trans "Create or edit" as tr_create_or_edit %}
{% bootstrap_button tr_create_or_edit icon='ok' button_class='btn-success' %}
{% trans "Confirm" as tr_confirm %}
{% bootstrap_button tr_confirm icon='ok' button_class='btn-success' %}
</form>
<script type="text/javascript">
var template = `{{ports.empty_form}}`;

View file

@ -31,9 +31,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block content %}
<h2>{% trans "List of the aliases of the interface" %}</h2>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-alias' interface_id %}"><i
class="fa fa-plus"></i>{% trans " Add an alias" %}</a>
class="fa fa-plus"></i> {% trans "Add an alias" %}</a>
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-alias' interface_id %}"><i
class="fa fa-trash"></i>{% trans " Delete one or several aliases" %}</a>
class="fa fa-trash"></i> {% trans "Delete one or several aliases" %}</a>
{% include 'machines/aff_alias.html' with alias_list=alias_list %}
<br/>
<br/>

View file

@ -33,77 +33,76 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h2>{% trans "List of extensions" %}</h2>
{% can_create Extension %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-extension' %}">
<i class="fa fa-plus"></i>
{% trans " Add an extension" %}</a>
<i class="fa fa-plus"></i> {% trans "Add an extension" %}</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-extension' %}">
<i class="fa fa-trash"></i>{% trans " Delete one or several extensions" %}
<i class="fa fa-trash"></i> {% trans "Delete one or several extensions" %}
</a>
{% include 'machines/aff_extension.html' with extension_list=extension_list %}
<h2>{% trans "List of SOA records" %}</h2>
{% can_create SOA %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-soa' %}">
<i class="fa fa-plus"></i>{% trans " Add an SOA record" %}
<i class="fa fa-plus"></i> {% trans "Add an SOA record" %}
</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-soa' %}">
<i class="fa fa-trash"></i>{% trans " Delete one or several SOA records" %}
<i class="fa fa-trash"></i> {% trans "Delete one or several SOA records" %}
</a>
{% include 'machines/aff_soa.html' with soa_list=soa_list %}
<h2>{% trans "List of MX records" %}</h2>
{% can_create Mx %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-mx' %}">
<i class="fa fa-plus"></i>{% trans " Add an MX record" %}
<i class="fa fa-plus"></i> {% trans "Add an MX record" %}
</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-mx' %}">
<i class="fa fa-trash"></i>{% trans " Delete one or several MX records" %}
<i class="fa fa-trash"></i> {% trans "Delete one or several MX records" %}
</a>
{% include 'machines/aff_mx.html' with mx_list=mx_list %}
<h2>{% trans "List of NS records" %}</h2>
{% can_create Ns %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-ns' %}">
<i class="fa fa-plus"></i>{% trans " Add an NS record" %}
<i class="fa fa-plus"></i> {% trans "Add an NS record" %}
</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-ns' %}">
<i class="fa fa-trash"></i>{% trans " Delete one or several NS records" %}
<i class="fa fa-trash"></i> {% trans "Delete one or several NS records" %}
</a>
{% include 'machines/aff_ns.html' with ns_list=ns_list %}
<h2>{% trans "List of TXT records" %}</h2>
{% can_create Txt %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-txt' %}">
<i class="fa fa-plus"></i>{% trans " Add a TXT record" %}
<i class="fa fa-plus"></i> {% trans "Add a TXT record" %}
</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-txt' %}">
<i class="fa fa-trash"></i>{% trans " Delete one or several TXT records" %}
<i class="fa fa-trash"></i> {% trans "Delete one or several TXT records" %}
</a>
{% include 'machines/aff_txt.html' with txt_list=txt_list %}
<h2>{% trans "List of DNAME records" %}</h2>
{% can_create DName %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-dname' %}">
<i class="fa fa-plus"></i> {% trans " Add a DNAME record" %}
<i class="fa fa-plus"></i> {% trans "Add a DNAME record" %}
</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-dname' %}">
<i class="fa fa-trash"></i> {% trans " Delete one or several DNAME records" %}
<i class="fa fa-trash"></i> {% trans "Delete one or several DNAME records" %}
</a>
{% include 'machines/aff_dname.html' with dname_list=dname_list %}
<h2>{% trans "List of SRV records" %}</h2>
{% can_create Srv %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-srv' %}">
<i class="fa fa-plus"></i>{% trans " Add an SRV record" %}
<i class="fa fa-plus"></i> {% trans "Add an SRV record" %}
</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-srv' %}">
<i class="fa fa-trash"></i>{% trans " Delete one or several SRV records" %}
<i class="fa fa-trash"></i> {% trans "Delete one or several SRV records" %}
</a>
{% include 'machines/aff_srv.html' with srv_list=srv_list %}
{% endblock %}

View file

@ -33,11 +33,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h2>{% trans "List of IP types" %}</h2>
{% can_create IpType %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-iptype' %}">
<i class="fa fa-plus"></i>{% trans " Add an IP type" %}
<i class="fa fa-plus"></i> {% trans "Add an IP type" %}
</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-iptype' %}">
<i class="fa fa-trash"></i>{% trans " Delete one or several IP types" %}
<i class="fa fa-trash"></i> {% trans "Delete one or several IP types" %}
</a>
{% include 'machines/aff_iptype.html' with iptype_list=iptype_list %}
{% endblock %}

View file

@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h2>{% trans "List of the IPv6 addresses of the interface" %}</h2>
{% can_create Ipv6List interface_id %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-ipv6list' interface_id %}">
<i class="fa fa-plus"></i>{% trans " Add an IPv6 address" %}
<i class="fa fa-plus"></i> {% trans "Add an IPv6 address" %}
</a>
{% acl_end %}
{% include 'machines/aff_ipv6.html' with ipv6_list=ipv6_list %}

View file

@ -34,11 +34,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h2>{% trans "List of machine types" %}</h2>
{% can_create MachineType %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-machinetype' %}">
<i class="fa fa-plus"></i>{% trans " Add a machine type" %}
<i class="fa fa-plus"></i> {% trans "Add a machine type" %}
</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-machinetype' %}">
<i class="fa fa-trash"></i>{% trans " Delete one or several machine types" %}
<i class="fa fa-trash"></i> {% trans "Delete one or several machine types" %}
</a>
{% include 'machines/aff_machinetype.html' with machinetype_list=machinetype_list %}
<br/>

View file

@ -35,11 +35,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h5>{% trans "The NAS device type and machine type are linked. It is useful for MAC address auto capture by RADIUS, and allows to choose the machine type to assign to the machines according to the NAS device type." %}</h5>
{% can_create Nas %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-nas' %}">
<i class="fa fa-plus"></i>{% trans " Add a NAS device type" %}
<i class="fa fa-plus"></i> {% trans "Add a NAS device type" %}
</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-nas' %}">
<i class="fa fa-trash"></i>{% trans " Delete one or several NAS device types" %}
<i class="fa fa-trash"></i> {% trans "Delete one or several NAS device types" %}
</a>
{% include 'machines/aff_nas.html' with nas_list=nas_list %}
<br/>

View file

@ -11,7 +11,7 @@
<h2>{% trans "List of ports configurations" %}</h2>
{% can_create OuverturePortList %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-portlist' %}">
<i class="fa fa-plus"></i>{% trans " Add a configuration" %}
<i class="fa fa-plus"></i> {% trans "Add a configuration" %}
</a>
{% acl_end %}
<table class="table table-striped">

View file

@ -33,9 +33,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h2>{% trans "List of roles" %}</h2>
{% can_create Role %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-role' %}"><i
class="fa fa-plus"></i>{% trans " Add a role" %}</a>
class="fa fa-plus"></i> {% trans "Add a role" %}</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-role' %}"><i
class="fa fa-trash"></i>{% trans " Delete one or several roles" %}</a>
class="fa fa-trash"></i> {% trans "Delete one or several roles" %}</a>
{% include 'machines/aff_role.html' with role_list=role_list %}
{% endblock %}

View file

@ -33,10 +33,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h2>{% trans "List of services" %}</h2>
{% can_create machines.Service %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-service' %}"><i
class="fa fa-plus"></i>{% trans " Add a service" %}</a>
class="fa fa-plus"></i> {% trans "Add a service" %}</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-service' %}"><i
class="fa fa-trash"></i>{% trans " Delete one or several services" %}</a>
class="fa fa-trash"></i> {% trans "Delete one or several services" %}</a>
{% include 'machines/aff_service.html' with service_list=service_list %}
<h2>{% trans "States of servers" %}</h2>

View file

@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h2>{% trans "SSH fingerprints" %}</h2>
{% can_create SshFp machine_id %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-sshfp' machine_id %}">
<i class="fa fa-plus"></i>{% trans " Add an SSH fingerprint" %}
<i class="fa fa-plus"></i> {% trans "Add an SSH fingerprint" %}
</a>
{% acl_end %}
{% include 'machines/aff_sshfp.html' with sshfp_list=sshfp_list %}

View file

@ -33,9 +33,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h2>{% trans "List of VLANs" %}</h2>
{% can_create Vlan %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-vlan' %}"><i
class="fa fa-plus"></i>{% trans " Add a VLAN" %}</a>
class="fa fa-plus"></i> {% trans "Add a VLAN" %}</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-vlan' %}"><i
class="fa fa-trash"></i>{% trans " Delete one or several VLANs" %}</a>
class="fa fa-trash"></i> {% trans "Delete one or several VLANs" %}</a>
{% include 'machines/aff_vlan.html' with vlan_list=vlan_list %}
{% endblock %}

View file

@ -60,7 +60,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% can_view_all Nas %}
<a class="list-group-item list-group-item-info" href="{% url 'machines:index-nas' %}">
<i class="fa fa-list-ul"></i>
{% trans "NAS devices" %}
{% trans "NAS devices" %}
</a>
{% acl_end %}
{% can_view_all machines.Service %}

View file

@ -250,7 +250,7 @@ def new_machine(request, user, **_kwargs):
"interfaceform": interface,
"domainform": domain,
"i_mbf_param": i_mbf_param,
"action_name": _("Create a machine"),
"action_name": _("Add"),
},
"machines/machine.html",
request,
@ -314,7 +314,7 @@ def del_machine(request, machine, **_kwargs):
reverse("users:profil", kwargs={"userid": str(machine.user.id)})
)
return form(
{"objet": machine, "objet_name": "machine"}, "machines/delete.html", request
{"objet": machine, "objet_name": _("machine")}, "machines/delete.html", request
)
@ -345,7 +345,7 @@ def new_interface(request, machine, **_kwargs):
"interfaceform": interface_form,
"domainform": domain_form,
"i_mbf_param": i_mbf_param,
"action_name": _("Create an interface"),
"action_name": _("Add"),
},
"machines/machine.html",
request,
@ -366,7 +366,7 @@ def del_interface(request, interface, **_kwargs):
reverse("users:profil", kwargs={"userid": str(request.user.id)})
)
return form(
{"objet": interface, "objet_name": "interface"}, "machines/delete.html", request
{"objet": interface, "objet_name": _("interface")}, "machines/delete.html", request
)
@ -386,7 +386,7 @@ def new_ipv6list(request, interface, **_kwargs):
reverse("machines:index-ipv6", kwargs={"interfaceid": str(interface.id)})
)
return form(
{"ipv6form": ipv6, "action_name": _("Create an IPv6 addresses list")},
{"ipv6form": ipv6, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -426,7 +426,7 @@ def del_ipv6list(request, ipv6list, **_kwargs):
reverse("machines:index-ipv6", kwargs={"interfaceid": str(interfaceid)})
)
return form(
{"objet": ipv6list, "objet_name": "ipv6"}, "machines/delete.html", request
{"objet": ipv6list, "objet_name": _("IPv6 addresses list")}, "machines/delete.html", request
)
@ -444,7 +444,7 @@ def new_sshfp(request, machine, **_kwargs):
reverse("machines:index-sshfp", kwargs={"machineid": str(machine.id)})
)
return form(
{"sshfpform": sshfp, "action_name": _("Create a SSHFP record")},
{"sshfpform": sshfp, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -482,7 +482,7 @@ def del_sshfp(request, sshfp, **_kwargs):
reverse("machines:index-sshfp", kwargs={"machineid": str(machineid)})
)
return form(
{"objet": sshfp, "objet_name": "sshfp"}, "machines/delete.html", request
{"objet": sshfp, "objet_name": _("SSHFP record")}, "machines/delete.html", request
)
@ -498,7 +498,7 @@ def add_iptype(request):
messages.success(request, _("The IP type was created."))
return redirect(reverse("machines:index-iptype"))
return form(
{"iptypeform": iptype, "action_name": _("Create an IP type")},
{"iptypeform": iptype, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -563,7 +563,7 @@ def add_machinetype(request):
messages.success(request, _("The machine type was created."))
return redirect(reverse("machines:index-machinetype"))
return form(
{"machinetypeform": machinetype, "action_name": _("Create a machine" " type")},
{"machinetypeform": machinetype, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -626,7 +626,7 @@ def add_extension(request):
messages.success(request, _("The extension was created."))
return redirect(reverse("machines:index-extension"))
return form(
{"extensionform": extension, "action_name": _("Create an extension")},
{"extensionform": extension, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -688,7 +688,7 @@ def add_soa(request):
messages.success(request, _("The SOA record was created."))
return redirect(reverse("machines:index-extension"))
return form(
{"soaform": soa, "action_name": _("Create an SOA record")},
{"soaform": soa, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -740,7 +740,7 @@ def add_mx(request):
messages.success(request, _("The MX record was created."))
return redirect(reverse("machines:index-extension"))
return form(
{"mxform": mx, "action_name": _("Create an MX record")},
{"mxform": mx, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -792,7 +792,7 @@ def add_ns(request):
messages.success(request, _("The NS record was created."))
return redirect(reverse("machines:index-extension"))
return form(
{"nsform": ns, "action_name": _("Create an NS record")},
{"nsform": ns, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -844,7 +844,7 @@ def add_dname(request):
messages.success(request, _("The DNAME record was created."))
return redirect(reverse("machines:index-extension"))
return form(
{"dnameform": dname, "action_name": _("Create a DNAME record")},
{"dnameform": dname, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -899,7 +899,7 @@ def add_txt(request):
messages.success(request, _("The TXT record was created."))
return redirect(reverse("machines:index-extension"))
return form(
{"txtform": txt, "action_name": _("Create a TXT record")},
{"txtform": txt, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -951,7 +951,7 @@ def add_srv(request):
messages.success(request, _("The SRV record was created."))
return redirect(reverse("machines:index-extension"))
return form(
{"srvform": srv, "action_name": _("Create an SRV record")},
{"srvform": srv, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -1008,7 +1008,7 @@ def add_alias(request, interface, interfaceid):
reverse("machines:index-alias", kwargs={"interfaceid": str(interfaceid)})
)
return form(
{"aliasform": alias, "action_name": _("Create an alias")},
{"aliasform": alias, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -1069,7 +1069,7 @@ def add_role(request):
messages.success(request, _("The role was created."))
return redirect(reverse("machines:index-role"))
return form(
{"roleform": role, "action_name": _("Create a role")},
{"roleform": role, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -1121,7 +1121,7 @@ def add_service(request):
messages.success(request, _("The service was created."))
return redirect(reverse("machines:index-service"))
return form(
{"serviceform": service, "action_name": _("Create a service")},
{"serviceform": service, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -1187,7 +1187,7 @@ def add_vlan(request):
messages.success(request, _("The VLAN was created."))
return redirect(reverse("machines:index-vlan"))
return form(
{"vlanform": vlan, "action_name": _("Create a VLAN")},
{"vlanform": vlan, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -1239,7 +1239,7 @@ def add_nas(request):
messages.success(request, _("The NAS device was created."))
return redirect(reverse("machines:index-nas"))
return form(
{"nasform": nas, "action_name": _("Create a NAS device")},
{"nasform": nas, "action_name": _("Add")},
"machines/machine.html",
request,
)
@ -1558,8 +1558,8 @@ def configure_ports(request, interface_instance, **_kwargs):
request,
(
_(
"Warning: the IPv4 isn't public, the opening won't have effect"
" in v4."
"Warning: the IP address is not public, the opening won't"
" have any effect in v4."
)
),
)
@ -1572,7 +1572,7 @@ def configure_ports(request, interface_instance, **_kwargs):
messages.success(request, _("The ports configuration was edited."))
return redirect(reverse("machines:index"))
return form(
{"interfaceform": interface, "action_name": _("Edit the" " configuration")},
{"interfaceform": interface, "action_name": _("Edit")},
"machines/machine.html",
request,
)