mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Merge pull request #4 from jeromelebleu/master
Show development note on home page
This commit is contained in:
commit
7c520dc0c1
2 changed files with 10 additions and 9 deletions
|
@ -19,7 +19,7 @@
|
|||
<div class="clearfix"></div>
|
||||
<br />
|
||||
</div>
|
||||
<div id="flash" class="alert" style="display: none">
|
||||
<div id="flash" style="display: none">
|
||||
</div>
|
||||
<div id="slider-container">
|
||||
<div id="slideBack" class="block" style="display: none;"></div>
|
||||
|
|
17
js/app.js
17
js/app.js
|
@ -47,14 +47,12 @@ app = Sammy('#main', function (sam) {
|
|||
html = '';
|
||||
for(lvl in flashs) {
|
||||
flashs[lvl].forEach( function(msg) {
|
||||
html += '<div class="'+ lvl +'">'+ msg +'</div>';
|
||||
if (lvl == 'fail') { alertClass = 'alert-danger'; }
|
||||
else { alertClass = 'alert-'+ lvl; }
|
||||
html += '<div class="alert '+ alertClass +'">'+ msg +'</div>';
|
||||
});
|
||||
}
|
||||
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', '<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');
|
||||
});
|
||||
|
||||
|
@ -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');
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue