Delete periods from select options

Make the UI more consistent by deleting periods which appear
intermittently at the end of some select options.

Closes-Bug: #1263823
Change-Id: I6f184b205788171fd4931f5a622353d943161123
This commit is contained in:
Ana Krivokapic 2013-12-24 05:36:28 +01:00
parent 58feb1a0fd
commit 66ae9cc886
9 changed files with 22 additions and 22 deletions

View File

@ -68,5 +68,5 @@ class AllocateView(forms.ModalFormView):
_("Unable to retrieve floating IP pools.")) _("Unable to retrieve floating IP pools."))
pool_list = [(pool.id, pool.name) for pool in pools] pool_list = [(pool.id, pool.name) for pool in pools]
if not pool_list: if not pool_list:
pool_list = [(None, _("No floating IP pools available."))] pool_list = [(None, _("No floating IP pools available"))]
return {'pool_list': pool_list} return {'pool_list': pool_list}

View File

@ -60,7 +60,7 @@ class RebuildInstanceForm(forms.SelfHandlingForm):
if choices: if choices:
choices.insert(0, ("", _("Select Image"))) choices.insert(0, ("", _("Select Image")))
else: else:
choices.insert(0, ("", _("No images available."))) choices.insert(0, ("", _("No images available")))
self.fields['image'].choices = choices self.fields['image'].choices = choices
if not api.nova.can_set_server_password(): if not api.nova.can_set_server_password():

View File

@ -1028,7 +1028,7 @@ class InstanceTests(test.TestCase):
else: else:
self.assertNotContains(res, password_field_label) self.assertNotContains(res, password_field_label)
boot_from_image_field_label = 'Boot from image (creates a new volume).' boot_from_image_field_label = 'Boot from image (creates a new volume)'
if block_device_mapping_v2: if block_device_mapping_v2:
self.assertContains(res, boot_from_image_field_label) self.assertContains(res, boot_from_image_field_label)
else: else:

View File

@ -135,22 +135,22 @@ class SetInstanceDetailsAction(workflows.Action):
request, context, *args, **kwargs) request, context, *args, **kwargs)
source_type_choices = [ source_type_choices = [
('', _("--- Select source ---")), ('', _("--- Select source ---")),
("image_id", _("Boot from image.")), ("image_id", _("Boot from image")),
("instance_snapshot_id", _("Boot from snapshot.")), ("instance_snapshot_id", _("Boot from snapshot")),
("volume_id", _("Boot from volume.")), ("volume_id", _("Boot from volume")),
] ]
try: try:
if api.nova.extension_supported("BlockDeviceMappingV2Boot", if api.nova.extension_supported("BlockDeviceMappingV2Boot",
request): request):
source_type_choices.append(("volume_image_id", source_type_choices.append(("volume_image_id",
_("Boot from image (creates a new volume)."))) _("Boot from image (creates a new volume)")))
except Exception: except Exception:
exceptions.handle(request, _('Unable to retrieve extensions ' exceptions.handle(request, _('Unable to retrieve extensions '
'information.')) 'information.'))
source_type_choices.append(("volume_snapshot_id", source_type_choices.append(("volume_snapshot_id",
_("Boot from volume snapshot (creates a new volume)."))) _("Boot from volume snapshot (creates a new volume)")))
self.fields['source_type'].choices = source_type_choices self.fields['source_type'].choices = source_type_choices
def clean(self): def clean(self):
@ -252,7 +252,7 @@ class SetInstanceDetailsAction(workflows.Action):
for zone in zones if zone.zoneState['available']] for zone in zones if zone.zoneState['available']]
zone_list.sort() zone_list.sort()
if not zone_list: if not zone_list:
zone_list.insert(0, ("", _("No availability zones found."))) zone_list.insert(0, ("", _("No availability zones found")))
elif len(zone_list) > 1: elif len(zone_list) > 1:
zone_list.insert(0, ("", _("Any Availability Zone"))) zone_list.insert(0, ("", _("Any Availability Zone")))
return zone_list return zone_list
@ -323,7 +323,7 @@ class SetInstanceDetailsAction(workflows.Action):
if choices: if choices:
choices.insert(0, ("", _("Select Instance Snapshot"))) choices.insert(0, ("", _("Select Instance Snapshot")))
else: else:
choices.insert(0, ("", _("No snapshots available."))) choices.insert(0, ("", _("No snapshots available")))
return choices return choices
def populate_volume_id_choices(self, request, context): def populate_volume_id_choices(self, request, context):
@ -338,7 +338,7 @@ class SetInstanceDetailsAction(workflows.Action):
if volumes: if volumes:
volumes.insert(0, ("", _("Select Volume"))) volumes.insert(0, ("", _("Select Volume")))
else: else:
volumes.insert(0, ("", _("No volumes available."))) volumes.insert(0, ("", _("No volumes available")))
return volumes return volumes
def populate_volume_snapshot_id_choices(self, request, context): def populate_volume_snapshot_id_choices(self, request, context):
@ -354,7 +354,7 @@ class SetInstanceDetailsAction(workflows.Action):
if snapshots: if snapshots:
snapshots.insert(0, ("", _("Select Volume Snapshot"))) snapshots.insert(0, ("", _("Select Volume Snapshot")))
else: else:
snapshots.insert(0, ("", _("No volume snapshots available."))) snapshots.insert(0, ("", _("No volume snapshots available")))
return snapshots return snapshots
@ -441,7 +441,7 @@ class SetAccessControlsAction(workflows.Action):
self.fields['keypair'].initial = keypair_list[0][0] self.fields['keypair'].initial = keypair_list[0][0]
keypair_list.insert(0, ("", _("Select a keypair"))) keypair_list.insert(0, ("", _("Select a keypair")))
else: else:
keypair_list = (("", _("No keypairs available.")),) keypair_list = (("", _("No keypairs available")),)
return keypair_list return keypair_list
def populate_groups_choices(self, request, context): def populate_groups_choices(self, request, context):

