provide a register button on login

also direct users from file to login
pull/1/head
ansuz 8 years ago
parent b910915d47
commit 3915b30055

@ -875,6 +875,12 @@ html.cp,
.cp #main_other #main-container {
display: inline-block;
}
.cp #main #userForm .extra p,
.cp #main_other #userForm .extra p {
font-size: 28px;
padding: 15px;
text-align: center;
}
.cp #main #data,
.cp #main_other #data {
width: 600px;

@ -337,6 +337,14 @@ noscript {
display: inline-block;
}
#userForm .extra {
p {
font-size: 28px;
padding: 15px;
text-align: center;
}
}
#data {
p {
margin: 0;

@ -302,6 +302,9 @@ define(function () {
out.login_invalPass = 'Password required';
out.login_unhandledError = 'An unexpected error occurred :(';
out.login_notRegistered = 'Not registered?';
out.register_importRecent = "Import pad history (Recommended)";
out.register_acceptTerms = "I accept <a href='/terms.html'>the terms of service</a>";
out.register_passwordsDontMatch = "Passwords do not match!";
@ -375,6 +378,7 @@ define(function () {
out.upload_name = "File name";
out.upload_size = "Size";
out.upload_progress = "Progress";
out.upload_mustLogin = "You must be logged in to upload files";
out.download_button = "Decrypt & Download";
// general warnings

@ -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({

@ -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>

@ -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/';
});
});
});

Loading…
Cancel
Save