Index: app/views/utils.js |
=== modified file 'app/views/utils.js' |
--- app/views/utils.js 2013-02-11 15:58:04 +0000 |
+++ app/views/utils.js 2013-02-28 18:08:43 +0000 |
@@ -375,6 +375,39 @@ |
}); |
}; |
+ utils.updateLandscapeBottomBar = function(landscape, env, model, container, |
+ scope) { |
+ // Landscape annotations are stored in a unit's annotations, but just on |
+ // the object in the case of services/environment. |
+ var annotations = model.annotations ? model.annotations : model; |
+ var envAnnotations = env.get ? env.get('annotations') : env; |
+ var controls = container.one('.landscape-controls').hide(); |
+ var logo = controls.one('.logo-tab i'); |
+ var machine = controls.one('.machine-control').hide(); |
+ var updates = controls.one('.updates-control').hide(); |
+ var restart = controls.one('.restart-control').hide(); |
+ |
+ if (envAnnotations['landscape-url']) { |
+ controls.show(); |
+ machine.show(); |
+ machine.one('a').setAttribute('href', |
+ landscape.getLandscapeURL(model)); |
+ logo.setAttribute('class', 'sprite landscape_' + scope); |
+ |
+ if (annotations['landscape-security-upgrades']) { |
+ updates.show(); |
+ updates.one('a').setAttribute('href', |
+ landscape.getLandscapeURL(model, 'security')); |
+ } |
+ |
+ if (annotations['landscape-needs-reboot']) { |
+ restart.show(); |
+ restart.one('a').setAttribute('href', |
+ landscape.getLandscapeURL(model, 'reboot')); |
+ } |
+ } |
+ }; |
+ |
function _addAlertMessage(container, alertClass, message) { |
var div = container.one('#message-area'); |