<ui:composition
template="/WEB-INF/templates/admin/admin_base.tpl"
xmlns="http://www.w3.org/1999/xhtml"
- 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"
<p:dataTable
id="countryList"
var="country"
- value="#{countryController.allCountries()}"
+ value="#{countryListController.allCountries}"
paginator="true"
+ paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
+ filteredValue="#{countryListController.filteredCountries}"
rows="10"
- summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_COUNTRIES}"
+ rowKey="#{country.countryId}"
+ reflow="true"
+ resizableColumns="true"
+ rowsPerPageTemplate="5,10,20,50,100"
+ sortMode="multiple"
+ summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_COUNTRY}"
emptyMessage="#{msg.ADMIN_EMPTY_LIST_COUNTRY}"
widgetVar="countryList"
+ selectionMode="single"
+ selection="#{countryListController.selectedCountry}"
+ skipChildren="true"
>
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ID_HEADER}" />
- </f:facet>
+ <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('countryList').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="countryList" trigger="toggler" />
+ </p:outputPanel>
+ </p:panelGrid>
+ </f:facet>
+
+ <p:ajax
+ event="rowSelect"
+ update="form-list-countries:country-details"
+ oncomplete="PF('countryDialog').show()"
+ />
+
+ <p:column
+ headerText="#{msg.ID_HEADER}"
+ sortBy="#{country.countryId}"
+ filterable="false"
+ >
<p:link
outcome="admin_show_country"
value="#{country.countryId}"
</p:link>
</p:column>
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_LIST_COUNTRY_DATA_COUNTRY_CODE}" />
- </f:facet>
+ <p:column
+ headerText="#{msg.DATA_COUNTRY_CODE}"
+ sortBy="#{country.countryCode}"
+ filterBy="#{country.countryCode}"
+ filterMatchMode="contains"
+ >
<h:outputText value="#{country.countryCode}" />
</p:column>
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_LIST_COUNTRY_DATA_COUNTRY_EXTERNAL_DIAL_PREFIX}" />
- </f:facet>
+ <p:column
+ headerText="#{msg.DATA_COUNTRY_NAME}"
+ sortBy="#{msg[country.countryI18nKey]}"
+ filterBy="#{msg[country.countryI18nKey]}"
+ filterMatchMode="contains"
+ >
+
+ <h:outputText value="#{msg[country.countryI18nKey]}" />
+ </p:column>
+
+ <p:column
+ headerText="#{msg.DATA_COUNTRY_EXTERNAL_DIAL_PREFIX}"
+ sortBy="#{country.countryExternalDialPrefix}"
+ filterBy="#{country.countryExternalDialPrefix}"
+ filterMatchMode="contains"
+ >
<h:outputText value="#{country.countryExternalDialPrefix}" />
</p:column>
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_LIST_COUNTRY_DATA_COUNTRY_NAME}" />
- </f:facet>
+ <p:column
+ headerText="#{msg.DATA_COUNTRY_ABROAD_DIAL_PREFIX}"
+ sortBy="#{country.countryAbroadDialPrefix}"
+ filterBy="#{country.countryAbroadDialPrefix}"
+ filterMatchMode="contains"
+ >
- <h:outputText value="#{msg[country.countryI18nKey]}" />
+ <h:outputText value="#{country.countryAbroadDialPrefix}" />
</p:column>
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_ACTION_LINKS_HEADER}" />
- </f:facet>
+ <p:column
+ headerText="#{msg.DATA_IS_REQUIRED}"
+ sortBy="#{country.countryIsLocalPrefixRequired}"
+ filterBy="#{country.countryIsLocalPrefixRequired}"
+ filterMatchMode="contains"
+ >
- <links:outputCountryAdminDropdownMenu country="#{country}" />
+ <h:outputText value="#{country.countryIsLocalPrefixRequired ? msg.CHOICE_YES : msg.CHOICE_NO}" />
+ </p:column>
+
+ <p:column
+ headerText="#{msg.DATA_COUNTRY_PHONE_CODE}"
+ sortBy="#{country.countryPhoneCode}"
+ filterBy="#{country.countryPhoneCode}"
+ filterMatchMode="contains"
+ >
+
+ <h:outputText value="#{country.countryPhoneCode}" />
+ </p:column>
+
+ <p:column
+ headerText="#{msg.ENTRY_CREATED_HEADER}"
+ sortBy="#{country.countryEntryCreated}"
+ filterBy="#{country.countryEntryCreated}"
+ filterMatchMode="contains"
+ >
+
+ <h:outputText value="#{country.countryEntryCreated}">
+ <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
+ </h:outputText>
+ </p:column>
+
+ <p:column
+ headerText="#{msg.ENTRY_UPDATED_HEADER}"
+ sortBy="#{country.countryEntryUpdated}"
+ filterBy="#{country.countryEntryUpdated}"
+ filterMatchMode="contains"
+ >
+
+ <h:outputText value="#{country.countryEntryUpdated}">
+ <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
+ </h:outputText>
+ </p:column>
+
+ <p:column
+ headerText="#{msg.ADMIN_ACTION_LINKS_HEADER}"
+ filterable="false"
+ sortable="false"
+ >
+ <p:menuButton value="#{msg.OPTIONS}">
+ <p:menuitem
+ outcome="admin_show_country"
+ value="#{msg.ADMIN_LINK_SHOW_SHORT}"
+ title="#{msg.ADMIN_LINK_SHOW_COUNTRY_TITLE}"
+ >
+ <f:param name="countryId" value="#{country.countryId}" />
+ </p:menuitem>
+
+ <p:menuitem
+ outcome="admin_edit_country"
+ value="#{msg.ADMIN_LINK_EDIT_SHORT}"
+ title="#{msg.ADMIN_LINK_EDIT_COUNTRY_TITLE}"
+ >
+ <f:param name="countryId" value="#{country.countryId}" />
+ </p:menuitem>
+
+ <p:menuitem outcome="admin_delete_country">
+ <h:outputText
+ styleClass="link-danger"
+ value="#{msg.ADMIN_LINK_DELETE_SHORT}"
+ title="#{msg.ADMIN_LINK_DELETE_COUNTRY_TITLE}"
+ />
+ <f:param name="countryId" value="#{country.countryId}" />
+ </p:menuitem>
+ </p:menuButton>
</p:column>
</p:dataTable>
+
+ <p:dialog
+ dynamic="true"
+ modal="true"
+ resizable="false"
+ header="#{msg.ADMIN_SINGLE_COUNTRY_DETAILS_HEADER}"
+ hideEffect="fade"
+ showEffect="fade"
+ widgetVar="countryDialog"
+ position="top"
+ responsive="true"
+ closeOnEscape="true"
+ >
+ <p:outputPanel id="country-details">
+ <p:panelGrid columns="2" rendered="#{not empty countryListController.selectedCountry}">
+ <f:facet name="header">
+ <h:outputFormat value="#{msg.ADMIN_COUNTRY_DETAILS_HEADER}">
+ <f:param value="#{msg[countryListController.selectedCountry.countryI18nKey]}" />
+ <f:param value="#{countryListController.selectedCountry.countryId}" />
+ </h:outputFormat>
+ </f:facet>
+
+ <p:outputLabel value="#{msg.ID_HEADER}" title="#{msg.COUNTRY_ID_NUMBER_TITLE}" />
+ <h:outputText value="#{countryListController.selectedCountry.countryId}" />
+ </p:panelGrid>
+ </p:outputPanel>
+ </p:dialog>
</h:form>
<h:form>
type="submit"
value="#{msg.BUTTON_ADMIN_ADD_COUNTRY}"
action="#{adminCountryController.addCountry()}"
- update=":master:form-list-countries:countryList"
+ update="form-list-countries:countryList"
/>
</p:panelGrid>
</h:panelGroup>