Commit b05078d8 by Kálmán Viktor

dashboard: i18n fixes

parent c7517f56
......@@ -463,7 +463,7 @@ class NodeForm(forms.ModelForm):
class TemplateForm(forms.ModelForm):
networks = forms.ModelMultipleChoiceField(
queryset=VLANS, required=False)
queryset=None, required=False, label=_("Networks"))
parent_type = forms.CharField(required=False)
def __init__(self, *args, **kwargs):
......@@ -471,6 +471,9 @@ class TemplateForm(forms.ModelForm):
self.user = kwargs.pop("user", None)
super(TemplateForm, self).__init__(*args, **kwargs)
self.fields['networks'].queryset = Vlan.get_objects_with_level(
'user', self.user)
data = self.data.copy()
data['owner'] = self.user.pk
self.data = data
......@@ -590,7 +593,7 @@ class TemplateForm(forms.ModelForm):
Field('arch'),
),
Fieldset(
"stuff",
_("Virtual machine settings"),
Field('access_method'),
Field('boot_menu'),
Field('raw_data', **kwargs_raw_data),
......@@ -600,7 +603,7 @@ class TemplateForm(forms.ModelForm):
Field("system"),
),
Fieldset(
_("External"),
_("External resources"),
Field("networks"),
Field("lease"),
Field("tags"),
......
......@@ -84,7 +84,8 @@ class VirtualMachineDescModel(BaseResourceConfigModel):
boot_menu = BooleanField(verbose_name=_('boot menu'), default=False,
help_text=_(
'Show boot device selection menu on boot.'))
lease = ForeignKey(Lease, help_text=_("Preferred expiration periods."))
lease = ForeignKey(Lease, help_text=_("Preferred expiration periods."),
verbose_name=_("Lease"))
raw_data = TextField(verbose_name=_('raw_data'), blank=True, help_text=_(
'Additional libvirt domain parameters in XML format.'))
req_traits = ManyToManyField(Trait, blank=True,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment