8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-05 01:16:27 +00:00

Translate to english

This commit is contained in:
Maël Kervella 2018-07-23 21:19:19 +00:00
parent 7631ea6c5f
commit 4bd0be94ed
7 changed files with 50 additions and 39 deletions

View file

@ -410,8 +410,9 @@ class DelTxtForm(FormRevMixin, Form):
else: else:
self.fields['txt'].queryset = Txt.objects.all() self.fields['txt'].queryset = Txt.objects.all()
class DNameForm(FormRevMixin, ModelForm): class DNameForm(FormRevMixin, ModelForm):
"""Ajout d'un DName pour une zone""" """Add a DNAME entry for a zone"""
class Meta: class Meta:
model = DName model = DName
fields = '__all__' fields = '__all__'
@ -422,10 +423,10 @@ class DNameForm(FormRevMixin, ModelForm):
class DelDNameForm(FormRevMixin, Form): class DelDNameForm(FormRevMixin, Form):
"""Suppression d'un ou plusieurs DName""" """Delete a set of DNAME entries"""
dnames = forms.ModelMultipleChoiceField( dnames = forms.ModelMultipleChoiceField(
queryset=Txt.objects.none(), queryset=Txt.objects.none(),
label="Enregistrements DName actuels", label="Existing DNAME entries",
widget=forms.CheckboxSelectMultiple widget=forms.CheckboxSelectMultiple
) )
@ -438,7 +439,6 @@ class DelDNameForm(FormRevMixin, Form):
self.fields['dnames'].queryset = DName.objects.all() self.fields['dnames'].queryset = DName.objects.all()
class SrvForm(FormRevMixin, ModelForm): class SrvForm(FormRevMixin, ModelForm):
"""Ajout d'un srv pour une zone""" """Ajout d'un srv pour une zone"""
class Meta: class Meta:

View file

@ -10,7 +10,7 @@ import re2o.mixins
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('machines', '0087_merge_20180624_1648'), ('machines', '0083_remove_duplicate_rights'),
] ]
operations = [ operations = [
@ -22,7 +22,9 @@ class Migration(migrations.Migration):
('zone', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='machines.Extension')), ('zone', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='machines.Extension')),
], ],
options={ options={
'permissions': (('view_dname', 'Peut voir un objet dname'),), 'permissions': (('view_dname', 'Can see a dname object'),),
'verbose_name': 'DNAME entry',
'verbose_name_plural': 'DNAME entries'
}, },
bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model), bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model),
), ),

View file

@ -672,23 +672,23 @@ class Txt(RevMixin, AclMixin, models.Model):
class DName(RevMixin, AclMixin, models.Model): class DName(RevMixin, AclMixin, models.Model):
""" Un enregistrement DName, qui crée un alias depuis la zone spécifié vers l'extension""" """A DNAME entry for the DNS."""
PRETTY_NAME = "Enregistrement DName"
zone = models.ForeignKey('Extension', on_delete=models.PROTECT) zone = models.ForeignKey('Extension', on_delete=models.PROTECT)
alias = models.CharField(max_length=255) alias = models.CharField(max_length=255)
class Meta: class Meta:
permissions = ( permissions = (
("view_dname", "Peut voir un objet dname"), ("view_dname", "Can see a dname object"),
) )
verbose_name = "DNAME entry"
verbose_name_plural = "DNAME entries"
def __str__(self): def __str__(self):
return str(self.zone) + " : " + str(self.alias) return str(self.zone) + " : " + str(self.alias)
@cached_property @cached_property
def dns_entry(self): def dns_entry(self):
"""Renvoie l'enregisterment DNAME complet pour le fichier de zone""" """Returns the DNAME record for the DNS zone file."""
return str(self.alias) + " IN DNAME " + str(self.zone) return str(self.alias) + " IN DNAME " + str(self.zone)
@ -1702,19 +1702,22 @@ def text_post_save(**_kwargs):
"""Regeneration dns après modification d'un TXT""" """Regeneration dns après modification d'un TXT"""
regen('dns') regen('dns')
@receiver(post_delete, sender=Txt) @receiver(post_delete, sender=Txt)
def text_post_delete(**_kwargs): def text_post_delete(**_kwargs):
"""Regeneration dns après modification d'un TX""" """Regeneration dns après modification d'un TX"""
regen('dns') regen('dns')
@receiver(post_save, sender=DName) @receiver(post_save, sender=DName)
def dname_post_save(**_kwargs): def dname_post_save(**_kwargs):
"""Regeneration dns après modification d'un DName""" """Updates the DNS regen after modification of a DName object."""
regen('dns') regen('dns')
@receiver(post_delete, sender=DName) @receiver(post_delete, sender=DName)
def DName_post_delete(**_kwargs): def dname_post_delete(**_kwargs):
"""Regeneration dns après modification d'un DName""" """Updates the DNS regen after deletion of a DName object."""
regen('dns') regen('dns')

