Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
999a46e0
authored
Sep 11, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: i18n for forms
parent
2bfa1d25
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
29 deletions
+30
-29
circle/network/forms.py
+30
-29
No files found.
circle/network/forms.py
View file @
999a46e0
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
from
django.forms
import
ModelForm
from
django.forms
import
ModelForm
from
django.core.urlresolvers
import
reverse_lazy
from
django.core.urlresolvers
import
reverse_lazy
from
django.utils.translation
import
ugettext_lazy
as
_
from
crispy_forms.helper
import
FormHelper
from
crispy_forms.helper
import
FormHelper
from
crispy_forms.layout
import
Layout
,
Fieldset
,
Div
,
Submit
,
BaseInput
from
crispy_forms.layout
import
Layout
,
Fieldset
,
Div
,
Submit
,
BaseInput
...
@@ -56,8 +57,8 @@ class BlacklistItemForm(ModelForm):
...
@@ -56,8 +57,8 @@ class BlacklistItemForm(ModelForm):
)
)
),
),
FormActions
(
FormActions
(
Submit
(
'submit'
,
'Save changes'
),
Submit
(
'submit'
,
_
(
'Save changes'
)
),
LinkButton
(
'back'
,
'Back'
,
reverse_lazy
(
'network.blacklist_list'
))
LinkButton
(
'back'
,
_
(
"Back"
)
,
reverse_lazy
(
'network.blacklist_list'
))
)
)
)
)
...
@@ -77,8 +78,8 @@ class DomainForm(ModelForm):
...
@@ -77,8 +78,8 @@ class DomainForm(ModelForm):
),
),
),
),
FormActions
(
FormActions
(
Submit
(
'submit'
,
'Save'
),
Submit
(
'submit'
,
_
(
'Save'
)
),
LinkButton
(
'back'
,
'Back'
,
reverse_lazy
(
'network.domain_list'
))
LinkButton
(
'back'
,
_
(
"Back"
)
,
reverse_lazy
(
'network.domain_list'
))
)
)
)
)
...
@@ -91,15 +92,15 @@ class GroupForm(ModelForm):
...
@@ -91,15 +92,15 @@ class GroupForm(ModelForm):
helper
.
layout
=
Layout
(
helper
.
layout
=
Layout
(
Div
(
Div
(
Fieldset
(
Fieldset
(
'
Identity
'
,
''
,
'name'
,
'name'
,
'description'
,
'description'
,
'owner'
,
'owner'
,
),
),
),
),
FormActions
(
FormActions
(
Submit
(
'submit'
,
'Save'
),
Submit
(
'submit'
,
_
(
'Save'
)
),
LinkButton
(
'back'
,
'Back'
,
reverse_lazy
(
'network.group_list'
))
LinkButton
(
'back'
,
_
(
"Back"
)
,
reverse_lazy
(
'network.group_list'
))
)
)
)
)
...
@@ -112,13 +113,13 @@ class HostForm(ModelForm):
...
@@ -112,13 +113,13 @@ class HostForm(ModelForm):
helper
.
layout
=
Layout
(
helper
.
layout
=
Layout
(
Div
(
Div
(
Fieldset
(
Fieldset
(
'
Identity
'
,
''
,
'hostname'
,
'hostname'
,
'reverse'
,
'reverse'
,
'mac'
,
'mac'
,
),
),
Fieldset
(
Fieldset
(
'Network'
,
_
(
'Network'
)
,
'vlan'
,
'vlan'
,
'ipv4'
,
'ipv4'
,
'ipv6'
,
'ipv6'
,
...
@@ -126,7 +127,7 @@ class HostForm(ModelForm):
...
@@ -126,7 +127,7 @@ class HostForm(ModelForm):
'external_ipv4'
,
'external_ipv4'
,
),
),
Fieldset
(
Fieldset
(
'Information'
,
_
(
'Information'
)
,
'description'
,
'description'
,
'location'
,
'location'
,
'comment'
,
'comment'
,
...
@@ -134,8 +135,8 @@ class HostForm(ModelForm):
...
@@ -134,8 +135,8 @@ class HostForm(ModelForm):
),
),
),
),
FormActions
(
FormActions
(
Submit
(
'submit'
,
'Save'
),
Submit
(
'submit'
,
_
(
'Save'
)
),
LinkButton
(
'back'
,
'Back'
,
reverse_lazy
(
'network.host_list'
)))
LinkButton
(
'back'
,
_
(
'Back'
)
,
reverse_lazy
(
'network.host_list'
)))
)
)
class
Meta
:
class
Meta
:
...
@@ -159,8 +160,8 @@ class RecordForm(ModelForm):
...
@@ -159,8 +160,8 @@ class RecordForm(ModelForm):
)
)
),
),
FormActions
(
FormActions
(
Submit
(
'submit'
,
'Save'
),
Submit
(
'submit'
,
_
(
"Save"
)
),
LinkButton
(
'back'
,
'Back'
,
reverse_lazy
(
'network.record_list'
))
LinkButton
(
'back'
,
_
(
"Back"
)
,
reverse_lazy
(
'network.record_list'
))
)
)
)
)
...
@@ -173,7 +174,7 @@ class RuleForm(ModelForm):
...
@@ -173,7 +174,7 @@ class RuleForm(ModelForm):
helper
.
layout
=
Layout
(
helper
.
layout
=
Layout
(
Div
(
Div
(
Fieldset
(
Fieldset
(
'
Identity
'
,
''
,
'direction'
,
'direction'
,
'description'
,
'description'
,
'foreign_network'
,
'foreign_network'
,
...
@@ -189,7 +190,7 @@ class RuleForm(ModelForm):
...
@@ -189,7 +190,7 @@ class RuleForm(ModelForm):
'nat_external_ipv4'
,
'nat_external_ipv4'
,
),
),
Fieldset
(
Fieldset
(
'External'
,
_
(
'External'
)
,
'vlan'
,
'vlan'
,
'vlangroup'
,
'vlangroup'
,
'host'
,
'host'
,
...
@@ -198,8 +199,8 @@ class RuleForm(ModelForm):
...
@@ -198,8 +199,8 @@ class RuleForm(ModelForm):
)
)
),
),
FormActions
(
FormActions
(
Submit
(
'submit'
,
'Save'
),
Submit
(
'submit'
,
_
(
"Save"
)
),
LinkButton
(
'back'
,
'Back'
,
reverse_lazy
(
'network.rule_list'
))
LinkButton
(
'back'
,
_
(
"Back"
)
,
reverse_lazy
(
'network.rule_list'
))
)
)
)
)
...
@@ -219,8 +220,8 @@ class SwitchPortForm(ModelForm):
...
@@ -219,8 +220,8 @@ class SwitchPortForm(ModelForm):
)
)
),
),
FormActions
(
FormActions
(
Submit
(
'submit'
,
'Save'
),
Submit
(
'submit'
,
_
(
"Save"
)
),
LinkButton
(
'back'
,
'Back'
,
LinkButton
(
'back'
,
_
(
"Back"
)
,
reverse_lazy
(
'network.switch_port_list'
))
reverse_lazy
(
'network.switch_port_list'
))
)
)
)
)
...
@@ -234,32 +235,32 @@ class VlanForm(ModelForm):
...
@@ -234,32 +235,32 @@ class VlanForm(ModelForm):
helper
.
layout
=
Layout
(
helper
.
layout
=
Layout
(
Div
(
Div
(
Fieldset
(
Fieldset
(
'
Identity
'
,
''
,
'name'
,
'name'
,
'vid'
,
'vid'
,
'network_type'
,
'network_type'
,
'managed'
,
'managed'
,
),
),
Fieldset
(
Fieldset
(
'IPv4'
,
_
(
'IPv4'
)
,
'network4'
,
'network4'
,
'snat_to'
,
'snat_to'
,
'snat_ip'
,
'snat_ip'
,
'dhcp_pool'
,
'dhcp_pool'
,
),
),
Fieldset
(
Fieldset
(
'IPv6'
,
_
(
'IPv6'
)
,
'network6'
,
'network6'
,
'ipv6_template'
,
'ipv6_template'
,
'host_ipv6_prefixlen'
,
'host_ipv6_prefixlen'
,
),
),
Fieldset
(
Fieldset
(
'Domain name service'
,
_
(
'Domain name service'
)
,
'domain'
,
'domain'
,
'reverse_domain'
,
'reverse_domain'
,
),
),
Fieldset
(
Fieldset
(
'Info'
,
_
(
'Info'
)
,
'description'
,
'description'
,
'comment'
,
'comment'
,
'owner'
,
'owner'
,
...
@@ -268,8 +269,8 @@ class VlanForm(ModelForm):
...
@@ -268,8 +269,8 @@ class VlanForm(ModelForm):
),
),
),
),
FormActions
(
FormActions
(
Submit
(
'submit'
,
'Save'
),
Submit
(
'submit'
,
_
(
"Save"
)
),
LinkButton
(
'back'
,
'Back'
,
reverse_lazy
(
'network.vlan_list'
))
LinkButton
(
'back'
,
_
(
"Back"
)
,
reverse_lazy
(
'network.vlan_list'
))
)
)
)
)
...
@@ -290,8 +291,8 @@ class VlanGroupForm(ModelForm):
...
@@ -290,8 +291,8 @@ class VlanGroupForm(ModelForm):
)
)
),
),
FormActions
(
FormActions
(
Submit
(
'submit'
,
'Save'
),
Submit
(
'submit'
,
_
(
"Save"
)
),
LinkButton
(
'back'
,
'Back'
,
reverse_lazy
(
LinkButton
(
'back'
,
_
(
"Back"
)
,
reverse_lazy
(
'network.vlan_group_list'
))
'network.vlan_group_list'
))
)
)
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment