Project

General

Profile

1
<%--
2
  Created by IntelliJ IDEA.
3
  User: sofia
4
  Date: 19/10/2017
5
  Time: 4:30 μμ
6
  To change this template use File | Settings | File Templates.
7
--%>
8
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
9
<!DOCTYPE html>
10
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
11
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
12
<head>
13
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
14
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
15
    <meta name="viewport" content="width=device-width, initial-scale=1">
16
    <base href=".">
17
    <title>OpenAIRE - Register</title>
18
    <script src="./js/jquery.js"></script>
19
    <script src="./js/uikit.js"></script>
20
    <script src="./js/validation.js"></script>
21
    <script src="./js/uikit-icons-max.js"></script>
22
    <link rel="stylesheet" style="text/css" href="./css/theme.css">
23
    <link rel="stylesheet" style="text/css" href="./css/custom.css">
24
    <link rel="stylesheet" style="text/css" href="./css/aai-custom.css">
25
    <script src='https://www.google.com/recaptcha/api.js'></script>
26
</head>
27
<body class="" style="">
28
<div class="uk-offcanvas-content uk-height-viewport">
29
    <!-- MENU STARTS HERE -->
30
    <!-- MAIN MENU STARTS HERE -->
31
    <div class="tm-header  tm-header-transparent" uk-header="">
32
        <div class="uk-container uk-container-expand">
33
            <nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
34
                <div class="uk-navbar-center">
35
                    <div class="uk-logo uk-navbar-item">
36
                        <img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
37
                    </div>
38
                </div>
39
            </nav>
40
        </div>
41
    </div>
42
    <!-- MENU ENDS HERE -->
43
    <!-- CONTENT STARTS HERE -->
44
    <div class="first_page_section uk-section-default uk-section uk-padding-remove-vertical">
45
        <div class="first_page_banner_headline uk-grid-collapse uk-flex-middle uk-margin-remove-vertical uk-grid" uk-grid="">
46
        </div>
47
    </div>
48
    <div class=" uk-section  uk-margin-small-top tm-middle custom-main-content" id="tm-main">
49
        <div class="uk-container uk-container-small uk-margin-medium-top  uk-margin-small-bottom uk-text-center">
50
            <h2 class="uk-h2 uk-margin-small-bottom">Create new OpenAIRE account</h2>
51
            <%--<div class="uk-text-meta uk-margin-large-bottom">Use the same credentials for all our services</div>--%>
52
                <div class="tm-main uk-width-1-1@s uk-width-1-1@m  uk-width-1-1@l uk-row-first uk-first-column">
53
                    <div class="uk-grid ">
54
                        <!-- CENTER SIDE -->
55
                        <div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
56
                            <h3 class="uk-h3">Create an account</h3>
57
                            <div class="middle-box text-center loginscreen animated fadeInDown ">
58
                                <div class="uk-width-1-3@m uk-align-center">
59
                                    <!-- REGISTER FORM -->
60
                                    <div id="registerForm">
61
                                        <form action="register" method="POST" role="form" class="m-t" id="register_form">
62
                                            <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
63
                                            <div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
64
                                            <div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
65
                                            <span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
66
                                            <c:remove var="message" scope="session" />
67
                                            <div class="form-group">
68
                                                <span class="msg_first_name_error uk-text-danger uk-text-small uk-float-left" style='${msg_first_name_error_display}'>Please enter your first name.</span>
69
                                                <input id="first_name" name="first_name" type="text" placeholder="First name (*)" class="form-control" value=${first_name}></div>
70
                                                <c:remove var="msg_first_name_error_display" scope="session" />
71
                                                <c:remove var="first_name" scope="session" />
72
                                            <div class="form-group">
73
                                                <span class="msg_last_name_error uk-text-danger uk-text-small uk-float-left" style="${msg_last_name_error_display}">Please enter your last name.</span>
74
                                                <input id="last_name" name="last_name" type="text" placeholder="Last name (*)" class="form-control" value=${last_name}></div>
75
                                                <c:remove var="msg_last_name_error_display" scope="session" />
76
                                                <c:remove var="last_name" scope="session" />
77
                                            <div class="form-group">
78
                                                <input id="organization" name="organization" type="text" placeholder="Affiliation / Organization:" class="form-control" value=${organization}></div>
79
                                                <c:remove var="organization" scope="session" />
80
                                            <div class="form-group">
81
                                                <span class="msg_username_min_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Minimum username length 5 characters.</span>
82
                                                <span class="msg_username_max_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Maximum username length 150 characters.</span>