View file

@ -25,8 +25,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th>Zone concernée</th> <th>Target zone</th>
<th>Enregistrement</th> <th>Record</th>
<th></th> <th></th>
<th></th> <th></th>
</tr> </tr>

View file

@ -61,12 +61,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% acl_end %} {% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-txt' %}"><i class="fa fa-trash"></i> Supprimer un enregistrement TXT</a> <a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-txt' %}"><i class="fa fa-trash"></i> Supprimer un enregistrement TXT</a>
{% include "machines/aff_txt.html" with txt_list=txt_list %} {% include "machines/aff_txt.html" with txt_list=txt_list %}
<h2>Liste des enregistrements DNAME</h2>
<h2>DNAME records</h2>
{% can_create DName %} {% can_create DName %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-dname' %}"><i class="fa fa-plus"></i> Ajouter un enregistrement DNAME</a> <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" %}
</a>
{% acl_end %} {% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-dname' %}"><i class="fa fa-trash"></i> Supprimer un enregistrement DNAME</a> <a class="btn btn-danger btn-sm" role="button" href="{% url 'machines:del-dname' %}">
<i class="fa fa-trash"></i> {% trans "Delete DNAME records" %}
</a>
{% include "machines/aff_dname.html" with dname_list=dname_list %} {% include "machines/aff_dname.html" with dname_list=dname_list %}
<h2>Liste des enregistrements SRV</h2> <h2>Liste des enregistrements SRV</h2>
{% can_create Srv %} {% can_create Srv %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-srv' %}"><i class="fa fa-plus"></i> Ajouter un enregistrement SRV</a> <a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-srv' %}"><i class="fa fa-plus"></i> Ajouter un enregistrement SRV</a>

View file

@ -54,12 +54,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if nsform %} {% if nsform %}
{% bootstrap_form_errors nsform %} {% bootstrap_form_errors nsform %}
{% endif %} {% endif %}
{% if dnameform %}
{% bootstrap_form_errors dnameform %}
{% endif %}
{% if txtform %} {% if txtform %}
{% bootstrap_form_errors txtform %} {% bootstrap_form_errors txtform %}
{% endif %} {% endif %}
{% if dnameform %}
{% bootstrap_form_errors dnameform %}
{% endif %}
{% if srvform %} {% if srvform %}
{% bootstrap_form_errors srvform %} {% bootstrap_form_errors srvform %}
{% endif %} {% endif %}
@ -126,7 +126,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% bootstrap_form txtform %} {% bootstrap_form txtform %}
{% endif %} {% endif %}
{% if dnameform %} {% if dnameform %}
<h3>Enregistrement DName</h3> <h3>DNAME record</h3>
{% bootstrap_form dnameform %} {% bootstrap_form dnameform %}
{% endif %} {% endif %}
{% if srvform %} {% if srvform %}

View file

@ -826,10 +826,10 @@ def add_dname(request):
dname = DNameForm(request.POST or None) dname = DNameForm(request.POST or None)
if dname.is_valid(): if dname.is_valid():
dname.save() dname.save()
messages.success(request, "Cet enregistrement DName a été ajouté") messages.success(request, "This DNAME record has been added")
return redirect(reverse('machines:index-extension')) return redirect(reverse('machines:index-extension'))
return form( return form(
{'dnameform': dname, 'action_name': 'Créer'}, {'dnameform': dname, 'action_name': "Create"},
'machines/machine.html', 'machines/machine.html',
request request
) )
@ -843,10 +843,10 @@ def edit_dname(request, dname_instance, **_kwargs):
if dname.is_valid(): if dname.is_valid():
if dname.changed_data: if dname.changed_data:
dname.save() dname.save()
messages.success(request, "DName modifié") messages.success(request, "DName successfully edited")
return redirect(reverse('machines:index-extension')) return redirect(reverse('machines:index-extension'))
return form( return form(
{'dnameform': dname, 'action_name': 'Editer'}, {'dnameform': dname, 'action_name': "Edit"},
'machines/machine.html', 'machines/machine.html',
request request
) )
@ -862,16 +862,16 @@ def del_dname(request, instances):
for dname_del in dname_dels: for dname_del in dname_dels:
try: try:
dname_del.delete() dname_del.delete()
messages.success(request, "Le dname a été supprimé") messages.success(request,
"The DNAME %s has been deleted" % dname_del)
except ProtectedError: except ProtectedError:
messages.error( messages.error(
request, request,
("Erreur le dname suivant %s ne peut être supprimé" "The DNAME %s can not be deleted" % dname_del
% dname_del)
) )
return redirect(reverse('machines:index-extension')) return redirect(reverse('machines:index-extension'))
return form( return form(
{'dnameform': dname, 'action_name': 'Supprimer'}, {'dnameform': dname, 'action_name': 'Delete'},
'machines/machine.html', 'machines/machine.html',
request request
) )