2017-11-30 18:31:08 +01:00
|
|
|
<%@ page contentType="text/html" pageEncoding="UTF-8"%>
|
|
|
|
<%@ page import="javax.portlet.*"%>
|
|
|
|
<%@ page import="org.gcube.common.portal.*"%>
|
2017-12-01 16:44:23 +01:00
|
|
|
<%@ page import=" org.gcube.portal.invites.InvitesManager"%>
|
2017-11-30 18:31:08 +01:00
|
|
|
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
|
|
|
|
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui"%>
|
|
|
|
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui"%>
|
|
|
|
<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme"%>
|
|
|
|
|
|
|
|
<portlet:defineObjects />
|
|
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
|
|
|
|
|
|
|
<portlet:resourceURL id="findState" var="findState"></portlet:resourceURL>
|
2017-12-04 19:19:43 +01:00
|
|
|
|
2017-11-30 18:31:08 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function(){
|
|
|
|
|
2017-12-04 19:19:43 +01:00
|
|
|
$( "#createAccountButton" ).click(function() {
|
|
|
|
var firstnameBox = $.trim( $('#firstname').val() )
|
|
|
|
if (firstnameBox == "") {
|
|
|
|
$('#labelFirstName').css("color","red");
|
|
|
|
$('#labelFirstName').text("First Name (This field is required)");
|
|
|
|
} else {
|
|
|
|
$('#labelFirstName').css("color","#555");
|
|
|
|
$('#labelFirstName').text("First Name (Required)");
|
|
|
|
}
|
|
|
|
var lastnameBox = $.trim( $('#lastname').val() )
|
|
|
|
if (lastnameBox == "") {
|
|
|
|
$('#labelLastName').css("color","red");
|
|
|
|
$('#labelLastName').text("Last Name (This field is required)");
|
|
|
|
} else {
|
|
|
|
$('#labelLastName').css("color","#555");
|
|
|
|
$('#labelLastName').text("Last Name (Required)");
|
|
|
|
}
|
|
|
|
|
|
|
|
var passwd1 = $('#password');
|
|
|
|
var labelPwd1 = $('#labelPwd1');
|
|
|
|
var passwd2 = $('#repassword');
|
|
|
|
var labelPwd2 = $('#labelPwd2');
|
|
|
|
|
|
|
|
labelPwd1.addClass( passwd1.val().length === 0 ? 'has-error' : 'has-success' );
|
|
|
|
labelPwd2.addClass( passwd2.val().length === 0 ? 'has-error' : 'has-success' );
|
|
|
|
|
|
|
|
var nomatch = $('#labelPasswordDontMatch');
|
|
|
|
|
|
|
|
if (passwd1.val() !== passwd2.val()) {
|
|
|
|
nomatch.css("display","block");
|
|
|
|
nomatch.css("color","red");
|
|
|
|
labelPwd1.addClass( passwd1.val() !== passwd2.val() ? 'has-error' : 'has-success' )
|
|
|
|
.removeClass( passwd1.val() === passwd2.val() ? 'has-error' : 'has-success' );
|
|
|
|
labelPwd2.addClass( passwd1.val() !== passwd2.val() ? 'has-error' : 'has-success' )
|
|
|
|
.removeClass( passwd1.val() === passwd2.val() ? 'has-error' : 'has-success' );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
nomatch.css("display","none");
|
|
|
|
}
|
|
|
|
|
|
|
|
var shortpwd = $('#labelPasswordTooShort');
|
|
|
|
|
|
|
|
if (passwd1.val().length > 0 && passwd1.val().length < 8) {
|
|
|
|
shortpwd.css("display","block");
|
|
|
|
shortpwd.css("color","red");
|
|
|
|
labelPwd1.addClass(passwd1.val().length < 8 ? 'has-error' : 'has-success' )
|
|
|
|
.removeClass(passwd1.val().length < 8 ? 'has-error' : 'has-success' );
|
|
|
|
labelPwd2.addClass(passwd2.val().length < 8 ? 'has-error' : 'has-success' )
|
|
|
|
.removeClass(passwd2.val().length < 8 ? 'has-error' : 'has-success' );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
shortpwd.css("display","none");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$( "#country" ).change(function() {
|
|
|
|
$.ajax({
|
|
|
|
url: "${findState}" ,
|
|
|
|
type: 'POST',
|
|
|
|
datatype:'json',
|
|
|
|
data: {
|
|
|
|
countryName: $("#country").val()
|
|
|
|
},
|
|
|
|
success: function(data){
|
|
|
|
var content= JSON.parse(data);
|
|
|
|
$('#state').html('');// to clear the previous option
|
|
|
|
$.each(content, function(i, state) {
|
|
|
|
$('#state').append($('<option>').text(state.name).attr('value', state.stateId));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2017-11-30 18:31:08 +01:00
|
|
|
</script>
|
2017-12-04 19:19:43 +01:00
|
|
|
<b>Change the Country State Change By Ajax</b> <br><br>
|
|
|
|
Country:
|
|
|
|
<select id="country" name="country">
|
|
|
|
<option value="select">Select Country</option>
|
|
|
|
<option value="india">India</option>
|
|
|
|
<option value="usa">USA</option>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<br><br>
|
|
|
|
State:
|
|
|
|
<select id="state" name="state">
|
|
|
|
</select>
|
2017-12-01 16:44:23 +01:00
|
|
|
<h1>
|
|
|
|
Hello
|
|
|
|
<c:out escapeXml="true" value="${invitedUser.firstName}" />!<br>
|
|
|
|
</h1>
|
2017-11-30 18:31:08 +01:00
|
|
|
|
|
|
|
<p class="lead">
|
2017-12-01 16:44:23 +01:00
|
|
|
You have recently received an invitation from
|
|
|
|
<c:out escapeXml="true" value="${inviteInstance.senderFullName}" />
|
|
|
|
to join the <a
|
|
|
|
href="/web<c:out escapeXml="true" value="${vreFriendlyURL}" />"
|
|
|
|
target="_blank"><c:out escapeXml="true" value="${vreName}" /></a>
|
|
|
|
Virtual Research Environment.
|
|
|
|
<c:choose>
|
|
|
|
<c:when test="${empty invitedUser}">
|
2017-12-04 19:19:43 +01:00
|
|
|
<br />
|
|
|
|
<span style="font-style: italic;">Please note</span>: the invite is valid for your email <a
|
|
|
|
href="mailto:<c:out escapeXml="true" value="${inviteInstance.invitedEmail}" />">
|
|
|
|
<c:out escapeXml="true" value="${inviteInstance.invitedEmail}" />
|
|
|
|
</a> only. To accept the invite, please fill in the information below:
|
2017-11-30 18:31:08 +01:00
|
|
|
<br />
|
2017-12-04 19:19:43 +01:00
|
|
|
|
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="row-fluid">
|
|
|
|
<div class="span4">
|
|
|
|
<fieldset>
|
|
|
|
<label>Email (Not editable)</label> <input type="text" name="email"
|
|
|
|
value="${inviteInstance.invitedEmail}" readonly style="color: #999;"/>
|
|
|
|
<label id="labelFirstName">First Name (Required)</label>
|
|
|
|
<input type="text" id="firstname" />
|
|
|
|
<label id="labelLastName">Last Name (Required)</label>
|
|
|
|
<input type="text" id="lastname" />
|
|
|
|
</fieldset>
|
|
|
|
</div>
|
|
|
|
<div class="span4">
|
|
|
|
<fieldset>
|
|
|
|
<label id="labelPwd1">Password</label>
|
|
|
|
<input type="password" id="password" />
|
|
|
|
<label id="labelPwd2">Confirm Password</label>
|
|
|
|
<input type="password" id="repassword"/>
|
|
|
|
<label style="display: none" id="labelPasswordDontMatch">Passwords don't match</label>
|
|
|
|
<label style="display: none" id="labelPasswordTooShort">Passwords must be at least 8 chars length</label>
|
|
|
|
<div style="margin-top: 20px;">
|
|
|
|
<button class="btn-primary btn-large" type="button" id="createAccountButton">Continue</button>
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-12-01 16:44:23 +01:00
|
|
|
</c:when>
|
|
|
|
<c:otherwise>
|
|
|
|
This invite is valid for your email <a
|
|
|
|
href="mailto:<c:out escapeXml="true" value="${inviteInstance.invitedEmail}" />">
|
|
|
|
<c:out escapeXml="true" value="${inviteInstance.invitedEmail}" />
|
|
|
|
</a> only, you will be asked to enter your password associated to it on this portal.
|
2017-11-30 18:31:08 +01:00
|
|
|
|
2017-12-04 19:19:43 +01:00
|
|
|
<%
|
|
|
|
String exploreURL = request.getAttribute("landingPage") + "/explore?" + InvitesManager.SITEID_ATTR
|
|
|
|
+ "=" + request.getAttribute("groupId");
|
|
|
|
%>
|
|
|
|
<p class="lead">
|
|
|
|
<button class="btn btn-large btn-primary"
|
|
|
|
onclick="window.location.href='<%=exploreURL%>'" type="button">
|
|
|
|
Accept invite on
|
|
|
|
<c:out escapeXml="true" value="${vreName}" />
|
|
|
|
</button>
|
2017-12-01 16:44:23 +01:00
|
|
|
</p>
|
|
|
|
</c:otherwise>
|
|
|
|
</c:choose>
|
|
|
|
|
2017-11-30 18:31:08 +01:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<br>
|
2017-12-04 19:19:43 +01:00
|
|
|
<c:out escapeXml="true" value="${inviteInstance} " />
|