View File

@ -60,7 +60,7 @@ class SetFlavorChoiceAction(workflows.Action):
if flavor_list: if flavor_list:
flavor_list.insert(0, ("", _("Select an New Flavor"))) flavor_list.insert(0, ("", _("Select an New Flavor")))
else: else:
flavor_list.insert(0, ("", _("No flavors available."))) flavor_list.insert(0, ("", _("No flavors available")))
return sorted(flavor_list) return sorted(flavor_list)
def get_help_text(self): def get_help_text(self):

View File

@ -287,10 +287,10 @@ class LoadBalancerTests(test.TestCase):
if not with_service_type: if not with_service_type:
self.assertNotContains(res, default_provider) self.assertNotContains(res, default_provider)
self.assertContains(res, ('Provider for Load Balancer ' self.assertContains(res, ('Provider for Load Balancer '
'is not supported.')) 'is not supported'))
elif with_provider_exception: elif with_provider_exception:
self.assertNotContains(res, default_provider) self.assertNotContains(res, default_provider)
self.assertContains(res, 'No provider is available.') self.assertContains(res, 'No provider is available')
else: else:
self.assertContains(res, default_provider) self.assertContains(res, default_provider)

View File

@ -95,9 +95,9 @@ class AddPoolAction(workflows.Action):
_("%s (default)") % default_provider)) _("%s (default)") % default_provider))
else: else:
if providers is None: if providers is None:
msg = _("Provider for Load Balancer is not supported.") msg = _("Provider for Load Balancer is not supported")
else: else:
msg = _("No provider is available.") msg = _("No provider is available")
provider_choices = [('', msg)] provider_choices = [('', msg)]
self.fields['provider'].widget.attrs['readonly'] = True self.fields['provider'].widget.attrs['readonly'] = True
self.fields['provider'].choices = provider_choices self.fields['provider'].choices = provider_choices

View File

@ -72,7 +72,7 @@ class AddInterface(forms.SelfHandlingForm):
if choices: if choices:
choices.insert(0, ("", _("Select Subnet"))) choices.insert(0, ("", _("Select Subnet")))
else: else:
choices.insert(0, ("", _("No subnets available."))) choices.insert(0, ("", _("No subnets available")))
return choices return choices
def handle(self, request, data): def handle(self, request, data):
@ -172,7 +172,7 @@ class SetGatewayForm(forms.SelfHandlingForm):
if choices: if choices:
choices.insert(0, ("", _("Select network"))) choices.insert(0, ("", _("Select network")))
else: else:
choices.insert(0, ("", _("No networks available."))) choices.insert(0, ("", _("No networks available")))
return choices return choices
def handle(self, request, data): def handle(self, request, data):

View File

@ -170,7 +170,7 @@ class CreateForm(forms.SelfHandlingForm):
if source_type_choices: if source_type_choices:
choices = ([('no_source_type', choices = ([('no_source_type',
_("No source, empty volume."))] + _("No source, empty volume"))] +
source_type_choices) source_type_choices)
self.fields['volume_source_type'].choices = choices self.fields['volume_source_type'].choices = choices
else: else:
@ -198,7 +198,7 @@ class CreateForm(forms.SelfHandlingForm):
exceptions.handle(request, _('Unable to retrieve availability ' exceptions.handle(request, _('Unable to retrieve availability '
'zones.')) 'zones.'))
if not zone_list: if not zone_list:
zone_list.insert(0, ("", _("No availability zones found."))) zone_list.insert(0, ("", _("No availability zones found")))
elif len(zone_list) > 0: elif len(zone_list) > 0:
zone_list.insert(0, ("", _("Any Availability Zone"))) zone_list.insert(0, ("", _("Any Availability Zone")))