Merge lp:~huwshimi/juju-gui/new-header into lp:juju-gui/experimental

Proposed by Huw Wilkins
Status: Needs review
Proposed branch: lp:~huwshimi/juju-gui/new-header
Merge into: lp:juju-gui/experimental
Diff against target: 409 lines (+135/-145)
9 files modified
app/app.js (+1/-1)
app/index.html (+29/-40)
app/views/service.js (+1/-1)
app/views/utils.js (+1/-1)
lib/views/base/header.less (+94/-0)
lib/views/stylesheet.less (+5/-98)
test/test_application_notifications.js (+1/-1)
test/test_environment_view.js (+1/-1)
test/test_notifications.js (+2/-2)
To merge this branch: bzr merge lp:~huwshimi/juju-gui/new-header
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+155898@code.launchpad.net

Commit message

Updated header to match the new design.

Description of the change

CHANGES:
Moved header css to own file.
Renamed classes and removed HTML that were specific Bootstrap.
Updated tests.
Set main header to use an id as there should only ever be one.
Updated colours and positioning to new design.
Added new logo file. Will update this again when we have an SVG of it.
Removed unnecessary HTML and made more semantically correct.
Re-ordered CSS to make more sense with the corresponding HTML and made it
more consistent.
Removed old image files.

TODO:
The new header is not yet responsive. That probably isn't worth doing until
we've moved the charm panel and removed the link and search from the header.
The notification button still uses Bootstrap and has not yet been styled
as per the new design.

To post a comment you must log in.

Unmerged revisions

464. By Huw Wilkins

