fix login
This commit is contained in:
parent
febdb0b027
commit
42fdb51337
@ -57,7 +57,7 @@
|
|||||||
<a class="nav-link js-scroll-trigger" target="_blank" href="https://kias.rfbr.ru/">КИАС РФФИ</a>
|
<a class="nav-link js-scroll-trigger" target="_blank" href="https://kias.rfbr.ru/">КИАС РФФИ</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link js-scroll-trigger" href="#logout">Выход</a>
|
<a class="nav-link js-scroll-trigger" href="/logout">Выход</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en"
|
<html lang="en"
|
||||||
xmlns:th="http://www.thymeleaf.org"
|
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
|
layout:decorator="default" xmlns:th="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -11,106 +11,33 @@
|
|||||||
class="fa fa-plane fa-4" aria-hidden="true"></i> Balance</span></a>
|
class="fa fa-plane fa-4" aria-hidden="true"></i> Balance</span></a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="container" layout:fragment="content">
|
<div layout:fragment="content">
|
||||||
<ul class="nav nav-tabs">
|
<section class="bg-light" id="portfolio">
|
||||||
<li class="active"><a href="#signin">Вход в систему</a></li>
|
<div class="container">
|
||||||
<li><a href="#register">Регистрация</a></li>
|
<div class="row justify-content-md-center">
|
||||||
</ul>
|
<div class="col-lg-6">
|
||||||
<div class="tab-content">
|
<form th:action="@{/login}" method="post" class="margined-top-10">
|
||||||
<div id="signin" class="tab-pane active">
|
<fieldset>
|
||||||
<form th:action="@{/login}" method="post" class="margined-top-10">
|
<div class="form-group">
|
||||||
<fieldset>
|
<input type="text" name="username" id="username" class="form-control"
|
||||||
<div class="form-group">
|
placeholder="Логин" required="true" autofocus="true"/>
|
||||||
<input type="text" name="username" id="username" class="form-control"
|
</div>
|
||||||
placeholder="Логин" required="true" autofocus="true"/>
|
<div class="form-group">
|
||||||
</div>
|
<input type="password" name="password" id="password" class="form-control"
|
||||||
<div class="form-group">
|
placeholder="Пароль" required="true"/>
|
||||||
<input type="password" name="password" id="password" class="form-control"
|
</div>
|
||||||
placeholder="Пароль" required="true"/>
|
<button type="submit" class="btn btn-success btn-block">Войти</button>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<button type="submit" class="btn btn-success btn-block">Войти</button>
|
<small class="form-text text-muted">
|
||||||
<div class="form-group">
|
<a href="/resetRequest">Забыли пароль?</a>
|
||||||
<small class="form-text text-muted">
|
</small>
|
||||||
<a href="/resetRequest">Забыли пароль?</a>
|
</div>
|
||||||
</small>
|
</fieldset>
|
||||||
</div>
|
</form>
|
||||||
</fieldset>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="register" class="tab-pane">
|
</section>
|
||||||
<form id="register-form" class="margined-top-10">
|
|
||||||
<fieldset>
|
|
||||||
<div class="form-group">
|
|
||||||
<input type="text" name="login" id="login" class="form-control"
|
|
||||||
placeholder="Логин" required="true" autofocus="true"
|
|
||||||
minlength="4" maxlength="50"/>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<input type="text" name="firstName" id="firstName" class="form-control"
|
|
||||||
placeholder="Имя" required="true" autofocus="true"
|
|
||||||
minlength="2" maxlength="50"/>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<input type="text" name="lastName" id="lastName" class="form-control"
|
|
||||||
placeholder="Фамилия" required="true" autofocus="true"
|
|
||||||
minlength="2" maxlength="50"/>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<input type="text" name="email" id="email" class="form-control"
|
|
||||||
placeholder="E-Mail" required="true" autofocus="true"
|
|
||||||
minlength="5" maxlength="100"/>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<input type="password" name="password" id="password1" class="form-control"
|
|
||||||
placeholder="Пароль" required="true" maxlength="50"/>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<input type="password" name="passwordConfirm" id="password2" class="form-control"
|
|
||||||
placeholder="Пароль (подтверждение)" required="true" maxlength="50"/>
|
|
||||||
</div>
|
|
||||||
<button type="submit" class="btn btn-info btn-block">Создать запись</button>
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<th:block layout:fragment="data-scripts">
|
|
||||||
<script type="text/javascript">
|
|
||||||
/*<![CDATA[*/
|
|
||||||
$(document).ready(function () {
|
|
||||||
if (isUrlVarExists('error')) {
|
|
||||||
showFeedbackMessage('Ошибка входа в систему', 'danger');
|
|
||||||
}
|
|
||||||
if (isUrlVarExists('logout')) {
|
|
||||||
showFeedbackMessage('Выход из системы произведен');
|
|
||||||
}
|
|
||||||
registerFormToJson = function () {
|
|
||||||
var formData = {};
|
|
||||||
$("#register-form").find(":input").not(":button").each(function () {
|
|
||||||
if ($(this).val() == null || $(this).val() === "") {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
formData[$(this).attr("name")] = $(this).val();
|
|
||||||
});
|
|
||||||
return JSON.stringify(formData);
|
|
||||||
};
|
|
||||||
registerUser = function () {
|
|
||||||
postToRest(urlUsersRegister, registerFormToJson(), function (data) {
|
|
||||||
showFeedbackMessage("Пользователь успешно создан");
|
|
||||||
$("#register-form").find(":input").not(":button").val("");
|
|
||||||
});
|
|
||||||
};
|
|
||||||
$("#register-form").submit(function () {
|
|
||||||
registerUser();
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
/*]]>*/
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</th:block>
|
|
||||||
<th:block layout:fragment="scripts">
|
|
||||||
<script src="/js/hashable-tabs.js"></script>
|
|
||||||
</th:block>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user