Merge "Fixed issue with names."

This commit is contained in:
Timur Nurlygayanov 2013-04-08 12:55:56 +04:00 committed by Gerrit Code Review
commit b5e81e6e77
3 changed files with 15 additions and 15 deletions

View File

@ -103,7 +103,7 @@ class DeployEnvironment(tables.BatchAction):
return api.environment_deploy(request, environment_id)
class ShowDataCenterServices(tables.LinkAction):
class ShowEnvironmentServices(tables.LinkAction):
name = 'edit'
verbose_name = _('Services')
url = 'horizon:project:tabula:services'
@ -112,7 +112,7 @@ class ShowDataCenterServices(tables.LinkAction):
return True
class UpdateDCRow(tables.Row):
class UpdateEnvironmentRow(tables.Row):
ajax = True
def get_data(self, request, environment_id):
@ -140,7 +140,7 @@ STATUS_DISPLAY_CHOICES = (
)
class DCTable(tables.DataTable):
class EnvironmentsTable(tables.DataTable):
STATUS_CHOICES = (
(None, True),
('Ready to deploy', True),
@ -158,12 +158,12 @@ class DCTable(tables.DataTable):
class Meta:
name = 'tabula'
verbose_name = _('Environment')
row_class = UpdateDCRow
verbose_name = _('Environments')
row_class = UpdateEnvironmentRow
status_columns = ['status']
table_actions = (CreateDataCenter,)
row_actions = (ShowDataCenterServices, DeleteDataCenter,
DeployDataCenter)
table_actions = (CreateEnvironment,)
row_actions = (ShowEnvironmentServices, DeleteEnvironment,
DeployEnvironment)
class ServicesTable(tables.DataTable):

View File

@ -29,7 +29,7 @@ from horizon.forms.views import ModalFormMixin
from glazierdashboard.tabula import api
from .tables import DCTable, ServicesTable
from .tables import EnvironmentsTable, ServicesTable
from .workflows import CreateDC
from .tabs import ServicesTabs
from .forms import (WizardFormADConfiguration, WizardFormIISConfiguration)
@ -127,7 +127,7 @@ class Wizard(ModalFormMixin, SessionWizardView, generic.FormView):
class IndexView(tables.DataTableView):
table_class = DCTable
table_class = EnvironmentsTable
template_name = 'index.html'
def get_data(self):

View File

@ -56,7 +56,7 @@ class SelectProjectUser(workflows.Step):
action_class = SelectProjectUserAction
class ConfigureDCAction(workflows.Action):
class ConfigureEnvironmentAction(workflows.Action):
name = forms.CharField(label=_("Environment Name"), required=True)
class Meta:
@ -64,8 +64,8 @@ class ConfigureDCAction(workflows.Action):
help_text_template = "_data_center_help.html"
class ConfigureDC(workflows.Step):
action_class = ConfigureDCAction
class ConfigureEnvironment(workflows.Step):
action_class = ConfigureEnvironmentAction
contibutes = ('name',)
def contribute(self, data, context):
@ -74,14 +74,14 @@ class ConfigureDC(workflows.Step):
return context
class CreateDC(workflows.Workflow):
class CreateEnvironment(workflows.Workflow):
slug = "create"
name = _("Create Environment")
finalize_button_name = _("Create")
success_message = _('Created environment "%s".')
failure_message = _('Unable to create environment "%s".')
success_url = "horizon:project:tabula:index"
default_steps = (SelectProjectUser, ConfigureDC)
default_steps = (SelectProjectUser, ConfigureEnvironment)
def format_status_message(self, message):
name = self.context.get('name', 'noname')