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.min.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
    <link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
26
    <link rel="icon" type="image/png" sizes="96x96" href="images/favicon//favicon-96x96.png">
27
    <link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
28
    <link href="images/favicon/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
29
    <script src='https://www.google.com/recaptcha/api.js'></script>
30
</head>
31
<body class="" style="">
32
<div class="uk-offcanvas-content uk-height-viewport">
33
    <!-- MENU STARTS HERE -->
34
    <!-- MAIN MENU STARTS HERE -->
35
    <div class="tm-header  tm-header-transparent" uk-header="">
36
        <div class="uk-container uk-container-expand">
37
            <nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}">
38
                <div class="uk-navbar-center">
39
                    <div class="uk-logo uk-navbar-item">
40
                        <img alt="OpenAIRE" class="uk-responsive-height" src="./images/Logo_Horizontal.png">
41
                    </div>
42
                </div>
43
            </nav>
44
        </div>
45
    </div>
46
    <!-- MENU ENDS HERE -->
47
    <!-- CONTENT STARTS HERE -->
48
    <div class="first_page_section uk-section-default uk-section uk-padding-remove-vertical">
49
        <div class="first_page_banner_headline uk-grid-collapse uk-flex-middle uk-margin-remove-vertical uk-grid" uk-grid="">
50
        </div>
51
    </div>
52
    <div class=" uk-section tm-middle custom-main-content" id="tm-main">
53
        <div class="uk-container uk-container-small uk-margin-small-bottom uk-text-center">
54
            <h2 class="uk-h2 uk-margin-small-bottom">Create new OpenAIRE account</h2>
55
            <%--<div class="uk-text-meta uk-margin-large-bottom">Use the same credentials for all our services</div>--%>
56
                <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">
57
                    <div class="uk-grid ">
58
                        <!-- CENTER SIDE -->
59
                        <div class="uk-width-1-1@m uk-width-1-1@s uk-text-center">
60
                            <h3 class="uk-h4">Create an account</h3>
61
                            <div class="middle-box text-center loginscreen animated fadeInDown ">
62
                                <div class="uk-width-1-3@m uk-align-center">
63
                                    <!-- REGISTER FORM -->
64
                                    <div id="registerForm">
65
                                        <form action="register" method="POST" role="form" class="m-t" id="register_form">
66
                                            <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
67
                                            <div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
68
                                            <div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
69
                                            <span id="server_error" class="uk-text-danger uk-text-small uk-float-left">${message}</span>
70
                                            <c:remove var="message" scope="session" />
71
                                            <div class="form-group">
72
                                                <span class="msg_first_name_error uk-text-danger uk-text-small uk-float-left" style="display:none;">Please enter your first name.</span>
73
                                                <input id="first_name" name="first_name" type="text" placeholder="First name (*)" class="form-control" value=${first_name}></div>
74
                                                <c:remove var="msg_first_name_error_display" scope="session" />
75
                                                <c:remove var="first_name" scope="session" />
76
                                            <div class="form-group">
77
                                                <span class="msg_last_name_error uk-text-danger uk-text-small uk-float-left" style="display:none;">Please enter your last name.</span>
78
                                                <input id="last_name" name="last_name" type="text" placeholder="Last name (*)" class="form-control" value=${last_name}></div>
79
                                                <c:remove var="msg_last_name_error_display" scope="session" />
80
                                                <c:remove var="last_name" scope="session" />
81
                                            <div class="form-group">
82
                                                <input id="organization" name="organization" type="text" placeholder="Affiliation / Organization:" class="form-control" value=${organization}></div>
83
                                                <c:remove var="organization" scope="session" />
84
                                            <div class="form-group">
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 class="msg_username_min_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Minimum username length 5 characters.</span>
87
                                                <span class="msg_username_max_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Maximum username length 150 characters.</span>
88
                                                <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>
89
                                                <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>
90
                                                <span id="username_server_error" class="uk-text-danger uk-text-small uk-float-left">${username_message}</span>
91
                                                <span id="username_allowed_chars_server_error" class="uk-text-danger uk-text-small uk-float-left">${username_allowed_chars_message}</span>
92
                                                <span id="username_first_char_server_error" class="uk-text-danger uk-text-small uk-float-left">${username_first_char_message}</span>
93
                                                <c:remove var="username_message" scope="session" />
94
                                                <c:remove var="username_allowed_chars_message" scope="session" />
95
                                                <c:remove var="username_first_char_message" scope="session" />
96
                                                <input id="username" name="username" type="text" placeholder="Username (*)" class="form-control" value=${username}></div>
97
                                                <c:remove var="username" scope="session" />
98
                                            <div class="form-group">
99
                                                <span class="msg_email_error uk-text-danger uk-text-small uk-float-left" style="display:none;">Please enter your email.</span>
100
                                                <span class="msg_email_validation_error uk-text-danger uk-text-small uk-float-left" style="display:none;">Please enter a valid email.</span>
101
                                                <span class="msg_email_conf_error uk-text-danger uk-text-small uk-float-left" style="display:none;">These emails don't match.</span>
102
                                                <span id="email_server_error" class="uk-text-danger uk-text-small uk-float-left">${email_message}</span>
103
                                                <c:remove var="msg_email_conf_error_display" scope="session" />
104
                                                <c:remove var="msg_email_validation_error_display" scope="session" />
105
                                                <c:remove var="email_message" scope="session" />
106
                                                <input id="email" name="email" type="text" placeholder="Email (*)" class="form-control" value=${email}></div>
107
                                                <c:remove var="email" scope="session" />
108
                                                <c:remove var="msg_email_error_display" scope="session" />
109
                                            <div class="form-group">
110
                                                <input id="email_conf" name="email_conf" type="text" placeholder="Confirm email (*)" class="form-control" value=${email_conf}></div>
111
                                                <c:remove var="email_conf" scope="session" />
112
                                            <div class="form-group">
113
                                                <span class="msg_password_error uk-text-danger uk-text-small uk-float-left" style="display:none;">Please enter your password.</span>
114
                                                <span class="msg_pass_conf_error uk-text-danger uk-text-small uk-float-left" style="display:none;">These passwords don't match.</span>
115
                                                <p>
116
                                                <span class="msg_please_add uk-text-danger uk-text-small uk-float-left" style="display:none">Please add: &nbsp</span></p>
117
                                                <span class="msg_lowercase_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A lowercase letter. &nbsp</span>
118
                                                <span class="msg_capital_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A capital (uppercase) letter. &nbsp </span>
119
                                                <span class="msg_number uk-text-danger uk-text-small uk-float-left" style="display:none">A number. &nbsp</span>
120
                                                <span class="msg_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Minimum 6 characters. &nbsp</span>
121
                                                <p><span class="msg_whitespace uk-text-danger uk-text-small uk-float-left" style="display:none">No white space allowed. &nbsp</span></p>
122
                                                <span class="msg_invalid_password  uk-text-danger uk-text-small uk-float-left" style="display:none;">The password must
123
                                                 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>
124
                                                <input id="password" name="password" type="password" placeholder="Password" class="form-control"></div>
125
                                                <c:remove var="msg_pass_conf_error_display" scope="session" />
126
                                                <c:remove var="msg_password_error_display" scope="session" />
127
                                                <c:remove var="msg_invalid_password_display" scope="session" />
128
                                            <div class="form-group">
129
                                                <input id="password_conf" name="password_conf" type="password" placeholder="Confirm password" class="form-control"></div>
130
                                            <div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
131
                                                <div class="uk-width-1-1 uk-text-meta uk-text-danger uk-first-column">(*) Required fields</div>
132
                                                <span class="uk-text-danger uk-text-small recaptcha_error" style="display:none;">You missed the reCAPTCHA validation!</span>
133
                                                <c:remove var="recaptcha_error_display" scope="session" />
134
                                                <div class="g-recaptcha" data-sitekey=${applicationScope.sitekey}></div>
135
                                                <div class="uk-width-1-1 uk-grid-margin uk-first-column">
136
                                                    <button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">Register</button>
137
                                                </div>
138
                                            </div>
139
                                        </form>
140
                                    </div>
141
                                    <!-- END OF REGISTER FORM -->
142
                                    <script>
143
                                        var myInput = document.getElementById("password");
144
                                        var usernameInput = document.getElementById("username");
145
                                        //var myEmailInput = document.getElementById("email");
146

    
147
                                        $("#password").focusin(function () {
148
                                            $(".msg_invalid_password").fadeOut();
149
                                        });
150

    
151
                                        // When the user starts to type something inside the password field
152
                                        myInput.onkeyup = function() {
153

    
154
                                            var space = /[\s]+/g;
155
                                            if (myInput.value.match(space)) {
156
                                                 $(".msg_whitespace").fadeIn();
157
                                            } else {
158
                                                 $(".msg_whitespace").fadeOut();
159
                                            }
160

    
161
                                            // Validate lowercase letters
162
                                            var lowerCaseLetters = /[a-z]/g;
163
                                            if (myInput.value.match(lowerCaseLetters)) {
164
                                                $(".msg_lowercase_letter").fadeOut();
165
                                            } else {
166
                                                $(".msg_lowercase_letter").fadeIn();
167
                                            }
168

    
169
                                            // Validate capital letters
170
                                            var upperCaseLetters = /[A-Z]/g;
171
                                            if (myInput.value.match(upperCaseLetters)) {
172
                                                $(".msg_capital_letter").fadeOut();
173
                                            } else {
174
                                                $(".msg_capital_letter").fadeIn();
175
                                            }
176

    
177
                                            // Validate numbers
178
                                            var numbers = /[0-9]/g;
179
                                            if (myInput.value.match(numbers)) {
180
                                                $(".msg_number").fadeOut();
181
                                            } else {
182
                                                $(".msg_number").fadeIn();
183
                                            }
184

    
185
                                            // Validate length
186
                                            if (myInput.value.length >= 6) {
187
                                                $(".msg_lenght").fadeOut();
188
                                            } else {
189
                                                $(".msg_lenght").fadeIn();
190
                                            }
191

    
192
                                            if(myInput.value.match(lowerCaseLetters) && myInput.value.match(upperCaseLetters)
193
                                                    && myInput.value.match(numbers) && (myInput.value.length >= 6)){
194
                                                if($(".msg_please_add").css('display')!='none'){
195
                                                    $(".msg_please_add").fadeOut();
196
                                                }
197
                                            } else {
198
                                                if($(".msg_please_add").css('display')=='none') {
199
                                                    $(".msg_please_add").fadeIn();
200
                                                }
201
                                            }
202
                                        }
203

    
204
                                        usernameInput.onkeyup = function() {
205

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

    
232

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

    
238
                                        $("#last_name").focusin(function () {
239
                                            $(this).removeClass('aai-form-danger');
240
                                            $(".msg_last_name_error").fadeOut();
241
                                        });
242

    
243
                                        $("#username").focusin(function () {
244
                                            $(this).removeClass('aai-form-danger');
245
                                            $(".msg_username_error").fadeOut();
246
                                            $("#username_server_error").fadeOut();
247
                                            $("#username_allowed_chars_server_error").fadeOut();
248
                                            $("#username_first_char_server_error").fadeOut();
249
                                        });
250

    
251
                                        $("#email").focusin(function () {
252
                                            $(this).removeClass('aai-form-danger');
253
                                            $(".msg_email_error").fadeOut();
254
                                            $(".msg_email_validation_error").fadeOut();
255
                                            $("#email_server_error").fadeOut();
256
                                        });
257

    
258
                                        $("#email_conf").focusin(function () {
259
                                            $(this).removeClass('aai-form-danger');
260
                                            $(".msg_email_conf_error").fadeOut();
261
                                        });
262

    
263
                                        $("#password").focusin(function () {
264
                                            $(this).removeClass('aai-form-danger');
265
                                            $(".msg_please_add").fadeOut();
266
                                            $(".msg_password_error").fadeOut();
267
                                            $(".msg_pass_conf_error").fadeOut();
268
                                            $(".msg_lowercase_letter").fadeOut();
269
                                            $(".msg_capital_letter").fadeOut();
270
                                            $(".msg_number").fadeOut();
271
                                            $(".msg_lenght").fadeOut();
272
                                        });
273

    
274
                                        $("#password_conf").focusin(function () {
275
                                            $(this).removeClass('aai-form-danger');
276
                                            $(".msg_pass_conf_error").fadeOut();
277
                                        });
278

    
279

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

    
321

    
322

    
323
                                    </script>
324
                                </div>
325
                                </ul>
326
                            </div>
327
                        </div>
328
                        <!-- END OF CENTER SIDE -->
329
                    </div>
330
                </div>
331
            </div>
332
        </div>
333
    </div>
334
    <!-- CONTENT ENDS HERE -->
335
    <!-- FOOTER STARTS HERE-->
336
    <div class="custom-footer"  style="z-index: 200;">
337
          <div class="uk-section-primary uk-section uk-section-small">
338
            <div class="uk-container">
339
              <div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
340
                <div class="uk-width-1-1@m uk-first-column">
341
                  <div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
342
                    <img alt="OpenAIRE" class="el-image" src="./images/Logo_Horizontal_white_small.png">
343
                  </div>
344
                  <div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
345
                    <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>
346
                    <div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/">D-NET</a>.</div>
347
                  </div>
348
                  <div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
349
                    <a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop="">
350
                    </a>
351
                  </div>
352
                </div>
353
              </div>
354
            </div>
355
          </div>
356
        </div>
357
</div>
358
</body>
359
</html>
(14-14/27)