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

View File

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

View File

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