AngularJS based panels page title updated

to more logical ones instead of "Horizon - OpenStack Dashboard".

Change-Id: Ia230ba28e011e99142e7fd2379fe1735ccd0b010
Closes-Bug: #1647855
This commit is contained in:
Yakup Adakli 2016-12-15 15:01:37 +03:00
parent c6d656a0b1
commit 124bbb3d82
9 changed files with 30 additions and 15 deletions

View File

@ -61,3 +61,9 @@ class ResourceBrowserView(MultiTableView):
class AngularIndexView(generic.TemplateView): class AngularIndexView(generic.TemplateView):
template_name = 'angular.html' template_name = 'angular.html'
title = _("Horizon")
def get_context_data(self, **kwargs):
context = super(AngularIndexView, self).get_context_data(**kwargs)
context["title"] = self.title
return context

View File

@ -18,16 +18,19 @@
from django.conf import settings from django.conf import settings
from django.conf.urls import url from django.conf.urls import url
from django.utils.translation import ugettext_lazy as _
from horizon.browsers.views import AngularIndexView from horizon.browsers.views import AngularIndexView
from openstack_dashboard.dashboards.admin.flavors import views from openstack_dashboard.dashboards.admin.flavors import views
if settings.ANGULAR_FEATURES['flavors_panel']: if settings.ANGULAR_FEATURES['flavors_panel']:
title = _("Flavors")
# New angular panel # New angular panel
urlpatterns = [ urlpatterns = [
url(r'^$', AngularIndexView.as_view(), name='index'), url(r'^$', AngularIndexView.as_view(title=title), name='index'),
url(r'^create/$', AngularIndexView.as_view(), name='create'), url(r'^create/$', AngularIndexView.as_view(title=title),
url(r'^(?P<id>[^/]+)/update/$', AngularIndexView.as_view(), name='create'),
url(r'^(?P<id>[^/]+)/update/$', AngularIndexView.as_view(title=title),
name='index'), name='index'),
] ]
else: else:

View File

@ -18,15 +18,17 @@
from django.conf import settings from django.conf import settings
from django.conf.urls import url from django.conf.urls import url
from django.utils.translation import ugettext_lazy as _
from horizon.browsers.views import AngularIndexView from horizon.browsers.views import AngularIndexView
from openstack_dashboard.dashboards.admin.images import views from openstack_dashboard.dashboards.admin.images import views
if settings.ANGULAR_FEATURES['images_panel']: if settings.ANGULAR_FEATURES['images_panel']:
title = _("Images")
# New angular images # New angular images
urlpatterns = [ urlpatterns = [
url(r'^$', AngularIndexView.as_view(), name='index'), url(r'^$', AngularIndexView.as_view(title=title), name='index'),
url(r'^(?P<image_id>[^/]+)/detail/$', url(r'^(?P<image_id>[^/]+)/detail/$',
AngularIndexView.as_view(), name='detail'), AngularIndexView.as_view(title=title), name='detail'),
] ]
else: else:
urlpatterns = [ urlpatterns = [

View File

@ -19,14 +19,17 @@
from django.conf import settings from django.conf import settings
from django.conf.urls import url from django.conf.urls import url
from django.utils.translation import ugettext_lazy as _
from horizon.browsers.views import AngularIndexView
from openstack_dashboard.dashboards.identity.users import views from openstack_dashboard.dashboards.identity.users import views
if settings.ANGULAR_FEATURES.get('users_panel', False): if settings.ANGULAR_FEATURES.get('users_panel', False):
title = _("Users")
# new angular panel # new angular panel
urlpatterns = [ urlpatterns = [
url(r'^$', views.AngularIndexView.as_view(), name='index'), url(r'^$', AngularIndexView.as_view(title=title), name='index'),
] ]
else: else:
urlpatterns = [ urlpatterns = [

View File

@ -25,7 +25,6 @@ from django.core.urlresolvers import reverse_lazy
from django.utils.decorators import method_decorator # noqa from django.utils.decorators import method_decorator # noqa
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.views.decorators.debug import sensitive_post_parameters # noqa from django.views.decorators.debug import sensitive_post_parameters # noqa
from django.views import generic
from horizon import exceptions from horizon import exceptions
from horizon import forms from horizon import forms
@ -45,10 +44,6 @@ from openstack_dashboard.dashboards.identity.users \
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
class AngularIndexView(generic.TemplateView):
template_name = 'angular.html'
class IndexView(tables.DataTableView): class IndexView(tables.DataTableView):
table_class = project_tables.UsersTable table_class = project_tables.UsersTable
template_name = 'identity/users/index.html' template_name = 'identity/users/index.html'

View File

@ -18,13 +18,15 @@
from django.conf import settings from django.conf import settings
from django.conf.urls import url from django.conf.urls import url
from django.utils.translation import ugettext_lazy as _
from horizon.browsers.views import AngularIndexView from horizon.browsers.views import AngularIndexView
from openstack_dashboard.dashboards.project.images.images import views from openstack_dashboard.dashboards.project.images.images import views
if settings.ANGULAR_FEATURES['images_panel']: if settings.ANGULAR_FEATURES['images_panel']:
title = _("Images")
urlpatterns = [ urlpatterns = [
url(r'^(?P<image_id>[^/]+)/$', AngularIndexView.as_view(), url(r'^(?P<image_id>[^/]+)/$', AngularIndexView.as_view(title=title),
name='detail'), name='detail'),
] ]
else: else:

View File

@ -19,6 +19,7 @@
from django.conf import settings from django.conf import settings
from django.conf.urls import include from django.conf.urls import include
from django.conf.urls import url from django.conf.urls import url
from django.utils.translation import ugettext_lazy as _
from horizon.browsers.views import AngularIndexView from horizon.browsers.views import AngularIndexView
from openstack_dashboard.dashboards.project.images.images \ from openstack_dashboard.dashboards.project.images.images \
import urls as image_urls import urls as image_urls
@ -28,9 +29,10 @@ from openstack_dashboard.dashboards.project.images import views
if settings.ANGULAR_FEATURES['images_panel']: if settings.ANGULAR_FEATURES['images_panel']:
title = _("Images")
# New angular images # New angular images
urlpatterns = [ urlpatterns = [
url(r'^$', AngularIndexView.as_view(), name='index'), url(r'^$', AngularIndexView.as_view(title=title), name='index'),
url(r'', include(image_urls, namespace='images')), url(r'', include(image_urls, namespace='images')),
url(r'', include(snapshot_urls, namespace='snapshots')), url(r'', include(snapshot_urls, namespace='snapshots')),
] ]

View File

@ -13,9 +13,11 @@
# under the License. # under the License.
from django.conf.urls import url from django.conf.urls import url
from django.utils.translation import ugettext_lazy as _
from horizon.browsers.views import AngularIndexView from horizon.browsers.views import AngularIndexView
title = _("Volumes")
urlpatterns = [ urlpatterns = [
url('', AngularIndexView.as_view(), name='index'), url('', AngularIndexView.as_view(title=title), name='index'),
] ]

View File

@ -1,6 +1,6 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Horizon" %}{% endblock %} {% block title %}{{ title }}{% endblock %}
{% block breadcrumb_nav %}{% endblock %} {% block breadcrumb_nav %}{% endblock %}