
This change is to introduce a flexible mechanism for projects to add content to horizon's navbar. - Introduces a new plugin file variable called ADD_HEADER_SECTIONS, which will take a list of views. These are template views that will be used to render individual header sections. - There is a new view in openstack_dashboard/views.py to cycle through these added views and combine them into the complete header to be added to the navbar. - This view is queried by newly added javascript after page load. On response it is inserted into the page's navbar. If more than one header is present, the first will be shown in the navbar, while the rest are added to a drop-down menu. - The currently displayed header can be changed by clicking on a new header in the drop-down; this is stored in a cookie to persist the selection between pages. - Unit tests were modified/added to verify the new plugin entry can be parsed successfully and the main header view can parse a plugin's view successfully Change-Id: I177b69ec4e78c17f827e540a7e669af1c29e8b59 Implements: blueprint extensible-header Signed-off-by: Tyler Smith <tyler.smith@windriver.com>
44 lines
1.6 KiB
HTML
Executable File
44 lines
1.6 KiB
HTML
Executable File
{% load i18n %}
|
|
|
|
{% spaceless %}
|
|
<nav class="navbar navbar-default navbar-fixed-top">
|
|
<div class="container-fluid">
|
|
<!-- Brand and toggle get grouped for better mobile display -->
|
|
<div class="navbar-header">
|
|
{% include "header/_brand.html" %}
|
|
|
|
<button id="sidebar-toggle" type="button" class="navbar-toggle pull-left">
|
|
<span class="sr-only">{% trans "Toggle navigation" %}</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
|
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
|
|
<span class="sr-only">{% trans "Toggle navigation" %}</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Collect the nav links, forms, and other content for toggling -->
|
|
<div class="collapse navbar-collapse" id="navbar-collapse">
|
|
<ul class="nav navbar-nav">
|
|
{% include "header/_context_selection.html" %}
|
|
</ul>
|
|
|
|
<ul class="nav navbar-nav navbar-right">
|
|
<li id="extensible-header" class="extensible-header"></li>
|
|
{% if profiler_enabled %}
|
|
{% include "developer/profiler/_mode_picker.html" %}
|
|
{% endif %}
|
|
{% include "header/_keystone_provider_selection.html" %}
|
|
{% include "header/_user_menu.html" %}
|
|
{% include "header/_region_selection.html" %}
|
|
</ul>
|
|
</div><!-- /.navbar-collapse -->
|
|
</div><!-- /.container-fluid -->
|
|
</nav>
|
|
{% endspaceless %}
|