Project

General

Profile

« Previous | Next » 

Revision 57650

new registration form

View differences:

login.html
66 66
							<div class="tab-pane" id="tabRegister">
67 67
								<h4 class="card-title">Register</h4>
68 68
								<div id="registerMessage">
69
									<p class="card-text mb-4">Insert the email used to access the OpenAIRE portal. An administrator will authorize you as soon as possible.</p>
69
									<p class="card-text mb-4">
70
										To use this service you have to perform the following steps:
71
										<ol>
72
											<li>Register your self on the OpenAIRE portal.</li>
73
											<li>Use the same credentials to access to the this tool</li>
74
											<li>Compile the Authorization Request Form</li>
75
											<li>An administrator will auhorize you as soon as possible</li>
76
										</ol>	
77
									</p>
70 78
								</div>
71
								<form method="post">
72
									<div class="form-group">
73
										<input type="text" name="email" id="email" class="form-control input-lg" placeholder="Email" required="true" autofocus="true" />
74
									</div>
75
									<div class="row">
76
										<div class="col-xs-6 col-sm-6 col-md-6">
77
											<input type="button" id="btnRegister" class="btn btn-lg btn-primary btn-block" value="Register" onclick="register(this.form.email.value)" />
78
										</div>
79
										<div class="col-xs-6 col-sm-6 col-md-6"></div>
80
									</div>
81
								</form>
82 79
							</div>
83 80
						</div>
84 81
					</div>
......
96 93
			e.preventDefault()
97 94
			$(this).tab('show')
98 95
		});
99
	
100
		function register(email) {
101
			$('#btnRegister').attr("disabled", "disabled");
102
			
103
			$.post("public_api/newUser", { 'email': email }, function(data, textStatus) {
104
				if (textStatus == 'success' && data.status == 1) {
105
					$('#registerMessage').html('<div class="alert alert-info">Registration saved !</div>');
106
				} else if (textStatus == 'success' && data.status == 2) {
107
					$('#registerMessage').html('<div class="alert alert-warning">User already registered !</div>');
108
					$('#btnRegister').removeAttr("disabled");
109
				} else {
110
					$('#registerMessage').html('<div class="alert alert-danger">Error saving registration !</div>');
111
				}
112
			}, 'json');
113
		}
114 96
	</script>
115 97
</body>
116 98
</html>

Also available in: Unified diff