]> git.mxchange.org Git - jjobs-war.git/blobdiff - web/admin/user/admin_user_list.xhtml
Please cherry-pick:
[jjobs-war.git] / web / admin / user / admin_user_list.xhtml
index 4b3f72a3a0e0d526383e466d4b4cfaec864627f9..fdd0c1408d4aa34a0f0417c5fa1471db89adeacb 100644 (file)
@@ -1,12 +1,14 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl"
                                xmlns="http://www.w3.org/1999/xhtml"
-                               xmlns:widgets="http://mxchange.org/jsf/core/widgets"
+                               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:f="http://xmlns.jcp.org/jsf/core"
+                               xmlns:p="http://primefaces.org/ui">
 
-       <ui:define name="admin_title">
+       <ui:define name="document_admin_title">
                <h:outputText value="#{msg.PAGE_TITLE_ADMIN_LIST_USER}" />
        </ui:define>
 
        </ui:define>
 
        <ui:define name="content">
-               <widgets:outputMessageBox message="#{msg.ADMIN_USER_LIST_EMPTY}" messageStyleClass="alert-danger" rendered="#{userController.allUsers().isEmpty()}" />
+               <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"
+                               >
 
-               <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}">
-                                       <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}" />
-                               </f:facet>
+                                       <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}" />
 
-                               <h:outputText value="#{msg[user.userContact.contactPersonalTitle.messageKey]}" />
-                       </h:column>
-
-                       <h:column>
-                               <f:facet name="header">
-                                       <h:outputText value="#{msg.ADMIN_CONTACT_FIRST_NAME}" />
+                                               <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>
 
-                               <h:outputText value="#{user.userContact.contactFirstName}" />
-                       </h:column>
+                               <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}" />
+                                       </p:link>
+                               </p:column>
 
-                       <h:column>
-                               <f:facet name="header">
-                                       <h:outputText value="#{msg.ADMIN_CONTACT_FAMILY_NAME}" />
-                               </f:facet>
+                               <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="#{user.userContact.contactFamilyName}" />
-                       </h:column>
+                                       <h:outputText value="#{msg[user.userContact.contactPersonalTitle.messageKey]}" />
+                               </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}" />
+                               </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}" />
+                               </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:column>
-                               <f:facet name="header">
-                                       <h:outputText value="#{msg.ADMIN_USER_ACCOUNT_STATUS}" />
-                               </f:facet>
+                                       <h:outputText styleClass="#{user.userAccountStatus.styleClass}" value="#{msg[user.userAccountStatus.messageKey]}" />
+                               </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 styleClass="#{user.userAccountStatus.styleClass}" value="#{msg[user.userAccountStatus.messageKey]}" />
-                       </h:column>
+                                       <h:outputText value="#{msg[user.userProfileMode.messageKey]}" />
+                               </p:column>
 
-                       <h:column>
-                               <f:facet name="header">
-                                       <h:outputText value="#{msg.ADMIN_USER_PROFILE_MODE}" />
-                               </f:facet>
+                               <p:column headerText="#{msg.ADMIN_HEADER_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>
+                               </p:column>
 
-                               <h:outputText value="#{msg[user.userProfileMode.messageKey]}" />
-                       </h:column>
+                               <p:column headerText="#{msg.ADMIN_HEADER_ACTION_LINKS}" sortable="false" filterable="false">
+                                       <links:outputUserAdminMiniLinks user="#{user}" />
+                               </p:column>
+                       </p:dataTable>
+               </h:form>
 
-                       <h:column>
+               <h:form>
+                       <p:panelGrid columns="1" styleClass="table table-full" layout="grid">
                                <f:facet name="header">
-                                       <h:outputText value="#{msg.ADMIN_LIST_ENTRY_CREATED}" />
-                               </f:facet>
-
-                               <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 table-medium" layout="block">
-                       <h:form id="form_admin_add_user">
-                               <div class="table-header">
                                        <h:outputText value="#{msg.ADMIN_ADD_USER_TITLE}" />
-                               </div>
+                               </f:facet>
 
                                <!-- Whether select contact data .. //-->
-                               <h:panelGroup id="admin_user_personal_data_option_1" styleClass="para" layout="block">
-                                       <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="#{adminUserController.contact}" converter="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}" />
-                                                               </h:selectOneMenu>
-                                                       </div>
-                                               </h:panelGroup>
-                                       </fieldset>
-                               </h:panelGroup>
-
-                               <h:panelGroup styleClass="para" layout="block">
+                               <!--
+                               @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 id="admin_user_personal_data_option_2" layout="block">
+                               <h:panelGroup layout="block">
                                        <ui:include src="/WEB-INF/templates/admin/user/admin_form_user_personal_data.tpl" />
                                </h:panelGroup>
 
-                               <div class="table-footer">
-                                       <h:commandButton styleClass="reset divider-right" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                       <h:commandButton styleClass="submit" type="submit" id="button_add_user" value="#{msg.BUTTON_ADMIN_ADD_USER}" action="#{adminUserController.addUser()}" />
-                               </div>
-                       </h:form>
-               </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>