]> 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.ENTRY_CREATED_HEADER}"
148                                         sortBy="#{country.countryEntryCreated}"
149                                         filterBy="#{country.countryEntryCreated}"
150                                         filterMatchMode="contains"
151                                         >
152
153                                         <h:outputText value="#{country.countryEntryCreated}">
154                                                 <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
155                                         </h:outputText>
156                                 </p:column>
157
158                                 <p:column
159                                         headerText="#{msg.ENTRY_UPDATED_HEADER}"
160                                         sortBy="#{country.countryEntryUpdated}"
161                                         filterBy="#{country.countryEntryUpdated}"
162                                         filterMatchMode="contains"
163                                         >
164
165                                         <h:outputText value="#{country.countryEntryUpdated}">
166                                                 <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
167                                         </h:outputText>
168                                 </p:column>
169
170                                 <p:column
171                                         headerText="#{msg.ADMIN_ACTION_LINKS_HEADER}"
172                                         filterable="false"
173                                         sortable="false"
174                                         >
175                                         <links:outputCountryAdminDropdownMenu country="#{country}" />
176                                 </p:column>
177                         </p:dataTable>
178
179                         <p:dialog
180                                 dynamic="true"
181                                 modal="true"
182                                 resizable="false"
183                                 header="#{msg.ADMIN_SINGLE_COUNTRY_DETAILS_HEADER}"
184                                 hideEffect="fade"
185                                 showEffect="fade"
186                                 widgetVar="countryDialog"
187                                 position="top"
188                                 responsive="true"
189                                 closeOnEscape="true"
190                                 >
191                                 <p:outputPanel id="country-details">
192                                         <p:panelGrid columns="2" rendered="#{not empty countryListController.selectedCountry}">
193                                                 <f:facet name="header">
194                                                         <h:outputFormat value="#{msg.ADMIN_COUNTRY_DETAILS_HEADER}">
195                                                                 <f:param value="#{msg[countryListController.selectedCountry.countryI18nKey]}" />
196                                                                 <f:param value="#{countryListController.selectedCountry.countryId}" />
197                                                         </h:outputFormat>
198                                                 </f:facet>
199
200                                                 <p:outputLabel value="#{msg.ID_HEADER}" title="#{msg.COUNTRY_ID_NUMBER_TITLE}" />
201                                                 <h:outputText value="#{countryListController.selectedCountry.countryId}" />
202                                         </p:panelGrid>
203                                 </p:outputPanel>
204                         </p:dialog>
205                 </h:form>
206
207                 <h:form>
208                         <h:panelGroup layout="block">
209                                 <div class="table-header">
210                                         <h:outputText value="#{msg.ADMIN_ADD_COUNTRY_TITLE}" />
211                                 </div>
212
213                                 <ui:include src="/WEB-INF/templates/admin/country/admin_form_country_data.tpl" />
214
215                                 <p:panelGrid columns="2" layout="grid">
216                                         <p:commandButton
217                                                 type="reset"
218                                                 value="#{msg.BUTTON_RESET_FORM}"
219                                                 />
220
221                                         <p:commandButton
222                                                 type="submit"
223                                                 value="#{msg.BUTTON_ADMIN_ADD_COUNTRY}"
224                                                 action="#{adminCountryController.addCountry()}"
225                                                 update=":master:form-list-countries:countryList"
226                                                 />
227                                 </p:panelGrid>
228                         </h:panelGroup>
229
230                         <div class="para notice">
231                                 <h:outputText value="#{msg.ADMIN_ADD_COUNTRY_NOTICES}" />
232                                 <ul>
233                                         <li><h:outputText value="#{msg.ADMIN_ADD_COUNTRY_I18N_KEY_NOTICE}" /></li>
234                                 </ul>
235                         </div>
236                 </h:form>
237         </ui:define>
238 </ui:composition>