]> git.mxchange.org Git - jjobs-war.git/blob - web/admin/contact/admin_contact_list.xhtml
Please cherry-pick:
[jjobs-war.git] / web / admin / contact / admin_contact_list.xhtml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <ui:composition
3         template="/WEB-INF/templates/admin/admin_base.tpl"
4         xmlns="http://www.w3.org/1999/xhtml"
5         xmlns:core="http://mxchange.org/jsf/core/widgets"
6         xmlns:links="http://mxchange.org/jsf/core/links"
7         xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
8         xmlns:h="http://xmlns.jcp.org/jsf/html"
9         xmlns:f="http://xmlns.jcp.org/jsf/core"
10         xmlns:p="http://primefaces.org/ui"
11         >
12
13         <ui:define name="document_admin_title">
14                 <h:outputText value="#{msg.PAGE_TITLE_ADMIN_LIST_CONTACT}" />
15         </ui:define>
16
17         <ui:define name="content_header">
18                 <h:outputText value="#{msg.CONTENT_TITLE_ADMIN_LIST_CONTACT}" />
19         </ui:define>
20
21         <ui:define name="content">
22                 <h:form id="form-list-contacts">
23                         <p:dataTable
24                                 id="contactList"
25                                 var="contact"
26                                 value="#{contactListController.allContacts}"
27                                 paginator="true"
28                                 paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
29                                 filteredValue="#{contactListController.filteredContacts}"
30                                 rows="10"
31                                 rowKey="#{contact.contactId}"
32                                 reflow="true"
33                                 resizableColumns="true"
34                                 rowsPerPageTemplate="5,10,20,50,100"
35                                 sortMode="multiple"
36                                 summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_CONTACT}"
37                                 emptyMessage="#{msg.ADMIN_EMPTY_LIST_CONTACT}"
38                                 widgetVar="contactList"
39                                 selectionMode="single"
40                                 selection="#{contactListController.selectedContact}"
41                                 skipChildren="true"
42                                 >
43
44                                 <f:facet name="header">
45                                         <p:panelGrid
46                                                 columns="3"
47                                                 layout="grid"
48                                                 columnClasses="ui-grid-col-4,ui-grid-col-6,ui-grid-col-2"
49                                                 >
50                                                 <p:spacer />
51
52                                                 <p:panelGrid
53                                                         columns="2"
54                                                         columnClasses="ui-grid-4,ui-grid-8"
55                                                         layout="grid"
56                                                         styleClass="ui-noborder"
57                                                         >
58                                                         <p:outputLabel for="globalFilter" value="#{msg.SEARCH_ALL_FIELDS}" style="float: right" />
59                                                         <p:inputText id="globalFilter" onkeyup="PF('contactList').filter()" placeholder="#{msg.ENTER_KEYWORD}"/>
60                                                 </p:panelGrid>
61
62                                                 <p:outputPanel>
63                                                         <p:spacer height="4" />
64
65                                                         <p:commandButton
66                                                                 id="toggler"
67                                                                 type="button"
68                                                                 value="#{msg.SELECT_SHOWN_COLUMNS}"
69                                                                 styleClass="column-selector"
70                                                                 />
71
72                                                         <p:columnToggler datasource="contactList" trigger="toggler" />
73                                                 </p:outputPanel>
74                                         </p:panelGrid>
75                                 </f:facet>
76
77                                 <p:ajax
78                                         event="rowSelect"
79                                         update=":master:form-list-contacts:contact-details"
80                                         oncomplete="PF('contactDialog').show()"
81                                         />
82
83                                 <p:column
84                                         headerText="#{msg.ID_HEADER}"
85                                         sortBy="#{contact.contactId}"
86                                         filterable="false"
87                                         >
88                                         <p:link
89                                                 outcome="admin_show_contact"
90                                                 value="#{contact.contactId}"
91                                                 title="#{msg.ADMIN_LINK_SHOW_CONTACT_DATA_TITLE}"
92                                                 >
93                                                 <f:param name="contactId" value="#{contact.contactId}" />
94                                         </p:link>
95                                 </p:column>
96
97                                 <p:column
98                                         headerText="#{msg.ADMIN_CONTACT_PERSONAL_TITLE}"
99                                         sortBy="#{contact.contactPersonalTitle}"
100                                         filterBy="#{contact.contactPersonalTitle}"
101                                         filterMatchMode="exact"
102                                         >
103                                         <f:facet name="filter">
104                                                 <p:selectOneMenu onchange="PF('contactList').filter()">
105                                                         <f:converter converterId="PersonalTitleConverter" />
106                                                         <f:selectItem itemLabel="#{msg.CHOICE_ALL}" itemValue="#{null}" />
107                                                         <f:selectItems
108                                                                 value="#{dataController.personalTitles}"
109                                                                 var="personalTitle"
110                                                                 itemValue="#{personalTitle}"
111                                                                 itemLabel="#{msg[personalTitle.messageKey]}"
112                                                                 />
113                                                 </p:selectOneMenu>
114                                         </f:facet>
115                                         <h:outputText value="#{msg[contact.contactPersonalTitle.messageKey]}" />
116                                 </p:column>
117
118                                 <p:column
119                                         headerText="#{msg.ADMIN_CONTACT_FIRST_NAME}"
120                                         sortBy="#{contact.contactFirstName}"
121                                         filterBy="#{contact.contactFirstName}"
122                                         filterMatchMode="contains"
123                                         >
124                                         <h:outputText value="#{contact.contactFirstName}" />
125                                 </p:column>
126
127                                 <p:column
128                                         headerText="#{msg.ADMIN_CONTACT_FAMILY_NAME}"
129                                         sortBy="#{contact.contactFamilyName}"
130                                         filterBy="#{contact.contactFamilyName}"
131                                         filterMatchMode="contains"
132                                         >
133                                         <h:outputText value="#{contact.contactFamilyName}" />
134                                 </p:column>
135
136                                 <p:column
137                                         headerText="#{msg.ENTRY_CREATED_HEADER}"
138                                         sortBy="#{contact.contactCreated}"
139                                         filterBy="#{contact.contactCreated}"
140                                         filterMatchMode="contains"
141                                         >
142                                         <h:outputText value="#{contact.contactCreated}">
143                                                 <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
144                                         </h:outputText>
145                                 </p:column>
146
147                                 <p:column
148                                         headerText="#{msg.ENTRY_UPDATED_HEADER}"
149                                         sortBy="#{contact.contactUpdated}"
150                                         filterBy="#{contact.contactUpdated}"
151                                         filterMatchMode="contains"
152                                         >
153                                         <h:outputText value="#{contact.contactUpdated}">
154                                                 <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
155                                         </h:outputText>
156                                 </p:column>
157
158                                 <p:column
159                                         headerText="#{msg.ADMIN_CONTACT_USAGE}"
160                                         sortable="false"
161                                         filterable="false"
162                                         >
163                                         <h:outputText value="#{msg[beanHelper.getContactUsageMessageKey(contact)]}" />
164                                 </p:column>
165
166                                 <p:column
167                                         headerText="#{msg.ADMIN_ACTION_LINKS_HEADER}"
168                                         sortable="false"
169                                         filterable="false"
170                                         >
171                                         <links:outputContactAdminDropdownMenu contact="#{contact}" />
172                                 </p:column>
173                         </p:dataTable>
174
175                         <p:dialog
176                                 dynamic="true"
177                                 modal="true"
178                                 resizable="false"
179                                 header="#{msg.ADMIN_SINGLE_CONTACT_DETAILS_HEADER}"
180                                 hideEffect="fade"
181                                 showEffect="fade"
182                                 widgetVar="contactDialog"
183                                 position="top"
184                                 responsive="true"
185                                 closeOnEscape="true"
186                                 >
187                                 <p:outputPanel id="contact-details">
188                                         <p:panelGrid columns="2" rendered="#{not empty contactListController.selectedContact}">
189                                                 <f:facet name="header">
190                                                         <h:outputFormat value="#{msg.ADMIN_CONTACT_DETAILS_HEADER}">
191                                                                 <f:param value="#{msg[contactListController.selectedContact.contactPersonalTitle.messageKey]}" />
192                                                                 <f:param value="#{contactListController.selectedContact.contactFirstName}" />
193                                                                 <f:param value="#{contactListController.selectedContact.contactFamilyName}" />
194                                                                 <f:param value="#{contactListController.selectedContact.contactId}" />
195                                                         </h:outputFormat>
196                                                 </f:facet>
197
198                                                 <p:outputLabel value="#{msg.ID_HEADER}" title="#{msg.CONTACT_ID_NUMBER_TITLE}" />
199                                                 <h:outputText value="#{contactListController.selectedContact.contactId}" />
200                                         </p:panelGrid>
201                                 </p:outputPanel>
202                         </p:dialog>
203                 </h:form>
204
205                 <h:form>
206                         <p:panelGrid
207                                 columns="1"
208                                 layout="grid"
209                                 >
210                                 <f:facet name="header">
211                                         <h:outputText value="#{msg.ADMIN_ADD_CONTACT_TITLE}" />
212                                 </f:facet>
213
214                                 <h:outputText value="#{msg.ADMIN_ADD_CONTACT_MINIMUM_DATA}" />
215
216                                 <core:outputAdminContactDataFormFields allowEmptyRequiredData="true" />
217
218                                 <f:facet name="footer">
219                                         <p:panelGrid columns="2" layout="grid">
220                                                 <p:commandButton
221                                                         styleClass="reset"
222                                                         type="reset"
223                                                         value="#{msg.BUTTON_RESET_FORM}"
224                                                         />
225                                                 <p:commandButton
226                                                         type="submit"
227                                                         value="#{msg.BUTTON_ADMIN_ADD_CONTACT}"
228                                                         action="#{adminContactController.addContact()}"
229                                                         update=":master:form-list-contacts:contactList"
230                                                         />
231                                         </p:panelGrid>
232                                 </f:facet>
233                         </p:panelGrid>
234                 </h:form>
235         </ui:define>
236 </ui:composition>