83
                                                <span class="msg_username_start uk-text-danger uk-text-small uk-float-left" style="display:none">The username must start with letter or digit.</span>
84
                                                <span class="msg_username_allowed_characters uk-text-danger uk-text-small uk-float-left" style="display:none">You can use letters, numbers, underscores, hyphens and periods.</span>
85
                                                <span class="msg_username_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your username.</span>
86
                                                <span id="username_server_error" class="uk-text-danger uk-text-small uk-float-left">${username_message}</span>
87
                                                <span id="username_allowed_chars_server_error" class="uk-text-danger uk-text-small uk-float-left">${username_allowed_chars_message}</span>
88
                                                <span id="username_first_char_server_error" class="uk-text-danger uk-text-small uk-float-left">${username_first_char_message}</span>
89
                                                <c:remove var="username_message" scope="session" />
90
                                                <c:remove var="username_allowed_chars_message" scope="session" />
91
                                                <c:remove var="username_first_char_message" scope="session" />
92
                                                <input id="username" name="username" type="text" placeholder="Username (*)" class="form-control" value=${username}></div>
93
                                                <c:remove var="username" scope="session" />
94
                                            <div class="form-group">
95
                                                <span class="msg_email_error uk-text-danger uk-text-small uk-float-left" style="${msg_email_error_display}">Please enter your email.</span>
96
                                                <span class="msg_email_validation_error uk-text-danger uk-text-small uk-float-left" style="${msg_email_validation_error_display}">Please enter a valid email.</span>
97
                                                <span class="msg_email_conf_error uk-text-danger uk-text-small uk-float-left" style="${msg_email_conf_error_display}">These emails don't match.</span>
98
                                                <span id="email_server_error" class="uk-text-danger uk-text-small uk-float-left">${email_message}</span>
99
                                                <c:remove var="msg_email_conf_error_display" scope="session" />
100
                                                <c:remove var="msg_email_validation_error_display" scope="session" />
101
                                                <c:remove var="email_message" scope="session" />
102
                                                <input id="email" name="email" type="text" placeholder="Email (*)" class="form-control" value=${email}></div>
103
                                                <c:remove var="email" scope="session" />
104
                                                <c:remove var="msg_email_error_display" scope="session" />
105
                                            <div class="form-group">
106
                                                <input id="email_conf" name="email_conf" type="text" placeholder="Confirm email (*)" class="form-control" value=${email_conf}></div>
107
                                                <c:remove var="email_conf" scope="session" />
108
                                            <div class="form-group">
109
                                                <span class="msg_password_error uk-text-danger uk-text-small uk-float-left" style="${msg_password_error_display}">Please enter your password.</span>
110
                                                <span class="msg_pass_conf_error uk-text-danger uk-text-small uk-float-left" style="${msg_pass_conf_error_display}">These passwords don't match.</span>
111
                                                <p>
112
                                                <span class="msg_whitespace uk-text-danger uk-text-small uk-float-left" style="display:none">White space is not allowed</span>
113
                                                <span class="msg_please_add uk-text-danger uk-text-small uk-float-left" style="display:none">Please add: &nbsp</span></p>
114
                                                <span class="msg_lowercase_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A lowercase letter. &nbsp</span>
115
                                                <span class="msg_capital_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A capital (uppercase) letter. &nbsp </span>
116
                                                <span class="msg_number uk-text-danger uk-text-small uk-float-left" style="display:none">A number. &nbsp</span>
117
                                                <span class="msg_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Minimum 6 characters (no white space allowed). &nbsp</span>
118
                                                <span class="msg_invalid_password  uk-text-danger uk-text-small uk-float-left" style="${msg_invalid_password_display}">The password must
119
                                                 contain a lowercase letter, a capital (uppercase) letter, a number and must be at least 6 characters long. White space character is not allowed.</span>
120
                                                <input id="password" name="password" type="password" placeholder="Password" class="form-control"></div>
121
                                                <c:remove var="msg_pass_conf_error_display" scope="session" />
122
                                                <c:remove var="msg_password_error_display" scope="session" />
123
                                                <c:remove var="msg_invalid_password_display" scope="session" />
124
                                            <div class="form-group">
125
                                                <input id="password_conf" name="password_conf" type="password" placeholder="Confirm password" class="form-control"></div>
126
                                            <div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
127
                                                <div class="uk-width-1-1 uk-text-meta uk-text-danger uk-first-column">(*) Required fields</div>