Styled header to match new design.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'app/app.js'
--- app/app.js 2013-03-26 16:09:53 +0000
+++ app/app.js 2013-03-28 06:55:24 +0000
@@ -403,7 +403,7 @@
403403
404 // Halts the default navigation on the juju logo to allow us to show404 // Halts the default navigation on the juju logo to allow us to show
405 // the real root view without namespaces405 // the real root view without namespaces
406 var navNode = Y.one('#nav-brand-env');406 var navNode = Y.one('#header-brand');
407 // Tests won't have this node.407 // Tests won't have this node.
408 if (navNode) {408 if (navNode) {
409 navNode.on('click', function(e) {409 navNode.on('click', function(e) {
410410
=== removed file 'app/assets/images/alert_icon.png'
411Binary files app/assets/images/alert_icon.png 2012-09-20 18:42:45 +0000 and app/assets/images/alert_icon.png 1970-01-01 00:00:00 +0000 differ411Binary files app/assets/images/alert_icon.png 2012-09-20 18:42:45 +0000 and app/assets/images/alert_icon.png 1970-01-01 00:00:00 +0000 differ
=== added file 'app/assets/images/header_nav_border.jpg'
412Binary files app/assets/images/header_nav_border.jpg 1970-01-01 00:00:00 +0000 and app/assets/images/header_nav_border.jpg 2013-03-28 06:55:24 +0000 differ412Binary files app/assets/images/header_nav_border.jpg 1970-01-01 00:00:00 +0000 and app/assets/images/header_nav_border.jpg 2013-03-28 06:55:24 +0000 differ
=== added file 'app/assets/images/juju_logo_header.png'
413Binary files app/assets/images/juju_logo_header.png 1970-01-01 00:00:00 +0000 and app/assets/images/juju_logo_header.png 2013-03-28 06:55:24 +0000 differ413Binary files app/assets/images/juju_logo_header.png 1970-01-01 00:00:00 +0000 and app/assets/images/juju_logo_header.png 2013-03-28 06:55:24 +0000 differ
=== removed file 'app/assets/images/top_bar.png'
414Binary files app/assets/images/top_bar.png 2012-09-20 18:42:45 +0000 and app/assets/images/top_bar.png 1970-01-01 00:00:00 +0000 differ414Binary files app/assets/images/top_bar.png 2012-09-20 18:42:45 +0000 and app/assets/images/top_bar.png 1970-01-01 00:00:00 +0000 differ
=== modified file 'app/index.html'
--- app/index.html 2013-03-26 16:09:53 +0000
+++ app/index.html 2013-03-28 06:55:24 +0000
@@ -74,46 +74,35 @@
74 <div id="viewport-wrapper">74 <div id="viewport-wrapper">
75 <div id="vp-left-border"></div>75 <div id="vp-left-border"></div>
76 <div id="viewport">76 <div id="viewport">
77 <div class="navbar">77 <div id="header">
78 <div id="nav-brand-env">78 <div id="header-brand">
79 <span>79 <a class="brand" href="/">
80 <a class="brand" href="/">80 <i class="sprite juju_logo_header" title="Juju GUI"></i>
81 <i class="sprite juju_logo" title="Juju GUI"></i>81 </a>
82 </a>82 <i class="sprite environment_icon"></i>
83 </span>83 <span id="environment-name"></span>
84 <span class="nav-container">84 <span id="provider-type" class="provider-type"></span>
85 <span class="nav-section">85 </div>
86 <i class="sprite environment_icon"></i>86 <ul id="header-nav" class="nav">
87 <span id="environment-name"></span>87 <li>
88 <span id="provider-type" class="provider-type"></span>88 <span id="notifications"></span>
89 </span>89 Alerts
90 </span>90 </li>
91 </div>91 <li>
92 <div id="nav-alerts-charms">92 <a href="/logout/" id="logout-trigger">Logout</a>
93 <span class="nav-container">93 </li>
94 <span class="nav-section">94 <li id="charm-search-trigger-container">
95 <i class="sprite alert_icon"></i>95 <span id="charm-search-trigger">
96 Alerts96 <i id="charm-search-icon" class="sprite charm_icon"></i>
97 <span id="notifications"></span>97 Charms
98 </span>98 <i id="charm-search-chevron"
99 </span>99 class="sprite chevron_down"></i>
100 <span class="nav-container">100 </span>
101 <span class="nav-section active-border">101 <input type="text" id="charm-search-field"
102 <a href="/logout/" id="logout-trigger">Logout</a>102 required="required" placeholder="Search for a charm" />
103 </span>103 </li>
104 </span>104 </ul>
105 <span class="nav-container" id="charm-search-trigger-container">105 <div class="gutter"></div>
106 <span class="nav-section active-border">
107 <span id="charm-search-trigger">
108 <i id="charm-search-icon" class="sprite charm_icon"></i>
109 Charms
110 <i id="charm-search-chevron" class="sprite chevron_down"></i>
111 </span>
112 <input type="text" id="charm-search-field"
113 required="required" placeholder="Search for a charm" />
114 </span>
115 </span>
116 </div>
117 </div>106 </div>
118107
119 <div id="content">108 <div id="content">
120109
=== modified file 'app/views/service.js'
--- app/views/service.js 2013-03-26 21:13:04 +0000
+++ app/views/service.js 2013-03-28 06:55:24 +0000
@@ -398,7 +398,7 @@
398 viewContainer = container.one('.view-container');398 viewContainer = container.one('.view-container');
399 if (viewContainer) {399 if (viewContainer) {
400 Y.fire('beforePageSizeRecalculation');400 Y.fire('beforePageSizeRecalculation');
401 var navbarHeight = getHeight(Y.one('.navbar')),401 var navbarHeight = getHeight(Y.one('#header')),
402 windowHeight = container.get('winHeight'),402 windowHeight = container.get('winHeight'),
403 headerHeight = getHeight(container.one(403 headerHeight = getHeight(container.one(
404 '.service-header-partial')),404 '.service-header-partial')),
405405
=== modified file 'app/views/utils.js'
--- app/views/utils.js 2013-03-26 21:13:04 +0000
+++ app/views/utils.js 2013-03-28 06:55:24 +0000
@@ -988,7 +988,7 @@
988 var containerHeight = Y.one('body').get(988 var containerHeight = Y.one('body').get(
989 primary ? 'winHeight' : 'docHeight'),989 primary ? 'winHeight' : 'docHeight'),
990 bottomNavbar = Y.one('.bottom-navbar'),990 bottomNavbar = Y.one('.bottom-navbar'),
991 navbar = Y.one('.navbar'),991 navbar = Y.one('#header'),
992 viewport = Y.one('#viewport'),992 viewport = Y.one('#viewport'),
993 result = {height: minheight || 0, width: minwidth || 0};993 result = {height: minheight || 0, width: minwidth || 0};
994 if (containerHeight && navbar && viewport) {994 if (containerHeight && navbar && viewport) {
995995
=== added directory 'lib/views/base'
=== added file 'lib/views/base/header.less'
--- lib/views/base/header.less 1970-01-01 00:00:00 +0000
+++ lib/views/base/header.less 2013-03-28 06:55:24 +0000
@@ -0,0 +1,94 @@
1#header {
2 position: relative;
3 height: 76px;
4 margin: -87px 0 0 0;
5 padding-top: 12px;
6 background-color: #505050;
7 border-bottom: 2px solid #606060;
8 color: @navbar-color;
9
10 #header-brand {
11 float: left;
12 margin: 0 0 12px 20px;
13
14 .brand {
15 display: inline-block;
16 margin-right: 26px;
17 padding: 0;
18 }
19 .provider-type {
20 font-size: 0.7em;
21 }
22 }
23 #header-nav {
24 float: right;
25 margin: 3px 18px 0 0;
26
27 li {
28 display: inline-block;
29 padding: 6px 21px;
30 background: transparent
31 url(/juju-ui/assets/images/header_nav_border.jpg)
32 repeat-y top left;
33
34 #charm-search-trigger {
35 cursor: pointer;
36 }
37 #logout-trigger {
38 display: inline-block;
39 padding: 3px 0 7px 0;
40 }
41 #notifications {
42 position: relative;
43 }
44 .btn {
45 margin: 0 5px;
46 }
47 input {
48 height: 23px;
49 width: 128px;
50 background: url(/juju-ui/assets/images/searchbox_icon.png)
51 no-repeat 4px 4px whiteSmoke;
52 margin: -3px 10px 0 10px;
53 padding: 3px 3px 3px 26px;
54 font-style: italic;
55 font-size: 0.9em;
56
57 &:valid {
58 background: white;
59 padding: 3px;
60 width: 151px;
61 font-style: normal;
62 font-size: 1em;
63 }
64 &:focus {
65 color: gray;
66 border-color: rgba(82, 168, 236, 0.8);
67 outline: 0;
68 outline: thin dotted 9;
69 box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
70 0 0 8px rgba(82, 168, 236, 0.6);
71 }
72 }
73 #charm-search-trigger-container {
74 width: @charm-panel-width - 39px;
75 white-space: nowrap;
76 border-left: 1px solid transparent;
77 &.active-border {
78 border-left-color: darkgray;
79 .create-box-shadow(inset 1px 0 0 lightgray);
80 }
81 }
82 a, a:hover, a:visited, a:active {
83 color: @navbar-color;
84 text-decoration: none;
85 }
86 }
87 }
88 .gutter {
89 clear: both;
90 height: 16px;
91 background-color: #404040;
92 border-top: 2px solid #000;
93 }
94}
095
=== modified file 'lib/views/stylesheet.less'
--- lib/views/stylesheet.less 2013-03-27 03:08:15 +0000
+++ lib/views/stylesheet.less 2013-03-28 06:55:24 +0000
@@ -21,7 +21,7 @@
21@charm-panel-configure-color: #2F2A27;21@charm-panel-configure-color: #2F2A27;
22@charm-panel-padding-left: 10px;22@charm-panel-padding-left: 10px;
23@charm-panel-width: 292px;23@charm-panel-width: 292px;
24@navbar-color: #2D2D2D!important;24@navbar-color: #eeeeee;
2525
2626
27body {27body {
@@ -108,102 +108,6 @@
108 }108 }
109}109}
110110
111.navbar {
112 margin-top: -87px;
113 margin-bottom: 0;
114 height: 87px;
115 min-width: 800px;
116 background: url(/juju-ui/assets/images/top_bar.png) repeat-x;
117 padding: 0;
118 position: relative;
119 color: @navbar-color;
120 .brand {
121 margin: 12px 26px 6px 10px;
122 padding: 0;
123 }
124 > div {
125 padding: 0;
126 .nav-container {
127 display: inline-block;
128 height: 44px;
129 margin: 2px 0 0 0;
130 padding: 20px 0 4px;
131 &#charm-search-trigger-container {
132 width: @charm-panel-width;
133 white-space: nowrap;
134 border-left: 1px solid transparent;
135 &.active-border {
136 border-left-color: darkgray;
137 .create-box-shadow(inset 1px 0 0 lightgray);
138 }
139 }
140 .nav-section {
141 border-left: 1px solid transparent;
142 &.active-border {
143 border-left-color: lightgray;
144 }
145 display: inline-block;
146 padding: 4px 10px;
147 #charm-search-trigger {
148 cursor: pointer;
149 }
150 #logout-trigger {
151 display: inline-block;
152 padding: 5px 0 8px 5px;
153 }
154 .btn {
155 margin: 0 5px;
156 }
157 input {
158 height: 23px;
159 width: 128px;
160 background: url(/juju-ui/assets/images/searchbox_icon.png)
161 no-repeat 4px 4px whiteSmoke;
162 margin: 0 10px;
163 padding: 3px 3px 3px 26px;
164 font-style: italic;
165 font-size: 0.9em;
166 &:valid {
167 background: white;
168 padding: 3px;
169 width: 151px;
170 font-style: normal;
171 font-size: 1em;
172 }
173 &:focus {
174 color: gray;
175 border-color: rgba(82, 168, 236, 0.8);
176 outline: 0;
177 outline: thin dotted 9;
178 box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
179 0 0 8px rgba(82, 168, 236, 0.6);
180 }
181 }
182 a, a:hover, a:visited, a:active {
183 color: @navbar-color;
184 text-decoration: none;
185 }
186 }
187 }
188 span:first-child .nav-section {
189 border-left: none;
190 padding: 0 6px;
191 }
192 &#nav-alerts-charms {
193 float: right;
194 .nav-container:first-child .nav-section {
195 position: relative;
196 }
197 }
198 &#nav-brand-env .nav-container {
199 float: left;
200 .provider-type {
201 font-size: 0.7em;
202 }
203 }
204 }
205}
206
207.bottom-navbar {111.bottom-navbar {
208 min-width: 800px;112 min-width: 800px;
209 height: 50px;113 height: 50px;
@@ -818,7 +722,7 @@
818 &.charm-filter-picker {722 &.charm-filter-picker {
819 left: 11px;723 left: 11px;
820 padding-bottom: 5px;724 padding-bottom: 5px;
821 @top: 0px;725 @top: 4px;
822 top: @top;726 top: @top;
823 .create-picker(270px, @top, @top, initial);727 .create-picker(270px, @top, @top, initial);
824 .picker-expanded .picker-list {728 .picker-expanded .picker-list {
@@ -1639,6 +1543,9 @@
1639 }1543 }
1640}1544}
16411545
1546/** Base **/
1547@import "base/header.less";
1548
1642/** SubApps **/1549/** SubApps **/
1643@import "browser/main.less";1550@import "browser/main.less";
16441551
16451552
=== modified file 'test/test_application_notifications.js'
--- test/test_application_notifications.js 2013-03-25 15:04:06 +0000
+++ test/test_application_notifications.js 2013-03-28 06:55:24 +0000
@@ -248,7 +248,7 @@
248248
249 it('should add a notification for "permissionDenied" exceptions (app)',249 it('should add a notification for "permissionDenied" exceptions (app)',
250 function() {250 function() {
251 var logoNode = Y.Node.create('<div id="nav-brand-env"></div>');251 var logoNode = Y.Node.create('<div id="header-brand"></div>');
252 Y.one('body').append(logoNode);252 Y.one('body').append(logoNode);
253 var app = new juju.App();253 var app = new juju.App();
254 app.env.fire('permissionDenied', {title: 'title', message: 'message'});254 app.env.fire('permissionDenied', {title: 'title', message: 'message'});
255255
=== modified file 'test/test_environment_view.js'
--- test/test_environment_view.js 2013-03-26 16:09:53 +0000
+++ test/test_environment_view.js 2013-03-28 06:55:24 +0000
@@ -625,7 +625,7 @@
625 function() {625 function() {
626 // The height of a navbar is used in calculating the viewport size,626 // The height of a navbar is used in calculating the viewport size,
627 // so add a temporary one to the DOM627 // so add a temporary one to the DOM
628 var navbar = Y.Node.create('<div class="navbar" ' +628 var navbar = Y.Node.create('<div id="header" ' +
629 'style="height:70px;">Navbar</div>');629 'style="height:70px;">Navbar</div>');
630 Y.one('body').append(navbar);630 Y.one('body').append(navbar);
631 var viewport = Y.Node.create('<div id="viewport" ' +631 var viewport = Y.Node.create('<div id="viewport" ' +
632632
=== modified file 'test/test_notifications.js'
--- test/test_notifications.js 2013-03-20 20:40:10 +0000
+++ test/test_notifications.js 2013-03-28 06:55:24 +0000
@@ -72,7 +72,7 @@
72 juju = Y.namespace('juju');72 juju = Y.namespace('juju');
73 models = Y.namespace('juju.models');73 models = Y.namespace('juju.models');
74 views = Y.namespace('juju.views');74 views = Y.namespace('juju.views');
75 logoNode = Y.Node.create('<div id="nav-brand-env"></div>');75 logoNode = Y.Node.create('<div id="header-brand"></div>');
76 Y.one('body').append(logoNode);76 Y.one('body').append(logoNode);
77 done();77 done();
78 });78 });
@@ -188,7 +188,7 @@
188188
189 it('must be able to include and show object links', function() {189 it('must be able to include and show object links', function() {
190 var container = Y.Node.create('<div id="test">'),190 var container = Y.Node.create('<div id="test">'),
191 logoNode = Y.Node.create('<div id="nav-brand-env"></div>'),191 logoNode = Y.Node.create('<div id="header-brand"></div>'),
192 conn = new(Y.namespace('juju-tests.utils')).SocketStub(),192 conn = new(Y.namespace('juju-tests.utils')).SocketStub(),
193 env = juju.newEnvironment({conn: conn}),193 env = juju.newEnvironment({conn: conn}),
194 app = new Y.juju.App({env: env, container: container}),194 app = new Y.juju.App({env: env, container: container}),

Subscribers

People subscribed via source and target branches