<%@ page import="com.atlassian.jira.config.properties.ApplicationProperties,
                 com.atlassian.jira.config.properties.APKeys,
                 com.atlassian.jira.ManagerFactory"%>
<%@ taglib uri="webwork" prefix="webwork" %>
<%@ taglib uri="sitemesh-page" prefix="page" %>

<webwork:if test="user != null">
<webwork:property value="user">
<html>
<head>
	<title><webwork:text name="'common.words.user'"/>: <webwork:property value="fullName" /></title>
</head>

<body>
<%@ include file="/includes/errormessages.jsp" %>
</webwork:property>
<page:applyDecorator name="jirapanel">
    <page:param name="title"><webwork:text name="'common.words.user'"/>: <webwork:property value="user/fullName" /></page:param>
    <page:param name="width">100%</page:param>
    <webwork:property value="user">

    <p />
    <div class="vcard"><%-- hCard microformat --%>
    <b><webwork:text name="'common.words.username'"/>:</b> <webwork:property value="name" /><br />
    <b><webwork:text name="'common.words.fullname'"/>:</b> <span class="fn"><webwork:property value="fullName" /></span><br />
    <b><webwork:text name="'common.words.email'"/>:</b> <a class="email" href="mailto:<webwork:property value="email" />"><webwork:property value="email" /></a><br />
    &nbsp;<br>
    <b><webwork:text name="'common.words.groups'"/>:</b><br>
        <webwork:iterator value="user/groups">
        &nbsp; <img src="<%= request.getContextPath() %>/images/icons/bullet_blue.gif" height="8" width="8" border="0" align="absmiddle" alt="">
        <webwork:property value="." /><br>
        </webwork:iterator>
    <br />
    <webwork:if test="/userProperties != null && /userProperties/empty == false">
    <b><webwork:text name="'common.words.properties'"/>:</b><br />
        <webwork:iterator value="/userProperties">
            &nbsp; <img src="<%= request.getContextPath() %>/images/icons/bullet_blue.gif" height="8" width="8" border="0" align="absmiddle" alt="">
            <webwork:property value="key" /> : <webwork:property value="value" /><br />
        </webwork:iterator>
     </webwork:if>
    </div>
    </webwork:property>
</page:applyDecorator>

<webwork:property value="user">
<p align="center">
	<b>
    <a href="<webwork:url page="/secure/ViewProfile.jspa"><webwork:param name="'name'" value="name"/></webwork:url>"><webwork:text name="'admin.viewuser.view.public.profile'"/></a>
    | <a href="<webwork:url page="EditUserProperties.jspa"><webwork:param name="'name'" value="name" /></webwork:url>"><webwork:text name="'admin.viewuser.edit.properties'"/></a>
    <% if (!ManagerFactory.getApplicationProperties().getOption(APKeys.JIRA_OPTION_USER_EXTERNALMGT)) { %>
    | <a id="editgroups_link" href="<webwork:url page="EditUserGroups!default.jspa"><webwork:param name="'name'" value="name" /></webwork:url>"><webwork:text name="'admin.viewuser.edit.groups'"/></a>
    | <a id="viewprojectroles_link" href="<webwork:url page="ViewUserProjectRoles!default.jspa"><webwork:param name="'name'" value="name" /><webwork:param name="'returnUrl'" value="'ViewUser.jspa'"/></webwork:url>"><webwork:text name="'admin.viewuser.view.project.roles'"/></a>
    | <a href="<webwork:url page="EditUser!default.jspa"><webwork:param name="'editName'" value="name" /></webwork:url>"><webwork:text name="'admin.viewuser.edit.details'"/></a>

        <webwork:if test="applicationProperties/option('jira.option.user.externalpasswordmanagement') == false">
    | <a href="<webwork:url page="SetPassword!default.jspa"><webwork:param name="'name'" value="name" /></webwork:url>"><webwork:text name="'admin.viewuser.set.password'"/></a>
    </webwork:if>
    | <a id="deleteuser_link" href="<webwork:url page="DeleteUser!default.jspa"><webwork:param name="'name'" value="name" /></webwork:url>"><webwork:text name="'admin.viewuser.delete.user'"/></a>
    <%  }   %>
    </b>
</p>

</body>
</html>

</webwork:property>
</webwork:if>
<webwork:else>
<html>
<head>
	<title><webwork:text name="'common.words.user'"/>: <webwork:text name="'common.words.none'"/></title>
</head>

<body>
<page:applyDecorator name="jirapanel">
    <page:param name="title"><webwork:text name="'admin.viewuser.user.does.not.exist.title'" /></page:param>
    <page:param name="width">100%</page:param>
    <p>
    <webwork:text name="'admin.viewuser.user.does.not.exist'">
        <webwork:param name="'value0'"><b><webwork:property value="name" /></b></webwork:param>
    </webwork:text>
    </p>
</page:applyDecorator>
</body>
</html>
</webwork:else>

