-<?xml version="1.0" encoding="UTF-8" ?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
-<html\r
- lang="#{localizationController.language}" xml:lang="#{localizationController.language}"\r
- xmlns="http://www.w3.org/1999/xhtml"\r
- xmlns:ui="http://xmlns.jcp.org/jsf/facelets"\r
- xmlns:h="http://xmlns.jcp.org/jsf/html"\r
- xmlns:f="http://xmlns.jcp.org/jsf/core"\r
- >\r
-\r
- <ui:composition template="/WEB-INF/templates/admin/admin_base.tpl">\r
- <ui:define name="admin_title">#{msg.PAGE_TITLE_ADMIN_LIST_COUNTRY}</ui:define>\r
-\r
- <ui:define name="content_header">\r
- #{msg.CONTENT_TITLE_ADMIN_LIST_COUNTRY}\r
- </ui:define>\r
-\r
- <ui:define name="content">\r
- <h:dataTable id="table_list_countries" var="country" value="#{adminCountryController.allCountries()}" styleClass="table_medium" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_COUNTRIES}" rendered="#{adminCountryController.hasCountries()}">\r
- <h:column>\r
- <f:facet name="header">#{msg.ADMIN_LIST_COUNTRY_DATA_COUNTRY_ID}</f:facet>\r
-\r
- <h:link outcome="admin_edit_country" title="#{msg.ADMIN_LINK_EDIT_DELETE_COUNTRY_TITLE}" value="#{country.countryId}">\r
- <f:param name="countryId" value="#{country.countryId}" />\r
- </h:link>\r
- </h:column>\r
-\r
- <h:column>\r
- <f:facet name="header">#{msg.ADMIN_LIST_COUNTRY_DATA_COUNTRY_CODE}</f:facet>\r
-\r
- <h:outputText value="#{country.countryCode}" />\r
- </h:column>\r
-\r
- <h:column>\r
- <f:facet name="header">#{msg.ADMIN_LIST_COUNTRY_DATA_COUNTRY_EXTERNAL_DIAL_PREFIX}</f:facet>\r
-\r
- <h:outputText value="#{country.countryExternalDialPrefix}" />\r
- </h:column>\r
-\r
- <h:column>\r
- <f:facet name="header">#{msg.ADMIN_LIST_COUNTRY_DATA_COUNTRY_NAME}</f:facet>\r
-\r
- <h:outputText value="#{msg[country.countryI18nkey]}" />\r
- </h:column>\r
- </h:dataTable>\r
-\r
- <h:form id="add_country">\r
- <div class="table_medium">\r
- <div class="table_header">\r
- #{msg.ADMIN_ADD_COUNTRY_TITLE}\r
- </div>\r
-\r
- <ui:include src="/WEB-INF/templates/admin/country/admin_form_country_data.tpl" />\r
-\r
- <div class="table_footer">\r
- <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />\r
- <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_ADMIN_ADD_COUNTRY}" action="#{adminCountryController.addCountry()}" />\r
- </div>\r
- </div>\r
-\r
- <div class="para notice">\r
- #{msg.ADMIN_ADD_COUNTRY_NOTICES}\r
- <ul>\r
- <li>#{msg.ADMIN_ADD_COUNTRY_I18N_KEY_NOTICE}</li>\r
- </ul>\r
- </div>\r
- </h:form>\r
- </ui:define>\r
- </ui:composition>\r
-</html>\r
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+ template="/WEB-INF/templates/admin/admin_base.tpl"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ xmlns:p="http://primefaces.org/ui"
+ >
+
+ <ui:define name="document_admin_title">
+ <h:outputText value="#{msg.PAGE_TITLE_ADMIN_LIST_COUNTRY}" />
+ </ui:define>
+
+ <ui:define name="content_header">
+ <h:outputText value="#{msg.CONTENT_TITLE_ADMIN_LIST_COUNTRY}" />
+ </ui:define>
+
+ <ui:define name="content">
+ <h:form id="form-list-countries">
+ <p:dataTable
+ id="countryList"
+ var="country"
+ value="#{countryListController.allCountries}"
+ paginator="true"
+ paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
+ filteredValue="#{countryListController.filteredCountries}"
+ rows="10"
+ 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"
+ >
+
+ <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}"
+ title="#{msg.ADMIN_LINK_SHOW_COUNTRY_TITLE}"
+ >
+ <f:param name="countryId" value="#{country.countryId}" />
+ </p:link>
+ </p:column>
+
+ <p:column
+ headerText="#{msg.DATA_COUNTRY_CODE}"
+ sortBy="#{country.countryCode}"
+ filterBy="#{country.countryCode}"
+ filterMatchMode="contains"
+ >
+
+ <h:outputText value="#{country.countryCode}" />
+ </p:column>
+
+ <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
+ headerText="#{msg.DATA_COUNTRY_ABROAD_DIAL_PREFIX}"
+ sortBy="#{country.countryAbroadDialPrefix}"
+ filterBy="#{country.countryAbroadDialPrefix}"
+ filterMatchMode="contains"
+ >
+
+ <h:outputText value="#{country.countryAbroadDialPrefix}" />
+ </p:column>
+
+ <p:column
+ headerText="#{msg.DATA_IS_REQUIRED}"
+ sortBy="#{country.countryIsLocalPrefixRequired}"
+ filterBy="#{country.countryIsLocalPrefixRequired}"
+ filterMatchMode="contains"
+ >
+
+ <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>
+ <h:panelGroup layout="block">
+ <div class="table-header">
+ <h:outputText value="#{msg.ADMIN_ADD_COUNTRY_TITLE}" />
+ </div>
+
+ <ui:include src="/WEB-INF/templates/admin/country/admin_form_country_data.tpl" />
+
+ <p:panelGrid columns="2" layout="grid">
+ <p:commandButton
+ type="reset"
+ value="#{msg.BUTTON_RESET_FORM}"
+ />
+
+ <p:commandButton
+ type="submit"
+ value="#{msg.BUTTON_ADMIN_ADD_COUNTRY}"
+ action="#{adminCountryController.addCountry()}"
+ update="form-list-countries:countryList"
+ />
+ </p:panelGrid>
+ </h:panelGroup>
+
+ <div class="para notice">
+ <h:outputText value="#{msg.ADMIN_ADD_COUNTRY_NOTICES}" />
+ <ul>
+ <li><h:outputText value="#{msg.ADMIN_ADD_COUNTRY_I18N_KEY_NOTICE}" /></li>
+ </ul>
+ </div>
+ </h:form>
+ </ui:define>
+</ui:composition>