diff --git a/horizon/browsers/views.py b/horizon/browsers/views.py index 75dfe6e325..3f6cf33d0a 100644 --- a/horizon/browsers/views.py +++ b/horizon/browsers/views.py @@ -61,3 +61,9 @@ class ResourceBrowserView(MultiTableView): class AngularIndexView(generic.TemplateView): 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 diff --git a/openstack_dashboard/dashboards/admin/flavors/urls.py b/openstack_dashboard/dashboards/admin/flavors/urls.py index 5d8f8c7812..b3d0b243cf 100644 --- a/openstack_dashboard/dashboards/admin/flavors/urls.py +++ b/openstack_dashboard/dashboards/admin/flavors/urls.py @@ -18,16 +18,19 @@ from django.conf import settings from django.conf.urls import url +from django.utils.translation import ugettext_lazy as _ from horizon.browsers.views import AngularIndexView from openstack_dashboard.dashboards.admin.flavors import views if settings.ANGULAR_FEATURES['flavors_panel']: + title = _("Flavors") # New angular panel urlpatterns = [ - url(r'^$', AngularIndexView.as_view(), name='index'), - url(r'^create/$', AngularIndexView.as_view(), name='create'), - url(r'^(?P[^/]+)/update/$', AngularIndexView.as_view(), + url(r'^$', AngularIndexView.as_view(title=title), name='index'), + url(r'^create/$', AngularIndexView.as_view(title=title), + name='create'), + url(r'^(?P[^/]+)/update/$', AngularIndexView.as_view(title=title), name='index'), ] else: diff --git a/openstack_dashboard/dashboards/admin/images/urls.py b/openstack_dashboard/dashboards/admin/images/urls.py index c8e1238175..6d75d5c70f 100644 --- a/openstack_dashboard/dashboards/admin/images/urls.py +++ b/openstack_dashboard/dashboards/admin/images/urls.py @@ -18,15 +18,17 @@ from django.conf import settings from django.conf.urls import url +from django.utils.translation import ugettext_lazy as _ from horizon.browsers.views import AngularIndexView from openstack_dashboard.dashboards.admin.images import views if settings.ANGULAR_FEATURES['images_panel']: + title = _("Images") # New angular images urlpatterns = [ - url(r'^$', AngularIndexView.as_view(), name='index'), + url(r'^$', AngularIndexView.as_view(title=title), name='index'), url(r'^(?P[^/]+)/detail/$', - AngularIndexView.as_view(), name='detail'), + AngularIndexView.as_view(title=title), name='detail'), ] else: urlpatterns = [ diff --git a/openstack_dashboard/dashboards/identity/users/urls.py b/openstack_dashboard/dashboards/identity/users/urls.py index 74f227f843..1c305cc64a 100644 --- a/openstack_dashboard/dashboards/identity/users/urls.py +++ b/openstack_dashboard/dashboards/identity/users/urls.py @@ -19,14 +19,17 @@ from django.conf import settings 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 if settings.ANGULAR_FEATURES.get('users_panel', False): + title = _("Users") # new angular panel urlpatterns = [ - url(r'^$', views.AngularIndexView.as_view(), name='index'), + url(r'^$', AngularIndexView.as_view(title=title), name='index'), ] else: urlpatterns = [ diff --git a/openstack_dashboard/dashboards/identity/users/views.py b/openstack_dashboard/dashboards/identity/users/views.py index 0b811adab8..1fdf2b3b65 100644 --- a/openstack_dashboard/dashboards/identity/users/views.py +++ b/openstack_dashboard/dashboards/identity/users/views.py @@ -25,7 +25,6 @@ from django.core.urlresolvers import reverse_lazy from django.utils.decorators import method_decorator # noqa from django.utils.translation import ugettext_lazy as _ from django.views.decorators.debug import sensitive_post_parameters # noqa -from django.views import generic from horizon import exceptions from horizon import forms @@ -45,10 +44,6 @@ from openstack_dashboard.dashboards.identity.users \ LOG = logging.getLogger(__name__) -class AngularIndexView(generic.TemplateView): - template_name = 'angular.html' - - class IndexView(tables.DataTableView): table_class = project_tables.UsersTable template_name = 'identity/users/index.html' diff --git a/openstack_dashboard/dashboards/project/images/images/urls.py b/openstack_dashboard/dashboards/project/images/images/urls.py index 6784c4ff5f..68b3962bc2 100644 --- a/openstack_dashboard/dashboards/project/images/images/urls.py +++ b/openstack_dashboard/dashboards/project/images/images/urls.py @@ -18,13 +18,15 @@ from django.conf import settings from django.conf.urls import url +from django.utils.translation import ugettext_lazy as _ from horizon.browsers.views import AngularIndexView from openstack_dashboard.dashboards.project.images.images import views if settings.ANGULAR_FEATURES['images_panel']: + title = _("Images") urlpatterns = [ - url(r'^(?P[^/]+)/$', AngularIndexView.as_view(), + url(r'^(?P[^/]+)/$', AngularIndexView.as_view(title=title), name='detail'), ] else: diff --git a/openstack_dashboard/dashboards/project/images/urls.py b/openstack_dashboard/dashboards/project/images/urls.py index 01fa9b0186..c0bf79c28f 100644 --- a/openstack_dashboard/dashboards/project/images/urls.py +++ b/openstack_dashboard/dashboards/project/images/urls.py @@ -19,6 +19,7 @@ from django.conf import settings from django.conf.urls import include from django.conf.urls import url +from django.utils.translation import ugettext_lazy as _ from horizon.browsers.views import AngularIndexView from openstack_dashboard.dashboards.project.images.images \ import urls as image_urls @@ -28,9 +29,10 @@ from openstack_dashboard.dashboards.project.images import views if settings.ANGULAR_FEATURES['images_panel']: + title = _("Images") # New angular images 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(snapshot_urls, namespace='snapshots')), ] diff --git a/openstack_dashboard/dashboards/project/ngvolumes/urls.py b/openstack_dashboard/dashboards/project/ngvolumes/urls.py index fb29ed698a..22ff976cf8 100644 --- a/openstack_dashboard/dashboards/project/ngvolumes/urls.py +++ b/openstack_dashboard/dashboards/project/ngvolumes/urls.py @@ -13,9 +13,11 @@ # under the License. from django.conf.urls import url +from django.utils.translation import ugettext_lazy as _ from horizon.browsers.views import AngularIndexView +title = _("Volumes") urlpatterns = [ - url('', AngularIndexView.as_view(), name='index'), + url('', AngularIndexView.as_view(title=title), name='index'), ] diff --git a/openstack_dashboard/templates/angular.html b/openstack_dashboard/templates/angular.html index 857b41fa15..1a5bf3b930 100644 --- a/openstack_dashboard/templates/angular.html +++ b/openstack_dashboard/templates/angular.html @@ -1,6 +1,6 @@ {% extends 'base.html' %} {% load i18n %} -{% block title %}{% trans "Horizon" %}{% endblock %} +{% block title %}{{ title }}{% endblock %} {% block breadcrumb_nav %}{% endblock %}