Fix Compose Service appearance.

And add validation to full_service_name field. Only alphanumeric and
dots are allowed.

Change-Id: I61e3ed8b5ec4d04eb39dc6cf210c5d1b9c2bb1d1
This commit is contained in:
Timur Sufiev 2013-12-11 15:59:36 +04:00
parent 023675ff92
commit 4b070eaa46
2 changed files with 9 additions and 3 deletions

View File

@ -15,7 +15,7 @@
import logging
from django.utils.translation import ugettext as _
from django.forms import MediaDefiningClass
from django.forms import MediaDefiningClass, RegexField
from .utils import Action, CheckboxInput, FILE_STEPS
from horizon import exceptions
from horizon import forms
@ -29,7 +29,8 @@ log = logging.getLogger(__name__)
class EditManifest(Action):
service_display_name = forms.CharField(label=_('Service Name'),
required=True)
full_service_name = forms.CharField(
full_service_name = forms.RegexField(
r'^[a-zA-Z0-9.]+$',
label=_('Fully Qualified Service Name'), required=True)
version = forms.CharField(label=_('Version'), initial='1')
enabled = forms.BooleanField(label=_('Active'), initial=True,

View File

@ -1,2 +1,7 @@
{% load i18n %}
<p>{% blocktrans %} Here will be some info about manifest fields.{% endblocktrans %}</p>
<p>{% blocktrans %}<strong>Service Name:</strong> is a human-readable service name.
{% endblocktrans %}</p>
<p>{% blocktrans %}<strong>Fully Qualified Service Name:</strong> is an internal service name. It should be unique and can contain only alphanumeric symbols and dots.{% endblocktrans %}</p>
<p>{% blocktrans %}<strong>Version:</strong> is a service version.{% endblocktrans %}</p>
<p>{% blocktrans %}<strong>Active:</strong> whether this service should be visible for users or not.{% endblocktrans %}</p>
<p>{% blocktrans %}<strong>Description:</strong> add text information about service. It will appear in service creation form in the Environments panel.{% endblocktrans %}</p>