]> git.mxchange.org Git - jjobs-war.git/blob - web/admin/country/admin_country_list.xhtml
Please cherry-pick:
[jjobs-war.git] / web / admin / country / admin_country_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:links="http://mxchange.org/jsf/core/links"
6         xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
7         xmlns:h="http://xmlns.jcp.org/jsf/html"
8         xmlns:f="http://xmlns.jcp.org/jsf/core"
9         xmlns:p="http://primefaces.org/ui"
10         >
11
12         <ui:define name="document_admin_title">
13                 <h:outputText value="#{msg.PAGE_TITLE_ADMIN_LIST_COUNTRY}" />
14         </ui:define>
15
16         <ui:define name="content_header">
17                 <h:outputText value="#{msg.CONTENT_TITLE_ADMIN_LIST_COUNTRY}" />
18         </ui:define>
19
20         <ui:define name="content">
21                 <h:form id="form-list-countries">
22                         <p:dataTable
23                                 id="countryList"
24                                 var="country"
25                                 value="#{countryListController.allCountries}"
26                                 paginator="true"
27                                 paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
28                                 filteredValue="#{countryListController.filteredCountries}"
29                                 rows="10"
30                                 rowKey="#{country.countryId}"
31                                 reflow="true"
32                                 resizableColumns="true"
33                                 rowsPerPageTemplate="5,10,20,50,100"
34                                 sortMode="multiple"
35                                 summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_COUNTRY}"
36                                 emptyMessage="#{msg.ADMIN_EMPTY_LIST_COUNTRY}"
37                                 widgetVar="countryList"
38                                 selectionMode="single"
39                                 selection="#{countryListController.selectedCountry}"
40                                 skipChildren="true"
41                                 >
42
43                                 <f:facet name="header">
44                                         <p:panelGrid
45                                                 columns="3"
46                                                 layout="grid"
47                                                 columnClasses="ui-grid-col-4,ui-grid-col-6,ui-grid-col-2"
48                                                 >
49                                                 <p:spacer />
50
51                                                 <p:panelGrid
52                                                         columns="2"
53                                                         columnClasses="ui-grid-4,ui-grid-8"
54                                                         layout="grid"
55                                                         styleClass="ui-noborder"
56                                                         >
57                                                         <p:outputLabel
58                                                                 for="globalFilter"
59                                                                 value="#{msg.SEARCH_ALL_FIELDS}"
60                                                                 style="float: right"
61                                                                 />
62
63                                                         <p:inputText
64                                                                 id="globalFilter"
65                                                                 onkeyup="PF('countryList').filter()"
66                                                                 placeholder="#{msg.ENTER_KEYWORD}"
67                                                                 />
68                                                 </p:panelGrid>
69
70                                                 <p:outputPanel>
71                                                         <p:spacer height="4" />
72
73                                                         <p:commandButton
74                                                                 id="toggler"
75                                                                 type="button"
76                                                                 value="#{msg.SELECT_SHOWN_COLUMNS}"
77                                                                 styleClass="column-selector"
78                                                                 />
79
80                                                         <p:columnToggler datasource="countryList" trigger="toggler" />
81                                                 </p:outputPanel>
82                                         </p:panelGrid>
83                                 </f:facet>
84
85                                 <p:ajax
86                                         event="rowSelect"
87                                         update=":master:form-list-countries:country-details"
88                                         oncomplete="PF('countryDialog').show()"
89                                         />
90
91                                 <p:column
92                                         headerText="#{msg.ID_HEADER}"
93                                         sortBy="#{country.countryId}"
94                                         filterable="false"
95                                         >
96                                         <p:link
97                                                 outcome="admin_show_country"
98                                                 value="#{country.countryId}"
99                                                 title="#{msg.ADMIN_LINK_SHOW_COUNTRY_TITLE}"
100                                                 >
101                                                 <f:param name="countryId" value="#{country.countryId}" />
102                                         </p:link>
103                                 </p:column>
104
105                                 <p:column
106                                         headerText="#{msg.DATA_COUNTRY_CODE}"
107                                         sortBy="#{country.countryCode}"
108                                         filterBy="#{country.countryCode}"
109                                         filterMatchMode="contains"
110                                         >
111
112                                         <h:outputText value="#{country.countryCode}" />
113                                 </p:column>
114
115                                 <p:column
116                                         headerText="#{msg.DATA_COUNTRY_NAME}"
117                                         sortBy="#{msg[country.countryI18nKey]}"
118                                         filterBy="#{msg[country.countryI18nKey]}"
119                                         filterMatchMode="contains"
120                                         >
121
122                                         <h:outputText value="#{msg[country.countryI18nKey]}" />
123                                 </p:column>
124
125                                 <p:column
126                                         headerText="#{msg.DATA_COUNTRY_EXTERNAL_DIAL_PREFIX}"
127                                         sortBy="#{country.countryExternalDialPrefix}"
128                                         filterBy="#{country.countryExternalDialPrefix}"
129                                         filterMatchMode="contains"
130                                         >
131
132                                         <h:outputText value="#{country.countryExternalDialPrefix}" />
133                                 </p:column>
134
135                                 <p:column
136                                         headerText="#{msg.DATA_COUNTRY_ABROAD_DIAL_PREFIX}"
137                                         sortBy="#{country.countryAbroadDialPrefix}"
138                                         filterBy="#{country.countryAbroadDialPrefix}"
139                                         filterMatchMode="contains"
140                                         >
141
142                                         <h:outputText value="#{country.countryAbroadDialPrefix}" />
143                                 </p:column>
144
145                                 <p:column
146                                         headerText="#{msg.DATA_IS_REQUIRED}"
147                                         sortBy="#{country.countryIsLocalPrefixRequired}"
148                                         filterBy="#{country.countryIsLocalPrefixRequired}"
149                                         filterMatchMode="contains"
150                                         >
151
152                                         <h:outputText value="#{country.countryIsLocalPrefixRequired ? msg.CHOICE_YES : msg.CHOICE_NO}" />
153                                 </p:column>
154
155                                 <p:column
156                                         headerText="#{msg.DATA_COUNTRY_PHONE_CODE}"
157                                         sortBy="#{country.countryPhoneCode}"
158                                         filterBy="#{country.countryPhoneCode}"
159                                         filterMatchMode="contains"
160                                         >
161
162                                         <h:outputText value="#{country.countryPhoneCode}" />
163                                 </p:column>
164
165                                 <p:column
166                                         headerText="#{msg.ENTRY_CREATED_HEADER}"
167                                         sortBy="#{country.countryEntryCreated}"
168                                         filterBy="#{country.countryEntryCreated}"
169                                         filterMatchMode="contains"
170                                         >
171
172                                         <h:outputText value="#{country.countryEntryCreated}">
173                                                 <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
174                                         </h:outputText>
175                                 </p:column>
176
177                                 <p:column
178                                         headerText="#{msg.ENTRY_UPDATED_HEADER}"
179                                         sortBy="#{country.countryEntryUpdated}"
180                                         filterBy="#{country.countryEntryUpdated}"
181                                         filterMatchMode="contains"
182                                         >
183
184                                         <h:outputText value="#{country.countryEntryUpdated}">
185                                                 <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
186                                         </h:outputText>
187                                 </p:column>
188
189                                 <p:column
190                                         headerText="#{msg.ADMIN_ACTION_LINKS_HEADER}"
191                                         filterable="false"
192                                         sortable="false"
193                                         >
194                                         <links:outputCountryAdminDropdownMenu country="#{country}" />
195                                 </p:column>
196                         </p:dataTable>
197
198                         <p:dialog
199                                 dynamic="true"
200                                 modal="true"
201                                 resizable="false"
202                                 header="#{msg.ADMIN_SINGLE_COUNTRY_DETAILS_HEADER}"
203                                 hideEffect="fade"
204                                 showEffect="fade"
205                                 widgetVar="countryDialog"
206                                 position="top"
207                                 responsive="true"
208                                 closeOnEscape="true"
209                                 >
210                                 <p:outputPanel id="country-details">
211                                         <p:panelGrid columns="2" rendered="#{not empty countryListController.selectedCountry}">
212                                                 <f:facet name="header">
213                                                         <h:outputFormat value="#{msg.ADMIN_COUNTRY_DETAILS_HEADER}">
214                                                                 <f:param value="#{msg[countryListController.selectedCountry.countryI18nKey]}" />
215                                                                 <f:param value="#{countryListController.selectedCountry.countryId}" />
216                                                         </h:outputFormat>
217                                                 </f:facet>
218
219                                                 <p:outputLabel value="#{msg.ID_HEADER}" title="#{msg.COUNTRY_ID_NUMBER_TITLE}" />
220                                                 <h:outputText value="#{countryListController.selectedCountry.countryId}" />
221                                         </p:panelGrid>
222                                 </p:outputPanel>
223                         </p:dialog>
224                 </h:form>
225
226                 <h:form>
227                         <h:panelGroup layout="block">
228                                 <div class="table-header">
229                                         <h:outputText value="#{msg.ADMIN_ADD_COUNTRY_TITLE}" />
230                                 </div>
231
232                                 <ui:include src="/WEB-INF/templates/admin/country/admin_form_country_data.tpl" />
233
234                                 <p:panelGrid columns="2" layout="grid">
235                                         <p:commandButton
236                                                 type="reset"
237                                                 value="#{msg.BUTTON_RESET_FORM}"
238                                                 />
239
240                                         <p:commandButton
241                                                 type="submit"
242                                                 value="#{msg.BUTTON_ADMIN_ADD_COUNTRY}"
243                                                 action="#{adminCountryController.addCountry()}"
244                                                 update=":master:form-list-countries:countryList"
245                                                 />
246                                 </p:panelGrid>
247                         </h:panelGroup>
248
249                         <div class="para notice">
250                                 <h:outputText value="#{msg.ADMIN_ADD_COUNTRY_NOTICES}" />
251                                 <ul>
252                                         <li><h:outputText value="#{msg.ADMIN_ADD_COUNTRY_I18N_KEY_NOTICE}" /></li>
253                                 </ul>
254                         </div>
255                 </h:form>
256         </ui:define>
257 </ui:composition>