20 Commits

Author SHA1 Message Date
Radomir Dopieralski
4a89303231 Clean up the syntax of html attributes to always use double quotes
Our templates are very inconsistent and sometimes even use single and
double quotes in the same tag. This is an attempt to clean it up a
little and use double quotes everywhere.

In addition, I have run into a problem with single quotes being
incorrectly escaped by the Django compressor, and I want to see if
this will help with the issue.

Change-Id: I2d5137a87ed65c6abef38a49264346f917a1c85a
2023-04-05 11:00:26 +02:00
Radomir Dopieralski
34a0159d1a Add system scope support to context switcher
Change-Id: Idd2ec7ae6e978a358b4b3639e86cadae06c90976
2021-11-26 14:09:46 +01:00
Akihiro Motoki
28b457bc62 UT: Detect template rendering errors
This commit enables template debug option to detect errors
in template rendering in unit tests.

Several errors in template rendering are found by enabling the
debug option and they are fixed in this commit.

Related-Bug: #1809983
Change-Id: I1a2d19f2eae62e16f02d3386abd65527bac4e7a0
2019-01-31 21:29:33 +09:00
Bo Wang
0c91293a79 Pass page_url instead of whole request to render
only page url is required to be rendered in template.
move more logic code back to python.

Change-Id: I9f52d030f65084e760f37a439de02b73ef94497f
2016-05-31 10:34:52 +00:00
space
edeb9ddaf9 Change projects redirects to overview page
I read the code of switch region and modify the code of switch project.
 Now change project will redirect to the original page.

Change-Id: Ia19eaefa5de884ac4d5900c93138922f00e9c692
Closes-Bug: #1549560
2016-03-12 11:17:21 +08:00
Diana Whitten
0bfca75f45 Context Picker should inherit BS dropdown styles
The first step in the dynamic theme effort requires that the context
selection picker inherit properly from a dropdown menu, so that the
styles can be shared and the experience is matched.

Dynamic themes will use the 'select' experience of the context menu
but from within the user menu, so it was necessary to match the
experiences to minimize duplicated code.

The style of the context menu was extremely dependant on DOM structure
and therefore difficult to customize. This has been simplified by using
classes and attempting to keep specificity as low as possible.

Change-Id: Idb9e8f5c1d246688418f68e12fb53f094c01ea34
Partially-implements: blueprint horizon-dynamic-theme
Partially-Implements: blueprint bootstrap-html-standards
2016-02-10 04:23:15 +00:00
Diana Whitten
4b5886d276 Branding: Nav icon spacing should use css
The padding around the Top Nav Bar's Dropdown Icons have been done
with actual text spaces, instead of relying on padding that is set
via css. This makes it very difficult to customize the padding
around these elements at a global level.

Some contextual classes have been added for ease of branding-level
customization.

Change-Id: I6768135351637db8a950a4b44366880817ce2df3
Closes-bug: #1537608
2016-02-07 16:50:36 +00:00
Diana Whitten
a9bd8b2335 Branding: Context selector delim should be icon
The delimiter in the context selector should use an icon to enable
vast customization options.

Change-Id: I07551471213e79b6f7d6e1c95ccc7a605c2a9418
Closes-bug: #1537594
2016-01-24 21:37:19 -07:00
Diana Whitten
378623217d Branding: Horizon Header should be more composable
A recent branding effort exposed several aspects of the header
templates that need to be more composable to enable richer
customizations.

The Horizon _header.html template has many components within it:
region pickers, user menus, logos. All of these things are highly
desirable to customize, but because it is all contained in the same
template, a brander will have to override the entire template. This
is not ideal as it increase the cost of maintenance.

The splash section of the login page, the context selector, the logo
section of the header, the user menu and the region selector are now
composable to a much more granular level.  The top navigation menus
can now be used outside of existing within a list.  The templates
now allow use as normal, standalone dropdown items.

Also, the current primary color used for 'material' was highly
unpleasant with OpenStack Red.  Another color on the material design
palette was chosen, very close to the previous blue. See
https://www.google.com/design/spec/style/color.html#color-color-palette

To showcase this new composability, 'material' now shows how to
customize the logo and logo-splash beyond just replacing the png, but
now allowing the use of any type of image.  In this case, the
OpenStack logos have been upgraded with their svg counterparts.

It was also noted that the context selection menu was using the wrong
variable to set the color of its links. This was corrected.

Closes-Bug: #1518584

Change-Id: Ib544176b9836e17fc913170664646e1d10eda831
2016-01-14 20:44:37 -07:00
Rajat Vig
6698d26fba Set target to _self for Header Links
Angular Panels have enabled ngRoute and HTML5 which
allows Angular to handle routing which makes all
routes to pass via Angular.

Links that do not have route defintion as a result stop
working.
This can be fixed by specifying the target="_self" on the <a> tags.

This is already in place for the Sidebar. It needs to done for the
Header Links as well.

