gourmetj-springboot/src/main/resources/META-INF/resources/main.xhtml

83 lines
3.4 KiB
HTML
Raw Normal View History

2021-12-28 20:59:40 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition template="/WEB-INF/layout/layout.xhtml"
2021-12-28 22:19:42 +00:00
xmlns:h="http://xmlns.jcp.org/jsf/html"
2021-12-28 20:59:40 +00:00
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
2021-12-28 20:59:40 +00:00
>
<ui:define name="title">Gourmet Recipe Manager</ui:define>
<ui:define name="content">
2021-12-28 22:19:42 +00:00
<h:form id="form1">
<div>
<span class="ui-input-icon-left"> <i
class="pi pi-search"
/> <p:inputText id="searchFor" size="45"
placeholder="Recipe title, (todo cuisine, etc.)"
value="#{adminMainBean.searchText}"
2021-12-28 20:59:40 +00:00
>
<f:ajax event="change" execute="@this"
render="form2:table1"
listener="#{adminMainBean.ajaxUpdateList}"
/>
</p:inputText>
</span>
<p:commandButton id="find" value="Find"
defaultCommand="true"
action="#{adminMainBean.doFind}"
/>
<p:commandButton id="ctlClear" value="Clear"
immediate="true"
update="form1:searchFor form2:table1"
action="#{adminMainBean.ajaxClearList}"
/>
<p:commandButton value="New Recipe"
action="#{adminMainBean.doNewRecipe}"
/>
<p:defaultCommand target="find" />
</div>
2021-12-28 22:19:42 +00:00
</h:form>
<h:form id="form2">
<p:dataTable id="table1" rows="30"
value="#{adminMainBean.searchResults}" var="row"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records"
rowsPerPageTemplate="5,10,15,20,30"
>
<p:column headerText="Icon">
<img height="40" src="/img/thumb/#{row.id}" />
</p:column>
<p:column headerText="Recipe"
style="width: 600px"
>
<h:commandLink
action="#{adminMainBean.showRecipe}"
value="#{row.title}"
/>
</p:column>
<p:column headerText="Category">
<h:outputText
2022-01-03 21:48:15 +00:00
value="#{userSession.formatCategories(row)}"
/>
</p:column>
<p:column headerText="Cuisine">
<h:outputText value="#{row.cuisine}" />
</p:column>
<p:column headerText="Rating">
<p:rating value="#{row.rating}"
readonly="true"
/>
</p:column>
<p:column headerText="Source">
<h:outputText value="#{row.source}" />
</p:column>
<p:column headerText="Prep Time">
<h:outputText
2022-01-03 21:48:15 +00:00
value="#{userSession.formatTime(row.preptime)}"
/>
</p:column>
2021-12-28 22:19:42 +00:00
</p:dataTable>
</h:form>
2021-12-28 20:59:40 +00:00
</ui:define>
</ui:composition>