Change font + bugfixes & disconnect route

This commit is contained in:
Kload 2013-09-24 17:38:38 +02:00
parent b3ad4383f4
commit 03483498a8
4 changed files with 26 additions and 11 deletions

View file

@ -1,5 +1,14 @@
html, body { html, body {
height: 100%; height: 100%;
font-family: 'Source Sans Pro';
}
body h1,
body h2,
body h3,
body h4,
body h5 {
font-family: 'Source Sans Pro';
} }
#slider { #slider {
@ -35,12 +44,6 @@ html, body {
padding: 5px; padding: 5px;
} }
/*.panel-title {*/
/*font-size: 18px;*/
/*font-weight: bold;*/
/*line-height: 25px;*/
/*}*/
body .form-control { body .form-control {
padding: 6px; padding: 6px;
} }

View file

@ -6,12 +6,13 @@
<title>YunoHost admin</title> <title>YunoHost admin</title>
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen"> <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="css/style.css" rel="stylesheet" media="screen"> <link href="css/style.css" rel="stylesheet" media="screen">
<link href="css/fonts.css" rel="stylesheet" media="screen">
</head> </head>
<body> <body>
<div id="slider"> <div id="slider">
<div class="page-header"> <div class="page-header">
<h1 class="pull-left">YunoHost <small>Administration</small></h1> <h1 class="pull-left">YunoHost <small>Administration</small></h1>
<a id="disconnect-button" href="#/disconnect" class="pull-right" style="padding-top: 29px; padding-right: 5px; font-size: 24px;"><span class="glyphicon glyphicon-log-out"></span></a> <a id="logout-button" href="#/logout" class="pull-right" style="padding-top: 29px; padding-right: 5px; font-size: 24px;"><span class="glyphicon glyphicon-log-out"></span></a>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<br /> <br />

View file

@ -166,7 +166,7 @@ app = Sammy('#main', function (sam) {
}); });
sam.get('#/login', function (c) { sam.get('#/login', function (c) {
$('#disconnect-button').hide(); $('#logout-button').hide();
store.set('path-1', '#/login'); store.set('path-1', '#/login');
c.view('login'); c.view('login');
}); });
@ -177,7 +177,8 @@ app = Sammy('#main', function (sam) {
store.set('password', btoa(c.params['password'])); store.set('password', btoa(c.params['password']));
c.api('/users', function(data) { c.api('/users', function(data) {
store.set('connected', true); store.set('connected', true);
$('#disconnect-button').fadeIn(); $('#logout-button').fadeIn();
c.flash('success', 'Logged in');
if (store.get('path')) { if (store.get('path')) {
c.redirect(store.get('path')); c.redirect(store.get('path'));
} else { } else {
@ -186,6 +187,16 @@ app = Sammy('#main', function (sam) {
}); });
}); });
sam.get('#/logout', function (c) {
store.clear('url');
store.clear('user');
store.clear('password');
store.clear('connected');
store.set('path', '#/');
c.flash('success', 'Logged out');
c.redirect('#/login');
});
/** /**
* Users * Users
* *
@ -205,7 +216,7 @@ app = Sammy('#main', function (sam) {
sam.post('#/users', function (c) { sam.post('#/users', function (c) {
if (c.params['password'] == c.params['confirmation']) { if (c.params['password'] == c.params['confirmation']) {
c.params['mail'] = c.params['email'] + '@' + c.params['domain']; c.params['mail'] = c.params['email'] + c.params['domain'];
c.api('/users', function(data) { // http://api.yunohost.org/#!/user/user_create_post_2 c.api('/users', function(data) { // http://api.yunohost.org/#!/user/user_create_post_2
c.redirect('#/users'); c.redirect('#/users');
}, 'POST', c.params.toHash()); }, 'POST', c.params.toHash());

View file

@ -1,5 +1,5 @@
<div class="pull-left"> <div class="pull-left">
<a class="btn btn-lg btn-default slide back" href="#/users/{{Username}}"><span class="glyphicon glyphicon-chevron-left"></span> {{Username}} info</a> <a class="btn btn-lg btn-default slide back" href="#/users/{{Username}}"><span class="glyphicon glyphicon-chevron-left"></span> Info</a>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="view-title">Edit {{Username}}</div> <div class="view-title">Edit {{Username}}</div>