You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
3.8 KiB
92 lines
3.8 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<ui:composition template="/WEB-INF/layout/layout.xhtml"
|
|
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
|
xmlns:f="http://xmlns.jcp.org/jsf/core"
|
|
xmlns:ui="http://java.sun.com/jsf/facelets"
|
|
xmlns:p="http://primefaces.org/ui"
|
|
>
|
|
<ui:define name="title">Gourmet Recipe Manager</ui:define>
|
|
<ui:define name="content">
|
|
<h:messages />
|
|
<h:form id="form1">
|
|
<div>
|
|
<p:inputText id="searchFor" size="45"
|
|
placeholder="Recipe title/cuisine/category, etc.)"
|
|
value="#{adminMainBean.searchText}"
|
|
>
|
|
<f:ajax event="change" execute="@this"
|
|
render="form2:table1"
|
|
listener="#{adminMainBean.ajaxUpdateList}"
|
|
/>
|
|
</p:inputText>
|
|
<p:defaultCommand target="find" />
|
|
<p:commandButton id="find" value="Find"
|
|
icon="ui-icon-search"
|
|
action="#{adminMainBean.doFind}"
|
|
update=":form2:table1"
|
|
/>
|
|
<p:outputLabel for="@next" value="Search for " />
|
|
<p:selectOneMenu id="ctlSearchType"
|
|
value="#{userSession.searchType}"
|
|
immediate="true"
|
|
>
|
|
<f:selectItems
|
|
value="#{userSession.searchTypeList}"
|
|
/>
|
|
<p:ajax />
|
|
</p:selectOneMenu>
|
|
<p:commandButton id="ctlClear" value="Clear"
|
|
icon="ui-icon-close"
|
|
update="@form:searchFor :form2:table1"
|
|
action="#{adminMainBean.ajaxClearList}"
|
|
/>
|
|
<p:commandButton value="New Recipe"
|
|
action="#{adminMainBean.doNewRecipe}"
|
|
/>
|
|
</div>
|
|
</h:form>
|
|
<h:form id="form2">
|
|
<p:dataTable id="table1" rows="30"
|
|
style="margin-top: 6px"
|
|
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
|
|
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 value="#{row.preptime}"
|
|
converter="com.mousetech.gourmetj.utils.TimeConverter"
|
|
/>
|
|
</p:column>
|
|
</p:dataTable>
|
|
</h:form>
|
|
</ui:define>
|
|
</ui:composition>
|
|
|