|
|
|
<?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"
|
|
|
|
ajax="false"
|
|
|
|
icon="ui-icon-arrowthick-1-w"
|
|
|
|
action="main.jsf"
|
|
|
|
immediate="true"
|
|
|
|
/>
|
|
|
|
<p:commandButton ajax="false"
|
|
|
|
value="Print"
|
|
|
|
icon="ui-icon-print"
|
|
|
|
action="recipePrint.jsf"
|
|
|
|
styleClass="ui-button-print"
|
|
|
|
immediate="true"
|
|
|
|
/>
|
|
|
|
<p:commandButton id="ctlShop"
|
|
|
|
icon="ui-icon-cart"
|
|
|
|
value="Shop"
|
|
|
|
immediate="true"
|
|
|
|
styleClass="#{recipeDetailBean.shop ? 'greenButton' : null}"
|
|
|
|
action="#{recipeDetailBean.doShop}"
|
|
|
|
update="ctlShop"
|
|
|
|
/>
|
|
|
|
<h:outputText value=""/>
|
|
|
|
<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="#{recipeDetailBean.recipe.preptime}"
|
|
|
|
converter="com.mousetech.gourmetj.utils.TimeConverter"
|
|
|
|
/>
|
|
|
|
<p:outputLabel for="@next"
|
|
|
|
value="Cook Time:"
|
|
|
|
/>
|
|
|
|
<h:outputText
|
|
|
|
label="Cook Time: "
|
|
|
|
value="#{recipeDetailBean.recipe.cooktime}"
|
|
|
|
converter="com.mousetech.gourmetj.utils.TimeConverter"
|
|
|
|
/>
|
|
|
|
</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:commandButton id="ctlDelete"
|
|
|
|
value="Delete Recipe"
|
|
|
|
onclick="PF('okDeleteDlg').show()"
|
|
|
|
/>
|
|
|
|
</p:column>
|
|
|
|
<!-- ====== Ingredients ============================ -->
|
|
|
|
<p:column id="ingredientsc"
|
|
|
|
style="width: 25%; vertical-align: top;"
|
|
|
|
>
|
|
|
|
<p:dataTable id="ingredients"
|
|
|
|
value="#{recipeDetailBean.ingredients}"
|
|
|
|
var="item"
|
|
|
|
rowStyleClass="#{item.ingGroup ? 'displayIngGroupRow' : null}"
|
|
|
|
>
|
|
|
|
<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="#{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:column label="Optional"
|
|
|
|
style="width: 2em"
|
|
|
|
>
|
|
|
|
<p:selectBooleanCheckbox
|
|
|
|
readonly="true"
|
|
|
|
value="#{item.optionalCB}"
|
|
|
|
/>
|
|
|
|
</p:column>
|
|
|
|
</p:dataTable>
|
|
|
|
<h:outputText
|
|
|
|
value="Recipe ID: #{recipeDetailBean.recipe.id}"
|
|
|
|
/>
|
|
|
|
</p:column>
|
|
|
|
</p:row>
|
|
|
|
</p:panelGrid>
|
|
|
|
</p:panelGrid>
|
|
|
|
</h:form>
|
|
|
|
<!-- -->
|
|
|
|
<h:form id="frmDelete">
|
|
|
|
<p:confirmDialog closable="false" id="okDeleteDlg"
|
|
|
|
header="Confirm Deletion"
|
|
|
|
message="OK to delete this recipe?"
|
|
|
|
severity="alert" widgetVar="okDeleteDlg"
|
|
|
|
style="z-index: 25000"
|
|
|
|
>
|
|
|
|
<p:commandButton id="dlgOK" value="OK"
|
|
|
|
oncomplete="PF('okDeleteDlg').hide()"
|
|
|
|
action="#{recipeDetailBean.doDelete}"
|
|
|
|
immediate="true"
|
|
|
|
/>
|
|
|
|
<p:commandButton id="dlgCancel" value="Cancel"
|
|
|
|
onclick="PF('okDeleteDlg').hide()"
|
|
|
|
/>
|
|
|
|
</p:confirmDialog>
|
|
|
|
</h:form>
|
|
|
|
</ui:define>
|
|
|
|
</ui:composition>
|