128
                                                <span class="uk-text-danger uk-text-small recaptcha_error" style="${recaptcha_error_display}">You missed the reCAPTCHA validation!</span>
129
                                                <c:remove var="recaptcha_error_display" scope="session" />
130
                                                <div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
131
                                                <div class="uk-width-1-1 uk-grid-margin uk-first-column">
132
                                                    <button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">Register</button>
133
                                                </div>
134
                                            </div>
135
                                        </form>
136
                                    </div>
137
                                    <!-- END OF REGISTER FORM -->
138
                                    <script>
139
                                        var myInput = document.getElementById("password");
140
                                        var usernameInput = document.getElementById("username");
141
                                        //var myEmailInput = document.getElementById("email");
142

    
143
                                        $("#password").focusin(function () {
144
                                            $(".msg_invalid_password").fadeOut();
145
                                        });
146

    
147
                                        // When the user starts to type something inside the password field
148
                                        myInput.onkeyup = function() {
149

    
150
                                            if (/\s/g.test(myInput.value)) {
151
                                                 $("msg_whitespace").fadeIn();
152
                                            } else {
153
                                                 $("msg_whitespace").fadeOut();
154
                                            }
155

    
156
                                            // Validate lowercase letters
157
                                            var lowerCaseLetters = /[a-z]/g;
158
                                            if (myInput.value.match(lowerCaseLetters)) {
159
                                                $(".msg_lowercase_letter").fadeOut();
160
                                            } else {
161
                                                $(".msg_lowercase_letter").fadeIn();
162
                                            }
163

    
164
                                            // Validate capital letters
165
                                            var upperCaseLetters = /[A-Z]/g;
166
                                            if (myInput.value.match(upperCaseLetters)) {
167
                                                $(".msg_capital_letter").fadeOut();
168
                                            } else {
169
                                                $(".msg_capital_letter").fadeIn();
170
                                            }
171

    
172
                                            // Validate numbers
173
                                            var numbers = /[0-9]/g;
174
                                            if (myInput.value.match(numbers)) {
175
                                                $(".msg_number").fadeOut();
176
                                            } else {
177
                                                $(".msg_number").fadeIn();
178
                                            }
179

    
180
                                            // Validate length
181
                                            if (myInput.value.length >= 6) {
182
                                                $(".msg_lenght").fadeOut();
183
                                            } else {
184
                                                $(".msg_lenght").fadeIn();
185
                                            }
186

    
187
                                            if(myInput.value.match(lowerCaseLetters) && myInput.value.match(upperCaseLetters)
188
                                                    && myInput.value.match(numbers) && (myInput.value.length >= 6)){
189
                                                if($(".msg_please_add").css('display')!='none'){
190
                                                    $(".msg_please_add").fadeOut();
191
                                                }
192
                                            } else {
193
                                                if($(".msg_please_add").css('display')=='none') {
194
                                                    $(".msg_please_add").fadeIn();
195
                                                }
196
                                            }
197
                                        }
198

    
199
                                        usernameInput.onkeyup = function() {
200

    
201
                                            // Validate username minimum length
202
                                            if (usernameInput.value.length >= 5) {
203
                                                $(".msg_username_min_lenght").fadeOut();
204
                                            } else {
205
                                                $(".msg_username_min_lenght").fadeIn();
206
                                            }
207
                                            // Validate username maximum length
208
                                            if (usernameInput.value.length < 150) {
209
                                                $(".msg_username_max_lenght").fadeOut();
210
                                            } else {
211
                                                $(".msg_username_max_lenght").fadeIn();
212
                                            }
213
                                            var allowedChars = /^[a-zA-Z0-9._-]*$/;
214
                                            if (usernameInput.value.match(allowedChars)) {
215
                                                $(".msg_username_allowed_characters").fadeOut();
216
                                            } else {
217
                                                $(".msg_username_allowed_characters").fadeIn();
218
                                            }
219
                                            var startsWith = /^[a-zA-Z0-9].*/;
220
                                            if (usernameInput.value.match(startsWith)) {
221
                                                $(".msg_username_start").fadeOut();
222
                                            } else {
223
                                                $(".msg_username_start").fadeIn();
224
                                            }
225
                                        }
226

    
227

    
228
                                        $("#first_name").focusin(function () {
229
                                            $(this).removeClass('aai-form-danger');
230
                                            $(".msg_first_name_error").fadeOut();
231
                                        });
232

    
233
                                        $("#last_name").focusin(function () {
234
                                            $(this).removeClass('aai-form-danger');
235
                                            $(".msg_last_name_error").fadeOut();
236
                                        });
