netbox-plugin-dns 1.1.2__py3-none-any.whl → 1.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of netbox-plugin-dns might be problematic. Click here for more details.

Files changed (84) hide show
  1. netbox_dns/__init__.py +14 -6
  2. netbox_dns/api/nested_serializers.py +3 -2
  3. netbox_dns/api/serializers_/nameserver.py +2 -1
  4. netbox_dns/api/serializers_/record.py +5 -4
  5. netbox_dns/api/serializers_/record_template.py +2 -1
  6. netbox_dns/api/serializers_/view.py +2 -1
  7. netbox_dns/api/serializers_/zone.py +12 -11
  8. netbox_dns/api/serializers_/zone_template.py +8 -7
  9. netbox_dns/api/views.py +9 -4
  10. netbox_dns/choices/record.py +4 -2
  11. netbox_dns/choices/zone.py +8 -4
  12. netbox_dns/fields/address.py +5 -22
  13. netbox_dns/fields/network.py +2 -1
  14. netbox_dns/fields/rfc2317.py +7 -3
  15. netbox_dns/filtersets/nameserver.py +3 -2
  16. netbox_dns/filtersets/record.py +14 -9
  17. netbox_dns/filtersets/record_template.py +3 -2
  18. netbox_dns/filtersets/view.py +3 -2
  19. netbox_dns/filtersets/zone.py +24 -22
  20. netbox_dns/filtersets/zone_template.py +15 -14
  21. netbox_dns/forms/nameserver.py +41 -17
  22. netbox_dns/forms/record.py +61 -32
  23. netbox_dns/forms/record_template.py +49 -28
  24. netbox_dns/forms/registrar.py +21 -17
  25. netbox_dns/forms/registration_contact.py +37 -25
  26. netbox_dns/forms/view.py +49 -27
  27. netbox_dns/forms/zone.py +173 -120
  28. netbox_dns/forms/zone_template.py +53 -43
  29. netbox_dns/locale/de/LC_MESSAGES/django.mo +0 -0
  30. netbox_dns/locale/en/LC_MESSAGES/django.mo +0 -0
  31. netbox_dns/management/commands/rebuild_dnssync.py +14 -1
  32. netbox_dns/models/nameserver.py +6 -2
  33. netbox_dns/models/record.py +74 -40
  34. netbox_dns/models/record_template.py +17 -9
  35. netbox_dns/models/registrar.py +11 -7
  36. netbox_dns/models/registration_contact.py +23 -11
  37. netbox_dns/models/view.py +15 -6
  38. netbox_dns/models/zone.py +83 -50
  39. netbox_dns/models/zone_template.py +12 -10
  40. netbox_dns/navigation.py +30 -28
  41. netbox_dns/signals/ipam_dnssync.py +21 -14
  42. netbox_dns/tables/ipam_dnssync.py +2 -1
  43. netbox_dns/tables/nameserver.py +2 -0
  44. netbox_dns/tables/record.py +21 -11
  45. netbox_dns/tables/record_template.py +12 -5
  46. netbox_dns/tables/registrar.py +2 -0
  47. netbox_dns/tables/registration_contact.py +2 -0
  48. netbox_dns/tables/view.py +3 -1
  49. netbox_dns/tables/zone.py +15 -2
  50. netbox_dns/tables/zone_template.py +7 -0
  51. netbox_dns/templates/netbox_dns/nameserver.html +6 -5
  52. netbox_dns/templates/netbox_dns/record/managed.html +2 -1
  53. netbox_dns/templates/netbox_dns/record/related.html +26 -14
  54. netbox_dns/templates/netbox_dns/record.html +39 -20
  55. netbox_dns/templates/netbox_dns/recordtemplate.html +27 -15
  56. netbox_dns/templates/netbox_dns/registrar.html +11 -10
  57. netbox_dns/templates/netbox_dns/registrationcontact.html +16 -15
  58. netbox_dns/templates/netbox_dns/view/button.html +2 -1
  59. netbox_dns/templates/netbox_dns/view/prefix.html +7 -4
  60. netbox_dns/templates/netbox_dns/view/related.html +26 -10
  61. netbox_dns/templates/netbox_dns/view.html +11 -14
  62. netbox_dns/templates/netbox_dns/zone/base.html +2 -1
  63. netbox_dns/templates/netbox_dns/zone/child.html +3 -2
  64. netbox_dns/templates/netbox_dns/zone/record.html +3 -2
  65. netbox_dns/templates/netbox_dns/zone/registration.html +8 -7
  66. netbox_dns/templates/netbox_dns/zone.html +28 -30
  67. netbox_dns/templates/netbox_dns/zonetemplate.html +27 -17
  68. netbox_dns/utilities/ipam_dnssync.py +15 -4
  69. netbox_dns/validators/dns_name.py +11 -4
  70. netbox_dns/validators/dns_value.py +55 -9
  71. netbox_dns/validators/rfc2317.py +6 -3
  72. netbox_dns/views/nameserver.py +4 -2
  73. netbox_dns/views/record_template.py +4 -3
  74. netbox_dns/views/registrar.py +3 -1
  75. netbox_dns/views/registration_contact.py +2 -1
  76. netbox_dns/views/view.py +2 -1
  77. netbox_dns/views/zone.py +6 -4
  78. netbox_dns/views/zone_template.py +8 -7
  79. {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.4.dist-info}/METADATA +2 -2
  80. netbox_plugin_dns-1.1.4.dist-info/RECORD +150 -0
  81. netbox_plugin_dns-1.1.2.dist-info/RECORD +0 -148
  82. {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.4.dist-info}/LICENSE +0 -0
  83. {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.4.dist-info}/WHEEL +0 -0
  84. {netbox_plugin_dns-1.1.2.dist-info → netbox_plugin_dns-1.1.4.dist-info}/top_level.txt +0 -0
