<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
- lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
- xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:f="http://xmlns.jcp.org/jsf/core"
- >
-
- <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">
- <ui:define name="admin_title">
- <h:outputText value="#{msg.PAGE_TITLE_ADMIN_LIST_USER}" />
- </ui:define>
-
- <ui:define name="content_header">
- <h:outputText value="#{msg.CONTENT_TITLE_ADMIN_LIST_USER}" />
- </ui:define>
-
- <ui:define name="content">
- <ui:fragment rendered="#{userController.allUsers().isEmpty()}">
- <ui:include src="/WEB-INF/templates/generic/message_box.tpl">
- <ui:param name="message" value="#{msg.ADMIN_USER_LIST_EMPTY}" />
- <ui:param name="styleClass" value="errors" />
- </ui:include>
- </ui:fragment>
-
- <h:dataTable id="table_list_users" var="user" value="#{userController.allUsers()}" styleClass="table_full" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_USERS}" rendered="#{not userController.allUsers().isEmpty()}">
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_USER_ID}" />
- </f:facet>
-
- <h:link outcome="admin_show_user" title="#{msg.ADMIN_LINK_SHOW_USER_TITLE}" value="#{user.userId}">
+<ui:composition template="/WEB-INF/templates/admin/admin_base.tpl"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:core="http://mxchange.org/jsf/core/widgets"
+ xmlns:links="http://mxchange.org/jsf/core/links"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ xmlns:p="http://primefaces.org/ui">
+
+ <ui:define name="document_admin_title">
+ <h:outputText value="#{msg.PAGE_TITLE_ADMIN_LIST_USER}" />
+ </ui:define>
+
+ <ui:define name="content_header">
+ <h:outputText value="#{msg.CONTENT_TITLE_ADMIN_LIST_USER}" />
+ </ui:define>
+
+ <ui:define name="content">
+ <h:form id="form-list-users">
+ <p:dataTable
+ id="table-list-users"
+ var="user"
+ value="#{userController.allUsers()}"
+ tableStyleClass="table table-full"
+ paginator="true"
+ paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
+ filteredValue="#{userController.filteredUsers}"
+ rows="10"
+ reflow="true"
+ resizableColumns="true"
+ rowsPerPageTemplate="5,10,20,50,100"
+ sortMode="multiple"
+ summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_USERS}"
+ emptyMessage="#{msg.ADMIN_EMPTY_LIST_USER}"
+ widgetVar="userList"
+ >
+
+ <f:facet name="header">
+ <p:panelGrid columns="2" columnClasses="ui-grid-col-10, ui-grid-col-2" layout="grid" styleClass="ui-noborder ui-transparent-widget">
+ <h:outputText value="#{msg.ADMIN_LIST_USERS_HEADER}" />
+
+ <p:commandButton id="toggler" type="button" value="#{msg.SELECT_SHOWN_COLUMNS}" styleClass="column-selector" />
+ <p:columnToggler datasource="table-list-users" trigger="toggler" />
+ </p:panelGrid>
+ </f:facet>
+
+ <p:column headerText="#{msg.ADMIN_USER_ID}" sortBy="#{user.userId}" filterBy="#{user.userId}" filterMatchMode="contains">
+ <p:link outcome="admin_show_user" title="#{msg.ADMIN_LINK_SHOW_USER_TITLE}" value="#{user.userId}">
<f:param name="userId" value="#{user.userId}" />
- </h:link>
- </h:column>
-
- <ui:fragment rendered="#{featureController.isFeatureEnabled('user_login_require_user_name')}">
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_LIST_USER_NAME}" />
- </f:facet>
-
- <h:outputText value="#{user.userName}" />
- </h:column>
- </ui:fragment>
-
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_CONTACT_PERSONAL_TITLE}" />
+ </p:link>
+ </p:column>
+
+ <p:column headerText="#{msg.ADMIN_LIST_USER_NAME}" sortBy="#{user.userName}" filterBy="#{user.userName}" filterMatchMode="contains" rendered="#{featureController.isFeatureEnabled('user_login_require_user_name')}">
+ <h:outputText value="#{user.userName}" />
+ </p:column>
+
+ <p:column headerText="#{msg.ADMIN_CONTACT_PERSONAL_TITLE}" sortBy="#{user.userContact.contactPersonalTitle}" filterBy="#{user.userContact.contactPersonalTitle}" filterMatchMode="exact">
+ <f:facet name="filter">
+ <p:selectOneMenu
+ filter="true"
+ filterMatchMode="contains"
+ label="#{msg.LABEL_PERSONAL_TITLES}"
+ onchange="PF('userList').filter()"
+ title="#{msg.FILTER_BY_SINGLE_PERSONAL_TITLE}"
+ >
+ <f:converter converterId="PersonalTitleConverter" />
+ <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+ <f:selectItems
+ value="#{dataController.personalTitles}"
+ var="personalTitle"
+ itemValue="#{personalTitle}"
+ itemLabel="#{msg[personalTitle.messageKey]}"
+ />
+ </p:selectOneMenu>
</f:facet>
<h:outputText value="#{msg[user.userContact.contactPersonalTitle.messageKey]}" />
- </h:column>
-
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_CONTACT_FIRST_NAME}" />
- </f:facet>
+ </p:column>
+ <p:column headerText="#{msg.ADMIN_CONTACT_FIRST_NAME}" sortBy="#{user.userContact.contactFirstName}" filterBy="#{user.userContact.contactFirstName}" filterMatchMode="contains">
<h:outputText value="#{user.userContact.contactFirstName}" />
- </h:column>
-
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_CONTACT_FAMILY_NAME}" />
- </f:facet>
+ </p:column>
+ <p:column headerText="#{msg.ADMIN_CONTACT_FAMILY_NAME}" sortBy="#{user.userContact.contactFamilyName}" filterBy="#{user.userContact.contactFamilyName}" filterMatchMode="contains">
<h:outputText value="#{user.userContact.contactFamilyName}" />
- </h:column>
-
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_USER_ACCOUNT_STATUS}" />
+ </p:column>
+
+ <p:column headerText="#{msg.ADMIN_USER_ACCOUNT_STATUS}" sortBy="#{user.userAccountStatus}" filterBy="#{user.userAccountStatus}" filterMatchMode="exact">
+ <f:facet name="filter">
+ <p:selectOneMenu
+ filter="true"
+ filterMatchMode="contains"
+ label="#{msg.LABEL_ACCOUNT_STATUS}"
+ onchange="PF('userList').filter()"
+ title="#{msg.FILTER_BY_SINGLE_ACCOUNT_STATUS_TITLE}"
+ >
+ <f:converter converterId="UserAccountStatusConverter" />
+ <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+ <f:selectItems
+ value="#{dataController.userAccountStatuses}"
+ var="accountStatus"
+ itemValue="#{accountStatus}"
+ itemLabel="#{msg[accountStatus.messageKey]}"
+ />
+ </p:selectOneMenu>
</f:facet>
<h:outputText styleClass="#{user.userAccountStatus.styleClass}" value="#{msg[user.userAccountStatus.messageKey]}" />
- </h:column>
-
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_USER_PROFILE_MODE}" />
+ </p:column>
+
+ <p:column headerText="#{msg.ADMIN_USER_PROFILE_MODE}" sortBy="#{user.userProfileMode}" filterBy="#{user.userProfileMode}" filterMatchMode="exact">
+ <f:facet name="filter">
+ <p:selectOneMenu
+ filter="true"
+ filterMatchMode="contains"
+ label="#{msg.LABEL_PROFILE_MODE}"
+ onchange="PF('userList').filter()"
+ title="#{msg.FILTER_BY_SINGLE_PROFILE_MODE_TITLE}"
+ >
+ <f:converter converterId="ProfileModeConverter" />
+ <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+ <f:selectItems
+ value="#{dataController.profileModes}"
+ var="profileMode"
+ itemValue="#{profileMode}"
+ itemLabel="#{msg[profileMode.messageKey]}"
+ />
+ </p:selectOneMenu>
</f:facet>
<h:outputText value="#{msg[user.userProfileMode.messageKey]}" />
- </h:column>
-
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_USER_CREATED}" />
- </f:facet>
+ </p:column>
+ <p:column headerText="#{msg.ADMIN_LIST_ENTRY_CREATED}" sortBy="#{user.userCreated}" filterable="false">
<h:outputText id="userCreated" value="#{user.userCreated.time}">
<f:convertDateTime for="userCreated" type="both" timeStyle="short" dateStyle="short" />
</h:outputText>
- </h:column>
- </h:dataTable>
-
- <h:panelGroup styleClass="table_medium" layout="block">
- <h:form id="form_admin_add_user">
- <div class="table_header">
- <h:outputText value="#{msg.ADMIN_ADD_USER_TITLE}" />
- </div>
-
- <!-- Whether select contact data .. //-->
- <div id="admin_user_personal_data_option_1" class="para">
- <fieldset class="fieldset" id="user_contact">
- <legend title="#{msg.ADMIN_SELECT_USER_CONTACT_LEGEND_TITLE}">
- <h:outputText value="#{msg.ADMIN_SELECT_USER_CONTACT_LEGEND}" />
- </legend>
-
- <h:panelGroup styleClass="table_row" layout="block">
- <div class="table_left_medium">
- <h:outputLabel for="userContact" value="#{msg.ADMIN_SELECT_USER_CONTACT}" />
- </div>
-
- <div class="table_right_medium">
- <h:selectOneMenu styleClass="select" id="userContact" value="#{beanHelper.contact}" converter="ContactConverter">
- <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
- <f:selectItems value="#{contactController.selectableContacts()}" var="contact" itemValue="#{contact}" itemLabel="#{contact.contactId}: #{msg[contact.contactPersonalTitle.messageKey]} #{contact.contactFirstName} #{contact.contactFamilyName}" />
- </h:selectOneMenu>
- </div>
-
- <div class="clear"></div>
- </h:panelGroup>
- </fieldset>
- </div>
-
- <div class="para">
- <h:outputText value="#{msg.ADMIN_ADD_OR_ENTER_CONTACT_DATA}" />
- </div>
-
- <!-- ... or enter it directly together it creating user account //-->
- <div id="admin_user_personal_data_option_2">
- <ui:include src="/WEB-INF/templates/admin/user/admin_form_user_personal_data.tpl" />
- </div>
-
- <div class="table_footer">
- <h:commandButton styleClass="reset right_space" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="submit" type="submit" id="add_user" value="#{msg.BUTTON_ADMIN_ADD_USER}" action="#{adminUserController.addUser()}" />
- </div>
- </h:form>
- </h:panelGroup>
- </ui:define>
- </ui:composition>
-</html>
+ </p:column>
+
+ <p:column headerText="#{msg.ADMIN_ACTION_LINKS}" sortable="false" filterable="false">
+ <links:outputUserAdminMiniLinks user="#{user}" />
+ </p:column>
+ </p:dataTable>
+ </h:form>
+
+ <h:form>
+ <p:panelGrid columns="1" styleClass="table table-full" layout="grid">
+ <f:facet name="header">
+ <h:outputText value="#{msg.ADMIN_ADD_USER_TITLE}" />
+ </f:facet>
+
+ <!-- Whether select contact data .. //-->
+ <!--
+ @TODO title="#{msg.ADMIN_SELECT_USER_CONTACT_LEGEND_TITLE}"
+ -->
+ <p:fieldset legend="#{msg.ADMIN_SELECT_USER_CONTACT_LEGEND}">
+ <p:panelGrid columns="2" columnClasses="ui-grid-col-3, ui-grid-col-9" styleClass="table table-full ui-noborder" layout="grid">
+ <p:outputLabel for="userContact" value="#{msg.ADMIN_SELECT_USER_CONTACT}" />
+ <p:selectOneMenu
+ id="userContact"
+ value="#{adminUserController.contact}"
+ filter="true"
+ filterMatchMode="contains"
+ >
+ <f:converter converterId="ContactConverter" />
+ <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+ <f:selectItems value="#{contactController.selectableContacts()}" var="contact" itemValue="#{contact}" itemLabel="#{contact.contactId}: #{msg[contact.contactPersonalTitle.messageKey]} #{contact.contactFirstName} #{contact.contactFamilyName}" />
+ </p:selectOneMenu>
+ </p:panelGrid>
+ </p:fieldset>
+
+ <h:panelGroup layout="block">
+ <h:outputText value="#{msg.ADMIN_ADD_OR_ENTER_CONTACT_DATA}" />
+ </h:panelGroup>
+
+ <!-- ... or enter it directly together it creating user account //-->
+ <h:panelGroup layout="block">
+ <ui:include src="/WEB-INF/templates/admin/user/admin_form_user_personal_data.tpl" />
+ </h:panelGroup>
+
+ <f:facet name="footer">
+ <p:panelGrid columns="2" layout="grid">
+ <p:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+
+ <p:commandButton
+ styleClass="submit"
+ type="submit"
+ id="submit_add_user"
+ value="#{msg.BUTTON_ADMIN_ADD_USER}"
+ action="#{adminUserController.addUser()}"
+ update=":master:form-list-users:table-list-users"
+ />
+ </p:panelGrid>
+ </f:facet>
+ </p:panelGrid>
+ </h:form>
+ </ui:define>
+</ui:composition>