237

    
238
                                        $("#username").focusin(function () {
239
                                            $(this).removeClass('aai-form-danger');
240
                                            $(".msg_username_error").fadeOut();
241
                                            $("#username_server_error").fadeOut();
242
                                            $("#username_allowed_chars_server_error").fadeOut();
243
                                            $("#username_first_char_server_error").fadeOut();
244
                                        });
245

    
246
                                        $("#email").focusin(function () {
247
                                            $(this).removeClass('aai-form-danger');
248
                                            $(".msg_email_error").fadeOut();
249
                                            $(".msg_email_validation_error").fadeOut();
250
                                            $("#email_server_error").fadeOut();
251
                                        });
252

    
253
                                        $("#email_conf").focusin(function () {
254
                                            $(this).removeClass('aai-form-danger');
255
                                            $(".msg_email_conf_error").fadeOut();
256
                                        });
257

    
258
                                        $("#password").focusin(function () {
259
                                            $(this).removeClass('aai-form-danger');
260
                                            $(".msg_please_add").fadeOut();
261
                                            $(".msg_password_error").fadeOut();
262
                                            $(".msg_pass_conf_error").fadeOut();
263
                                            $(".msg_lowercase_letter").fadeOut();
264
                                            $(".msg_capital_letter").fadeOut();
265
                                            $(".msg_number").fadeOut();
266
                                            $(".msg_lenght").fadeOut();
267
                                        });
268

    
269
                                        $("#password_conf").focusin(function () {
270
                                            $(this).removeClass('aai-form-danger');
271
                                            $(".msg_pass_conf_error").fadeOut();
272
                                        });
273

    
274

    
275
//                                        // Run on page load
276
//                                        window.onload = function() {
277
//
278
////                                            // If sessionStorage is storing default values (ex. name), exit the function and do not restore data
279
////                                            if (sessionStorage.getItem('name') == "name") {
280
////                                                return;
281
////                                            }
282
//
283
//                                            // If values are not blank, restore them to the fields
284
//
285
//                                            var first_name = sessionStorage.getItem('first_name');
286
//                                            if (first_name !== null) $('#first_name').val(first_name);
287
//
288
//                                            var last_name = sessionStorage.getItem('last_name');
289
//                                            if (last_name !== null) $('#last_name').val(last_name);
290
//
291
//                                            var organization = sessionStorage.getItem('organization');
292
//                                            if (organization !== null) $('#organization').val(organization);
293
//
294
//                                            var username = sessionStorage.getItem('username');
295
//                                            if (username !== null) $('#username').val(username);
296
//
297
//                                            var email = sessionStorage.getItem('email');
298
//                                            if (email !== null) $('#email').val(email);
299
//
300
//                                            var email_conf= sessionStorage.getItem('email_conf');
301
//                                            if (email_conf!== null) $('#email_conf').val(email_conf);
302
//
303
//
304
//                                        }
305
//
306
//                                        // Before refreshing the page, save the form data to sessionStorage
307
//                                        window.onbeforeunload = function() {
308
//                                            sessionStorage.setItem("first_name", $('#first_name').val());
309
//                                            sessionStorage.setItem("last_name", $('#last_name').val());
310
//                                            sessionStorage.setItem("organization", $('#organization').val());
311
//                                            sessionStorage.setItem("username", $('#username').val());
312
//                                            sessionStorage.setItem("email", $('#email').val());
313
//                                            sessionStorage.setItem("email_conf", $('#email_conf').val());
314
//                                        }
315

    
316

    
317

    
318
                                    </script>
319
                                </div>
320
                                </ul>
321
                            </div>
322
                        </div>
323
                        <!-- END OF CENTER SIDE -->
324
                    </div>
325
                </div>
326
            </div>
327
        </div>
328
    </div>
329
    <!-- CONTENT ENDS HERE -->
330
    <!-- FOOTER STARTS HERE-->
331
    <div class="custom-footer"  style="z-index: 200;">
332
          <div class="uk-section-primary uk-section uk-section-small">
333
            <div class="uk-container">
334
              <div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
335
                <div class="uk-width-1-1@m uk-first-column">
336
                  <div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
337
                    <img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
338
                  </div>
339
                  <div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
340
                    <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>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
341
                    <div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
342
                  </div>
343
                  <div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
344
                    <a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
345
                    </a>
346
                  </div>
347
                </div>
348
              </div>
349
            </div>
350
          </div>
351
        </div>
352
</div>
353
</body>
354
</html>
(9-9/16)