<%@ include file="/common/taglibs.jsp" %>

<head>
    <title><fmt:message key="title.profile"/></title>
    <meta name="menu" content="profile"/>
    <meta name="current_user_id" content="${currentUser.id}"/>
</head>

<div class="fullContent not-locked">
    <div class="TabPanel">
        <div class="Pane">
        <s:if test="hasActionErrors()">
	    <div class="feedback error">
	        <ul>
	            <s:iterator value="actionErrors">
	                <li><s:property/></li>
	            </s:iterator>
	        </ul>
	    </div>
	</s:if>
	<%-- Success Messages --%>
	<c:if test="${not empty messages}">
	    <div class="feedback notification">
	        <ul>
	            <c:forEach var="msg" items="${messages}">
	                <li><c:out value="${msg}" escapeXml="false"/></li>
	            </c:forEach>
	        </ul>
	    </div>
	    <c:remove var="messages" scope="session"/>
	</c:if>
            <s:form method="post" action="profile/%{id}">
                <s:hidden name="_method" value="put"/>
                <h2 class="title">
                    <fmt:message key='heading.profile.accountinfo'/>
                </h2>
                <span class="Field ClearedField"><s:textfield key="label.user.username" name="username" required="true" theme="xhtml" readonly="true" cssClass="noborder"/></span>
                <span class="Field ClearedField"><s:textfield key="label.user.firstName" name="firstName" theme="xhtml" /></span>
                <span class="Field ClearedField"><s:textfield key="label.user.lastName" name="lastName" theme="xhtml"/></span>
                <span class="Field MediumField ClearedField"><s:textfield key="label.user.email" name="email" required="true" theme="xhtml"/></span>
        </div>
        <div class="Pane">
        	<h2 class="title"><fmt:message key="heading.profile.changepassword"/></h2>
        	<p><fmt:message key="text.profile.changepassword"/></p>
        	<span class="Field ClearedField"><s:password key="label.user.password" name="new_password" theme="xhtml" /></span>
        	<span class="Field ClearedField"><s:password key="label.user.confirmPassword" name="confirmPassword" theme="xhtml" /></span>
        </div>
        <div class="Pane">
                <h2 class="title"><fmt:message key='heading.profile.optionalinfo'/></h2>
                <p><fmt:message key="text.profile.openid"/></p>
                <span class="Field MediumField ClearedField"><s:textfield key="label.user.openid" name="openid" theme="xhtml"/></span>
                <s:if test="twitterEnabled">
	                <p><fmt:message key="text.profile.twitter"/></p>
	                <span class="Field LargeField ClearedField"><s:textfield key="label.user.twitterid" name="twitterid" theme="xhtml"/></span>
	            </s:if>
                <span class="Field ClearedField"><s:textfield key="label.user.phoneNumber" name="phoneNumber" theme="xhtml"/></span>
                <span class="Field MediumField ClearedField"><s:textfield key="label.user.website" name="website" theme="xhtml"/></span>
                <div class="Actions">
                    <ul>
                        <li><s:submit theme="xhtml" key="action.updateprofile"/></li>
                    </ul>

                </div>
            </s:form>
        </div>
    </div>
</div>