Finish account settings option.
This commit is contained in:
99
wise-webapp/src/main/webapp/jsp/accountSettings.jsp
Executable file
99
wise-webapp/src/main/webapp/jsp/accountSettings.jsp
Executable file
@@ -0,0 +1,99 @@
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
|
||||
<div>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#changeUserPanel" data-toggle="pill">General</a></li>
|
||||
<li><a href="#changePasswordPanel" data-toggle="pill">Security</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade active in" id="changeUserPanel">
|
||||
<div id="changeInfoMsg" class="alert">
|
||||
</div>
|
||||
<form action="#" method="POST" id="changeUserForm">
|
||||
<fieldset>
|
||||
<label for="email"><strong><spring:message code="EMAIL"/>:</strong></label>
|
||||
<input type="text" name="password" id="email" required="required" readonly="readonly"
|
||||
value="${user.email}"/>
|
||||
|
||||
<label for="userName"><strong><spring:message code="USERNAME"/>:</strong></label>
|
||||
<input type="text" name="password" id="userName" required="required" value="${user.username}"
|
||||
readonly="readonly"/>
|
||||
|
||||
<label for="firstname"><strong><spring:message code="FIRSTNAME"/>:</strong></label>
|
||||
<input type="text" name="firstname" id="firstname" required="required" value="${user.firstname}"/>
|
||||
|
||||
<label for="lastname"><strong><spring:message code="LASTNAME"/>:</strong></label>
|
||||
<input type="text" name="lastname" id="lastname" required="required" value="${user.lastname}"/>
|
||||
|
||||
<br/>
|
||||
<input type="submit" id="changeUserInfoBtn" class="btn btn-primary" value="Save"/>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="tab-pane fade" id="changePasswordPanel">
|
||||
<div id="changePasswordMsg" class="alert">
|
||||
</div>
|
||||
<form action="#" method="POST" id="changePasswordForm">
|
||||
<fieldset>
|
||||
<label for="password"><strong><spring:message code="NEW_PASSWORD"/>:</strong></label>
|
||||
<input type="password" name="password" id="password" required="required"/>
|
||||
|
||||
<label for="repassword"><strong><spring:message code="CONFIRM_NEW_PASSWORD"/>:</strong></label>
|
||||
<input type="password" name="password" id="repassword" required="required"/>
|
||||
<br/>
|
||||
<input type="submit" id="changePasswordBtn" class="btn btn-primary"
|
||||
value="<spring:message code="CHANGE_PASSWORD"/>"/>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#changePasswordMsg').hide();
|
||||
function postChange(url, postBody, msgContainerId, successMsg) {
|
||||
// Change success message ...
|
||||
jQuery.ajax(url, {
|
||||
async:false,
|
||||
dataType: 'json',
|
||||
data: postBody,
|
||||
type: 'PUT',
|
||||
contentType:"text/plain; charset=utf-8",
|
||||
success : function(data, textStatus, jqXHR) {
|
||||
$('#' + msgContainerId).removeClass('alert-error').addClass('alert-info').show();
|
||||
$('#' + msgContainerId).text(successMsg);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
$('#' + msgContainerId).removeClass('alert-info').addClass('alert-error').show();
|
||||
$('#' + msgContainerId).text(textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#changePasswordForm').submit(function(event) {
|
||||
|
||||
var inputVal = $('#changePasswordForm #password').val();
|
||||
var rinputVal = $('#changePasswordForm #repassword').val();
|
||||
if (inputVal != rinputVal) {
|
||||
// Password mismatch message ...
|
||||
$('#changePasswordMsg').removeClass('alert-info').addClass('alert-error').show();
|
||||
$('#changePasswordMsg').text('<spring:message code="PASSWORD_MISSMATCH"/>');
|
||||
} else {
|
||||
postChange("service/account/password", inputVal, 'changePasswordMsg', '<spring:message code="CHANGE_PASSWORD_SUCCESS"/>');
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
$('#changeUserForm').submit(function(event) {
|
||||
|
||||
var fistname = $('#changeUserForm #firstname').val();
|
||||
var lastname = $('#changeUserForm #lastname').val();
|
||||
|
||||
postChange("service/account/firstname", fistname, 'changeInfoMsg', 'Your info has been changed successfully');
|
||||
postChange("service/account/lastname", lastname, 'changeInfoMsg', 'Your info has been changed successfully');
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
</script>
|
@@ -17,8 +17,8 @@
|
||||
<spring:message code="MY_WISEMAPS"/>
|
||||
</a>
|
||||
| <a href="${pageContext.request.contextPath}/c/settings" rel="moodalbox 400px 250px wizard"
|
||||
title="<spring:message code="SETTINGS_DETAIL"/>">
|
||||
<spring:message code="SETTINGS"/>
|
||||
title="<spring:message code="ACCOUNT_DETAIL"/>">
|
||||
<spring:message code="ACCOUNT"/>
|
||||
</a>
|
||||
| <a href="${pageContext.request.contextPath}/c/logout" title="<spring:message code="LOGOUT"/>">
|
||||
<spring:message code="LOGOUT"/>
|
||||
|
@@ -1,17 +1,33 @@
|
||||
<%@page pageEncoding="UTF-8"%>
|
||||
<%@page pageEncoding="UTF-8" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||||
|
||||
<div id="settings-dialog-modal" class="modal fade">
|
||||
<div class="modal-header">
|
||||
<button class="close" data-dismiss="modal">x</button>
|
||||
<h3><spring:message code="ACCOUNT"/></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-cancel" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="header">
|
||||
<div id="headerToolbar">
|
||||
<c:choose>
|
||||
<c:when test="${principal != null}">
|
||||
<div id="headerActions">
|
||||
<spring:message code="WELCOME"/>, ${principal.firstname}
|
||||
| <span><a href="${pageContext.request.contextPath}/c/maps/"><spring:message code="MY_WISEMAPS"/></a></span>
|
||||
| <span><a href="${pageContext.request.contextPath}/c/settings" title="<spring:message code="SETTINGS_DETAIL"/>"><spring:message code="SETTINGS"/></a></span>
|
||||
| <span><a href="${pageContext.request.contextPath}/c/logout" title="<spring:message code="LOGOUT"/>"><spring:message code="LOGOUT"/></a></span>
|
||||
| <span><a href="${pageContext.request.contextPath}/c/maps/"><spring:message
|
||||
code="MY_WISEMAPS"/></a></span>
|
||||
| <span><a id="userSettingsBtn" href="#"
|
||||
title="<spring:message code="ACCOUNT_DETAIL"/>"><spring:message
|
||||
code="ACCOUNT"/></a></span>
|
||||
| <span><a href="${pageContext.request.contextPath}/c/logout"
|
||||
title="<spring:message code="LOGOUT"/>"><spring:message code="LOGOUT"/></a></span>
|
||||
</div>
|
||||
</c:when>
|
||||
<c:when test="${param.removeSignin!=true}">
|
||||
@@ -20,7 +36,7 @@
|
||||
<span><a href="${pageContext.request.contextPath}/c/login" title="<spring:message code="SIGN_IN"/>">
|
||||
<spring:message code="SIGN_IN"/>
|
||||
</a></span>
|
||||
</div>
|
||||
</div>
|
||||
</c:when>
|
||||
</c:choose>
|
||||
<div class="header_languages">
|
||||
@@ -38,13 +54,6 @@
|
||||
</div>
|
||||
<c:if test="${param.onlyActionHeader!=true}">
|
||||
<div id="headerContent">
|
||||
<div id="headerButtons">
|
||||
<%--<div id="blogLink">--%>
|
||||
<%--<a href="${pageContext.request.contextPath}/c/blog" title="<spring:message code="BLOG_TITLE"/>">--%>
|
||||
<%--<spring:message code="BLOG"/>--%>
|
||||
<%--</a>--%>
|
||||
<%--</div>--%>
|
||||
</div>
|
||||
<a href="${pageContext.request.contextPath}/c/home" title="Homepage">
|
||||
<div id="headerLogo"> </div>
|
||||
</a>
|
||||
@@ -55,3 +64,20 @@
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#userSettingsBtn').click(
|
||||
function(event) {
|
||||
$('#settings-dialog-modal .modal-body').load("/c/account/settings"),function() {
|
||||
$('#settings-dialog-modal .btn-accept').unbind('click').click(function() {
|
||||
// hacer lago ...
|
||||
});
|
||||
};
|
||||
$('#settings-dialog-modal').modal();
|
||||
event.preventDefault();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
@@ -49,11 +49,11 @@
|
||||
|
||||
<li><strong><spring:message code="URL"/>:</strong>
|
||||
<li><input name="url"
|
||||
value="http://www.wisemapping.com/c/publicView?mapId=${mindmap.id}"
|
||||
value="${baseUrl}/c/maps/${mindmap.id}/public"
|
||||
style="width:400px" readonly="readonly"/>
|
||||
</li>
|
||||
<li><strong><spring:message code="BLOG_SNIPPET"/></strong>
|
||||
<pre><iframe style="border:0;width:600px;height:400px;border: 1px solid black" src="http://www.wisemapping.com/c/embeddedView?mapId=${mindmap.id}&amzoom=1"></iframe></pre>
|
||||
<pre><iframe style="border:0;width:600px;height:400px;border: 1px solid black" src="${baseUrl}/c/maps/${mindmap.id}/embed?zoom=1"></iframe></pre>
|
||||
</li>
|
||||
<li><spring:message code="EMBEDDED_MAP_SIZE"/></li>
|
||||
</ul>
|
||||
|
@@ -64,9 +64,9 @@
|
||||
|
||||
<spring:message code="WELCOME"/>, ${principal.firstname}|<span><a
|
||||
href="c/maps/"><spring:message code="MY_WISEMAPS"/></a></span> |
|
||||
<span><a id="settings" href="c/settings"
|
||||
title="<spring:message code="SETTINGS_DETAIL"/>"><spring:message code="SETTINGS"/></a></span>
|
||||
| <span><a href="c/logout" title="<spring:message code="LOGOUT"/>">
|
||||
<%--<span><a id="settings" href="c/settings"--%>
|
||||
<%--title="<spring:message code="ACCOUNT_DETAIL"/>"><spring:message code="ACCOUNT"/></a></span> |--%>
|
||||
<span><a href="c/logout" title="<spring:message code="LOGOUT"/>">
|
||||
<spring:message code="LOGOUT"/>
|
||||
</a></span>
|
||||
</div>
|
||||
|
@@ -115,7 +115,7 @@
|
||||
|
||||
<div id="dialogsContainer">
|
||||
<!-- New map dialog -->
|
||||
<div id="new-dialog-modal" title="Add new map" class="modal fade" style="display:none">
|
||||
<div id="new-dialog-modal" title="Add new map" class="modal fade">
|
||||
<div class="modal-header">
|
||||
<button class="close" data-dismiss="modal">x</button>
|
||||
<h3>Create a new map</h3>
|
||||
@@ -144,7 +144,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Duplicate map dialog -->
|
||||
<div id="duplicate-dialog-modal" class="modal fade" style="display: none">
|
||||
<div id="duplicate-dialog-modal" class="modal fade">
|
||||
<div class="modal-header">
|
||||
<button class="close" data-dismiss="modal">x</button>
|
||||
<h3 id="dupDialogTitle"></h3>
|
||||
@@ -175,7 +175,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Rename map dialog -->
|
||||
<div id="rename-dialog-modal" class="modal fade" style="display: none">
|
||||
<div id="rename-dialog-modal" class="modal fade">
|
||||
<div class="modal-header">
|
||||
<button class="close" data-dismiss="modal">x</button>
|
||||
<h3 id="renameDialogTitle"></h3>
|
||||
@@ -204,7 +204,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Delete map dialog -->
|
||||
<div id="delete-dialog-modal" class="modal fade" style="display: none">
|
||||
<div id="delete-dialog-modal" class="modal fade">
|
||||
<div class="modal-header">
|
||||
<button class="close" data-dismiss="modal">x</button>
|
||||
<h3>Delete MindMap</h3>
|
||||
@@ -222,7 +222,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Info map dialog -->
|
||||
<div id="info-dialog-modal" class="modal fade" style="display: none">
|
||||
<div id="info-dialog-modal" class="modal fade">
|
||||
<div class="modal-header">
|
||||
<button class="close" data-dismiss="modal">x</button>
|
||||
<h3>Info</h3>
|
||||
@@ -236,7 +236,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Publish Dialog Config -->
|
||||
<div id="publish-dialog-modal" class="modal fade" style="display: none">
|
||||
<div id="publish-dialog-modal" class="modal fade">
|
||||
<div class="modal-header">
|
||||
<button class="close" data-dismiss="modal">x</button>
|
||||
<h3>Publish</h3>
|
||||
@@ -251,7 +251,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Export Dialog Config -->
|
||||
<div id="export-dialog-modal" class="modal fade" style="display: none">
|
||||
<div id="export-dialog-modal" class="modal fade">
|
||||
<div class="modal-header">
|
||||
<button class="close" data-dismiss="modal">x</button>
|
||||
<h3>Export</h3>
|
||||
@@ -266,7 +266,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Import Dialog Config -->
|
||||
<div id="import-dialog-modal" class="modal fade" style="display: none">
|
||||
<div id="import-dialog-modal" class="modal fade">
|
||||
<div class="modal-header">
|
||||
<button class="close" data-dismiss="modal">x</button>
|
||||
<h3>Import</h3>
|
||||
@@ -281,7 +281,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Share Dialog Config -->
|
||||
<div id="share-dialog-modal" class="modal fade" style="display: none">
|
||||
<div id="share-dialog-modal" class="modal fade">
|
||||
<div class="modal-header">
|
||||
<button class="close" data-dismiss="modal">x</button>
|
||||
<h3>Share</h3>
|
||||
@@ -296,7 +296,7 @@
|
||||
</div>
|
||||
|
||||
<!-- History Dialog Config -->
|
||||
<div id="history-dialog-modal" class="modal fade" style="display: none">
|
||||
<div id="history-dialog-modal" class="modal fade" >
|
||||
<div class="modal-header">
|
||||
<button class="close" data-dismiss="modal">x</button>
|
||||
<h3>History</h3>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<!DOCTYPE HTML>
|
||||
|
||||
<%@page pageEncoding="UTF-8" %>
|
||||
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
|
@@ -20,7 +20,7 @@
|
||||
<label for="email"><spring:message code="EMAIL"/></label>
|
||||
<input id="email" type="email" required="required" name="email"/>
|
||||
|
||||
<input type="submit" value="<spring:message code="SUBMIT"/>" class="btn btn-primary" data-loading-text="Saving ..."/>
|
||||
<input type="submit" value="<spring:message code="SUBMIT"/>" class="btn btn-primary" data-loading-text="Seding ..."/>
|
||||
<input type="button" value="<spring:message code="CANCEL"/>" class="btn"
|
||||
onclick="window.location='<c:url value="c/maps/"/>'"/>
|
||||
</fieldset>
|
||||
|
@@ -1,17 +0,0 @@
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
<div>
|
||||
<ul>
|
||||
<li><a rel="moodalbox 400px 200px wizard"
|
||||
href="<c:out value="${pageContext.request.contextPath}/c/changePassword"/>"
|
||||
title="<spring:message code="CHANGE_PASSWORD"/>">
|
||||
<spring:message code="CHANGE_PASSWORD"/>
|
||||
</a>
|
||||
</li>
|
||||
<li><a rel="moodalbox 400px 250px wizard"
|
||||
href="<c:out value="${pageContext.request.contextPath}/c/editProfile"/>"
|
||||
title="<spring:message code="EDIT_PROFILE"/>">
|
||||
<spring:message code="EDIT_PROFILE"/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
Reference in New Issue
Block a user