]> git.mxchange.org Git - jjobs-war.git/blobdiff - web/admin/contact/admin_contact_list.xhtml
Please cherry-pick:
[jjobs-war.git] / web / admin / contact / admin_contact_list.xhtml
index 6ca9c35761a1c24df95208f11e0515969cc0bda5..9eb72bd3cff854172765616106c550adc9106370 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: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: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_CONTACT}" />
        <ui:define name="content">
                <h:form id="form-list-contacts">
                        <p:dataTable
-                               id="table-list-contacts"
+                               id="contactList"
                                var="contact"
-                               value="#{contactController.allContacts()}"
-                               tableStyleClass="table table-full"
+                               value="#{contactListController.allContacts}"
                                paginator="true"
+                               paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
+                               filteredValue="#{contactListController.filteredContacts}"
                                rows="10"
+                               rowKey="#{contact.contactId}"
+                               reflow="true"
+                               resizableColumns="true"
+                               rowsPerPageTemplate="5,10,20,50,100"
+                               sortMode="multiple"
                                summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_CONTACT}"
-                               emptyMessage="#{msg.ADMIN_CONTACT_LIST_EMPTY}"
+                               emptyMessage="#{msg.ADMIN_EMPTY_LIST_CONTACT}"
                                widgetVar="contactList"
+                               selectionMode="single"
+                               selection="#{contactListController.selectedContact}"
+                               skipChildren="true"
                                >
-                               <p:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_CONTACT_ID}" />
-                                       </f:facet>
 
-                                       <p:link outcome="admin_show_contact" title="#{msg.ADMIN_LINK_SHOW_CONTACT_DATA_TITLE}" value="#{contact.contactId}">
+                               <f:facet name="header">
+                                       <p:panelGrid
+                                               columns="3"
+                                               layout="grid"
+                                               columnClasses="ui-grid-col-4,ui-grid-col-6,ui-grid-col-2"
+                                               >
+                                               <p:spacer />
+
+                                               <p:panelGrid
+                                                       columns="2"
+                                                       columnClasses="ui-grid-4,ui-grid-8"
+                                                       layout="grid"
+                                                       styleClass="ui-noborder"
+                                                       >
+                                                       <p:outputLabel for="globalFilter" value="#{msg.SEARCH_ALL_FIELDS}" style="float: right" />
+                                                       <p:inputText id="globalFilter" onkeyup="PF('contactList').filter()" placeholder="#{msg.ENTER_KEYWORD}"/>
+                                               </p:panelGrid>
+
+                                               <p:outputPanel>
+                                                       <p:spacer height="4" />
+
+                                                       <p:commandButton
+                                                               id="toggler"
+                                                               type="button"
+                                                               value="#{msg.SELECT_SHOWN_COLUMNS}"
+                                                               styleClass="column-selector"
+                                                               />
+
+                                                       <p:columnToggler datasource="contactList" trigger="toggler" />
+                                               </p:outputPanel>
+                                       </p:panelGrid>
+                               </f:facet>
+
+                               <p:ajax
+                                       event="rowSelect"
+                                       update=":master:form-list-contacts:contact-details"
+                                       oncomplete="PF('contactDialog').show()"
+                                       />
+
+                               <p:column
+                                       headerText="#{msg.ID_HEADER}"
+                                       sortBy="#{contact.contactId}"
+                                       filterable="false"
+                                       >
+                                       <p:link
+                                               outcome="admin_show_contact"
+                                               value="#{contact.contactId}"
+                                               title="#{msg.ADMIN_LINK_SHOW_CONTACT_DATA_TITLE}"
+                                               >
                                                <f:param name="contactId" value="#{contact.contactId}" />
                                        </p:link>
                                </p:column>
 
-                               <p:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_CONTACT_PERSONAL_TITLE}" />
+                               <p:column
+                                       headerText="#{msg.ADMIN_CONTACT_PERSONAL_TITLE}"
+                                       sortBy="#{contact.contactPersonalTitle}"
+                                       filterBy="#{contact.contactPersonalTitle}"
+                                       filterMatchMode="exact"
+                                       >
+                                       <f:facet name="filter">
+                                               <p:selectOneMenu onchange="PF('contactList').filter()">
+                                                       <f:converter converterId="PersonalTitleConverter" />
+                                                       <f:selectItem itemLabel="#{msg.CHOICE_ALL}" itemValue="#{null}" />
+                                                       <f:selectItems
+                                                               value="#{dataController.personalTitles}"
+                                                               var="personalTitle"
+                                                               itemValue="#{personalTitle}"
+                                                               itemLabel="#{msg[personalTitle.messageKey]}"
+                                                               />
+                                               </p:selectOneMenu>
                                        </f:facet>
-
                                        <h:outputText value="#{msg[contact.contactPersonalTitle.messageKey]}" />
                                </p:column>
 
-                               <p:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_CONTACT_FIRST_NAME}" />
-                                       </f:facet>
-
+                               <p:column
+                                       headerText="#{msg.ADMIN_CONTACT_FIRST_NAME}"
+                                       sortBy="#{contact.contactFirstName}"
+                                       filterBy="#{contact.contactFirstName}"
+                                       filterMatchMode="contains"
+                                       >
                                        <h:outputText value="#{contact.contactFirstName}" />
                                </p:column>
 
-                               <p:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_CONTACT_FAMILY_NAME}" />
-                                       </f:facet>
-
+                               <p:column
+                                       headerText="#{msg.ADMIN_CONTACT_FAMILY_NAME}"
+                                       sortBy="#{contact.contactFamilyName}"
+                                       filterBy="#{contact.contactFamilyName}"
+                                       filterMatchMode="contains"
+                                       >
                                        <h:outputText value="#{contact.contactFamilyName}" />
                                </p:column>
 
