From 1097f3ca531d14814c940502bb63221b6b780a8a Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Thu, 17 Dec 2015 13:54:31 +1100 Subject: [PATCH] Add ngSwift Django Interface This patch adds the scaffolding for the new angular Swift interface, but none of the static files for that interface. The body of the interface will be added in a follow-on patch. To test set DISABLED = False in _1921_project_ng_containers_panel.py Co-Author: Neill Cox Change-Id: Icc11167f82554dee31edc465a14be8ebbe435403 --- .../project/ngcontainers/__init__.py | 0 .../dashboards/project/ngcontainers/panel.py | 23 ++++++++++++++++ .../templates/ngcontainers/index.html | 11 ++++++++ .../dashboards/project/ngcontainers/urls.py | 26 +++++++++++++++++++ .../dashboards/project/ngcontainers/views.py | 19 ++++++++++++++ .../_1921_project_ng_containers_panel.py | 26 +++++++++++++++++++ 6 files changed, 105 insertions(+) create mode 100644 openstack_dashboard/dashboards/project/ngcontainers/__init__.py create mode 100644 openstack_dashboard/dashboards/project/ngcontainers/panel.py create mode 100644 openstack_dashboard/dashboards/project/ngcontainers/templates/ngcontainers/index.html create mode 100644 openstack_dashboard/dashboards/project/ngcontainers/urls.py create mode 100644 openstack_dashboard/dashboards/project/ngcontainers/views.py create mode 100644 openstack_dashboard/enabled/_1921_project_ng_containers_panel.py diff --git a/openstack_dashboard/dashboards/project/ngcontainers/__init__.py b/openstack_dashboard/dashboards/project/ngcontainers/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openstack_dashboard/dashboards/project/ngcontainers/panel.py b/openstack_dashboard/dashboards/project/ngcontainers/panel.py new file mode 100644 index 0000000000..3ac43abeb2 --- /dev/null +++ b/openstack_dashboard/dashboards/project/ngcontainers/panel.py @@ -0,0 +1,23 @@ +# Copyright 2015, Rackspace, US, 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.utils.translation import ugettext_lazy as _ + +import horizon + + +class NGContainers(horizon.Panel): + name = _("NGContainers") + slug = 'ngcontainers' + permissions = ('openstack.services.object-store',) diff --git a/openstack_dashboard/dashboards/project/ngcontainers/templates/ngcontainers/index.html b/openstack_dashboard/dashboards/project/ngcontainers/templates/ngcontainers/index.html new file mode 100644 index 0000000000..1d94169ca8 --- /dev/null +++ b/openstack_dashboard/dashboards/project/ngcontainers/templates/ngcontainers/index.html @@ -0,0 +1,11 @@ +{% extends 'base.html' %} +{% load i18n %} +{% block title %}{% trans "Containers" %}{% endblock %} + +{% block page_header %} + {% include "horizon/common/_page_header.html" with title=_("Containers") %} +{% endblock page_header %} + +{% block main %} + [This content to be replaced in follow-on patch with actual interface.] +{% endblock %} diff --git a/openstack_dashboard/dashboards/project/ngcontainers/urls.py b/openstack_dashboard/dashboards/project/ngcontainers/urls.py new file mode 100644 index 0000000000..a11ec8fa12 --- /dev/null +++ b/openstack_dashboard/dashboards/project/ngcontainers/urls.py @@ -0,0 +1,26 @@ +# Copyright 2015, Rackspace, US, 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.conf.urls import patterns +from django.conf.urls import url + +from openstack_dashboard.dashboards.project.ngcontainers import views + + +VIEW_MOD = 'openstack_dashboard.dashboards.project.ngcontainers.views' + +urlpatterns = patterns( + 'openstack_dashboard.dashboards.project.ngcontainers.views', + url(r'^$', views.IndexView.as_view(), name='index'), +) diff --git a/openstack_dashboard/dashboards/project/ngcontainers/views.py b/openstack_dashboard/dashboards/project/ngcontainers/views.py new file mode 100644 index 0000000000..87d0e0c45a --- /dev/null +++ b/openstack_dashboard/dashboards/project/ngcontainers/views.py @@ -0,0 +1,19 @@ +# Copyright 2015, Rackspace, US, 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.views import generic + + +class IndexView(generic.TemplateView): + template_name = 'project/ngcontainers/index.html' diff --git a/openstack_dashboard/enabled/_1921_project_ng_containers_panel.py b/openstack_dashboard/enabled/_1921_project_ng_containers_panel.py new file mode 100644 index 0000000000..41e84ff461 --- /dev/null +++ b/openstack_dashboard/enabled/_1921_project_ng_containers_panel.py @@ -0,0 +1,26 @@ +# Copyright 2016, Rackspace, US, 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 = 'ngcontainers' +# The slug of the dashboard the PANEL associated with. Required. +PANEL_DASHBOARD = 'project' +# The slug of the panel group the PANEL is associated with. +PANEL_GROUP = 'object_store' + +# Python panel class of the PANEL to be added. +ADD_PANEL = ('openstack_dashboard.dashboards.project.' + 'ngcontainers.panel.NGContainers') + +DISABLED = True