Commit b05078d8 by Kálmán Viktor

dashboard: i18n fixes

parent c7517f56
...@@ -463,7 +463,7 @@ class NodeForm(forms.ModelForm): ...@@ -463,7 +463,7 @@ class NodeForm(forms.ModelForm):
class TemplateForm(forms.ModelForm): class TemplateForm(forms.ModelForm):
networks = forms.ModelMultipleChoiceField( networks = forms.ModelMultipleChoiceField(
queryset=VLANS, required=False) queryset=None, required=False, label=_("Networks"))
parent_type = forms.CharField(required=False) parent_type = forms.CharField(required=False)
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
...@@ -471,6 +471,9 @@ class TemplateForm(forms.ModelForm): ...@@ -471,6 +471,9 @@ class TemplateForm(forms.ModelForm):
self.user = kwargs.pop("user", None) self.user = kwargs.pop("user", None)
super(TemplateForm, self).__init__(*args, **kwargs) super(TemplateForm, self).__init__(*args, **kwargs)
self.fields['networks'].queryset = Vlan.get_objects_with_level(
'user', self.user)
data = self.data.copy() data = self.data.copy()
data['owner'] = self.user.pk data['owner'] = self.user.pk
self.data = data self.data = data
...@@ -590,7 +593,7 @@ class TemplateForm(forms.ModelForm): ...@@ -590,7 +593,7 @@ class TemplateForm(forms.ModelForm):
Field('arch'), Field('arch'),
), ),
Fieldset( Fieldset(
"stuff", _("Virtual machine settings"),
Field('access_method'), Field('access_method'),
Field('boot_menu'), Field('boot_menu'),
Field('raw_data', **kwargs_raw_data), Field('raw_data', **kwargs_raw_data),
...@@ -600,7 +603,7 @@ class TemplateForm(forms.ModelForm): ...@@ -600,7 +603,7 @@ class TemplateForm(forms.ModelForm):
Field("system"), Field("system"),
), ),
Fieldset( Fieldset(
_("External"), _("External resources"),
Field("networks"), Field("networks"),
Field("lease"), Field("lease"),
Field("tags"), Field("tags"),
......
...@@ -84,7 +84,8 @@ class VirtualMachineDescModel(BaseResourceConfigModel): ...@@ -84,7 +84,8 @@ class VirtualMachineDescModel(BaseResourceConfigModel):
boot_menu = BooleanField(verbose_name=_('boot menu'), default=False, boot_menu = BooleanField(verbose_name=_('boot menu'), default=False,
help_text=_( help_text=_(
'Show boot device selection menu on boot.')) '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=_( raw_data = TextField(verbose_name=_('raw_data'), blank=True, help_text=_(
'Additional libvirt domain parameters in XML format.')) 'Additional libvirt domain parameters in XML format.'))
req_traits = ManyToManyField(Trait, blank=True, 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