Change activate page base on new theme. Add input.js for input behaviour.
This commit is contained in:
parent
c7c9ad4117
commit
682d0ab09e
|
@ -1,139 +1,80 @@
|
|||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: sofia
|
||||
Date: 20/10/2017
|
||||
Time: 3:43 μμ
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<!DOCTYPE html>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<base href=".">
|
||||
<title>OpenAIRE - Activation</title>
|
||||
<script src="./js/jquery.js"></script>
|
||||
<script src="./js/uikit.min.js"></script>
|
||||
<script src="./js/validation.js"></script>
|
||||
<link rel="stylesheet" style="text/css" href="./css/theme.css">
|
||||
<link rel="stylesheet" style="text/css" href="./css/custom.css">
|
||||
<link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
|
||||
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
|
||||
</head>
|
||||
<body class="" style="">
|
||||
<div class="uk-offcanvas-content uk-height-viewport">
|
||||
<!-- MENU STARTS HERE -->
|
||||
<!-- MAIN MENU STARTS HERE -->
|
||||
<div class="tm-header tm-header-transparent" uk-header="">
|
||||
<div class="uk-container uk-container-expand">
|
||||
<nav class="uk-navbar" uk-navbar="{"align":"left"}">
|
||||
<div class="uk-navbar-center">
|
||||
<div class="uk-logo uk-navbar-item">
|
||||
<img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<jsp:include page="head.jsp">
|
||||
<jsp:param name="title" value="OpenAIRE - Activate Account"/>
|
||||
<jsp:param name="form" value="true"/>
|
||||
</jsp:include>
|
||||
<body>
|
||||
<div class="uk-section uk-container uk-container-small">
|
||||
<div class="uk-text-center">
|
||||
<img src="images/Logo_Horizontal.png" style="height: 80px;">
|
||||
<h1 class="uk-h4 uk-margin-large-top">Thank you for registering!</h1>
|
||||
<div class="uk-text-large uk-margin-medium-bottom">
|
||||
The next step is to <span class="uk-text-bolder">activate your account.</span>
|
||||
</div>
|
||||
<!-- MENU ENDS HERE -->
|
||||
<!-- CONTENT STARTS HERE -->
|
||||
<div class="first_page_section uk-section-default uk-section uk-padding-remove-vertical">
|
||||
<div class="first_page_banner_headline uk-grid-collapse uk-flex-middle uk-margin-remove-vertical uk-grid" uk-grid="">
|
||||
</div>
|
||||
<div class="uk-margin-large-bottom">
|
||||
An <span class="uk-text-bolder">email</span> with your username and an <span
|
||||
class="uk-text-bolder">activation code</span>
|
||||
has been sent to you. Please use them in the form below to activate your account.
|
||||
The activation code <span class="uk-text-bold uk-text-warning">expires in 24 hours</span>.
|
||||
</div>
|
||||
<div class="tm-middle custom-main-content" id="tm-main">
|
||||
<div class="uk-container uk-container-small uk-section uk-margin-small-bottom uk-text-center">
|
||||
<div uk-grid="" class="uk-grid uk-grid-stack">
|
||||
<div class="tm-main uk-width-1-2@s uk-width-1-1@m uk-width-1-1@l uk-row-first uk-first-column uk-align-center">
|
||||
<div class="uk-grid ">
|
||||
<!-- CENTER SIDE -->
|
||||
<div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
|
||||
<div class="middle-box text-center loginscreen animated fadeInDown ">
|
||||
<p>Thank you for registering! <br>
|
||||
The next step is to <span class="uk-text-bold uk-text-primary">activate your account.</span><br><br>
|
||||
An <span class="uk-text-bold">email</span> with your username and an <span class="uk-text-bold">activation code</span> has been sent to you. Please use them in the form below to activate your account.<br>
|
||||
<span class="uk-text-bold">Note:</span> the activation code <span class="uk-text-warning">expires in 24 hours</span>.
|
||||
|
||||
|
||||
</p>
|
||||
<div class="uk-width-1-3@m uk-align-center">
|
||||
<!-- Validate form -->
|
||||
<div id="registerForm" class="uk-padding">
|
||||
<form action="activate" method="POST" role="form" class="m-t" id="register_form">
|
||||
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
|
||||
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
|
||||
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
|
||||
<div class="form-group">
|
||||
<span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
|
||||
<c:remove var="message" scope="session" />
|
||||
<span id="server_username_error" class="uk-text-danger uk-text-small uk-float-left">${msg_username_error}</span>
|
||||
<c:remove var="msg_username_error" scope="session" />
|
||||
<input id="username" name="username" type="text" placeholder="Username" class="form-control"></div>
|
||||
<div class="form-group">
|
||||
<span id="server_activation_code_error" class="uk-text-danger uk-text-small uk-float-left">${msg_activation_code_error}</span>
|
||||
<c:remove var="msg_activation_code_error" scope="session" />
|
||||
<input id="verification_code" name="verification_code" type="text" placeholder="Activation Code" value="${param.code}" class="form-control"></div>
|
||||
<div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
|
||||
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
|
||||
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">Activate account</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- END OF REGISTER FORM -->
|
||||
<script>
|
||||
$("#username").focusin(function() {
|
||||
$(this).removeClass('aai-form-danger');
|
||||
$("#server_username_error").fadeOut();
|
||||
$("#server_error").fadeOut();
|
||||
});
|
||||
|
||||
$("#verification_code").focusin(function() {
|
||||
$(this).removeClass('aai-form-danger');
|
||||
$("#server_activation_code_error").fadeOut();
|
||||
$("#server_error").fadeOut();
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END OF CENTER SIDE -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form action="activate" method="POST" role="form"
|
||||
class="uk-grid uk-child-width-1-1 uk-flex-column uk-flex-middle" uk-grid>
|
||||
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
|
||||
<div id="server_error" class="uk-text-danger uk-text-center uk-text-small">${message}</div>
|
||||
<c:remove var="message" scope="session" />
|
||||
<div input id="username" class="uk-width-medium@s">
|
||||
<div class="input-wrapper inner x-small">
|
||||
<div class="input-box">
|
||||
<div class="placeholder">
|
||||
<label>Username <sup>*</sup></label>
|
||||
</div>
|
||||
<div class="uk-flex uk-flex-middle">
|
||||
<input name="username" class="input uk-text-truncate">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span id="server_username_error" class="uk-text-danger uk-text-small">
|
||||
${msg_username_error}
|
||||
</span>
|
||||
<c:remove var="msg_username_error" scope="session" />
|
||||
</div>
|
||||
<!-- CONTENT ENDS HERE -->
|
||||
<!-- FOOTER STARTS HERE-->
|
||||
<div class="custom-footer" style="z-index: 200;">
|
||||
<div class="uk-section-primary uk-section uk-section-small">
|
||||
<div class="uk-container">
|
||||
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
|
||||
<div class="uk-width-1-1@m uk-first-column">
|
||||
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
|
||||
<img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
|
||||
</div>
|
||||
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
|
||||
<div><a href="http://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license"><img alt="Creative" src="./images/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a> UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A <a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
|
||||
<div>OPENAIRE IS POWERED BY <a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
|
||||
</div>
|
||||
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
|
||||
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div input id="verification_code" class="uk-width-medium@s">
|
||||
<div class="input-wrapper inner x-small">
|
||||
<div class="input-box">
|
||||
<div class="placeholder">
|
||||
<label>Activation Code <sup>*</sup></label>
|
||||
</div>
|
||||
<div class="uk-flex uk-flex-middle">
|
||||
<input name="verification_code" value="${param.code}" class="input uk-text-truncate">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span id="server_activation_code_error" class="uk-text-danger uk-text-small">
|
||||
${msg_activation_code_error}
|
||||
</span>
|
||||
<c:remove var="msg_activation_code_error" scope="session" />
|
||||
</div>
|
||||
<!-- FOOTER ENDS HERE -->
|
||||
<div class="uk-width-1-1 uk-text-center">
|
||||
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">
|
||||
Activate
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
$("#username input").focusin(function() {
|
||||
$("#server_username_error").hide();
|
||||
$("#server_error").hide();
|
||||
});
|
||||
|
||||
$("#verification_code input").focusin(function() {
|
||||
$("#server_activation_code_error").hide();
|
||||
$("#server_error").hide();
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
@ -15,4 +16,7 @@
|
|||
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
|
||||
<link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"/>
|
||||
<script src='https://www.google.com/recaptcha/api.js'></script>
|
||||
<c:if test="${param.form == true}">
|
||||
<script src='js/input.js'></script>
|
||||
</c:if>
|
||||
</head>
|
|
@ -0,0 +1,81 @@
|
|||
$(document).ready(function () {
|
||||
let inputs = $('[input]').toArray();
|
||||
|
||||
$(window).click(function () {
|
||||
blur();
|
||||
});
|
||||
|
||||
$.each(inputs, function (index, input) {
|
||||
$(input).click(function (event) {
|
||||
focus(input, index);
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
isActive(input);
|
||||
});
|
||||
|
||||
function isActive(input) {
|
||||
let textField = getTextField(input);
|
||||
let wrapper = getWrapper(input);
|
||||
if(textField.val().length > 0) {
|
||||
if (wrapper) {
|
||||
wrapper.addClass('active');
|
||||
}
|
||||
}
|
||||
textField.on('input', function() {
|
||||
if($(this).val().length > 0) {
|
||||
wrapper.addClass('active');
|
||||
} else {
|
||||
wrapper.removeClass('active');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Focus current input and blur all the others in this page.
|
||||
* */
|
||||
function focus(input, index) {
|
||||
let textField = getTextField(input);
|
||||
if(textField) {
|
||||
textField.focus();
|
||||
let wrapper = getWrapper(input);
|
||||
if (wrapper) {
|
||||
wrapper.addClass('focused');
|
||||
}
|
||||
}
|
||||
blur(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Blurs all inputs except this given index;
|
||||
* */
|
||||
function blur(index = -1) {
|
||||
$.each(inputs, function (j, input) {
|
||||
let textField = getTextField(input);
|
||||
if(textField && index !== j) {
|
||||
textField.blur();
|
||||
let wrapper = getWrapper(input);
|
||||
if(wrapper) {
|
||||
wrapper.removeClass('focused');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function getWrapper(input) {
|
||||
return $(input).find('.input-wrapper');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the current textField
|
||||
* Currently works for input and textarea
|
||||
* */
|
||||
function getTextField(input) {
|
||||
let textField = $(input).find('input');
|
||||
if(!textField) {
|
||||
textField = $(input).find('textarea');
|
||||
}
|
||||
return textField;
|
||||
}
|
|
@ -46,28 +46,25 @@ function validateForm() {
|
|||
// }
|
||||
|
||||
// Check if username is filled
|
||||
if($("#username").val() != undefined) {
|
||||
if($.trim($("#username").val()).length <= 0) {
|
||||
$("#username").addClass('uk-input aai-form-danger');
|
||||
$(".msg_username_error").show();
|
||||
let usernameInput = getTextField($("#username"));
|
||||
if(usernameInput.val() !== undefined) {
|
||||
let wrapper = getWrapper("#username");
|
||||
if($.trim(usernameInput.val()).length <= 0) {
|
||||
wrapper.addClass('danger');
|
||||
hasError = true;
|
||||
} else {
|
||||
isUsernameFilled = true;
|
||||
$(".msg_username_error").hide();
|
||||
$("#username").removeClass('aai-form-danger');
|
||||
wrapper.removeClass('danger');
|
||||
}
|
||||
}
|
||||
|
||||
if($("#verification_code").val() != undefined) {
|
||||
if($.trim($("#verification_code").val()).length <= 0) {
|
||||
$("#verification_code").addClass('uk-input aai-form-danger');
|
||||
$(".msg_verification_code_error").show();
|
||||
$(".msg_activation_code_error").show();
|
||||
let verificationCodeInput = getTextField($("#verification_code"));
|
||||
if(verificationCodeInput.val() !== undefined) {
|
||||
let wrapper = getWrapper("#verification_code");
|
||||
if($.trim(verificationCodeInput.val()).length <= 0) {
|
||||
wrapper.addClass('danger');
|
||||
hasError = true;
|
||||
} else {
|
||||
$(".msg_verification_code_error").hide();
|
||||
$(".msg_activation_code_error").hide();
|
||||
$("#verification_code").removeClass('aai-form-danger');
|
||||
wrapper.removeClass('danger');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -230,10 +227,7 @@ function validatePassword(password) {
|
|||
}
|
||||
|
||||
function confirm(first, second) {
|
||||
if (first == second)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return first == second;
|
||||
}
|
||||
|
||||
function loginForm(){
|
||||
|
|
Loading…
Reference in New Issue