Cleaned up formatting on recipe detail display.

This commit is contained in:
tim holloway 2024-02-02 17:16:46 -05:00
parent 205835bb5f
commit a7702e27f3

View File

@ -27,179 +27,166 @@
<h:messages /> <h:messages />
<h:form id="form1"> <h:form id="form1">
<p:panelGrid label="#{recipeDetailBean.recipe.title}" <p:panelGrid label="#{recipeDetailBean.recipe.title}"
columns="1" columns="2"
> >
<p:panelGrid> <f:facet name="header">
<f:facet name="header"> <h:outputText styleClass="recipeTitle"
<h:outputText styleClass="recipeTitle" value="#{recipeDetailBean.recipe.title}"
value="#{recipeDetailBean.recipe.title}" />
/> </f:facet>
</f:facet> <p:panel id="leftCol" style="width: auto;">
<p:row> <p:panelGrid columns="2">
<p:column id="leftCol" style="width: 75%"> <p:panelGrid id="picButtons" columns="2">
<p:panelGrid columns="2"> <img id="bigpix"
<img id="bigpix" style="width: 132px;"
src="/img/picture/#{recipeDetailBean.recipe.id}" src="/img/picture/#{recipeDetailBean.recipe.id}"
/> />
<p:panelGrid id="pnlDetails" <p:panelGrid id="pnlButtons"
columns="2" columns="2" style="width: 220px;"
> >
<!-- TODO: ask if we should save --> <!-- TODO: ask if we should save -->
<p:commandButton value="Back" <p:commandButton value="Back"
ajax="false" ajax="false"
icon="ui-icon-arrowthick-1-w" icon="ui-icon-arrowthick-1-w"
action="home" action="home"
immediate="true" immediate="true"
/> />
<p:commandButton ajax="false" <p:commandButton ajax="false"
value="Print" value="Print"
icon="ui-icon-print" icon="ui-icon-print"
action="recipePrint.jsf" action="recipePrint.jsf"
styleClass="ui-button-print" styleClass="ui-button-print"
immediate="true" immediate="true"
/> />
<p:commandButton id="ctlShop" <p:commandButton id="ctlShop"
icon="ui-icon-cart" icon="ui-icon-cart"
value="Shop" value="Shop" immediate="true"
immediate="true" styleClass="#{recipeDetailBean.shop ? 'greenButton' : null}"
styleClass="#{recipeDetailBean.shop ? 'greenButton' : null}" action="#{recipeDetailBean.doShop}"
action="#{recipeDetailBean.doShop}" update="ctlShop"
update="ctlShop" />
/> <h:outputText value="" />
<h:outputText value=""/> <p:outputLabel for="@next"
<p:outputLabel for="@next" value="Categories:"
value="Categories:" />
/> <h:outputText label="Category: "
<h:outputText value="#{userSession.formatCategories(recipeDetailBean.recipe)}"
label="Category: " />
value="#{userSession.formatCategories(recipeDetailBean.recipe)}" <p:outputLabel for="@next"
/> value="Cuisine:"
<p:outputLabel for="@next" />
value="Cuisine:" <h:outputText label="Cuisine: "
/> value="#{recipeDetailBean.recipe.cuisine}"
<h:outputText />
label="Cuisine: " <p:outputLabel for="@next"
value="#{recipeDetailBean.recipe.cuisine}" value="Prep Time:"
/> />
<p:outputLabel for="@next" <h:outputText label="Prep Time: "
value="Prep Time:" value="#{recipeDetailBean.recipe.preptime}"
/> converter="com.mousetech.gourmetj.utils.TimeConverter"
<h:outputText />
label="Prep Time: " <p:outputLabel for="@next"
value="#{recipeDetailBean.recipe.preptime}" value="Cook Time:"
converter="com.mousetech.gourmetj.utils.TimeConverter" />
/> <h:outputText label="Cook Time: "
<p:outputLabel for="@next" value="#{recipeDetailBean.recipe.cooktime}"
value="Cook Time:" converter="com.mousetech.gourmetj.utils.TimeConverter"
/> />
<h:outputText <h:outputText value="" />
label="Cook Time: " <p:commandButton
value="#{recipeDetailBean.recipe.cooktime}" icon="ui-icon-wrench"
converter="com.mousetech.gourmetj.utils.TimeConverter" value="Edit"
/> action="#{recipeDetailBean.editDescription}"
</p:panelGrid> />
</p:panelGrid> </p:panelGrid>
<h:commandLink value="Edit Details" </p:panelGrid>
action="#{recipeDetailBean.editDescription}" </p:panelGrid>
<!-- -->
<p:panel id="pnlInstr">
<f:facet name="header">
<h:outputText styleClass="subtitle"
value="Instructions"
/> />
<!-- --> </f:facet>
<p:panelGrid id="pnlInstr" <h:outputText id="instructions"
columns="1" style="width: 100%" escape="false"
> value="#{recipeDetailBean.instructions}"
<f:facet name="header"> />
<h:outputText <br />
styleClass="subtitle" <h:commandLink value="Edit Instructions"
value="Instructions" action="#{recipeDetailBean.editInstructions}"
/> />
</f:facet> </p:panel>
<h:outputText id="instructions" <p:panel id="pnlNotes">
escape="false" <f:facet name="header">
value="#{recipeDetailBean.instructions}" <h:outputText styleClass="subtitle"
/> value="Notes"
<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> </f:facet>
<!-- ====== Ingredients ============================ --> <h:outputText escape="false"
<p:column id="ingredientsc" value="#{recipeDetailBean.modifications}"
style="width: 25%; vertical-align: top;" />
<br />
<h:commandLink value="Edit Notes"
action="#{recipeDetailBean.editNotes}"
/>
</p:panel>
<p:commandButton id="ctlDelete"
value="Delete Recipe"
onclick="PF('okDeleteDlg').show()"
/>
</p:panel>
<!-- ====== Ingredients ============================ -->
<p:panel id="ingredientsc"
style="width: 30%; min-width: 40em; 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"
> >
<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 <h:outputText
value="Recipe ID: #{recipeDetailBean.recipe.id}" value="#{item.displayAmount}"
/> />
</p:column> </p:column>
</p:row> <p:column label="Units"
</p:panelGrid> style="width: 5em"
>
<h:outputText value="#{item.unit}" />
</p:column>
<p:column label="Item"
style="width: 20em; text-wrap: wrap"
>
<h:outputText value="#{item.item}" />
</p:column>
<p:column label="Optional"
style="width: 2em"
>
<p:selectBooleanCheckbox
disabled="true"
value="#{item.optionalCB}"
/>
</p:column>
</p:dataTable>
<h:outputText
value="Recipe ID: #{recipeDetailBean.recipe.id}"
/>
</p:panel>
</p:panelGrid> </p:panelGrid>
</h:form> </h:form>
<!-- --> <!-- -->