provide a register button on login

also direct users from file to login
This commit is contained in:
ansuz
2017-05-29 13:11:07 +02:00
parent b910915d47
commit 3915b30055
6 changed files with 39 additions and 1 deletions

View File

@@ -301,7 +301,12 @@ define([
}
if (!Cryptpad.isLoggedIn()) {
return Cryptpad.alert("You must be logged in to upload files");
return Cryptpad.alert(Messages.upload_mustLogin, function () {
if (sessionStorage) {
sessionStorage.redirectTo = window.location.href;
}
window.location.href = '/login/';
});
}
$form.css({

View File

@@ -62,6 +62,10 @@
<input type="text" id="name" name="name" class="form-control" data-localization-placeholder="login_username" autofocus>
<input type="password" id="password" name="password" class="form-control" data-localization-placeholder="login_password">
<button class="btn btn-primary login first" data-localization="login_login"></button>
<div class="extra">
<p data-localization="login_notRegistered"></p>
<button id="register" class="btn btn-success register first" data-localization="login_register"></button>
</div>
</div>
</div>
</div>

View File

@@ -128,5 +128,16 @@ define([
}, 0);
}, 100);
});
$('#register').on('click', function () {
if (sessionStorage) {
if ($uname.val()) {
sessionStorage.login_user = $uname.val();
}
if ($passwd.val()) {
sessionStorage.login_pass = $passwd.val();
}
}
window.location.href = '/register/';
});
});
});