From d803f27ccec9f2a2b700600130a6dc08861a395b Mon Sep 17 00:00:00 2001 From: Shu Muto Date: Tue, 14 Feb 2017 12:33:00 +0900 Subject: [PATCH] Use common Angular view for Queues panel This patch uses Horizon's common Angular views module for Queues panel. Also, breadcrumbs are shown. Change-Id: Iae5edc9d370fbda20889a043a2574bd034170881 Closes-Bug: #1664374 --- .../queues/templates/queues/index.html | 11 ----------- zaqar_ui/content/queues/urls.py | 8 ++++---- zaqar_ui/content/queues/views.py | 19 ------------------- .../dashboard/project/queues/queues.module.js | 9 +++++++-- 4 files changed, 11 insertions(+), 36 deletions(-) delete mode 100644 zaqar_ui/content/queues/templates/queues/index.html delete mode 100644 zaqar_ui/content/queues/views.py diff --git a/zaqar_ui/content/queues/templates/queues/index.html b/zaqar_ui/content/queues/templates/queues/index.html deleted file mode 100644 index e2dda2f..0000000 --- a/zaqar_ui/content/queues/templates/queues/index.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends 'base.html' %} -{% load i18n %} -{% block title %}{% trans "Queues" %}{% endblock %} - -{% block page_header %} - -{% endblock page_header %} - -{% block main %} - -{% endblock %} diff --git a/zaqar_ui/content/queues/urls.py b/zaqar_ui/content/queues/urls.py index f94fea1..1ceb906 100644 --- a/zaqar_ui/content/queues/urls.py +++ b/zaqar_ui/content/queues/urls.py @@ -13,10 +13,10 @@ # limitations under the License. from django.conf import urls +from horizon.browsers import views +from zaqar_ui.content.queues import panel -from zaqar_ui.content.queues import views - - +title = panel.Queues.name urlpatterns = [ - urls.url(r'^$', views.IndexView.as_view(), name='index'), + urls.url(r'^$', views.AngularIndexView.as_view(title=title), name='index'), ] diff --git a/zaqar_ui/content/queues/views.py b/zaqar_ui/content/queues/views.py deleted file mode 100644 index 22b9298..0000000 --- a/zaqar_ui/content/queues/views.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2015 IBM Corp. -# -# 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/queues/index.html' diff --git a/zaqar_ui/static/dashboard/project/queues/queues.module.js b/zaqar_ui/static/dashboard/project/queues/queues.module.js index fee9c0b..f906796 100644 --- a/zaqar_ui/static/dashboard/project/queues/queues.module.js +++ b/zaqar_ui/static/dashboard/project/queues/queues.module.js @@ -32,7 +32,8 @@ config.$inject = [ '$provide', - '$windowProvider' + '$windowProvider', + '$routeProvider' ]; /** @@ -58,12 +59,16 @@ * @name horizon.dashboard.project.queues.basePath * @param {Object} $provide * @param {Object} $windowProvider + * @param {Object} $routeProvider * @returns {undefined} Returns nothing * @description Base path for the queues panel */ - function config($provide, $windowProvider) { + function config($provide, $windowProvider, $routeProvider) { var path = $windowProvider.$get().STATIC_URL + 'dashboard/project/queues/'; $provide.constant('horizon.dashboard.project.queues.basePath', path); + $routeProvider.when('/project/queues', { + templateUrl: path + 'table/queue.html' + }); } })();