netbox_dns/navigation.py CHANGED
@@ -1,3 +1,5 @@
1
+ from django.utils.translation import gettext_lazy as _
2
+
1
3
  from netbox.plugins import PluginMenuButton, PluginMenuItem, PluginMenu
2
4
  from netbox.plugins.utils import get_plugin_config
3
5
 
@@ -6,18 +8,18 @@ top_level_menu = get_plugin_config("netbox_dns", "top_level_menu")
6
8
 
7
9
  view_menu_item = PluginMenuItem(
8
10
  link="plugins:netbox_dns:view_list",
9
- link_text="Views",
11
+ link_text=_("Views"),
10
12
  permissions=["netbox_dns.view_view"],
11
13
  buttons=(
12
14
  PluginMenuButton(
13
15
  "plugins:netbox_dns:view_add",
14
- "Add",
16
+ _("Add"),
15
17
  "mdi mdi-plus-thick",
16
18
  permissions=["netbox_dns.add_view"],
17
19
  ),
18
20
  PluginMenuButton(
19
21
  "plugins:netbox_dns:view_import",
20
- "Import",
22
+ _("Import"),
21
23
  "mdi mdi-upload",
22
24
  permissions=["netbox_dns.add_view"],
23
25
  ),
@@ -26,18 +28,18 @@ view_menu_item = PluginMenuItem(
26
28
 
27
29
  zone_menu_item = PluginMenuItem(
28
30
  link="plugins:netbox_dns:zone_list",
29
- link_text="Zones",
31
+ link_text=_("Zones"),
30
32
  permissions=["netbox_dns.view_zone"],
31
33
  buttons=(
32
34
  PluginMenuButton(
33
35
  "plugins:netbox_dns:zone_add",
34
- "Add",
36
+ _("Add"),
35
37
  "mdi mdi-plus-thick",
36
38
  permissions=["netbox_dns.add_zone"],
37
39
  ),
38
40
  PluginMenuButton(
39
41
  "plugins:netbox_dns:zone_import",
40
- "Import",
42
+ _("Import"),
41
43
  "mdi mdi-upload",
42
44
  permissions=["netbox_dns.add_zone"],
43
45
  ),
@@ -46,18 +48,18 @@ zone_menu_item = PluginMenuItem(
46
48
 
47
49
  nameserver_menu_item = PluginMenuItem(
48
50
  link="plugins:netbox_dns:nameserver_list",
49
- link_text="Nameservers",
51
+ link_text=_("Nameservers"),
50
52
  permissions=["netbox_dns.view_nameserver"],
51
53
  buttons=(
52
54
  PluginMenuButton(
53
55
  "plugins:netbox_dns:nameserver_add",
54
- "Add",
56
+ _("Add"),
55
57
  "mdi mdi-plus-thick",
56
58
  permissions=["netbox_dns.add_nameserver"],
57
59
  ),
58
60
  PluginMenuButton(
59
61
  "plugins:netbox_dns:nameserver_import",
60
- "Import",
62
+ _("Import"),
61
63
  "mdi mdi-upload",
62
64
  permissions=["netbox_dns.add_nameserver"],
63
65
  ),
@@ -66,18 +68,18 @@ nameserver_menu_item = PluginMenuItem(
66
68
 
67
69
  record_menu_item = PluginMenuItem(
68
70
  link="plugins:netbox_dns:record_list",
69
- link_text="Records",
71
+ link_text=_("Records"),
70
72
  permissions=["netbox_dns.view_record"],
71
73
  buttons=(
72
74
  PluginMenuButton(
73
75
  "plugins:netbox_dns:record_add",
74
- "Add",
76
+ _("Add"),
75
77
  "mdi mdi-plus-thick",
76
78
  permissions=["netbox_dns.add_record"],
77
79
  ),
78
80
  PluginMenuButton(
79
81
  "plugins:netbox_dns:record_import",
80
- "Import",
82
+ _("Import"),
81
83
  "mdi mdi-upload",
82
84
  permissions=["netbox_dns.add_record"],
83
85
  ),
@@ -86,24 +88,24 @@ record_menu_item = PluginMenuItem(
86
88
 
87
89
  managed_record_menu_item = PluginMenuItem(
88
90
  link="plugins:netbox_dns:managed_record_list",
89
- link_text="Managed Records",
91
+ link_text=_("Managed Records"),
90
92
  permissions=["netbox_dns.view_record"],
91
93
  )
92
94
 
93
95
  zonetemplate_menu_item = PluginMenuItem(
94
96
  link="plugins:netbox_dns:zonetemplate_list",
95
- link_text="Zone Templates",
97
+ link_text=_("Zone Templates"),
96
98
  permissions=["netbox_dns.view_zonetemplate"],
97
99
  buttons=(
98
100
  PluginMenuButton(
99
101
  "plugins:netbox_dns:zonetemplate_add",
100
- "Add",
102
+ _("Add"),
101
103
  "mdi mdi-plus-thick",
102
104
  permissions=["netbox_dns.add_zonetemplate"],
103
105
  ),
104
106
  PluginMenuButton(
105
107
  "plugins:netbox_dns:zonetemplate_import",
106
- "Import",
108
+ _("Import"),
107
109
  "mdi mdi-upload",
108
110
  permissions=["netbox_dns.add_zonetemplate"],
109
111
  ),
@@ -112,18 +114,18 @@ zonetemplate_menu_item = PluginMenuItem(
112
114
 
113
115
  recordtemplate_menu_item = PluginMenuItem(
114
116
  link="plugins:netbox_dns:recordtemplate_list",
115
- link_text="Record Templates",
117
+ link_text=_("Record Templates"),
116
118
  permissions=["netbox_dns.view_recordtemplate"],
117
119
  buttons=(
118
120
  PluginMenuButton(
119
121
  "plugins:netbox_dns:recordtemplate_add",
120
- "Add",
122
+ _("Add"),
121
123
  "mdi mdi-plus-thick",
122
124
  permissions=["netbox_dns.add_recordtemplate"],
123
125
  ),
124
126
  PluginMenuButton(
125
127
  "plugins:netbox_dns:recordtemplate_import",
126
- "Import",
128
+ _("Import"),
127
129
  "mdi mdi-upload",
128
130
  permissions=["netbox_dns.add_recordtemplate"],
129
131
  ),
@@ -132,18 +134,18 @@ recordtemplate_menu_item = PluginMenuItem(
132
134
 
133
135
  registrar_menu_item = PluginMenuItem(
134
136
  link="plugins:netbox_dns:registrar_list",
135
- link_text="Registrars",
137
+ link_text=_("Registrars"),
136
138
  permissions=["netbox_dns.view_registrar"],
137
139
  buttons=(
138
140
  PluginMenuButton(
139
141
  "plugins:netbox_dns:registrar_add",
140
- "Add",
142
+ _("Add"),
141
143
  "mdi mdi-plus-thick",
142
144
  permissions=["netbox_dns.add_registrar"],
143
145
  ),
144
146
  PluginMenuButton(
145
147
  "plugins:netbox_dns:registrar_import",
146
- "Import",
148
+ _("Import"),
147
149
  "mdi mdi-upload",
148
150
  permissions=["netbox_dns.add_registrar"],
149
151
  ),
@@ -152,18 +154,18 @@ registrar_menu_item = PluginMenuItem(
152
154
 
153
155
  contact_menu_item = PluginMenuItem(
154
156
  link="plugins:netbox_dns:registrationcontact_list",
155
- link_text="Registration Contacts",
157
+ link_text=_("Registration Contacts"),
156
158
  permissions=["netbox_dns.view_registrationcontact"],
157
159
  buttons=(
158
160
  PluginMenuButton(
159
161
  "plugins:netbox_dns:registrationcontact_add",
160
- "Add",
162
+ _("Add"),
161
163
  "mdi mdi-plus-thick",
162
164
  permissions=["netbox_dns.add_registrationcontact"],
163
165
  ),
164
166
  PluginMenuButton(
165
167
  "plugins:netbox_dns:registrationcontact_import",
166
- "Import",
168
+ _("Import"),
167
169
  "mdi mdi-upload",
168
170
  permissions=["netbox_dns.add_registrationcontact"],
169
171
  ),
@@ -176,7 +178,7 @@ if top_level_menu:
176
178
  label=menu_name,
177
179
  groups=(
178
180
  (
179
- "DNS Configuration",
181
+ _("DNS Configuration"),
180
182
  (
181
183
  view_menu_item,
182
184
  zone_menu_item,
@@ -186,14 +188,14 @@ if top_level_menu:
186
188
  ),
187
189
  ),
188
190
  (
189
- "Templates",
191
+ _("Templates"),
190
192
  (
191
193
  zonetemplate_menu_item,
192
194
  recordtemplate_menu_item,
193
195
  ),
194
196
  ),
195
197
  (
196
- "Domain Registration",
198
+ _("Domain Registration"),
197
199
  (
198
200
  registrar_menu_item,
199
201
  contact_menu_item,
@@ -4,6 +4,7 @@ from django.conf import settings
4
4
  from django.dispatch import receiver
5
5
  from django.db.models.signals import pre_delete, pre_save, post_save, m2m_changed
6
6
  from django.core.exceptions import ValidationError
7
+ from django.utils.translation import gettext as _
7
8
 
8
9
  from netbox.context import current_request
9
10
  from netbox.signals import post_clean
@@ -60,18 +61,18 @@ def ipam_dnssync_ipaddress_post_clean(instance, **kwargs):
60
61
  if not ip_address.custom_field_data.get("ipaddress_dns_disabled"):
61
62
  raise ValidationError(
62
63
  {
63
- "dns_name": "Unique DNS records are enforced and there is already "
64
- f"an active IP address {instance.address} with DNS name {instance.dns_name}. "
65
- "Plesase choose a different name or disable record creation for this "
66
- "IP address."
64
+ "dns_name": _(
65
+ "Unique DNS records are enforced and there is already "
66
+ "an active IP address {address} with DNS name {name}. Please choose "
67
+ "a different name or disable record creation for this IP address."
68
+ ).format(address=instance.address, name=instance.dns_name)
67
69
  }
68
70
  )
69
71
 
70
72
  # +
71
73
  # Check NetBox DNS record permission for changes to IPAddress custom fields
72
- #
73
- # Normally, as the modfication of DNS fields
74
- if (request := current_request.get()) is not None:
74
+ # -
75
+ if (current_request.get()) is not None:
75
76
  cf_data = instance.custom_field_data
76
77
  if (
77
78
  not instance._state.adding
@@ -96,7 +97,7 @@ def ipam_dnssync_ipaddress_post_clean(instance, **kwargs):
96
97
  and not check_record_permission(change=False, delete=False)
97
98
  ):
98
99
  raise ValidationError(
99
- f"User '{request.user}' is not allowed to alter DNSsync custom fields"
100
+ _("You do not have permission to alter DNSsync custom fields")
100
101
  )
101
102
 
102
103
  try:
@@ -139,13 +140,17 @@ def ipam_dnssync_prefix_pre_save(instance, **kwargs):
139
140
  dns_views = ", ".join([view.name for view in instance.netbox_dns_views.all()])
140
141
  if request is not None:
141
142
  raise AbortRequest(
142
- f"This prefix is currently assigned to the following DNS views: {dns_views}"
143
- f"Please deassign it from these views before making changes to the prefix "
144
- f"or VRF."
143
+ _(
144
+ "This prefix is currently assigned to the following DNS views: {views}. "
145
+ "Please deassign it from these views before making changes to the prefix "
146
+ "or VRF."
147
+ ).format(views=dns_views)
145
148
  )
146
149
 
147
150
  raise ValidationError(
148
- f"Prefix is assigned to DNS views {dns_views}. Prefix and VRF must not be changed"
151
+ _(
152
+ "Prefix is assigned to DNS views {views}. Prefix and VRF must not be changed"
153
+ ).format(views=dns_views)
149
154
  )
150
155
 
151
156
 
@@ -166,8 +171,10 @@ def ipam_dnssync_prefix_pre_delete(instance, **kwargs):
166
171
  except ValidationError as exc:
167
172
  if request is not None:
168
173
  raise AbortRequest(
169
- f"Prefix deletion would cause DNS errors: {exc.messages[0]} "
170
- "Please review DNS View assignments for this and the parent prefix"
174
+ _(
175
+ "Prefix deletion would cause DNS errors: {errors}. Please review "
176
+ "DNS View assignments for this and the parent prefix"
177
+ ).format(errors=exc.messages[0])
171
178
  )
172
179
  else:
173
180
  raise exc
@@ -1,10 +1,11 @@
1
1
  import django_tables2 as tables
2
+ from django.utils.translation import gettext_lazy as _
2
3
 
3
4
  from ipam.tables import PrefixTable
4
5
  from utilities.tables import register_table_column
5
6
 
6
7
  views = tables.ManyToManyColumn(
7
- verbose_name="DNS Views",
8
+ verbose_name=_("DNS Views"),
8
9
  linkify_item=True,
9
10
  )
10
11
 
@@ -1,4 +1,5 @@
1
1
  import django_tables2 as tables
2
+ from django.utils.translation import gettext_lazy as _
2
3
 
3
4
  from netbox.tables import NetBoxTable, TagColumn
4
5
  from tenancy.tables import TenancyColumnsMixin
@@ -11,6 +12,7 @@ __all__ = ("NameServerTable",)
11
12
 
12
13
  class NameServerTable(TenancyColumnsMixin, NetBoxTable):
13
14
  name = tables.Column(
15
+ verbose_name=_("Name"),
14
16
  linkify=True,
15
17
  )
16
18
  tags = TagColumn(
@@ -1,5 +1,7 @@
1
1
  import django_tables2 as tables
2
2
  from django.utils.html import format_html
3
+ from django.utils.translation import gettext_lazy as _
4
+ from django.utils.translation import pgettext_lazy as _p
3
5
 
4
6
 
5
7
  from netbox.tables import (
@@ -23,33 +25,39 @@ __all__ = (
23
25
 
24
26
  class RecordBaseTable(TenancyColumnsMixin, NetBoxTable):
25
27
  zone = tables.Column(
28
+ verbose_name=_("Zone"),
26
29
  linkify=True,
27
30
  )
28
31
  view = tables.Column(
32
+ verbose_name=_p("DNS", "View"),
29
33
  accessor="zone__view",
30
34
  linkify=True,
31
35
  )
32
- type = tables.Column()
36
+ type = tables.Column(
37
+ verbose_name=_("Type"),
38
+ )
33
39
  name = tables.Column(
40
+ verbose_name=_("Name"),
34
41
  linkify=True,
35
42
  )
36
43
  fqdn = tables.Column(
37
- verbose_name="FQDN",
44
+ verbose_name=_("FQDN"),
38
45
  linkify=True,
39
46
  )
40
47
  value = tables.TemplateColumn(
48
+ verbose_name=_("Value"),
41
49
  template_code="{{ value|truncatechars:64 }}",
42
50
  )
43
51
  unicode_value = tables.TemplateColumn(
44
- verbose_name="Unicode Value",
52
+ verbose_name=_("Unicode Value"),
45
53
  template_code="{{ value|truncatechars:64 }}",
46
54
  accessor="value",
47
55
  )
48
56
  ttl = tables.Column(
49
- verbose_name="TTL",
57
+ verbose_name=_("TTL"),
50
58
  )
51
59
  active = tables.BooleanColumn(
52
- verbose_name="Active",
60
+ verbose_name=_("Active"),
53
61
  )
54
62
 
55
63
  def render_name(self, value, record):
@@ -60,15 +68,17 @@ class RecordBaseTable(TenancyColumnsMixin, NetBoxTable):
60
68
 
61
69
 
62
70
  class RecordTable(RecordBaseTable):
63
- status = ChoiceFieldColumn()
71
+ status = ChoiceFieldColumn(
72
+ verbose_name=_("Status"),
73
+ )
64
74
  disable_ptr = tables.BooleanColumn(
65
- verbose_name="Disable PTR",
75
+ verbose_name=_("Disable PTR"),
66
76
  )
67
77
  tags = TagColumn(
68
78
  url_name="plugins:netbox_dns:record_list",
69
79
  )
70
80
  ptr_record = tables.Column(
71
- verbose_name="PTR Record",
81
+ verbose_name=_("PTR Record"),
72
82
  linkify=True,
73
83
  )
74
84
 
@@ -91,15 +101,15 @@ class RecordTable(RecordBaseTable):
91
101
 
92
102
  class ManagedRecordTable(RecordBaseTable):
93
103
  address_record = tables.Column(
94
- verbose_name="Address Record",
104
+ verbose_name=_("Address Record"),
95
105
  linkify=True,
96
106
  )
97
107
  ipam_ip_address = tables.Column(
98
- verbose_name="IPAM IP Address",
108
+ verbose_name=_("IPAM IP Address"),
99
109
  linkify=True,
100
110
  )
101
111
  related_ip_address = tables.Column(
102
- verbose_name="Related IP Address",
112
+ verbose_name=_("Related IP Address"),
103
113
  empty_values=(),
104
114
  orderable=False,
105
115
  )
@@ -1,4 +1,5 @@
1
1
  import django_tables2 as tables
2
+ from django.utils.translation import gettext_lazy as _
2
3
 
3
4
  from netbox.tables import NetBoxTable, TagColumn, ActionsColumn
4
5
  from tenancy.tables import TenancyColumnsMixin
@@ -15,23 +16,29 @@ __all__ = (
15
16
 
16
17
  class RecordTemplateTable(TenancyColumnsMixin, NetBoxTable):
17
18
  name = tables.Column(
19
+ verbose_name=_("Name"),
18
20
  linkify=True,
19
21
  )
20
- record_name = tables.Column()
21
- type = tables.Column()
22
+ record_name = tables.Column(
23
+ verbose_name=_("Record Name"),
24
+ )
25
+ type = tables.Column(
26
+ verbose_name=_("Type"),
27
+ )
22
28
  value = tables.TemplateColumn(
29
+ verbose_name=_("Value"),
23
30
  template_code="{{ value|truncatechars:64 }}",
24
31
  )
25
32
  unicode_value = tables.TemplateColumn(
26
- verbose_name="Unicode Value",
33
+ verbose_name=_("Unicode Value"),
27
34
  template_code="{{ value|truncatechars:64 }}",
28
35
  accessor="value",
29
36
  )
30
37
  ttl = tables.Column(
31
- verbose_name="TTL",
38
+ verbose_name=_("TTL"),
32
39
  )
33
40
  disable_ptr = tables.BooleanColumn(
34
- verbose_name="Disable PTR",
41
+ verbose_name=_("Disable PTR"),
35
42
  )
36
43
  tags = TagColumn(
37
44
  url_name="plugins:netbox_dns:recordtemplate_list",
@@ -1,4 +1,5 @@
1
1
  import django_tables2 as tables
2
+ from django.utils.translation import gettext_lazy as _
2
3
 
3
4
  from netbox.tables import NetBoxTable, TagColumn
4
5
 
@@ -10,6 +11,7 @@ __all__ = ("RegistrarTable",)
10
11
 
11
12
  class RegistrarTable(NetBoxTable):
12
13
  name = tables.Column(
14
+ verbose_name=_("Name"),
13
15
  linkify=True,
14
16
  )
15
17
  tags = TagColumn(
@@ -1,4 +1,5 @@
1
1
  import django_tables2 as tables
2
+ from django.utils.translation import gettext_lazy as _
2
3
 
3
4
  from netbox.tables import NetBoxTable, TagColumn
4
5
 
@@ -10,6 +11,7 @@ __all__ = ("RegistrationContactTable",)
10
11
 
11
12
  class RegistrationContactTable(NetBoxTable):
12
13
  contact_id = tables.Column(
14
+ verbose_name=_("Contact ID"),
13
15
  linkify=True,
14
16
  )
15
17
  tags = TagColumn(
netbox_dns/tables/view.py CHANGED
@@ -1,4 +1,5 @@
1
1
  import django_tables2 as tables
2
+ from django.utils.translation import gettext_lazy as _
2
3
 
3
4
  from netbox.tables import NetBoxTable, TagColumn, ActionsColumn
4
5
  from tenancy.tables import TenancyColumnsMixin
@@ -14,10 +15,11 @@ __all__ = (
14
15
 
15
16
  class ViewTable(TenancyColumnsMixin, NetBoxTable):
16
17
  name = tables.Column(
18
+ verbose_name=_("Name"),
17
19
  linkify=True,
18
20
  )
19
21
  default_view = tables.BooleanColumn(
20
- verbose_name="Default View",
22
+ verbose_name=_("Default View"),
21
23
  )
22
24
  tags = TagColumn(url_name="plugins:netbox_dns:view_list")
23
25
 
netbox_dns/tables/zone.py CHANGED
@@ -1,4 +1,6 @@
1
1
  import django_tables2 as tables
2
+ from django.utils.translation import gettext_lazy as _
3
+ from django.utils.translation import pgettext_lazy as _p
2
4
 
3
5
  from netbox.tables import (
4
6
  ChoiceFieldColumn,
@@ -15,15 +17,20 @@ __all__ = ("ZoneTable",)
15
17
 
16
18
  class ZoneTable(TenancyColumnsMixin, NetBoxTable):
17
19
  name = tables.Column(
20
+ verbose_name=_("Name"),
18
21
  linkify=True,
19
22
  )
20
23
  view = tables.Column(
24
+ verbose_name=_p("DNS", "View"),
21
25
  linkify=True,
22
26
  )
23
27
  soa_mname = tables.Column(
28
+ verbose_name=_("SOA MName"),
24
29
  linkify=True,
25
30
  )
26
- status = ChoiceFieldColumn()
31
+ status = ChoiceFieldColumn(
32
+ verbose_name=_("Status"),
33
+ )
27
34
  tags = TagColumn(
28
35
  url_name="plugins:netbox_dns:zone_list",
29
36
  )
@@ -31,24 +38,30 @@ class ZoneTable(TenancyColumnsMixin, NetBoxTable):
31
38
  verbose_name="Default TTL",
32
39
  )
33
40
  rfc2317_prefix = tables.Column(
34
- verbose_name="RFC2317 Prefix",
41
+ verbose_name=_("RFC2317 Prefix"),
35
42
  )
36
43
  rfc2317_parent_zone = tables.Column(
44
+ verbose_name=_("RFC2317 Parent Zone"),
37
45
  linkify=True,
38
46
  )
39
47
  registrar = tables.Column(
48
+ verbose_name=_("Registrar"),
40
49
  linkify=True,
41
50
  )
42
51
  registrant = tables.Column(
52
+ verbose_name=_("Registrant"),
43
53
  linkify=True,
44
54
  )
45
55
  admin_c = tables.Column(
56
+ verbose_name=_("Administrative Contact"),
46
57
  linkify=True,
47
58
  )
48
59
  tech_c = tables.Column(
60
+ verbose_name=_("Technical Contact"),
49
61
  linkify=True,
50
62
  )
51
63
  billing_c = tables.Column(
64
+ verbose_name=_("Billing Contact"),
52
65
  linkify=True,
53
66
  )
54
67
 
@@ -1,4 +1,5 @@
1
1
  import django_tables2 as tables
2
+ from django.utils.translation import gettext_lazy as _
2
3
 
3
4
  from netbox.tables import NetBoxTable, TagColumn, ActionsColumn
4
5
  from tenancy.tables import TenancyColumnsMixin
@@ -14,24 +15,30 @@ __all__ = (
14
15
 
15
16
  class ZoneTemplateTable(TenancyColumnsMixin, NetBoxTable):
16
17
  name = tables.Column(
18
+ verbose_name=_("Name"),
17
19
  linkify=True,
18
20
  )
19
21
  tags = TagColumn(
20
22
  url_name="plugins:netbox_dns:zonetemplate_list",
21
23
  )
22
24
  registrar = tables.Column(
25
+ verbose_name=_("Registrar"),
23
26
  linkify=True,
24
27
  )
25
28
  registrant = tables.Column(
29
+ verbose_name=_("Registrant"),
26
30
  linkify=True,
27
31
  )
28
32
  admin_c = tables.Column(
33
+ verbose_name=_("Administrative Contact"),
29
34
  linkify=True,
30
35
  )
31
36
  tech_c = tables.Column(
37
+ verbose_name=_("Technical Contact"),
32
38
  linkify=True,
33
39
  )
34
40
  billing_c = tables.Column(
41
+ verbose_name=_("Billing Contact"),
35
42
  linkify=True,
36
43
  )
37
44
 
@@ -1,29 +1,30 @@
1
1
  {% extends 'generic/object.html' %}
2
+ {% load i18n %}
2
3
 
3
4
  {% block content %}
4
5
  <div class="row">
5
6
  <div class="col col-md-6">
6
7
  <div class="card">
7
- <h5 class="card-header">Name Server</h5>
8
+ <h5 class="card-header">{% trans "Nameserver" %}</h5>
8
9
  <table class="table table-hover attr-table">
9
10
  <tr>
10
- <th scope="row">Name</th>
11
+ <th scope="row">{% trans "Name" %}</th>
11
12
  <td>{{ object.name }}</td>
12
13
  </tr>
13
14
  {% if unicode_name %}
14
15
  <tr>
15
- <th scope="row">IDN</th>
16
+ <th scope="row">{% trans "IDN" %}</th>
16
17
  <td>{{ unicode_name }}</td>
17
18
  </tr>
18
19
  {% endif %}
19
20
  {% if object.description %}
20
21
  <tr>
21
- <th scope="row">Description</th>
22
+ <th scope="row">{% trans "Description" %}</th>
22
23
  <td style="word-break:break-all;">{{ object.description }}</td>
23
24
  </tr>
24
25
  {% endif %}
25
26
  <tr>
26
- <th scope="row">Tenant</th>
27
+ <th scope="row">{% trans "Tenant" %}</th>
27
28
  <td>
28
29
  {% if object.tenant.group %}
29
30
  {{ object.tenant.group|linkify }} /
@@ -1,3 +1,4 @@
1
1
  {% extends 'generic/object_list.html' %}
2
+ {% load i18n %}
2
3
 
3
- {% block title %}Managed Records{% endblock %}
4
+ {% block title %}{% trans "Managed Records" %}{% endblock %}