]> git.mxchange.org Git - jjobs-war.git/blobdiff - web/admin/country/admin_country_list.xhtml
Please cherry-pick:
[jjobs-war.git] / web / admin / country / admin_country_list.xhtml
index bcba909a0d14a68a1600f1a1f4101e6fd95ae682..9cb7b3b93abc8bfc04e446a7bf9ad238608225e5 100644 (file)
@@ -1,13 +1,14 @@
 <?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: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"
-                               xmlns:p="http://primefaces.org/ui">
-
-       <ui:define name="admin_title">
+<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">
                <h:form id="form-list-countries">
                        <p:dataTable
-                               id="table-list-countries"
+                               id="countryList"
                                var="country"
-                               value="#{countryController.allCountries()}"
-                               tableStyleClass="table table-full"
+                               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}"
-                               emptyMessage="#{msg.ADMIN_COUNTRY_LIST_EMPTY}"
+                               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.ADMIN_ID_NUMBER}" />
-                                       </f:facet>
 
-                                       <p:link outcome="admin_show_country" title="#{msg.ADMIN_LINK_SHOW_COUNTRY_TITLE}" value="#{country.countryId}">
+                               <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>
-                                       <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
+                                       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>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_ACTION_LINKS}" />
-                                       </f:facet>
+                               <p:column
+                                       headerText="#{msg.DATA_COUNTRY_PHONE_CODE}"
+                                       sortBy="#{country.countryPhoneCode}"
+                                       filterBy="#{country.countryPhoneCode}"
+                                       filterMatchMode="contains"
+                                       >
 
-                                       <links:outputCountryAdminMiniLinks country="#{country}" />
+                                       <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 styleClass="table table-full" layout="block">
+                       <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" />
 
-                               <div class="table-footer">
+                               <p:panelGrid columns="2" layout="grid">
                                        <p:commandButton
-                                               styleClass="reset divider-right"
                                                type="reset"
                                                value="#{msg.BUTTON_RESET_FORM}"
                                                />
+
                                        <p:commandButton
-                                               styleClass="submit"
                                                type="submit"
                                                value="#{msg.BUTTON_ADMIN_ADD_COUNTRY}"
                                                action="#{adminCountryController.addCountry()}"
-                                               update=":master:form-list-countries:table-list-countries"
+                                               update="form-list-countries:countryList"
                                                />
-                               </div>
+                               </p:panelGrid>
                        </h:panelGroup>
 
                        <div class="para notice">