dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #29058
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14613: Removes js alerts and adds a refresh button when unable to load apps
------------------------------------------------------------
revno: 14613
committer: Mark Polak <markpo@xxxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-04-02 15:48:42 +0200
message:
Removes js alerts and adds a refresh button when unable to load apps
modified:
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/menu.css
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/menu.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/menu.css 2014-04-02 12:45:15 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/menu.css 2014-04-02 13:48:42 +0000
@@ -395,6 +395,37 @@
padding-right: 4px;
}
+.app-menu-error
+{
+ background: darkred;
+ background: rgba(160, 0, 0, .70);
+ border: 1px solid darkred;
+ border-radius: 5px;
+ display: block;
+ padding: .5em 0;
+ text-align: center;
+ width: 100%;
+}
+
+.app-menu-error:hover
+{
+ background: rgba(160, 0, 0, .80);
+ cursor: pointer;
+}
+
+.app-menu-error a
+{
+ background-color: transparent;
+ color: white;
+}
+
+.app-menu-error a:hover
+{
+ background-color: transparent;
+ color: white;
+ text-decoration: none;
+}
+
/*
* Media queries for the menu
*/
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.js 2014-04-01 12:46:32 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.menu.js 2014-04-02 13:48:42 +0000
@@ -404,8 +404,6 @@
//TODO: Give user feedback for successful save
}).error(function () {
//TODO: Give user feedback for failure to save
- //TODO: Translate this error message
- alert('Unable to save your app order to the server.');
});
}
}
@@ -475,8 +473,11 @@
menu.addMenuItems(data.modules);
}
}).error(function () {
+ //TODO: Give user feedback for failure to load items
//TODO: Translate this error message
- alert('Can not load apps from server.');
+ var error_template = '<li class="app-menu-error"><a href="' + window.location.href +'">Unable to load your apps, click to refresh</a></li>';
+ $('#' + selector).addClass('app-menu').html('<ul>' + error_template + '</ul>');
+ $('#menuDropDown1 .menuDropDownBox').html(error_template);
});
/**