]> 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 for="globalFilter" value="#{msg.SEARCH_ALL_FIELDS}" style="float: right" />
58                                                         <p:inputText id="globalFilter" onkeyup="PF('countryList').filter()" placeholder="#{msg.ENTER_KEYWORD}"/>
59                                                 </p:panelGrid>
60
61                                                 <p:outputPanel>
62                                                         <p:spacer height="4" />
63
64                                                         <p:commandButton
65                                                                 id="toggler"
66                                                                 type="button"
67                                                                 value="#{msg.SELECT_SHOWN_COLUMNS}"
68                                                                 styleClass="column-selector"
69                                                                 />
70
71                                                         <p:columnToggler datasource="countryList" trigger="toggler" />
72                                                 </p:outputPanel>
73                                         </p:panelGrid>
74                                 </f:facet>
75
76                                 <p:ajax
77                                         event="rowSelect"
78                                         update=":master:form-list-countries:country-details"
79                                         oncomplete="PF('countryDialog').show()"
80                                         />
81
82                                 <p:column
83                                         headerText="#{msg.ID_HEADER}"
84                                         sortBy="#{country.countryId}"
85                                         filterable="false"
86                                         >
87                                         <p:link
88                                                 outcome="admin_show_country"
89                                                 value="#{country.countryId}"
90                                                 title="#{msg.ADMIN_LINK_SHOW_COUNTRY_TITLE}"
91                                                 >
92                                                 <f:param name="countryId" value="#{country.countryId}" />
93                                         </p:link>
94                                 </p:column>
95
96                                 <p:column
97                                         headerText="#{msg.DATA_COUNTRY_CODE}"
98                                         sortBy="#{country.countryCode}"
99                                         filterBy="#{country.countryCode}"
100                                         filterMatchMode="contains"
101                                         >
102
103                                         <h:outputText value="#{country.countryCode}" />
104                                 </p:column>
105
106                                 <p:column
107                                         headerText="#{msg.DATA_COUNTRY_NAME}"
108                                         sortBy="#{msg[country.countryI18nKey]}"
109                                         filterBy="#{msg[country.countryI18nKey]}"
110                                         filterMatchMode="contains"
111                                         >
112
113                                         <h:outputText value="#{msg[country.countryI18nKey]}" />
114                                 </p:column>
115
116                                 <p:column
117                                         headerText="#{msg.DATA_COUNTRY_EXTERNAL_DIAL_PREFIX}"
118                                         sortBy="#{country.countryExternalDialPrefix}"
119                                         filterBy="#{country.countryExternalDialPrefix}"
120                                         filterMatchMode="contains"
121                                         >
122
123                                         <h:outputText value="#{country.countryExternalDialPrefix}" />
124                                 </p:column>
125
126                                 <p:column
127                                         headerText="#{msg.DATA_COUNTRY_ABROAD_DIAL_PREFIX}"
128                                         sortBy="#{country.countryAbroadDialPrefix}"
129                                         filterBy="#{country.countryAbroadDialPrefix}"
130                                         filterMatchMode="contains"
131                                         >
132
133                                         <h:outputText value="#{country.countryAbroadDialPrefix}" />
134                                 </p:column>
135
136                                 <p:column
137                                         headerText="#{msg.DATA_IS_REQUIRED}"
138                                         sortBy="#{country.countryIsLocalPrefixRequired}"
139                                         filterBy="#{country.countryIsLocalPrefixRequired}"
140                                         filterMatchMode="contains"
141                                         >
142
143                                         <h:outputText value="#{country.countryIsLocalPrefixRequired ? msg.CHOICE_YES : msg.CHOICE_NO}" />
144                                 </p:column>
145
146                                 <p:column
147                                         headerText="#{msg.DATA_COUNTRY_PHONE_CODE}"
148                                         sortBy="#{country.countryPhoneCode}"
149                                         filterBy="#{country.countryPhoneCode}"
150                                         filterMatchMode="contains"
151                                         >
152
153                                         <h:outputText value="#{country.countryPhoneCode}" />
154                                 </p:column>
155
156                                 <p:column
157                                         headerText="#{msg.ENTRY_CREATED_HEADER}"
158                                         sortBy="#{country.countryEntryCreated}"
159                                         filterBy="#{country.countryEntryCreated}"
160                                         filterMatchMode="contains"
161                                         >
162
163                                         <h:outputText value="#{country.countryEntryCreated}">
164                                                 <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
165                                         </h:outputText>
166                                 </p:column>
167
168                                 <p:column
169                                         headerText="#{msg.ENTRY_UPDATED_HEADER}"
170                                         sortBy="#{country.countryEntryUpdated}"
171                                         filterBy="#{country.countryEntryUpdated}"
172                                         filterMatchMode="contains"
173                                         >
174
175                                         <h:outputText value="#{country.countryEntryUpdated}">
176                                                 <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
177                                         </h:outputText>
178                                 </p:column>
179
180                                 <p:column
181                                         headerText="#{msg.ADMIN_ACTION_LINKS_HEADER}"
182                                         filterable="false"
183                                         sortable="false"
184                                         >
185                                         <links:outputCountryAdminDropdownMenu country="#{country}" />
186                                 </p:column>
187                         </p:dataTable>
188
189                         <p:dialog
190                                 dynamic="true"
191                                 modal="true"
192                                 resizable="false"
193                                 header="#{msg.ADMIN_SINGLE_COUNTRY_DETAILS_HEADER}"
194                                 hideEffect="fade"
195                                 showEffect="fade"
196                                 widgetVar="countryDialog"
197                                 position="top"
198                                 responsive="true"
199                                 closeOnEscape="true"
200                                 >
201                                 <p:outputPanel id="country-details">
202                                         <p:panelGrid columns="2" rendered="#{not empty countryListController.selectedCountry}">
203                                                 <f:facet name="header">
204                                                         <h:outputFormat value="#{msg.ADMIN_COUNTRY_DETAILS_HEADER}">
205                                                                 <f:param value="#{msg[countryListController.selectedCountry.countryI18nKey]}" />
206                                                                 <f:param value="#{countryListController.selectedCountry.countryId}" />
207                                                         </h:outputFormat>
208                                                 </f:facet>
209
210                                                 <p:outputLabel value="#{msg.ID_HEADER}" title="#{msg.COUNTRY_ID_NUMBER_TITLE}" />
211                                                 <h:outputText value="#{countryListController.selectedCountry.countryId}" />
212                                         </p:panelGrid>
213                                 </p:outputPanel>
214                         </p:dialog>
215                 </h:form>
216
217                 <h:form>
218                         <h:panelGroup layout="block">
219                                 <div class="table-header">
220                                         <h:outputText value="#{msg.ADMIN_ADD_COUNTRY_TITLE}" />
221                                 </div>
222
223                                 <ui:include src="/WEB-INF/templates/admin/country/admin_form_country_data.tpl" />
224
225                                 <p:panelGrid columns="2" layout="grid">
226                                         <p:commandButton
227                                                 type="reset"
228                                                 value="#{msg.BUTTON_RESET_FORM}"
229                                                 />
230
231                                         <p:commandButton
232                                                 type="submit"
233                                                 value="#{msg.BUTTON_ADMIN_ADD_COUNTRY}"
234                                                 action="#{adminCountryController.addCountry()}"
235                                                 update=":master:form-list-countries:countryList"
236                                                 />
237                                 </p:panelGrid>
238                         </h:panelGroup>
239
240                         <div class="para notice">
241                                 <h:outputText value="#{msg.ADMIN_ADD_COUNTRY_NOTICES}" />
242                                 <ul>
243                                         <li><h:outputText value="#{msg.ADMIN_ADD_COUNTRY_I18N_KEY_NOTICE}" /></li>
244                                 </ul>
245                         </div>
246                 </h:form>
247         </ui:define>
248 </ui:composition>