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
1=== modified file 'app/app.js'
2--- app/app.js 2013-03-26 16:09:53 +0000
3+++ app/app.js 2013-03-28 06:55:24 +0000
4@@ -403,7 +403,7 @@
5
6 // Halts the default navigation on the juju logo to allow us to show
7 // the real root view without namespaces
8- var navNode = Y.one('#nav-brand-env');
9+ var navNode = Y.one('#header-brand');
10 // Tests won't have this node.
11 if (navNode) {
12 navNode.on('click', function(e) {
13
14=== removed file 'app/assets/images/alert_icon.png'
15Binary 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
16=== added file 'app/assets/images/header_nav_border.jpg'
17Binary 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
18=== added file 'app/assets/images/juju_logo_header.png'
19Binary 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
20=== removed file 'app/assets/images/top_bar.png'
21Binary 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
22=== modified file 'app/index.html'
23--- app/index.html 2013-03-26 16:09:53 +0000
24+++ app/index.html 2013-03-28 06:55:24 +0000
25@@ -74,46 +74,35 @@
26 <div id="viewport-wrapper">
27 <div id="vp-left-border"></div>
28 <div id="viewport">
29- <div class="navbar">
30- <div id="nav-brand-env">
31- <span>
32- <a class="brand" href="/">
33- <i class="sprite juju_logo" title="Juju GUI"></i>
34- </a>
35- </span>
36- <span class="nav-container">
37- <span class="nav-section">
38- <i class="sprite environment_icon"></i>
39- <span id="environment-name"></span>
40- <span id="provider-type" class="provider-type"></span>
41- </span>
42- </span>
43- </div>
44- <div id="nav-alerts-charms">
45- <span class="nav-container">
46- <span class="nav-section">
47- <i class="sprite alert_icon"></i>
48- Alerts
49- <span id="notifications"></span>
50- </span>
51- </span>
52- <span class="nav-container">
53- <span class="nav-section active-border">
54- <a href="/logout/" id="logout-trigger">Logout</a>
55- </span>
56- </span>
57- <span class="nav-container" id="charm-search-trigger-container">
58- <span class="nav-section active-border">
59- <span id="charm-search-trigger">
60- <i id="charm-search-icon" class="sprite charm_icon"></i>
61- Charms
62- <i id="charm-search-chevron" class="sprite chevron_down"></i>
63- </span>
64- <input type="text" id="charm-search-field"
65- required="required" placeholder="Search for a charm" />
66- </span>
67- </span>
68- </div>
69+ <div id="header">
70+ <div id="header-brand">
71+ <a class="brand" href="/">
72+ <i class="sprite juju_logo_header" title="Juju GUI"></i>
73+ </a>
74+ <i class="sprite environment_icon"></i>
75+ <span id="environment-name"></span>
76+ <span id="provider-type" class="provider-type"></span>
77+ </div>
78+ <ul id="header-nav" class="nav">
79+ <li>
80+ <span id="notifications"></span>
81+ Alerts
82+ </li>
83+ <li>
84+ <a href="/logout/" id="logout-trigger">Logout</a>
85+ </li>
86+ <li id="charm-search-trigger-container">
87+ <span id="charm-search-trigger">
88+ <i id="charm-search-icon" class="sprite charm_icon"></i>
89+ Charms
90+ <i id="charm-search-chevron"
91+ class="sprite chevron_down"></i>
92+ </span>
93+ <input type="text" id="charm-search-field"
94+ required="required" placeholder="Search for a charm" />
95+ </li>
96+ </ul>
97+ <div class="gutter"></div>
98 </div>
99
100 <div id="content">
101
102=== modified file 'app/views/service.js'
103--- app/views/service.js 2013-03-26 21:13:04 +0000
104+++ app/views/service.js 2013-03-28 06:55:24 +0000
105@@ -398,7 +398,7 @@
106 viewContainer = container.one('.view-container');
107 if (viewContainer) {
108 Y.fire('beforePageSizeRecalculation');
109- var navbarHeight = getHeight(Y.one('.navbar')),
110+ var navbarHeight = getHeight(Y.one('#header')),
111 windowHeight = container.get('winHeight'),
112 headerHeight = getHeight(container.one(
113 '.service-header-partial')),
114
115=== modified file 'app/views/utils.js'
116--- app/views/utils.js 2013-03-26 21:13:04 +0000
117+++ app/views/utils.js 2013-03-28 06:55:24 +0000
118@@ -988,7 +988,7 @@
119 var containerHeight = Y.one('body').get(
120 primary ? 'winHeight' : 'docHeight'),
121 bottomNavbar = Y.one('.bottom-navbar'),
122- navbar = Y.one('.navbar'),
123+ navbar = Y.one('#header'),
124 viewport = Y.one('#viewport'),
125 result = {height: minheight || 0, width: minwidth || 0};
126 if (containerHeight && navbar && viewport) {
127
128=== added directory 'lib/views/base'
129=== added file 'lib/views/base/header.less'
130--- lib/views/base/header.less 1970-01-01 00:00:00 +0000
131+++ lib/views/base/header.less 2013-03-28 06:55:24 +0000
132@@ -0,0 +1,94 @@
133+#header {
134+ position: relative;
135+ height: 76px;
136+ margin: -87px 0 0 0;
137+ padding-top: 12px;
138+ background-color: #505050;
139+ border-bottom: 2px solid #606060;
140+ color: @navbar-color;
141+
142+ #header-brand {
143+ float: left;
144+ margin: 0 0 12px 20px;
145+
146+ .brand {
147+ display: inline-block;
148+ margin-right: 26px;
149+ padding: 0;
150+ }
151+ .provider-type {
152+ font-size: 0.7em;
153+ }
154+ }
155+ #header-nav {
156+ float: right;
157+ margin: 3px 18px 0 0;
158+
159+ li {
160+ display: inline-block;
161+ padding: 6px 21px;
162+ background: transparent
163+ url(/juju-ui/assets/images/header_nav_border.jpg)
164+ repeat-y top left;
165+
166+ #charm-search-trigger {
167+ cursor: pointer;
168+ }
169+ #logout-trigger {
170+ display: inline-block;
171+ padding: 3px 0 7px 0;
172+ }
173+ #notifications {
174+ position: relative;
175+ }
176+ .btn {
177+ margin: 0 5px;
178+ }
179+ input {
180+ height: 23px;
181+ width: 128px;
182+ background: url(/juju-ui/assets/images/searchbox_icon.png)
183+ no-repeat 4px 4px whiteSmoke;
184+ margin: -3px 10px 0 10px;
185+ padding: 3px 3px 3px 26px;
186+ font-style: italic;
187+ font-size: 0.9em;
188+
189+ &:valid {
190+ background: white;
191+ padding: 3px;
192+ width: 151px;
193+ font-style: normal;
194+ font-size: 1em;
195+ }
196+ &:focus {
197+ color: gray;
198+ border-color: rgba(82, 168, 236, 0.8);
199+ outline: 0;
200+ outline: thin dotted 9;
201+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
202+ 0 0 8px rgba(82, 168, 236, 0.6);
203+ }
204+ }
205+ #charm-search-trigger-container {
206+ width: @charm-panel-width - 39px;
207+ white-space: nowrap;
208+ border-left: 1px solid transparent;
209+ &.active-border {
210+ border-left-color: darkgray;
211+ .create-box-shadow(inset 1px 0 0 lightgray);
212+ }
213+ }
214+ a, a:hover, a:visited, a:active {
215+ color: @navbar-color;
216+ text-decoration: none;
217+ }
218+ }
219+ }
220+ .gutter {
221+ clear: both;
222+ height: 16px;
223+ background-color: #404040;
224+ border-top: 2px solid #000;
225+ }
226+}
227
228=== modified file 'lib/views/stylesheet.less'
229--- lib/views/stylesheet.less 2013-03-27 03:08:15 +0000
230+++ lib/views/stylesheet.less 2013-03-28 06:55:24 +0000
231@@ -21,7 +21,7 @@
232 @charm-panel-configure-color: #2F2A27;
233 @charm-panel-padding-left: 10px;
234 @charm-panel-width: 292px;
235-@navbar-color: #2D2D2D!important;
236+@navbar-color: #eeeeee;
237
238
239 body {
240@@ -108,102 +108,6 @@
241 }
242 }
243
244-.navbar {
245- margin-top: -87px;
246- margin-bottom: 0;
247- height: 87px;
248- min-width: 800px;
249- background: url(/juju-ui/assets/images/top_bar.png) repeat-x;
250- padding: 0;
251- position: relative;
252- color: @navbar-color;
253- .brand {
254- margin: 12px 26px 6px 10px;
255- padding: 0;
256- }
257- > div {
258- padding: 0;
259- .nav-container {
260- display: inline-block;
261- height: 44px;
262- margin: 2px 0 0 0;
263- padding: 20px 0 4px;
264- &#charm-search-trigger-container {
265- width: @charm-panel-width;
266- white-space: nowrap;
267- border-left: 1px solid transparent;
268- &.active-border {
269- border-left-color: darkgray;
270- .create-box-shadow(inset 1px 0 0 lightgray);
271- }
272- }
273- .nav-section {
274- border-left: 1px solid transparent;
275- &.active-border {
276- border-left-color: lightgray;
277- }
278- display: inline-block;
279- padding: 4px 10px;
280- #charm-search-trigger {
281- cursor: pointer;
282- }
283- #logout-trigger {
284- display: inline-block;
285- padding: 5px 0 8px 5px;
286- }
287- .btn {
288- margin: 0 5px;
289- }
290- input {
291- height: 23px;
292- width: 128px;
293- background: url(/juju-ui/assets/images/searchbox_icon.png)
294- no-repeat 4px 4px whiteSmoke;
295- margin: 0 10px;
296- padding: 3px 3px 3px 26px;
297- font-style: italic;
298- font-size: 0.9em;
299- &:valid {
300- background: white;
301- padding: 3px;
302- width: 151px;
303- font-style: normal;
304- font-size: 1em;
305- }
306- &:focus {
307- color: gray;
308- border-color: rgba(82, 168, 236, 0.8);
309- outline: 0;
310- outline: thin dotted 9;
311- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
312- 0 0 8px rgba(82, 168, 236, 0.6);
313- }
314- }
315- a, a:hover, a:visited, a:active {
316- color: @navbar-color;
317- text-decoration: none;
318- }
319- }
320- }
321- span:first-child .nav-section {
322- border-left: none;
323- padding: 0 6px;
324- }
325- &#nav-alerts-charms {
326- float: right;
327- .nav-container:first-child .nav-section {
328- position: relative;
329- }
330- }
331- &#nav-brand-env .nav-container {
332- float: left;
333- .provider-type {
334- font-size: 0.7em;
335- }
336- }
337- }
338-}
339-
340 .bottom-navbar {
341 min-width: 800px;
342 height: 50px;
343@@ -818,7 +722,7 @@
344 &.charm-filter-picker {
345 left: 11px;
346 padding-bottom: 5px;
347- @top: 0px;
348+ @top: 4px;
349 top: @top;
350 .create-picker(270px, @top, @top, initial);
351 .picker-expanded .picker-list {
352@@ -1639,6 +1543,9 @@
353 }
354 }
355
356+/** Base **/
357+@import "base/header.less";
358+
359 /** SubApps **/
360 @import "browser/main.less";
361
362
363=== modified file 'test/test_application_notifications.js'
364--- test/test_application_notifications.js 2013-03-25 15:04:06 +0000
365+++ test/test_application_notifications.js 2013-03-28 06:55:24 +0000
366@@ -248,7 +248,7 @@
367
368 it('should add a notification for "permissionDenied" exceptions (app)',
369 function() {
370- var logoNode = Y.Node.create('<div id="nav-brand-env"></div>');
371+ var logoNode = Y.Node.create('<div id="header-brand"></div>');
372 Y.one('body').append(logoNode);
373 var app = new juju.App();
374 app.env.fire('permissionDenied', {title: 'title', message: 'message'});
375
376=== modified file 'test/test_environment_view.js'
377--- test/test_environment_view.js 2013-03-26 16:09:53 +0000
378+++ test/test_environment_view.js 2013-03-28 06:55:24 +0000
379@@ -625,7 +625,7 @@
380 function() {
381 // The height of a navbar is used in calculating the viewport size,
382 // so add a temporary one to the DOM
383- var navbar = Y.Node.create('<div class="navbar" ' +
384+ var navbar = Y.Node.create('<div id="header" ' +
385 'style="height:70px;">Navbar</div>');
386 Y.one('body').append(navbar);
387 var viewport = Y.Node.create('<div id="viewport" ' +
388
389=== modified file 'test/test_notifications.js'
390--- test/test_notifications.js 2013-03-20 20:40:10 +0000
391+++ test/test_notifications.js 2013-03-28 06:55:24 +0000
392@@ -72,7 +72,7 @@
393 juju = Y.namespace('juju');
394 models = Y.namespace('juju.models');
395 views = Y.namespace('juju.views');
396- logoNode = Y.Node.create('<div id="nav-brand-env"></div>');
397+ logoNode = Y.Node.create('<div id="header-brand"></div>');
398 Y.one('body').append(logoNode);
399 done();
400 });
401@@ -188,7 +188,7 @@
402
403 it('must be able to include and show object links', function() {
404 var container = Y.Node.create('<div id="test">'),
405- logoNode = Y.Node.create('<div id="nav-brand-env"></div>'),
406+ logoNode = Y.Node.create('<div id="header-brand"></div>'),
407 conn = new(Y.namespace('juju-tests.utils')).SocketStub(),
408 env = juju.newEnvironment({conn: conn}),
409 app = new Y.juju.App({env: env, container: container}),

Subscribers

People subscribed via source and target branches