Enable breadcrumbs for AngularIndexView

This patch enables breadcrumb navigation for panels using
horizon.browsers.views.AngularIndexView.

Change-Id: If6d100472e61c1cb00e18c56e25300b45d8a7098
Needed-By: Iae5edc9d370fbda20889a043a2574bd034170881
This commit is contained in:
Shu Muto 2017-03-07 13:50:50 +09:00 committed by Rob Cresswell
parent a3e28c1b6c
commit 21e3d07644
2 changed files with 16 additions and 2 deletions

View File

@ -60,10 +60,26 @@ class ResourceBrowserView(MultiTableView):
class AngularIndexView(generic.TemplateView):
'''View for Angularized panel
title: to display title for browser window or tab.
page_title: to display current position in breadcrumb.
Sample usage is as follows.
from horizon.browsers import views
views.AngularIndexView.as_view(title="Images")
views.AngularIndexView.as_view(title="Browser Title",
page_title="Page Title")
'''
template_name = 'angular.html'
title = _("Horizon")
page_title = None
def get_context_data(self, **kwargs):
context = super(AngularIndexView, self).get_context_data(**kwargs)
context["title"] = self.title
if self.page_title is None:
context["page_title"] = self.title
else:
context["page_title"] = self.page_title
return context

View File

@ -2,8 +2,6 @@
{% load i18n %}
{% block title %}{{ title }}{% endblock %}
{% block breadcrumb_nav %}{% endblock %}
{% block page_header %}
{% endblock %}