Closes-Bug: #1531734
Change-Id: Ida76b40fdf0b66ba3ee3af4d32701974c312af57
2016-01-08 19:51:03 +00:00
Rob Cresswell
f2b2289b4a Drop Django 1.7 support
Django 1.7 support ends in December 2015
(https://www.djangoproject.com/download/#supported-versions), so it
will not be supported by Mitaka release.

This patch removes many of the deprecation warnings:-

`RedirectView.permanent` change:
https://docs.djangoproject.com/en/1.8/ref/class-based-views/base/

`url` change:
https://docs.djangoproject.com/en/1.8/internals/deprecation/
See version 1.5 notes for the url and ssi template tag change

`django.forms.utils` change:
https://docs.djangoproject.com/en/1.8/internals/deprecation/
See version 1.9 notes

`firstof` change:
https://docs.djangoproject.com/en/1.8/internals/deprecation/
See version 1.8 notes for cycle and firstof template tags

Change-Id: If546c087e73d189daa92e5bd63f0533fcf19089f
Partially-Implements: blueprint drop-dj17
2015-11-16 11:55:38 +00:00
Diana Whitten
97939292eb Horizon Context Selection should be to the right
An unintended result of a recent refactor left the context picker css
without any love. The refactor of the topbar needs to have style
parity to its previous incantation.

It was noted that the design for the current context selection is not
a good pattern to follow for responsive design.  The menu grows
horizontally, which will make it difficult to see on smaller screens
as well as when it is displayed in the now responsive topbar.  The
original design still applies to larger screens, but now on smaller
screens, the menu will fall back to a vertically growing responsive
menu.

The nav-header color has been changed, because it was also the same
color as the 'disabled' nav item state, which was confusing.

Refactoring of the some of the context_selection.py code was required
in order to support wrapping the menus in <li> tagss without needing
to change their corresponding HTML files.  Since the files can be
used as templatetag templates outside of _header.html, it was best to
keep them as stand alone <ul> lists.

Change-Id: I6e7c7b6fed08d215bcf83941da1bf90b40cd17b2
closes-bug: #1483910
partially implements bp: bootstrap-html-standards
2015-08-14 10:48:45 -07:00
Diana Whitten
5b3af1f0d5 Top Nav is responsive and inherits from its theme
Horizon's top nav now uses <nav> and correcly implements
the Bootstrap HTML standards to make a responsive experience.

Partially-Implements: blueprint horizon-theme-css-reorg
Partially-Implements: blueprint bootstrap-html-standards

Change-Id: I73c5529ae477a17f10a17946ac7120969578a0ba
2015-08-03 10:44:04 -07:00
Jenkins
24f85b850a Merge "Add anti-ClickJack XFS hardening for old browsers" 2015-07-03 02:53:10 +00:00
Brian Tully
056151cc70 Add anti-ClickJack XFS hardening for old browsers
A Cross-Frame Scripting (XFS) vulnerability can allow an attacker to
load the vulnerable application inside an HTML iframe tag on a
malicious page. An attacker could use XFS to devise a Clickjacking
attack to conduct phishing, frame sniffing, social engineering or
Cross-Site Request Forgery attacks. Although many pages within Horizon
leverage the X-Frame-Options header with the recommended SAMEORIGIN
policy, some (still popular) older browsers don’t support this setting.
Namely, browsers older than IE 8 and Firefox 3.6.9 don’t recognize the
header and are thus vulnerable to an attack known as ClickJacking
unless an additional mitigating control is present.

To support legacy browsers, a suggested best practice is to add a
frame breaking script to the base/global template file.

Reference: http://tinyurl.com/anticlickjack

Change-Id: Ibd7acd0d7b4c4d58afcd59f025735bfc9e4c2957
Closes-Bug: 1461154
2015-07-02 12:57:35 -04:00
Diana Whitten
9ae749512d Icon font carets should be used over caret class
Icon font carets should be used over the caret class because they
offer more flexibility while themeing. An Icon Font will grow with
the font size dynamically, whereas the caret class is hardcoded to
a specific set of sizes. Also, the fa-caret-down has the same feel
of the other icons --> showing a slight border radius.

Change-Id: I01c01df96d9d3d1bf07b009f94776d53389e0c32
Partially-Implements: blueprint horizon-theme-icons
2015-06-25 11:14:27 -07:00
Radomir Dopieralski
d7ad91e8a8 Replace the glyphicons with font awesome icons
There are still some scss mixins that use the old (from bootstrap 2)
image icons. Replacing them will have to be done in a separate patch.

I also link to the css file, instead of scss, because django-pyscss has
some problems finding the right file. This is reported and will have to
be fixed upstream to unbundle bootstrap.

Change-Id: I67e94a9283bcceef8fc89343f3f5b2d7e0d4449f
Partial-implement: blueprint font-icons-replace
2014-12-01 14:36:38 -07:00
Jiri Tomasek
fca44e6642 Restyled topbar to resemble UX guidelines
Also moved topbar styling into separate component
Adjusted context selection to match other dropdowns, merged it with topbar styles file

Partially-Implements: blueprint css-breakdown
Partially-Implements: blueprint navigation-styling
Change-Id: If30b85f5415a3e8d0416fdafeb233b722feb014f
2014-10-16 09:38:55 +02:00
David Lyle
7a2c528f17 Fixing template compatibility
New template files missing proper url import. Adding imports.

Closes-Bug: #1372334
Change-Id: I053996065ada3977432d3d46eb5e6724cae31e97
2014-09-22 11:32:00 -06:00
Thai Tran
7dd2aa8b4a Context selection for project and region
Providing the mechanism to easily switch between projects and regions.

Only shows domain info if OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT is set
to True in settings.

Will add domain switching for v3 once support for it is complete.
Will add advance filtering rules in follow up patch.

Co-Authored-By: David Lyle <david.lyle@hp.com>

Implements: blueprint context-selection

Change-Id: Ie6e81eebe822ab2394b07345d148a1c06a33a25f
2014-09-02 09:38:27 -06:00