<%@ taglib uri="/spring" prefix="spring" %>
<div id="userEditor" class="editor" style="display:none;">
    <table cellpadding="0" cellspacing="0" border="0" style="height:100%;width:100%">
        <tr>
            <td>
                <div id="userEditorToolbar" class="toolbar">
                    <input id="saveItemBtn" type="button" class="toolbarBtn fl" style="float:left;"
                           value="<spring:message code="jsp.userManager.userEditor.save"/>" />
                    <input id="cancelEditBtn" type="button" class="toolbarBtn fl" style="float:left;"
                           value="<spring:message code="jsp.userManager.userEditor.cancel"/>" />
                    <%--<div class="cb"></div>--%>
                </div>
            </td>
        </tr>
        <tr>
            <td style="height:100%" class="panelBorder">
                <div id="userEditorContentContainer" class="editorContentContainer">
                    <%-- Editor components for NOT external user --%>
                    <div id="userEditorContent" class="userDetails">
                        <table id="userEditorControlTable" cellpadding="0" cellspacing="0">
                            <colgroup>
                                <col class="validatorCol" />
                                <col />
                                <col />
                                <col class="validatorCol" />
                                <col />
                            </colgroup>
                            <tr>
                                <td> </td>
                                <td valign="top">
                                    <div class="inputZone">
                                        <div class="fieldLabel"><spring:message code="jsp.userManager.userEditor.userId"/></div>
                                        <input id="userNameInput" type="text" maxlength="100" readonly="readonly" class="new_tabletextfieldorlist textInput editorInput disabledInput"/>
                                    </div>
                                </td>
                                <td> </td>
                                <td>
                                    <div class="fieldLabel">&nbsp;</div>
                                    <div id="passwordValidator" class="validator"></div>
                                </td>
                                <td>
                                    <div class="inputZone">
                                        <div class="fieldLabel"><spring:message code="jsp.userManager.userEditor.password"/></div>
                                        <input id="passwordInput" type="password" maxlength="100" class="new_tabletextfieldorlist textInput editorInput"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td> </td>
                                <td>
                                    <div class="inputZone">
                                        <div class="fieldLabel"><spring:message code="jsp.userManager.userEditor.fullName"/></div>
                                        <input id="fullNameInput" type="text" maxlength="100" class="new_tabletextfieldorlist textInput editorInput"/>
                                    </div>
                                </td>
                                <td></td>
                                <td>
                                    <div class="fieldLabel">&nbsp;</div>
                                    <div id="confirmPasswordValidator" class="validator"></div>
                                </td>
                                <td>
                                    <div class="inputZone">
                                        <div class="fieldLabel"><spring:message code="jsp.userManager.userEditor.confirmPassword"/></div>
                                        <input id="confirmPasswordInput" type="password" maxlength="100" class="new_tabletextfieldorlist textInput editorInput"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="fieldLabel">&nbsp;</div>
                                    <div id="emailValidator" class="validator"></div>
                                </td>
                                <td>
                                    <div class="inputZone">
                                        <div class="fieldLabel"><spring:message code="jsp.userManager.userEditor.emailAddress"/></div>
                                        <input id="emailInput" type="text" maxlength="100" class="new_tabletextfieldorlist textInput editorInput"/>
                                    </div>
                                </td>
                                <td style="width:30px"></td>
                                <td></td>
                                <td valign="top">
                                    <div class="inputZone">
                                        <div class="fieldLabel">&nbsp;</div>
                                        <input id="userEnabledInput" type="checkbox" />
                                        <span class="checkboxLabel" style="height:100%"><spring:message code="jsp.userManager.userEditor.enableThisUser"/></span>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td id="userEditorValidationSummaryCell" colspan="5">
                                    <div id="userEditorValidationSummary" class="alertText validationSummary editorValidationSummary"> </div>
                                </td>
                            </tr>
                        </table>
                        <div class="rolesList">
                            <div class="userDetailsTitle"><spring:message code="jsp.userManager.assignedRoles"/> (<a id="editRulesBtn" href="#null"><spring:message code="jsp.userManager.userEditor.editRoles"/></a>)</div>
                            <div id="rolesInEditor" class="userDetailsValue"></div>
                        </div>
                        <br>
                        <div class="rolesList">
                            <div class="userDetailsTitle"><spring:message code="jsp.userManager.profileAttributes"/></div>
                            <div id="userEditorAttributes" class="userDetailsValue"></div>
                        </div>
                    </div>

                    <%-- Editor components for external user--%>
                    <div id="externalUserEditorContent" class="userDetails">
                        <div class="userDetailsTitle fl"><spring:message code="jsp.userManager.externalUser"/></div>
                        <div class="cb"></div>
                        <div id="externalUserUserName" class="userDetailsTitle"></div>
                        <div id="externalUserFullName" class="userDetailsValue"></div>
                        <div id="externalUserEmail" class="userDetailsValue"></div>
                        <br/>
                        <div class="userDetailsTitle"><spring:message code="jsp.userManager.assignedExternalRoles"/></div>
                        <div id="externalUserExternalRoles" class="userDetailsValue"></div>
                        <br/>
                        <div class="userDetailsTitle"><spring:message code="jsp.userManager.assignedRoles"/> (<a id="externalUserEditRulesBtn" href="#null"><spring:message code="jsp.userManager.userEditor.editRoles"/></a>)</div>
                        <div id="externalUserRoles" class="userDetailsValue"></div>
                        <br/>
                        <div class="userDetailsTitle"><spring:message code="jsp.userManager.profileAttributes"/></div>
                        <div id="externalAttributes" class="userDetailsValue"></div>
                        <br/>
                    </div>
                </div>
            </td>
        </tr>
    </table>

</div>

<div id="editRoles" style="position:absolute;display:none;" class="assigner">
    <table class="dialogFrame" cellspacing="0px" cellpadding="0px">
        <tr><td>
            <div class="dialogHeader" onmousedown="dialogOnMouseDown(event);">
                <div class="dialogHeaderTitle"><spring:message code="jsp.userManager.userEditor.roleEditor.title"/></div>
            </div>
        </td></tr>
        <tr><td class="dialogContent" valign="top">

            <div class="assignerListZone" style="float:left;">
                <span class="fieldLabel"><spring:message code="jsp.userManager.userEditor.roleEditor.available"/></span><input type="text" style="visibility:hidden; width:20px;" class="assignerAssignedTo" value=""/>
                <div id="assignerAvailableItems" class="assignerSpace assignerList" ></div>
            </div>

            <div class="assignerAddRemoveBtnZone" style="float:left;">
                <center>

                    <div id="assignerAddBtn" class="swapButton right up" ></div><div><br/><br/></div>
                    <div id="assignerRemoveBtn" class="swapButton left up" ></div>

                </center>
            </div>

            <div class="assignerListZone" style="float:left;">
                <span class="fieldLabel"><spring:message code="jsp.userManager.userEditor.roleEditor.assigned"/></span><input type="text" id="assignerAssignedTo" class="assignerAssignedTo" value=""/>
                <div id="assignerAssignedItems" class="assignerSpace assignerList" ></div>
            </div>
        </td></tr>
        <tr><td class="dialogButtonPanel" align="right">
            <div style="float:left;"><input id="assignerRevert" type="button" value="<spring:message code="jsp.userManager.userEditor.roleEditor.revert"/>" class="dialogButton"/></div>
            <div style="float:right;"><input  id="assignerDone" type="button" value="<spring:message code="jsp.userManager.userEditor.roleEditor.done"/>" class="dialogButton"/></div>
            <span style="clear:both;"/>
        </td></tr>
    </table>
</div>
