Show development note on home page

This commit is contained in:
Jerome Lebleu 2013-12-19 02:18:08 +01:00
parent 5fffdda9a6
commit 89e8ec8dc7

View file

@ -231,6 +231,9 @@ app = Sammy('#main', function (sam) {
* *
*/ */
sam.get('#/', function (c) { sam.get('#/', function (c) {
// Show development note
c.flash('info', '<b>You are using a development version.</b><br />' +
'Please note that you can use the <a href="https://doc.yunohost.org/#/moulinette" target="_blank">moulinette</a> if you want to access to more YunoHost\'s features.');
c.view('home'); c.view('home');
}); });
@ -263,7 +266,7 @@ app = Sammy('#main', function (sam) {
store.set('user', 'admin'); store.set('user', 'admin');
store.set('password', btoa(c.params['password'])); store.set('password', btoa(c.params['password']));
c.api('/api', function(data) { c.api('/api', function(data) {
if (data.apiVersion == '0.1') { if (data.apiVersion) {
c.api('/users', function(data) { c.api('/users', function(data) {
store.set('connected', true); store.set('connected', true);
$('#logout-button').fadeIn(); $('#logout-button').fadeIn();
@ -275,7 +278,7 @@ app = Sammy('#main', function (sam) {
} }
}); });
} else { } else {
c.flash('fail', 'Non-compatible API (0.1 required)'); c.flash('fail', 'Non-compatible API');
c.redirect('#/login'); c.redirect('#/login');
} }
}); });