Files
unionflow-client-quarkus-pr…/target/classes/META-INF/resources/pages/secure/aide/history.xhtml

133 lines
7.1 KiB
HTML

<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
template="/templates/main-template.xhtml">
<ui:param name="page" value="#{demandesAideBean}"/>
<ui:define name="title">Historique des Demandes d'Aide - UnionFlow</ui:define>
<ui:define name="content">
<h:form id="formHistory">
<p:messages id="messages" showDetail="true" closable="true"/>
<!-- En-tête -->
<div class="card mb-3">
<div class="flex justify-content-between align-items-center flex-column md:flex-row">
<div>
<h3 class="m-0">
<i class="pi pi-history text-primary mr-2"></i>
Historique des Demandes d'Aide
</h3>
<p class="text-600 m-0 mt-2">
Consultez l'historique complet de toutes les demandes d'aide
</p>
</div>
</div>
</div>
<!-- Filtres -->
<div class="card mb-3">
<h5 class="mb-3">Filtres</h5>
<div class="grid">
<div class="col-12 md:col-3">
<p:outputLabel for="statutFilter" value="Statut"/>
<p:selectOneMenu id="statutFilter" value="#{demandesAideBean.filtres.statut}" styleClass="w-full">
<f:selectItem itemLabel="Tous" itemValue=""/>
<f:selectItem itemLabel="En attente" itemValue="EN_ATTENTE"/>
<f:selectItem itemLabel="Approuvée" itemValue="APPROUVEE"/>
<f:selectItem itemLabel="Rejetée" itemValue="REJETEE"/>
<p:ajax event="change" update="dtHistory"/>
</p:selectOneMenu>
</div>
<div class="col-12 md:col-3">
<p:outputLabel for="typeFilter" value="Type"/>
<p:selectOneMenu id="typeFilter" value="#{demandesAideBean.filtres.type}" styleClass="w-full">
<f:selectItem itemLabel="Tous" itemValue=""/>
<f:selectItem itemLabel="Médicale" itemValue="AIDE_MEDICALE"/>
<f:selectItem itemLabel="Alimentaire" itemValue="AIDE_ALIMENTAIRE"/>
<f:selectItem itemLabel="Éducative" itemValue="AIDE_EDUCATIVE"/>
<p:ajax event="change" update="dtHistory"/>
</p:selectOneMenu>
</div>
<div class="col-12 md:col-3">
<p:outputLabel for="dateDebut" value="Date début"/>
<p:calendar id="dateDebut" value="#{demandesAideBean.filtres.dateDebut}"
styleClass="w-full" pattern="dd/MM/yyyy">
<p:ajax event="dateSelect" update="dtHistory"/>
</p:calendar>
</div>
<div class="col-12 md:col-3">
<p:outputLabel for="dateFin" value="Date fin"/>
<p:calendar id="dateFin" value="#{demandesAideBean.filtres.dateFin}"
styleClass="w-full" pattern="dd/MM/yyyy">
<p:ajax event="dateSelect" update="dtHistory"/>
</p:calendar>
</div>
</div>
<div class="flex justify-content-end gap-2 mt-3">
<p:commandButton value="Rechercher"
icon="pi pi-search"
styleClass="ui-button-primary"
action="#{demandesAideBean.rechercher}"
update="dtHistory"/>
<p:commandButton value="Réinitialiser"
icon="pi pi-refresh"
styleClass="ui-button-outlined ui-button-secondary"
action="#{demandesAideBean.reinitialiserFiltres}"
update="@form"/>
</div>
</div>
<!-- Liste -->
<div class="card">
<h5 class="mb-3">Historique Complet</h5>
<p:dataTable id="dtHistory"
var="demande"
value="#{demandesAideBean.demandesFiltrees}"
paginator="true"
rows="10"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,25"
currentPageReportTemplate="Affichage {startRecord}-{endRecord} sur {totalRecords}">
<p:column headerText="Demandeur" sortBy="#{demande.demandeur}">
<div>
<div class="font-medium">#{demande.demandeur}</div>
<small class="text-600">#{demande.localisation}</small>
</div>
</p:column>
<p:column headerText="Type" sortBy="#{demande.type}">
<p:tag value="#{demande.typeLibelle}" severity="#{demande.typeSeverity}" icon="pi #{demande.typeIcon}"/>
</p:column>
<p:column headerText="Montant" sortBy="#{demande.montantDemande}">
<div class="font-bold text-green-500">#{demande.montantDemande} FCFA</div>
</p:column>
<p:column headerText="Statut" sortBy="#{demande.statut}">
<p:tag value="#{demande.statutLibelle}"
severity="#{demande.statutSeverity}"
icon="pi #{demande.statutIcon}"/>
</p:column>
<p:column headerText="Date" sortBy="#{demande.dateDemande}">
<h:outputText value="#{demande.dateDemande}">
<f:convertDateTime pattern="dd/MM/yyyy"/>
</h:outputText>
</p:column>
<p:column headerText="Actions" style="width:150px">
<p:commandButton icon="pi pi-eye"
styleClass="ui-button-rounded ui-button-text ui-button-info"
action="#{demandesAideBean.voirDetails(demande)}"
title="Voir détails"/>
</p:column>
</p:dataTable>
</div>
</h:form>
</ui:define>
</ui:composition>