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,22 +27,22 @@
<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:row> <p:panel id="leftCol" style="width: auto;">
<p:column id="leftCol" style="width: 75%">
<p:panelGrid columns="2"> <p:panelGrid columns="2">
<p:panelGrid id="picButtons" 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"
@ -60,55 +60,51 @@
/> />
<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 <h:outputText label="Category: "
label="Category: "
value="#{userSession.formatCategories(recipeDetailBean.recipe)}" value="#{userSession.formatCategories(recipeDetailBean.recipe)}"
/> />
<p:outputLabel for="@next" <p:outputLabel for="@next"
value="Cuisine:" value="Cuisine:"
/> />
<h:outputText <h:outputText label="Cuisine: "
label="Cuisine: "
value="#{recipeDetailBean.recipe.cuisine}" value="#{recipeDetailBean.recipe.cuisine}"
/> />
<p:outputLabel for="@next" <p:outputLabel for="@next"
value="Prep Time:" value="Prep Time:"
/> />
<h:outputText <h:outputText label="Prep Time: "
label="Prep Time: "
value="#{recipeDetailBean.recipe.preptime}" value="#{recipeDetailBean.recipe.preptime}"
converter="com.mousetech.gourmetj.utils.TimeConverter" converter="com.mousetech.gourmetj.utils.TimeConverter"
/> />
<p:outputLabel for="@next" <p:outputLabel for="@next"
value="Cook Time:" value="Cook Time:"
/> />
<h:outputText <h:outputText label="Cook Time: "
label="Cook Time: "
value="#{recipeDetailBean.recipe.cooktime}" value="#{recipeDetailBean.recipe.cooktime}"
converter="com.mousetech.gourmetj.utils.TimeConverter" converter="com.mousetech.gourmetj.utils.TimeConverter"
/> />
</p:panelGrid> <h:outputText value="" />
</p:panelGrid> <p:commandButton
<h:commandLink value="Edit Details" icon="ui-icon-wrench"
value="Edit"
action="#{recipeDetailBean.editDescription}" action="#{recipeDetailBean.editDescription}"
/> />
</p:panelGrid>
</p:panelGrid>
</p:panelGrid>
<!-- --> <!-- -->
<p:panelGrid id="pnlInstr" <p:panel id="pnlInstr">
columns="1" style="width: 100%"
>
<f:facet name="header"> <f:facet name="header">
<h:outputText <h:outputText styleClass="subtitle"
styleClass="subtitle"
value="Instructions" value="Instructions"
/> />
</f:facet> </f:facet>
@ -116,35 +112,33 @@
escape="false" escape="false"
value="#{recipeDetailBean.instructions}" value="#{recipeDetailBean.instructions}"
/> />
<h:commandLink <br />
value="Edit Instructions" <h:commandLink value="Edit Instructions"
action="#{recipeDetailBean.editInstructions}" action="#{recipeDetailBean.editInstructions}"
/> />
</p:panelGrid> </p:panel>
<p:panelGrid id="pnlNotes" <p:panel id="pnlNotes">
columns="1" style="width: 100%"
>
<f:facet name="header"> <f:facet name="header">
<h:outputText <h:outputText styleClass="subtitle"
styleClass="subtitle"
value="Notes" value="Notes"
/> />
</f:facet> </f:facet>
<h:outputText escape="false" <h:outputText escape="false"
value="#{recipeDetailBean.modifications}" value="#{recipeDetailBean.modifications}"
/> />
<br />
<h:commandLink value="Edit Notes" <h:commandLink value="Edit Notes"
action="#{recipeDetailBean.editNotes}" action="#{recipeDetailBean.editNotes}"
/> />
</p:panelGrid> </p:panel>
<p:commandButton id="ctlDelete" <p:commandButton id="ctlDelete"
value="Delete Recipe" value="Delete Recipe"
onclick="PF('okDeleteDlg').show()" onclick="PF('okDeleteDlg').show()"
/> />
</p:column> </p:panel>
<!-- ====== Ingredients ============================ --> <!-- ====== Ingredients ============================ -->
<p:column id="ingredientsc" <p:panel id="ingredientsc"
style="width: 25%; vertical-align: top;" style="width: 30%; min-width: 40em; vertical-align: top;"
> >
<p:dataTable id="ingredients" <p:dataTable id="ingredients"
value="#{recipeDetailBean.ingredients}" value="#{recipeDetailBean.ingredients}"
@ -152,8 +146,7 @@
rowStyleClass="#{item.ingGroup ? 'displayIngGroupRow' : null}" rowStyleClass="#{item.ingGroup ? 'displayIngGroupRow' : null}"
> >
<f:facet name="header"> <f:facet name="header">
<h:outputText <h:outputText styleClass="subtitle"
styleClass="subtitle"
value="Ingredients" value="Ingredients"
/> />
</f:facet> </f:facet>
@ -174,22 +167,18 @@
<p:column label="Units" <p:column label="Units"
style="width: 5em" style="width: 5em"
> >
<h:outputText <h:outputText value="#{item.unit}" />
value="#{item.unit}"
/>
</p:column> </p:column>
<p:column label="Item" <p:column label="Item"
style="width: 20em" style="width: 20em; text-wrap: wrap"
> >
<h:outputText <h:outputText value="#{item.item}" />
value="#{item.item}"
/>
</p:column> </p:column>
<p:column label="Optional" <p:column label="Optional"
style="width: 2em" style="width: 2em"
> >
<p:selectBooleanCheckbox <p:selectBooleanCheckbox
readonly="true" disabled="true"
value="#{item.optionalCB}" value="#{item.optionalCB}"
/> />
</p:column> </p:column>
@ -197,9 +186,7 @@
<h:outputText <h:outputText
value="Recipe ID: #{recipeDetailBean.recipe.id}" value="Recipe ID: #{recipeDetailBean.recipe.id}"
/> />
</p:column> </p:panel>
</p:row>
</p:panelGrid>
</p:panelGrid> </p:panelGrid>
</h:form> </h:form>
<!-- --> <!-- -->