diff --git a/js/app.js b/js/app.js
index b9a4ff67..b9f2a8fe 100644
--- a/js/app.js
+++ b/js/app.js
@@ -47,14 +47,12 @@ app = Sammy('#main', function (sam) {
html = '';
for(lvl in flashs) {
flashs[lvl].forEach( function(msg) {
- html += '
'+ msg +'
';
+ if (lvl == 'fail') { alertClass = 'alert-danger'; }
+ else { alertClass = 'alert-'+ lvl; }
+ html += '
'+ msg +'
';
});
}
- if (level == 'fail') { alertClass = 'alert-danger'; }
- else if (level == 'success') { alertClass = 'alert-success'; }
- else { alertClass = 'alert-info'; }
-
- $('#flash').removeClass().addClass('alert '+ alertClass).html(html).fadeIn();
+ $('#flash').html(html).fadeIn();
},
// API connection helper
@@ -233,6 +231,9 @@ app = Sammy('#main', function (sam) {
*
*/
sam.get('#/', function (c) {
+ // Show development note
+ c.flash('info', '
You are using a development version.' +
+ 'Please note that you can use the
moulinette if you want to access to more YunoHost\'s features.');
c.view('home');
});
@@ -265,7 +266,7 @@ app = Sammy('#main', function (sam) {
store.set('user', 'admin');
store.set('password', btoa(c.params['password']));
c.api('/api', function(data) {
- if (data.apiVersion == '0.1') {
+ if (data.apiVersion) {
c.api('/users', function(data) {
store.set('connected', true);
$('#logout-button').fadeIn();
@@ -277,7 +278,7 @@ app = Sammy('#main', function (sam) {
}
});
} else {
- c.flash('fail', 'Non-compatible API (0.1 required)');
+ c.flash('fail', 'Non-compatible API');
c.redirect('#/login');
}
});