Web implementation of the Gourmet Recipe Manager
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.
 
 
 
 

167 lines
6.7 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"
>
<!-- Tabbed page for the Mainpage "Shopping..." button -->
<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>
This is the list of recipe items you've selected to shop for.
<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: 60em"
value="#{shoppingListBean.recipeList}"
var="item"
>
<f:facet name="header">
<h:outputText value="Recipes " />
<p:commandButton
update="@parent:tblRecipes"
value="Clear Recipes"
immediate="true"
action="#{shoppingListBean.clearRecipeList}"
/>
</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="vertical-align: top; margin-left: 1em; margin-right: 1em;"
>
<p:dataTable id="tblShopIngredients"
value="#{shoppingListBean.ingredientList}"
style="width: 60em;"
sortBy="#{item.shopCat}" var="item"
>
<f:facet name="header">
<h:outputText
styleClass="subtitle"
value="Ingredients"
/>
</f:facet>
<p:column colspan="4">
<h:outputText
value="#{item.shopCat}"
/>
</p:column>
<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 id="outItem"
value="#{item.item}"
styleClass="#{(item.inPantry) ? 'noRecipe' :'plusRecipe' }"
/>
</p:column>
<p:column style="width: 3em">
<f:facet name="header">
<h:outputText value="Pantry" />
</f:facet>
<p:selectBooleanCheckbox
value="#{item.inPantry}"
>
<p:ajax update="outItem"
listener="#{shoppingListBean.updatePantry(item)}"
/>
</p:selectBooleanCheckbox>
</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="tabPantry" title="Pantry">
<h:outputText value="Stuff already in the pantry." />
<h:outputText value="For future implementation" />
</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?redirect=true"
/>
</h:form>
</ui:define>
</ui:composition>