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.
 
 
 
 

201 lines
9.4 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</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;
}
</style>
<h:messages />
<h:form id="form1">
<p:panelGrid label="#{recipeDetailBean.recipe.title}"
columns="1"
>
<p:panelGrid>
<f:facet name="header">
<h:outputText styleClass="recipeTitle"
value="#{recipeDetailBean.recipe.title}"
/>
</f:facet>
<p:row>
<p:column id="leftCol" style="width: 75%">
<p:panelGrid columns="2">
<img id="bigpix"
src="/img/picture/#{recipeDetailBean.recipe.id}"
/>
<p:panelGrid id="pnlDetails"
columns="2"
>
<p:commandButton
value="Back"
icon="ui-icon-arrowthick-1-w"
action="main.jsf"
immediate="true"
/>
<p:commandButton
value="Print"
icon="ui-icon-print"
action="recipePrint.jsf"
styleClass="ui-button-print"
immediate="true"
/>
<p:outputLabel for="@next"
value="Categories:"
/>
<h:outputText
label="Category: "
value="#{userSession.formatCategories(recipeDetailBean.recipe)}"
/>
<p:outputLabel for="@next"
value="Cuisine:"
/>
<h:outputText
label="Cuisine: "
value="#{recipeDetailBean.recipe.cuisine}"
/>
<p:outputLabel for="@next"
value="Prep Time:"
/>
<h:outputText
label="Prep Time: "
value="#{userSession.formatTime(recipeDetailBean.recipe.preptime)}"
/>
<p:outputLabel for="@next"
value="Cook Time:"
/>
<h:outputText
label="Cook Time: "
value="#{userSession.formatTime(recipeDetailBean.recipe.cooktime)}"
/>
</p:panelGrid>
</p:panelGrid>
<h:commandLink value="Edit Details"
action="#{recipeDetailBean.editDescription}"
/>
<!-- -->
<p:panelGrid id="pnlInstr"
columns="1" style="width: 100%"
>
<f:facet name="header">
<h:outputText
styleClass="subtitle"
value="Instructions"
/>
</f:facet>
<h:outputText id="instructions"
escape="false"
value="#{recipeDetailBean.instructions}"
/>
<h:commandLink
value="Edit Instructions"
action="#{recipeDetailBean.editInstructions}"
/>
</p:panelGrid>
<p:panelGrid id="pnlNotes"
columns="1" style="width: 100%"
>
<f:facet name="header">
<h:outputText
styleClass="subtitle"
value="Notes"
/>
</f:facet>
<h:outputText escape="false"
value="#{recipeDetailBean.modifications}"
/>
<h:commandLink value="Edit Notes"
action="#{recipeDetailBean.editNotes}"
/>
</p:panelGrid>
<p:button id="ctlDelete"
value="Delete Recipe"
action="#{recipeDetailBean.doDelete}"
immediate="true"
>
<f:facet name="confirmation">
<h:outputText
value="Delete this recipe. Are you sure?"
/>
</f:facet>
</p:button>
</p:column>
<!-- ====== Ingredients ============================ -->
<p:column id="ingredientsc"
style="width: 25%; vertical-align: top;"
>
<p:dataTable id="ingredients"
showDirectLinksArrows="true"
value="#{recipeDetailBean.ingredients}"
var="ingredient"
>
<f:facet name="header">
<h:outputText
styleClass="subtitle"
value="Ingredients"
/>
</f:facet>
<f:facet name="footer">
<h:commandLink
value="Edit Ingredients"
style="vertical-align: top"
action="#{recipeDetailBean.editIngredients}"
/>
</f:facet>
<p:column label="Amt"
style="width: 3em; text-align: right"
>
<h:outputText
value="#{ingredient.displayAmount}"
/>
</p:column>
<p:column label="Units"
style="width: 5em"
>
<h:outputText
value="#{ingredient.unit}"
/>
</p:column>
<p:column label="Item"
style="width: 20em"
>
<h:outputText
value="#{ingredient.item}"
/>
</p:column>
<p:column label="Optional"
style="width: 2em"
>
<p:selectBooleanCheckbox
readonly="true"
value="#{ingredient.optionalCB}"
/>
</p:column>
</p:dataTable>
<h:outputText
value="Recipe ID: #{recipeDetailBean.recipe.id}"
/>
</p:column>
</p:row>
</p:panelGrid>
</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>