-                               <p:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_CONTACT_USAGE}" />
-                                       </f:facet>
-
-                                       <h:outputText value="#{msg[beanHelper.getContactUsageMessageKey(contact)]}" />
+                               <p:column
+                                       headerText="#{msg.ENTRY_CREATED_HEADER}"
+                                       sortBy="#{contact.contactCreated}"
+                                       filterBy="#{contact.contactCreated}"
+                                       filterMatchMode="contains"
+                                       >
+                                       <h:outputText value="#{contact.contactCreated}">
+                                               <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
+                                       </h:outputText>
                                </p:column>
 
-                               <p:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_LIST_ENTRY_CREATED}" />
-                                       </f:facet>
-
-                                       <h:outputText id="contactCreated" value="#{contact.contactCreated.time}">
-                                               <f:convertDateTime for="contactCreated" type="both" timeStyle="short" dateStyle="short" />
+                               <p:column
+                                       headerText="#{msg.ENTRY_UPDATED_HEADER}"
+                                       sortBy="#{contact.contactUpdated}"
+                                       filterBy="#{contact.contactUpdated}"
+                                       filterMatchMode="contains"
+                                       >
+                                       <h:outputText value="#{contact.contactUpdated}">
+                                               <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
                                        </h:outputText>
                                </p:column>
 
-                               <p:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_ACTION_LINKS}" />
-                                       </f:facet>
+                               <p:column
+                                       headerText="#{msg.ADMIN_CONTACT_USAGE}"
+                                       sortable="false"
+                                       filterable="false"
+                                       >
+                                       <h:outputText value="#{msg[beanHelper.getContactUsageMessageKey(contact)]}" />
+                               </p:column>
 
-                                       <links:outputContactAdminMiniLinks contact="#{contact}" />
+                               <p:column
+                                       headerText="#{msg.ADMIN_ACTION_LINKS_HEADER}"
+                                       sortable="false"
+                                       filterable="false"
+                                       >
+                                       <links:outputContactAdminDropdownMenu contact="#{contact}" />
                                </p:column>
                        </p:dataTable>
+
+                       <p:dialog
+                               dynamic="true"
+                               modal="true"
+                               resizable="false"
+                               header="#{msg.ADMIN_SINGLE_CONTACT_DETAILS_HEADER}"
+                               hideEffect="fade"
+                               showEffect="fade"
+                               widgetVar="contactDialog"
+                               position="top"
+                               responsive="true"
+                               closeOnEscape="true"
+                               >
+                               <p:outputPanel id="contact-details">
+                                       <p:panelGrid columns="2" rendered="#{not empty contactListController.selectedContact}">
+                                               <f:facet name="header">
+                                                       <h:outputFormat value="#{msg.ADMIN_CONTACT_DETAILS_HEADER}">
+                                                               <f:param value="#{msg[contactListController.selectedContact.contactPersonalTitle.messageKey]}" />
+                                                               <f:param value="#{contactListController.selectedContact.contactFirstName}" />
+                                                               <f:param value="#{contactListController.selectedContact.contactFamilyName}" />
+                                                               <f:param value="#{contactListController.selectedContact.contactId}" />
+                                                       </h:outputFormat>
+                                               </f:facet>
+
+                                               <p:outputLabel value="#{msg.ID_HEADER}" title="#{msg.CONTACT_ID_NUMBER_TITLE}" />
+                                               <h:outputText value="#{contactListController.selectedContact.contactId}" />
+                                       </p:panelGrid>
+                               </p:outputPanel>
+                       </p:dialog>
                </h:form>
 
-               <h:form id="form-admin-add-contact">
-                       <p:panelGrid layout="grid" columns="1" styleClass="table table-full">
+               <h:form>
+                       <p:panelGrid
+                               columns="1"
+                               layout="grid"
+                               >
                                <f:facet name="header">
                                        <h:outputText value="#{msg.ADMIN_ADD_CONTACT_TITLE}" />
                                </f:facet>
 
                                <h:outputText value="#{msg.ADMIN_ADD_CONTACT_MINIMUM_DATA}" />
 
-                               <widgets:outputAdminContactDataFormFields />
+                               <core:outputAdminContactDataFormFields allowEmptyRequiredData="true" />
 
                                <f:facet name="footer">
-                                       <p:commandButton
-                                               styleClass="reset divider-right"
-                                               type="reset"
-                                               value="#{msg.BUTTON_RESET_FORM}"
-                                               />
-                                       <p:commandButton
-                                               styleClass="submit"
-                                               type="submit"
-                                               value="#{msg.BUTTON_ADMIN_ADD_CONTACT}"
-                                               action="#{adminContactController.addContact()}"
-                                               update=":master:form-list-contacts:table-list-contacts"
-                                               />
+                                       <p:panelGrid columns="2" layout="grid">
+                                               <p:commandButton
+                                                       styleClass="reset"
+                                                       type="reset"
+                                                       value="#{msg.BUTTON_RESET_FORM}"
+                                                       />
+                                               <p:commandButton
+                                                       type="submit"
+                                                       value="#{msg.BUTTON_ADMIN_ADD_CONTACT}"
+                                                       action="#{adminContactController.addContact()}"
+                                                       update=":master:form-list-contacts:contactList"
+                                                       />
+                                       </p:panelGrid>
                                </f:facet>
                        </p:panelGrid>
                </h:form>