From 7e5e888481f13440c61cff0af829f4ea9d1edeff Mon Sep 17 00:00:00 2001 From: shu-mutou Date: Fri, 11 Dec 2015 18:29:07 +0900 Subject: [PATCH] Use Horizon's plugin registration system Magnum UI and their panels are currently registered via their `dashboard.py` and `panel.py` files, but should use the enabled files. This is standard in Horizon. This patch changes registration method to enabled files. For moving our dashboard to under the "project" dashbaord, we need to change URLs. So, many files will be changed. Since "/project/containers" is already used by Swift Container panel, this patch uses "bays", "baymodels" and "bays/containers" for URLs. Change-Id: Icedb984331bd46540f2e7d12bbefcc308aff214f Closes-Bug: #1507679 --- MANIFEST.in | 4 +- README.rst | 7 +++- doc/source/index.rst | 5 ++- ...y => _50_project_containers_panelgroup.py} | 9 ++++- enabled/_51_project_containers_bays_panel.py | 23 +++++++++++ .../_52_project_containers_baymodels_panel.py | 23 +++++++++++ ..._53_project_containers_containers_panel.py | 23 +++++++++++ magnum_ui/containers/tests.py | 30 -------------- magnum_ui/{bay => content}/__init__.py | 0 .../baymodels}/__init__.py | 0 .../{baymodel => content/baymodels}/panel.py | 9 +---- .../{baymodel => content/baymodels}/tests.py | 0 .../{baymodel => content/baymodels}/urls.py | 3 +- .../{baymodel => content/baymodels}/views.py | 4 +- .../{containers => content/bays}/__init__.py | 0 .../bays/containers/__init__.py} | 0 .../{ => content/bays}/containers/panel.py | 6 +-- magnum_ui/content/bays/containers/tests.py | 36 +++++++++++++++++ .../{ => content/bays}/containers/urls.py | 7 ++-- .../{ => content/bays}/containers/views.py | 4 +- magnum_ui/{bay => content/bays}/panel.py | 9 +---- magnum_ui/{bay => content/bays}/tests.py | 0 magnum_ui/{bay => content/bays}/urls.py | 6 ++- magnum_ui/{bay => content/bays}/views.py | 2 +- magnum_ui/dashboard.py | 26 ------------ .../baymodels.module.js} | 5 +-- .../baymodels.module.spec.js} | 4 +- .../baymodels.scss} | 0 .../detail/detail.controller.js | 2 +- .../detail/detail.html | 6 +-- .../table/table.controller.js | 10 ++--- .../table/table.controller.spec.js | 0 .../{baymodel => baymodels}/table/table.html | 4 +- .../bay.module.js => bays/bays.module.js} | 5 +-- .../bays.module.spec.js} | 4 +- .../baymodel.scss => bays/bays.scss} | 0 .../{bay => bays}/create/bay-model.js | 2 +- .../create/create-workflow.service.js | 16 ++++---- .../create/info/bay.info.controller.js | 2 +- .../{bay => bays}/create/info/info.help.html | 0 .../{bay => bays}/create/info/info.html | 0 .../create/misc/bay.misc.controller.js | 2 +- .../{bay => bays}/create/misc/misc.help.html | 0 .../{bay => bays}/create/misc/misc.html | 0 .../{bay => bays}/create/modal.controller.js | 2 +- .../create/modal.spec.js} | 0 .../create/size/bay.size.controller.js | 2 +- .../{bay => bays}/create/size/size.help.html | 0 .../{bay => bays}/create/size/size.html | 0 .../{bay => bays}/create/wizard.controller.js | 4 +- .../{bay => bays}/detail/detail.controller.js | 2 +- .../{bay => bays}/detail/detail.html | 4 +- .../{bay => bays}/table/table.controller.js | 10 ++--- .../bays/table/table.controller.spec.js | 0 .../containers/{bay => bays}/table/table.html | 6 +-- .../dashboard/containers/containers.module.js | 40 +++++++++---------- .../dashboard/containers/containers.scss | 4 +- .../containers/detail/detail.controller.js | 2 +- .../containers/containers/detail/detail.html | 6 +-- .../containers/containers/table/table.html | 4 +- .../baymodels}/index.html | 2 +- .../bays.containers}/index.html | 2 +- .../bay => templates/bays}/index.html | 2 +- 63 files changed, 216 insertions(+), 174 deletions(-) rename enabled/{_50_add_containers_dashboard.py => _50_project_containers_panelgroup.py} (71%) create mode 100644 enabled/_51_project_containers_bays_panel.py create mode 100644 enabled/_52_project_containers_baymodels_panel.py create mode 100644 enabled/_53_project_containers_containers_panel.py delete mode 100644 magnum_ui/containers/tests.py rename magnum_ui/{bay => content}/__init__.py (100%) rename magnum_ui/{baymodel => content/baymodels}/__init__.py (100%) rename magnum_ui/{baymodel => content/baymodels}/panel.py (84%) rename magnum_ui/{baymodel => content/baymodels}/tests.py (100%) rename magnum_ui/{baymodel => content/baymodels}/urls.py (93%) rename magnum_ui/{baymodel => content/baymodels}/views.py (87%) rename magnum_ui/{containers => content/bays}/__init__.py (100%) rename magnum_ui/{static/dashboard/containers/bay/bay.scss => content/bays/containers/__init__.py} (100%) rename magnum_ui/{ => content/bays}/containers/panel.py (88%) create mode 100644 magnum_ui/content/bays/containers/tests.py rename magnum_ui/{ => content/bays}/containers/urls.py (79%) rename magnum_ui/{ => content/bays}/containers/views.py (86%) rename magnum_ui/{bay => content/bays}/panel.py (86%) rename magnum_ui/{bay => content/bays}/tests.py (100%) rename magnum_ui/{bay => content/bays}/urls.py (78%) rename magnum_ui/{bay => content/bays}/views.py (94%) delete mode 100644 magnum_ui/dashboard.py rename magnum_ui/static/dashboard/containers/{baymodel/baymodel.module.js => baymodels/baymodels.module.js} (88%) rename magnum_ui/static/dashboard/containers/{baymodel/baymodel.module.spec.js => baymodels/baymodels.module.spec.js} (89%) rename magnum_ui/static/dashboard/containers/{bay/create/modal.spec.js => baymodels/baymodels.scss} (100%) rename magnum_ui/static/dashboard/containers/{baymodel => baymodels}/detail/detail.controller.js (96%) rename magnum_ui/static/dashboard/containers/{baymodel => baymodels}/detail/detail.html (93%) rename magnum_ui/static/dashboard/containers/{baymodel => baymodels}/table/table.controller.js (88%) rename magnum_ui/static/dashboard/containers/{bay => baymodels}/table/table.controller.spec.js (100%) rename magnum_ui/static/dashboard/containers/{baymodel => baymodels}/table/table.html (96%) rename magnum_ui/static/dashboard/containers/{bay/bay.module.js => bays/bays.module.js} (89%) rename magnum_ui/static/dashboard/containers/{bay/bay.module.spec.js => bays/bays.module.spec.js} (82%) rename magnum_ui/static/dashboard/containers/{baymodel/baymodel.scss => bays/bays.scss} (100%) rename magnum_ui/static/dashboard/containers/{bay => bays}/create/bay-model.js (97%) rename magnum_ui/static/dashboard/containers/{bay => bays}/create/create-workflow.service.js (72%) rename magnum_ui/static/dashboard/containers/{bay => bays}/create/info/bay.info.controller.js (98%) rename magnum_ui/static/dashboard/containers/{bay => bays}/create/info/info.help.html (100%) rename magnum_ui/static/dashboard/containers/{bay => bays}/create/info/info.html (100%) rename magnum_ui/static/dashboard/containers/{bay => bays}/create/misc/bay.misc.controller.js (95%) rename magnum_ui/static/dashboard/containers/{bay => bays}/create/misc/misc.help.html (100%) rename magnum_ui/static/dashboard/containers/{bay => bays}/create/misc/misc.html (100%) rename magnum_ui/static/dashboard/containers/{bay => bays}/create/modal.controller.js (97%) rename magnum_ui/static/dashboard/containers/{baymodel/table/table.controller.spec.js => bays/create/modal.spec.js} (100%) rename magnum_ui/static/dashboard/containers/{bay => bays}/create/size/bay.size.controller.js (95%) rename magnum_ui/static/dashboard/containers/{bay => bays}/create/size/size.help.html (100%) rename magnum_ui/static/dashboard/containers/{bay => bays}/create/size/size.html (100%) rename magnum_ui/static/dashboard/containers/{bay => bays}/create/wizard.controller.js (92%) rename magnum_ui/static/dashboard/containers/{bay => bays}/detail/detail.controller.js (96%) rename magnum_ui/static/dashboard/containers/{bay => bays}/detail/detail.html (95%) rename magnum_ui/static/dashboard/containers/{bay => bays}/table/table.controller.js (89%) create mode 100644 magnum_ui/static/dashboard/containers/bays/table/table.controller.spec.js rename magnum_ui/static/dashboard/containers/{bay => bays}/table/table.html (95%) rename magnum_ui/{baymodel/templates/baymodel => templates/baymodels}/index.html (86%) rename magnum_ui/{containers/templates/containers => templates/bays.containers}/index.html (86%) rename magnum_ui/{bay/templates/bay => templates/bays}/index.html (86%) diff --git a/MANIFEST.in b/MANIFEST.in index 885c1393..24c384ba 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,2 @@ include setup.py -recursive-include magnum_ui/bay/templates * -recursive-include magnum_ui/baymodel/templates * -recursive-include magnum_ui/static * +recursive-include magnum_ui/templates * diff --git a/README.rst b/README.rst index 23ae6cdb..5286b5ce 100644 --- a/README.rst +++ b/README.rst @@ -41,7 +41,12 @@ Install Magnum UI with all dependencies in your virtual environment:: And enable it in Horizon:: - cp ../magnum-ui/enabled/_50_add_containers_dashboard.py openstack_dashboard/local/enabled + cp ../magnum-ui/enabled/_50_project_containers_panelgroup.py openstack_dashboard/local/enabled + cp ../magnum-ui/enabled/_51_project_containers_bays_panel.py openstack_dashboard/local/enabled + cp ../magnum-ui/enabled/_52_project_containers_baymodels_panel.py openstack_dashboard/local/enabled + cp ../magnum-ui/enabled/_53_project_containers_containers_panel.py openstack_dashboard/local/enabled + + To run horizon with the newly enabled Magnum UI plugin run:: diff --git a/doc/source/index.rst b/doc/source/index.rst index e302dd1f..5886fd91 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -41,7 +41,10 @@ Install Magnum UI with all dependencies in your virtual environment:: And enable it in Horizon:: - cp ../magnum-ui/enabled/_50_add_containers_dashboard.py openstack_dashboard/local/enabled + cp ../magnum-ui/enabled/_50_project_containers_panelgroup.py openstack_dashboard/local/enabled + cp ../magnum-ui/enabled/_51_project_containers_bays_panel.py openstack_dashboard/local/enabled + cp ../magnum-ui/enabled/_52_project_containers_baymodels_panel.py openstack_dashboard/local/enabled + cp ../magnum-ui/enabled/_53_project_containers_containers_panel.py openstack_dashboard/local/enabled Release Notes ============= diff --git a/enabled/_50_add_containers_dashboard.py b/enabled/_50_project_containers_panelgroup.py similarity index 71% rename from enabled/_50_add_containers_dashboard.py rename to enabled/_50_project_containers_panelgroup.py index 84964f7d..8137f6c0 100644 --- a/enabled/_50_add_containers_dashboard.py +++ b/enabled/_50_project_containers_panelgroup.py @@ -11,8 +11,15 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +from django.utils.translation import ugettext_lazy as _ + +# The slug of the panel group to be added to HORIZON_CONFIG. Required. +PANEL_GROUP = 'containers' +# The display name of the PANEL_GROUP. Required. +PANEL_GROUP_NAME = _('Containers') +# The slug of the dashboard the PANEL_GROUP associated with. Required. +PANEL_GROUP_DASHBOARD = 'project' -DASHBOARD = 'containers' ADD_INSTALLED_APPS = ['magnum_ui'] ADD_ANGULAR_MODULES = [ diff --git a/enabled/_51_project_containers_bays_panel.py b/enabled/_51_project_containers_bays_panel.py new file mode 100644 index 00000000..00192534 --- /dev/null +++ b/enabled/_51_project_containers_bays_panel.py @@ -0,0 +1,23 @@ +# Copyright 2015 NEC Corporation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +# The slug of the panel to be added to HORIZON_CONFIG. Required. +PANEL = 'bays' +# The slug of the panel group the PANEL is associated with. +PANEL_GROUP = 'containers' +# The slug of the dashboard the PANEL associated with. Required. +PANEL_DASHBOARD = 'project' + +# Python panel class of the PANEL to be added. +ADD_PANEL = 'magnum_ui.content.bays.panel.Bays' diff --git a/enabled/_52_project_containers_baymodels_panel.py b/enabled/_52_project_containers_baymodels_panel.py new file mode 100644 index 00000000..0370e13a --- /dev/null +++ b/enabled/_52_project_containers_baymodels_panel.py @@ -0,0 +1,23 @@ +# Copyright 2015 NEC Corporation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +# The slug of the panel to be added to HORIZON_CONFIG. Required. +PANEL = 'baymodels' +# The slug of the panel group the PANEL is associated with. +PANEL_GROUP = 'containers' +# The slug of the dashboard the PANEL associated with. Required. +PANEL_DASHBOARD = 'project' + +# Python panel class of the PANEL to be added. +ADD_PANEL = 'magnum_ui.content.baymodels.panel.BayModels' diff --git a/enabled/_53_project_containers_containers_panel.py b/enabled/_53_project_containers_containers_panel.py new file mode 100644 index 00000000..c4c1fce1 --- /dev/null +++ b/enabled/_53_project_containers_containers_panel.py @@ -0,0 +1,23 @@ +# Copyright 2015 NEC Corporation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +# The slug of the panel to be added to HORIZON_CONFIG. Required. +PANEL = 'bays.containers' +# The slug of the panel group the PANEL is associated with. +PANEL_GROUP = 'containers' +# The slug of the dashboard the PANEL associated with. Required. +PANEL_DASHBOARD = 'project' + +# Python panel class of the PANEL to be added. +ADD_PANEL = 'magnum_ui.content.bays.containers.panel.Containers' diff --git a/magnum_ui/containers/tests.py b/magnum_ui/containers/tests.py deleted file mode 100644 index 66bb2307..00000000 --- a/magnum_ui/containers/tests.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2015 Cisco Systems, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from django.core.urlresolvers import reverse -import horizon -from magnum_ui.containers.panel import Containers as containers_panel -from openstack_dashboard.test import helpers as test - - -class ContainerTests(test.TestCase): - def test_registration(self): - dashboard = horizon.get_dashboard('containers') - registered_panel = dashboard.get_panel('containers') - self.assertEqual(registered_panel.slug, containers_panel.slug) - - def test_index(self): - index = reverse('horizon:containers:containers:index') - res = self.client.get(index) - self.assertTemplateUsed(res, 'containers/containers/index.html') diff --git a/magnum_ui/bay/__init__.py b/magnum_ui/content/__init__.py similarity index 100% rename from magnum_ui/bay/__init__.py rename to magnum_ui/content/__init__.py diff --git a/magnum_ui/baymodel/__init__.py b/magnum_ui/content/baymodels/__init__.py similarity index 100% rename from magnum_ui/baymodel/__init__.py rename to magnum_ui/content/baymodels/__init__.py diff --git a/magnum_ui/baymodel/panel.py b/magnum_ui/content/baymodels/panel.py similarity index 84% rename from magnum_ui/baymodel/panel.py rename to magnum_ui/content/baymodels/panel.py index 098ad46e..8694c471 100644 --- a/magnum_ui/baymodel/panel.py +++ b/magnum_ui/content/baymodels/panel.py @@ -13,14 +13,9 @@ # under the License. from django.utils.translation import ugettext_lazy as _ -from magnum_ui import dashboard - import horizon -class BayModel(horizon.Panel): +class BayModels(horizon.Panel): name = _("Bay Models") - slug = "baymodel" - - -dashboard.Containers.register(BayModel) + slug = "baymodels" diff --git a/magnum_ui/baymodel/tests.py b/magnum_ui/content/baymodels/tests.py similarity index 100% rename from magnum_ui/baymodel/tests.py rename to magnum_ui/content/baymodels/tests.py diff --git a/magnum_ui/baymodel/urls.py b/magnum_ui/content/baymodels/urls.py similarity index 93% rename from magnum_ui/baymodel/urls.py rename to magnum_ui/content/baymodels/urls.py index b923e7f6..1fae56b1 100644 --- a/magnum_ui/baymodel/urls.py +++ b/magnum_ui/content/baymodels/urls.py @@ -14,8 +14,7 @@ from django.conf.urls import patterns from django.conf.urls import url - -from magnum_ui.baymodel.views import IndexView +from magnum_ui.content.baymodels.views import IndexView urlpatterns = patterns( diff --git a/magnum_ui/baymodel/views.py b/magnum_ui/content/baymodels/views.py similarity index 87% rename from magnum_ui/baymodel/views.py rename to magnum_ui/content/baymodels/views.py index c1106919..e69af348 100644 --- a/magnum_ui/baymodel/views.py +++ b/magnum_ui/content/baymodels/views.py @@ -14,9 +14,7 @@ from horizon import views -from magnum_ui.api.rest import magnum # noqa - class IndexView(views.APIView): # A very simple class-based view... - template_name = 'containers/baymodel/index.html' + template_name = 'baymodels/index.html' diff --git a/magnum_ui/containers/__init__.py b/magnum_ui/content/bays/__init__.py similarity index 100% rename from magnum_ui/containers/__init__.py rename to magnum_ui/content/bays/__init__.py diff --git a/magnum_ui/static/dashboard/containers/bay/bay.scss b/magnum_ui/content/bays/containers/__init__.py similarity index 100% rename from magnum_ui/static/dashboard/containers/bay/bay.scss rename to magnum_ui/content/bays/containers/__init__.py diff --git a/magnum_ui/containers/panel.py b/magnum_ui/content/bays/containers/panel.py similarity index 88% rename from magnum_ui/containers/panel.py rename to magnum_ui/content/bays/containers/panel.py index 46d7d663..598fc340 100644 --- a/magnum_ui/containers/panel.py +++ b/magnum_ui/content/bays/containers/panel.py @@ -14,12 +14,8 @@ from django.utils.translation import ugettext_lazy as _ import horizon -from magnum_ui import dashboard class Containers(horizon.Panel): name = _("Containers") - slug = "containers" - - -dashboard.Containers.register(Containers) + slug = "bays.containers" diff --git a/magnum_ui/content/bays/containers/tests.py b/magnum_ui/content/bays/containers/tests.py new file mode 100644 index 00000000..00105503 --- /dev/null +++ b/magnum_ui/content/bays/containers/tests.py @@ -0,0 +1,36 @@ +# Copyright 2015 Cisco Systems, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +# from django.core.urlresolvers import reverse +# import horizon +# from magnum_ui.containers.containers.panel import Containers +from openstack_dashboard.test import helpers as test + + +class ContainerTests(test.TestCase): + def test_me(self): + self.assertTrue(1 + 1 == 2) + +# FIXME(shu-mutou): this tests seems not to work in new Horizon's plugin +# registration system +# def test_registration(self): +# dashboard = horizon.get_dashboard('project') +# registered_panel = dashboard.get_panel('containers.containers') +# self.assertEqual(registered_panel.slug, Containers.slug) + +# def test_index(self): +# index = reverse('horizon:bays:containers:index') +# res = self.client.get(index) +# self.assertTemplateUsed( +# res, 'project/bays/containers/index.html') diff --git a/magnum_ui/containers/urls.py b/magnum_ui/content/bays/containers/urls.py similarity index 79% rename from magnum_ui/containers/urls.py rename to magnum_ui/content/bays/containers/urls.py index 19a90bdd..f4313c75 100644 --- a/magnum_ui/containers/urls.py +++ b/magnum_ui/content/bays/containers/urls.py @@ -14,12 +14,11 @@ from django.conf.urls import patterns from django.conf.urls import url - -from magnum_ui.containers.views import IndexView +from magnum_ui.content.bays.containers import views urlpatterns = patterns( '', - url(r'^[0-9a-f\-]{36}$', IndexView.as_view(), name='detail'), - url(r'^$', IndexView.as_view(), name='index'), + url(r'^[0-9a-f\-]{36}$', views.IndexView.as_view(), name='detail'), + url(r'^$', views.IndexView.as_view(), name='index'), ) diff --git a/magnum_ui/containers/views.py b/magnum_ui/content/bays/containers/views.py similarity index 86% rename from magnum_ui/containers/views.py rename to magnum_ui/content/bays/containers/views.py index bf811ec8..5cbda1b4 100644 --- a/magnum_ui/containers/views.py +++ b/magnum_ui/content/bays/containers/views.py @@ -14,8 +14,6 @@ from horizon import views -from magnum_ui.api.rest import magnum # noqa - class IndexView(views.APIView): - template_name = 'containers/containers/index.html' + template_name = 'bays.containers/index.html' diff --git a/magnum_ui/bay/panel.py b/magnum_ui/content/bays/panel.py similarity index 86% rename from magnum_ui/bay/panel.py rename to magnum_ui/content/bays/panel.py index 41322cf5..3879fe15 100644 --- a/magnum_ui/bay/panel.py +++ b/magnum_ui/content/bays/panel.py @@ -13,14 +13,9 @@ # under the License. from django.utils.translation import ugettext_lazy as _ -from magnum_ui import dashboard - import horizon -class Bay(horizon.Panel): +class Bays(horizon.Panel): name = _("Bays") - slug = "bay" - - -dashboard.Containers.register(Bay) + slug = "bays" diff --git a/magnum_ui/bay/tests.py b/magnum_ui/content/bays/tests.py similarity index 100% rename from magnum_ui/bay/tests.py rename to magnum_ui/content/bays/tests.py diff --git a/magnum_ui/bay/urls.py b/magnum_ui/content/bays/urls.py similarity index 78% rename from magnum_ui/bay/urls.py rename to magnum_ui/content/bays/urls.py index 544c3801..4e96a6ed 100644 --- a/magnum_ui/bay/urls.py +++ b/magnum_ui/content/bays/urls.py @@ -12,14 +12,16 @@ # License for the specific language governing permissions and limitations # under the License. +from django.conf.urls import include from django.conf.urls import patterns from django.conf.urls import url - -from magnum_ui.bay.views import IndexView +from magnum_ui.content.bays.containers import urls as containers_urls +from magnum_ui.content.bays.views import IndexView urlpatterns = patterns( '', + url(r'^containers/', include(containers_urls, namespace='containers')), url(r'^[0-9a-f\-]{36}$', IndexView.as_view(), name='detail'), url(r'^$', IndexView.as_view(), name='index'), ) diff --git a/magnum_ui/bay/views.py b/magnum_ui/content/bays/views.py similarity index 94% rename from magnum_ui/bay/views.py rename to magnum_ui/content/bays/views.py index aed7c7c5..4aa5ea3d 100644 --- a/magnum_ui/bay/views.py +++ b/magnum_ui/content/bays/views.py @@ -19,4 +19,4 @@ from magnum_ui.api.rest import magnum # noqa class IndexView(views.APIView): # A very simple class-based view... - template_name = 'containers/bay/index.html' + template_name = 'bays/index.html' diff --git a/magnum_ui/dashboard.py b/magnum_ui/dashboard.py deleted file mode 100644 index d2591df8..00000000 --- a/magnum_ui/dashboard.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2015 Cisco Systems. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from django.utils.translation import ugettext_lazy as _ - -import horizon - - -class Containers(horizon.Dashboard): - name = _("Containers") - slug = "containers" - panels = ('bay', 'baymodel', 'containers') - default_panel = 'bay' - -horizon.register(Containers) diff --git a/magnum_ui/static/dashboard/containers/baymodel/baymodel.module.js b/magnum_ui/static/dashboard/containers/baymodels/baymodels.module.js similarity index 88% rename from magnum_ui/static/dashboard/containers/baymodel/baymodel.module.js rename to magnum_ui/static/dashboard/containers/baymodels/baymodels.module.js index a720e4c2..cdbf1199 100644 --- a/magnum_ui/static/dashboard/containers/baymodel/baymodel.module.js +++ b/magnum_ui/static/dashboard/containers/baymodels/baymodels.module.js @@ -19,7 +19,7 @@ /** * @ngdoc overview - * @name horizon.dashboard.containers.baymodel + * @name horizon.dashboard.containers.baymodels * @ngModule * * @description @@ -27,6 +27,5 @@ * panel */ angular - .module('horizon.dashboard.containers.baymodel', []); - + .module('horizon.dashboard.containers.baymodels', []); })(); diff --git a/magnum_ui/static/dashboard/containers/baymodel/baymodel.module.spec.js b/magnum_ui/static/dashboard/containers/baymodels/baymodels.module.spec.js similarity index 89% rename from magnum_ui/static/dashboard/containers/baymodel/baymodel.module.spec.js rename to magnum_ui/static/dashboard/containers/baymodels/baymodels.module.spec.js index fce813d7..bc40a8e0 100644 --- a/magnum_ui/static/dashboard/containers/baymodel/baymodel.module.spec.js +++ b/magnum_ui/static/dashboard/containers/baymodels/baymodels.module.spec.js @@ -16,9 +16,9 @@ (function() { 'use strict'; - describe('horizon.dashboard.containers.baymodel', function() { + describe('horizon.dashboard.containers.baymodels', function() { it('should exist', function() { - expect(angular.module('horizon.dashboard.containers.baymodel')).toBeDefined(); + expect(angular.module('horizon.dashboard.containers.baymodels')).toBeDefined(); }); }); diff --git a/magnum_ui/static/dashboard/containers/bay/create/modal.spec.js b/magnum_ui/static/dashboard/containers/baymodels/baymodels.scss similarity index 100% rename from magnum_ui/static/dashboard/containers/bay/create/modal.spec.js rename to magnum_ui/static/dashboard/containers/baymodels/baymodels.scss diff --git a/magnum_ui/static/dashboard/containers/baymodel/detail/detail.controller.js b/magnum_ui/static/dashboard/containers/baymodels/detail/detail.controller.js similarity index 96% rename from magnum_ui/static/dashboard/containers/baymodel/detail/detail.controller.js rename to magnum_ui/static/dashboard/containers/baymodels/detail/detail.controller.js index 4df956bc..2564c9ce 100644 --- a/magnum_ui/static/dashboard/containers/baymodel/detail/detail.controller.js +++ b/magnum_ui/static/dashboard/containers/baymodels/detail/detail.controller.js @@ -17,7 +17,7 @@ "use strict"; angular - .module('horizon.dashboard.containers') + .module('horizon.dashboard.containers.baymodels') .controller('BayModelDetailController', BayModelDetailController); BayModelDetailController.$inject = [ diff --git a/magnum_ui/static/dashboard/containers/baymodel/detail/detail.html b/magnum_ui/static/dashboard/containers/baymodels/detail/detail.html similarity index 93% rename from magnum_ui/static/dashboard/containers/baymodel/detail/detail.html rename to magnum_ui/static/dashboard/containers/baymodels/detail/detail.html index 23f2ce23..4dfcaf08 100644 --- a/magnum_ui/static/dashboard/containers/baymodel/detail/detail.html +++ b/magnum_ui/static/dashboard/containers/baymodels/detail/detail.html @@ -1,7 +1,7 @@
@@ -44,7 +44,7 @@
Flavor ID
@@ -60,7 +60,7 @@
SSH Authorized Key
diff --git a/magnum_ui/static/dashboard/containers/baymodel/table/table.controller.js b/magnum_ui/static/dashboard/containers/baymodels/table/table.controller.js similarity index 88% rename from magnum_ui/static/dashboard/containers/baymodel/table/table.controller.js rename to magnum_ui/static/dashboard/containers/baymodels/table/table.controller.js index b287d7b2..c4acc750 100644 --- a/magnum_ui/static/dashboard/containers/baymodel/table/table.controller.js +++ b/magnum_ui/static/dashboard/containers/baymodels/table/table.controller.js @@ -19,22 +19,22 @@ /** * @ngdoc overview - * @name containersBayModelTableController + * @name containersBayModelsTableController * @ngController * * @description * Controller for the containers bay model table */ angular - .module('horizon.dashboard.containers.baymodel') - .controller('containersBayModelTableController', containersBayModelTableController); + .module('horizon.dashboard.containers.baymodels') + .controller('containersBayModelsTableController', containersBayModelsTableController); - containersBayModelTableController.$inject = [ + containersBayModelsTableController.$inject = [ '$scope', 'horizon.app.core.openstack-service-api.magnum' ]; - function containersBayModelTableController($scope, magnum) { + function containersBayModelsTableController($scope, magnum) { var ctrl = this; ctrl.ibaymodels = []; ctrl.baymodels = []; diff --git a/magnum_ui/static/dashboard/containers/bay/table/table.controller.spec.js b/magnum_ui/static/dashboard/containers/baymodels/table/table.controller.spec.js similarity index 100% rename from magnum_ui/static/dashboard/containers/bay/table/table.controller.spec.js rename to magnum_ui/static/dashboard/containers/baymodels/table/table.controller.spec.js diff --git a/magnum_ui/static/dashboard/containers/baymodel/table/table.html b/magnum_ui/static/dashboard/containers/baymodels/table/table.html similarity index 96% rename from magnum_ui/static/dashboard/containers/baymodel/table/table.html rename to magnum_ui/static/dashboard/containers/baymodels/table/table.html index 53346d8b..ff6a0688 100644 --- a/magnum_ui/static/dashboard/containers/baymodel/table/table.html +++ b/magnum_ui/static/dashboard/containers/baymodels/table/table.html @@ -1,4 +1,4 @@ -
Name
-
{$ bm.name $}
+
{$ bm.name $}
ID
{$ bm.id $}
diff --git a/magnum_ui/static/dashboard/containers/bay/bay.module.js b/magnum_ui/static/dashboard/containers/bays/bays.module.js similarity index 89% rename from magnum_ui/static/dashboard/containers/bay/bay.module.js rename to magnum_ui/static/dashboard/containers/bays/bays.module.js index 83f987ae..741210fd 100644 --- a/magnum_ui/static/dashboard/containers/bay/bay.module.js +++ b/magnum_ui/static/dashboard/containers/bays/bays.module.js @@ -19,7 +19,7 @@ /** * @ngdoc overview - * @name horizon.dashboard.containers.bay + * @name horizon.dashboard.containers.bays * @ngModule * * @description @@ -27,6 +27,5 @@ * panel */ angular - .module('horizon.dashboard.containers.bay', []); - + .module('horizon.dashboard.containers.bays', []); })(); diff --git a/magnum_ui/static/dashboard/containers/bay/bay.module.spec.js b/magnum_ui/static/dashboard/containers/bays/bays.module.spec.js similarity index 82% rename from magnum_ui/static/dashboard/containers/bay/bay.module.spec.js rename to magnum_ui/static/dashboard/containers/bays/bays.module.spec.js index 3b2d9968..0036d042 100644 --- a/magnum_ui/static/dashboard/containers/bay/bay.module.spec.js +++ b/magnum_ui/static/dashboard/containers/bays/bays.module.spec.js @@ -16,9 +16,9 @@ (function() { 'use strict'; - describe('horizon.dashboard.containers.bay', function() { + describe('horizon.dashboard.containers.bays', function() { it('should exist', function() { - expect(angular.module('horizon.dashboard.containers.bay')).toBeDefined(); + expect(angular.module('horizon.dashboard.containers.bays')).toBeDefined(); }); }); diff --git a/magnum_ui/static/dashboard/containers/baymodel/baymodel.scss b/magnum_ui/static/dashboard/containers/bays/bays.scss similarity index 100% rename from magnum_ui/static/dashboard/containers/baymodel/baymodel.scss rename to magnum_ui/static/dashboard/containers/bays/bays.scss diff --git a/magnum_ui/static/dashboard/containers/bay/create/bay-model.js b/magnum_ui/static/dashboard/containers/bays/create/bay-model.js similarity index 97% rename from magnum_ui/static/dashboard/containers/bay/create/bay-model.js rename to magnum_ui/static/dashboard/containers/bays/create/bay-model.js index 2be0f3f5..b1197e0b 100644 --- a/magnum_ui/static/dashboard/containers/bay/create/bay-model.js +++ b/magnum_ui/static/dashboard/containers/bays/create/bay-model.js @@ -18,7 +18,7 @@ 'use strict'; angular - .module('horizon.dashboard.containers.bay') + .module('horizon.dashboard.containers.bays') .factory('bayModel', bayModel); bayModel.$inject = [ diff --git a/magnum_ui/static/dashboard/containers/bay/create/create-workflow.service.js b/magnum_ui/static/dashboard/containers/bays/create/create-workflow.service.js similarity index 72% rename from magnum_ui/static/dashboard/containers/bay/create/create-workflow.service.js rename to magnum_ui/static/dashboard/containers/bays/create/create-workflow.service.js index e67d6a1e..07f5bbca 100644 --- a/magnum_ui/static/dashboard/containers/bay/create/create-workflow.service.js +++ b/magnum_ui/static/dashboard/containers/bays/create/create-workflow.service.js @@ -18,8 +18,8 @@ 'use strict'; angular - .module('horizon.dashboard.containers.bay') - .factory('horizon.dashboard.containers.bay.workflow', bayWorkflow); + .module('horizon.dashboard.containers.bays') + .factory('horizon.dashboard.containers.bays.workflow', bayWorkflow); bayWorkflow.$inject = [ 'horizon.dashboard.containers.basePath', @@ -33,20 +33,20 @@ steps: [ { title: gettext('Info'), - templateUrl: basePath + 'bay/create/info/info.html', - helpUrl: basePath + 'bay/create/info/info.help.html', + templateUrl: basePath + 'bays/create/info/info.html', + helpUrl: basePath + 'bays/create/info/info.help.html', formName: 'bayInfoForm' }, { title: gettext('Size'), - templateUrl: basePath + 'bay/create/size/size.html', - helpUrl: basePath + 'bay/create/size/size.help.html', + templateUrl: basePath + 'bays/create/size/size.html', + helpUrl: basePath + 'bays/create/size/size.help.html', formName: 'baySizeForm' }, { title: gettext('Misc'), - templateUrl: basePath + 'bay/create/misc/misc.html', - helpUrl: basePath + 'bay/create/misc/misc.help.html', + templateUrl: basePath + 'bays/create/misc/misc.html', + helpUrl: basePath + 'bays/create/misc/misc.help.html', formName: 'bayMiscForm' } ], diff --git a/magnum_ui/static/dashboard/containers/bay/create/info/bay.info.controller.js b/magnum_ui/static/dashboard/containers/bays/create/info/bay.info.controller.js similarity index 98% rename from magnum_ui/static/dashboard/containers/bay/create/info/bay.info.controller.js rename to magnum_ui/static/dashboard/containers/bays/create/info/bay.info.controller.js index d4b59f16..73216b25 100644 --- a/magnum_ui/static/dashboard/containers/bay/create/info/bay.info.controller.js +++ b/magnum_ui/static/dashboard/containers/bays/create/info/bay.info.controller.js @@ -26,7 +26,7 @@ * Controller for the containers bay info step in create workflow */ angular - .module('horizon.dashboard.containers.bay') + .module('horizon.dashboard.containers.bays') .controller('createBayInfoController', createBayInfoController); createBayInfoController.$inject = [ diff --git a/magnum_ui/static/dashboard/containers/bay/create/info/info.help.html b/magnum_ui/static/dashboard/containers/bays/create/info/info.help.html similarity index 100% rename from magnum_ui/static/dashboard/containers/bay/create/info/info.help.html rename to magnum_ui/static/dashboard/containers/bays/create/info/info.help.html diff --git a/magnum_ui/static/dashboard/containers/bay/create/info/info.html b/magnum_ui/static/dashboard/containers/bays/create/info/info.html similarity index 100% rename from magnum_ui/static/dashboard/containers/bay/create/info/info.html rename to magnum_ui/static/dashboard/containers/bays/create/info/info.html diff --git a/magnum_ui/static/dashboard/containers/bay/create/misc/bay.misc.controller.js b/magnum_ui/static/dashboard/containers/bays/create/misc/bay.misc.controller.js similarity index 95% rename from magnum_ui/static/dashboard/containers/bay/create/misc/bay.misc.controller.js rename to magnum_ui/static/dashboard/containers/bays/create/misc/bay.misc.controller.js index d59610c9..feff39d4 100644 --- a/magnum_ui/static/dashboard/containers/bay/create/misc/bay.misc.controller.js +++ b/magnum_ui/static/dashboard/containers/bays/create/misc/bay.misc.controller.js @@ -26,7 +26,7 @@ * Controller for the containers bay misc step in create workflow */ angular - .module('horizon.dashboard.containers.bay') + .module('horizon.dashboard.containers.bays') .controller('createBayMiscController', createBayMiscController); createBayMiscController.$inject = [ diff --git a/magnum_ui/static/dashboard/containers/bay/create/misc/misc.help.html b/magnum_ui/static/dashboard/containers/bays/create/misc/misc.help.html similarity index 100% rename from magnum_ui/static/dashboard/containers/bay/create/misc/misc.help.html rename to magnum_ui/static/dashboard/containers/bays/create/misc/misc.help.html diff --git a/magnum_ui/static/dashboard/containers/bay/create/misc/misc.html b/magnum_ui/static/dashboard/containers/bays/create/misc/misc.html similarity index 100% rename from magnum_ui/static/dashboard/containers/bay/create/misc/misc.html rename to magnum_ui/static/dashboard/containers/bays/create/misc/misc.html diff --git a/magnum_ui/static/dashboard/containers/bay/create/modal.controller.js b/magnum_ui/static/dashboard/containers/bays/create/modal.controller.js similarity index 97% rename from magnum_ui/static/dashboard/containers/bay/create/modal.controller.js rename to magnum_ui/static/dashboard/containers/bays/create/modal.controller.js index ec5d910d..18968e7d 100644 --- a/magnum_ui/static/dashboard/containers/bay/create/modal.controller.js +++ b/magnum_ui/static/dashboard/containers/bays/create/modal.controller.js @@ -26,7 +26,7 @@ * Controller for the containers bay create modal */ angular - .module('horizon.dashboard.containers.bay') + .module('horizon.dashboard.containers.bays') .controller('containersBayModalController', containersBayModalController); containersBayModalController.$inject = [ diff --git a/magnum_ui/static/dashboard/containers/baymodel/table/table.controller.spec.js b/magnum_ui/static/dashboard/containers/bays/create/modal.spec.js similarity index 100% rename from magnum_ui/static/dashboard/containers/baymodel/table/table.controller.spec.js rename to magnum_ui/static/dashboard/containers/bays/create/modal.spec.js diff --git a/magnum_ui/static/dashboard/containers/bay/create/size/bay.size.controller.js b/magnum_ui/static/dashboard/containers/bays/create/size/bay.size.controller.js similarity index 95% rename from magnum_ui/static/dashboard/containers/bay/create/size/bay.size.controller.js rename to magnum_ui/static/dashboard/containers/bays/create/size/bay.size.controller.js index aae95993..f49f443a 100644 --- a/magnum_ui/static/dashboard/containers/bay/create/size/bay.size.controller.js +++ b/magnum_ui/static/dashboard/containers/bays/create/size/bay.size.controller.js @@ -26,7 +26,7 @@ * Controller for the containers bay size step in create workflow */ angular - .module('horizon.dashboard.containers.bay') + .module('horizon.dashboard.containers.bays') .controller('createBaySizeController', createBaySizeController); createBaySizeController.$inject = [ diff --git a/magnum_ui/static/dashboard/containers/bay/create/size/size.help.html b/magnum_ui/static/dashboard/containers/bays/create/size/size.help.html similarity index 100% rename from magnum_ui/static/dashboard/containers/bay/create/size/size.help.html rename to magnum_ui/static/dashboard/containers/bays/create/size/size.help.html diff --git a/magnum_ui/static/dashboard/containers/bay/create/size/size.html b/magnum_ui/static/dashboard/containers/bays/create/size/size.html similarity index 100% rename from magnum_ui/static/dashboard/containers/bay/create/size/size.html rename to magnum_ui/static/dashboard/containers/bays/create/size/size.html diff --git a/magnum_ui/static/dashboard/containers/bay/create/wizard.controller.js b/magnum_ui/static/dashboard/containers/bays/create/wizard.controller.js similarity index 92% rename from magnum_ui/static/dashboard/containers/bay/create/wizard.controller.js rename to magnum_ui/static/dashboard/containers/bays/create/wizard.controller.js index 38cbf84a..c574f9e8 100644 --- a/magnum_ui/static/dashboard/containers/bay/create/wizard.controller.js +++ b/magnum_ui/static/dashboard/containers/bays/create/wizard.controller.js @@ -26,13 +26,13 @@ * Controller for the containers bay create modal */ angular - .module('horizon.dashboard.containers.bay') + .module('horizon.dashboard.containers.bays') .controller('createBayWizardController', createBayWizardController); createBayWizardController.$inject = [ '$scope', 'bayModel', - 'horizon.dashboard.containers.bay.workflow' + 'horizon.dashboard.containers.bays.workflow' ]; function createBayWizardController($scope, model, workflow) { diff --git a/magnum_ui/static/dashboard/containers/bay/detail/detail.controller.js b/magnum_ui/static/dashboard/containers/bays/detail/detail.controller.js similarity index 96% rename from magnum_ui/static/dashboard/containers/bay/detail/detail.controller.js rename to magnum_ui/static/dashboard/containers/bays/detail/detail.controller.js index 0a63695a..8b196941 100644 --- a/magnum_ui/static/dashboard/containers/bay/detail/detail.controller.js +++ b/magnum_ui/static/dashboard/containers/bays/detail/detail.controller.js @@ -17,7 +17,7 @@ "use strict"; angular - .module('horizon.dashboard.containers') + .module('horizon.dashboard.containers.bays') .controller('BayDetailController', BayDetailController); BayDetailController.$inject = [ diff --git a/magnum_ui/static/dashboard/containers/bay/detail/detail.html b/magnum_ui/static/dashboard/containers/bays/detail/detail.html similarity index 95% rename from magnum_ui/static/dashboard/containers/bay/detail/detail.html rename to magnum_ui/static/dashboard/containers/bays/detail/detail.html index df531f10..d4010504 100644 --- a/magnum_ui/static/dashboard/containers/bay/detail/detail.html +++ b/magnum_ui/static/dashboard/containers/bays/detail/detail.html @@ -1,7 +1,7 @@
@@ -14,7 +14,7 @@
ID
diff --git a/magnum_ui/static/dashboard/containers/bay/table/table.controller.js b/magnum_ui/static/dashboard/containers/bays/table/table.controller.js similarity index 89% rename from magnum_ui/static/dashboard/containers/bay/table/table.controller.js rename to magnum_ui/static/dashboard/containers/bays/table/table.controller.js index 02551dd7..edefe755 100644 --- a/magnum_ui/static/dashboard/containers/bay/table/table.controller.js +++ b/magnum_ui/static/dashboard/containers/bays/table/table.controller.js @@ -19,22 +19,22 @@ /** * @ngdoc overview - * @name containersBayTableController + * @name containersBaysTableController * @ngController * * @description * Controller for the containers bay table */ angular - .module('horizon.dashboard.containers.bay') - .controller('containersBayTableController', containersBayTableController); + .module('horizon.dashboard.containers.bays') + .controller('containersBaysTableController', containersBaysTableController); - containersBayTableController.$inject = [ + containersBaysTableController.$inject = [ '$scope', 'horizon.app.core.openstack-service-api.magnum' ]; - function containersBayTableController($scope, magnum) { + function containersBaysTableController($scope, magnum) { var ctrl = this; ctrl.ibays = []; ctrl.bays = []; diff --git a/magnum_ui/static/dashboard/containers/bays/table/table.controller.spec.js b/magnum_ui/static/dashboard/containers/bays/table/table.controller.spec.js new file mode 100644 index 00000000..e69de29b diff --git a/magnum_ui/static/dashboard/containers/bay/table/table.html b/magnum_ui/static/dashboard/containers/bays/table/table.html similarity index 95% rename from magnum_ui/static/dashboard/containers/bay/table/table.html rename to magnum_ui/static/dashboard/containers/bays/table/table.html index 8e0c6af3..4b7c648e 100644 --- a/magnum_ui/static/dashboard/containers/bay/table/table.html +++ b/magnum_ui/static/dashboard/containers/bays/table/table.html @@ -1,4 +1,4 @@ -
+ ng-click="modal.openBayCreateWizard({successUrl: '/project/bays/'})"> Create Bay @@ -133,7 +133,7 @@
Name
-
{$ b.name $}
+
{$ b.name $}
ID
{$ b.id $}
diff --git a/magnum_ui/static/dashboard/containers/containers.module.js b/magnum_ui/static/dashboard/containers/containers.module.js index 6fb87842..525f3244 100644 --- a/magnum_ui/static/dashboard/containers/containers.module.js +++ b/magnum_ui/static/dashboard/containers/containers.module.js @@ -26,47 +26,47 @@ */ angular .module('horizon.dashboard.containers', [ - 'horizon.dashboard.containers.bay', - 'horizon.dashboard.containers.baymodel', + 'horizon.dashboard.containers.bays', + 'horizon.dashboard.containers.baymodels', 'horizon.dashboard.containers.containers', 'ngRoute' ]) - .config(config); + .config(config) config.$inject = ['$provide', '$windowProvider', '$routeProvider', '$locationProvider']; function config($provide, $windowProvider, $routeProvider, $locationProvider) { + /* FIXME (shu-mutou): remove settings for $locationProvider if following patch is merged. + * https://review.openstack.org/#/c/260741/ + */ $locationProvider - .html5Mode({ - enabled: true - }); + .html5Mode({ + enabled: true + }) + .hashPrefix('!'); var path = $windowProvider.$get().STATIC_URL + 'dashboard/containers/'; $provide.constant('horizon.dashboard.containers.basePath', path); $routeProvider - .when('/containers', { + .when('/project/bays/containers', { templateUrl: path + 'containers/table/table.html' }) - .when('/containers/:containerId', { + .when('/project/bays/containers/:containerId', { templateUrl: path + 'containers/detail/detail.html' }) - .when('/baymodel', { - templateUrl: path + 'baymodel/table/table.html' + .when('/project/baymodels', { + templateUrl: path + 'baymodels/table/table.html' }) - .when('/baymodel/:baymodelId', { - templateUrl: path + 'baymodel/detail/detail.html' + .when('/project/baymodels/:baymodelId', { + templateUrl: path + 'baymodels/detail/detail.html' }) - .when('/', { - templateUrl: path + 'bay/table/table.html' + .when('/project/bays', { + templateUrl: path + 'bays/table/table.html' }) - .when('/:bayId', { - templateUrl: path + 'bay/detail/detail.html' - }) - .otherwise({ - redirectTo: '/' + .when('/project/bays/:bayId', { + templateUrl: path + 'bays/detail/detail.html' }); } - })(); diff --git a/magnum_ui/static/dashboard/containers/containers.scss b/magnum_ui/static/dashboard/containers/containers.scss index 4609a00b..7e5c9b74 100644 --- a/magnum_ui/static/dashboard/containers/containers.scss +++ b/magnum_ui/static/dashboard/containers/containers.scss @@ -5,6 +5,6 @@ // Custom Style Variables @import "/custom/styles"; -@import "baymodel/baymodel"; -@import "bay/bay"; +@import "baymodels/baymodels"; +@import "bays/bays"; @import "containers/containers"; diff --git a/magnum_ui/static/dashboard/containers/containers/detail/detail.controller.js b/magnum_ui/static/dashboard/containers/containers/detail/detail.controller.js index a7dad871..1e665e9c 100644 --- a/magnum_ui/static/dashboard/containers/containers/detail/detail.controller.js +++ b/magnum_ui/static/dashboard/containers/containers/detail/detail.controller.js @@ -17,7 +17,7 @@ "use strict"; angular - .module('horizon.dashboard.containers') + .module('horizon.dashboard.containers.containers') .controller('ContainerDetailController', ContainerDetailController); ContainerDetailController.$inject = [ diff --git a/magnum_ui/static/dashboard/containers/containers/detail/detail.html b/magnum_ui/static/dashboard/containers/containers/detail/detail.html index e8749057..ceaf4968 100644 --- a/magnum_ui/static/dashboard/containers/containers/detail/detail.html +++ b/magnum_ui/static/dashboard/containers/containers/detail/detail.html @@ -1,7 +1,7 @@
@@ -32,7 +32,7 @@
ID
@@ -60,7 +60,7 @@
ID
diff --git a/magnum_ui/static/dashboard/containers/containers/table/table.html b/magnum_ui/static/dashboard/containers/containers/table/table.html index 9497bfc0..2aedde59 100644 --- a/magnum_ui/static/dashboard/containers/containers/table/table.html +++ b/magnum_ui/static/dashboard/containers/containers/table/table.html @@ -24,7 +24,7 @@ @@ -141,7 +141,7 @@
Name
-
{$ c.name $}
+
{$ c.name $}
UUID
{$ c.id $}
diff --git a/magnum_ui/baymodel/templates/baymodel/index.html b/magnum_ui/templates/baymodels/index.html similarity index 86% rename from magnum_ui/baymodel/templates/baymodel/index.html rename to magnum_ui/templates/baymodels/index.html index 756da30a..f5b8b729 100644 --- a/magnum_ui/baymodel/templates/baymodel/index.html +++ b/magnum_ui/templates/baymodels/index.html @@ -10,7 +10,7 @@ {% endblock page_header %} {% block ng_route_base %} - + {% endblock %} {% block main %} diff --git a/magnum_ui/containers/templates/containers/index.html b/magnum_ui/templates/bays.containers/index.html similarity index 86% rename from magnum_ui/containers/templates/containers/index.html rename to magnum_ui/templates/bays.containers/index.html index ba8f84db..2ab3912e 100644 --- a/magnum_ui/containers/templates/containers/index.html +++ b/magnum_ui/templates/bays.containers/index.html @@ -10,7 +10,7 @@ {% endblock page_header %} {% block ng_route_base %} - + {% endblock %} {% block main %} diff --git a/magnum_ui/bay/templates/bay/index.html b/magnum_ui/templates/bays/index.html similarity index 86% rename from magnum_ui/bay/templates/bay/index.html rename to magnum_ui/templates/bays/index.html index 4d03ae30..8cffcac0 100644 --- a/magnum_ui/bay/templates/bay/index.html +++ b/magnum_ui/templates/bays/index.html @@ -10,7 +10,7 @@ {% endblock page_header %} {% block ng_route_base %} - + {% endblock %} {% block main %}