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.
141 lines
5.2 KiB
141 lines
5.2 KiB
<?xml version="1.0"?>
|
|
<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"
|
|
xmlns:c="http://xmlns.jcp.org/jstl"
|
|
>
|
|
<ui:define name="title">Gourmet Recipe Manager - Shopping</ui:define>
|
|
<ui:define name="content">
|
|
<style>
|
|
.recipeTitle {
|
|
font-size: larger;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.subtitle {
|
|
font-size: large;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.ui-panelgrid-cell {
|
|
border-width: 0;
|
|
border-style: none;
|
|
}
|
|
|
|
.noRecipe {
|
|
text-decoration: line-through;
|
|
color: gray;
|
|
}
|
|
|
|
.plusRecipe {
|
|
|
|
}
|
|
</style>
|
|
<h:messages />
|
|
<p:tabView id="tabGroupClient" orientation="left"
|
|
dynamic="true"
|
|
>
|
|
<p:tab id="overviewTab" title="Shopping List">
|
|
<h:form id="form1">
|
|
<p:dataTable id="tblRecipes"
|
|
style="width: 600px"
|
|
value="#{shoppingListBean.recipeList}"
|
|
var="item"
|
|
>
|
|
<f:facet name="header">
|
|
<h:outputText value="Recipes" />
|
|
</f:facet>
|
|
<p:column style="width: 4em">
|
|
<p:spinner required="true" min="0"
|
|
value="#{item.count}" size="1"
|
|
>
|
|
<p:ajax
|
|
listener="#{shoppingListBean.pfAmountChange}"
|
|
update="@form:tblShopIngredients rname"
|
|
/>
|
|
</p:spinner>
|
|
</p:column>
|
|
<p:column>
|
|
<h:outputText id="rname"
|
|
styleClass="#{(item.count eq 0) ? 'noRecipe' :'plusRecipe' }"
|
|
value="#{item.recipe.title}"
|
|
/>
|
|
</p:column>
|
|
</p:dataTable>
|
|
<!-- ====== Ingredients To Buy ======================= -->
|
|
<p:column id="dlIng">
|
|
<p:commandButton value="Download List" ajax="false">
|
|
<p:fileDownload
|
|
value="#{shoppingListBean.dlIngredientList}"
|
|
/>
|
|
</p:commandButton>
|
|
</p:column>
|
|
<p:column id="ingredientsc"
|
|
style="width: 25%; vertical-align: top;"
|
|
>
|
|
<p:dataTable id="tblShopIngredients"
|
|
style="width: 600px; margin-top: 10px"
|
|
value="#{shoppingListBean.ingredientList}"
|
|
sortBy="#{item.shopCat}" var="item"
|
|
>
|
|
<f:facet name="header">
|
|
<h:outputText
|
|
styleClass="subtitle"
|
|
value="Ingredients"
|
|
/>
|
|
</f:facet>
|
|
<p:headerRow>
|
|
<p:column colspan="4">
|
|
<h:outputText
|
|
value="#{item.shopCat}"
|
|
/>
|
|
</p:column>
|
|
</p:headerRow>
|
|
<p:column label="Amt"
|
|
style="width: 3em; text-align: right"
|
|
>
|
|
<h:outputText
|
|
value="#{item.displayAmount}"
|
|
/>
|
|
</p:column>
|
|
<p:column label="Units"
|
|
style="width: 5em"
|
|
>
|
|
<h:outputText
|
|
value="#{item.unit}"
|
|
/>
|
|
</p:column>
|
|
<p:column label="Item"
|
|
style="width: 20em"
|
|
>
|
|
<h:outputText
|
|
value="#{item.item}"
|
|
/>
|
|
</p:column>
|
|
</p:dataTable>
|
|
</p:column>
|
|
</h:form>
|
|
</p:tab>
|
|
<!-- -->
|
|
<p:tab id="ingshopcatEditTab"
|
|
title="Edit Shopping Categories"
|
|
>
|
|
<ui:include
|
|
src="/WEB-INF/layout/misctabs/ingshopkey.xhtml"
|
|
/>
|
|
</p:tab>
|
|
<!-- -->
|
|
<p:tab id="tabImportExport" title="Import/Export">
|
|
<h:outputText value="For future implementation" />
|
|
</p:tab>
|
|
</p:tabView>
|
|
<h:form id="frmHome">
|
|
<p:commandButton id="doHome" value="Home"
|
|
icon="ui-icon-home" ajax="false" immediate="true"
|
|
action="main.jsf"
|
|
/>
|
|
</h:form>
|
|
</ui:define>
|
|
</ui:composition> |