|
|
|
@ -8,7 +8,7 @@ |
|
|
|
|
> |
|
|
|
|
<ui:define name="title">Gourmet Recipe Manager</ui:define> |
|
|
|
|
<ui:define name="content"> |
|
|
|
|
<style> |
|
|
|
|
<style> |
|
|
|
|
.ingSel { |
|
|
|
|
width: 3em; |
|
|
|
|
text-align: center; |
|
|
|
@ -40,6 +40,7 @@ |
|
|
|
|
/> |
|
|
|
|
<p:inputText id="rtitle" size="45" |
|
|
|
|
required="true" focus="true" |
|
|
|
|
placeholder="A recipe title is required." |
|
|
|
|
value="#{recipeDetailBean.recipe.title}" |
|
|
|
|
> |
|
|
|
|
<f:ajax execute="rtitle" |
|
|
|
@ -99,8 +100,7 @@ |
|
|
|
|
value="Description" |
|
|
|
|
/> |
|
|
|
|
<p:inputTextarea id="description" |
|
|
|
|
rows="10" cols="30" |
|
|
|
|
escape="false" |
|
|
|
|
rows="10" cols="45" |
|
|
|
|
value="#{recipeDetailBean.recipe.description}" |
|
|
|
|
/> |
|
|
|
|
<p:panel id="picPanel"> |
|
|
|
@ -131,25 +131,28 @@ |
|
|
|
|
<p:tab id="ingredientsTab" |
|
|
|
|
title="Ingredients" |
|
|
|
|
> |
|
|
|
|
<p:panel header="Ingredients"> |
|
|
|
|
<p:panel id="pnlIngredients"> |
|
|
|
|
<f:facet name="header">Ingredients</f:facet> |
|
|
|
|
<!-- NOTE: disabled doesn't work from AJAX render. Swap images --> |
|
|
|
|
<h:panelGroup id="ingButtons"> |
|
|
|
|
<p:button value="Up" id="ctlUp"> |
|
|
|
|
<!-- <f:ajax |
|
|
|
|
listener="recipeDetailBean.ajaxMoveUp" |
|
|
|
|
execute="ingredientTable" |
|
|
|
|
render="ingredientTable" |
|
|
|
|
/> --> |
|
|
|
|
</p:button> |
|
|
|
|
<p:button value="Down" |
|
|
|
|
<p:commandButton value="Up" |
|
|
|
|
id="ctlUp" |
|
|
|
|
> |
|
|
|
|
<f:ajax |
|
|
|
|
listener="#{recipeDetailBean.ajaxMoveUp}" |
|
|
|
|
execute="ingredientTable" |
|
|
|
|
render="ingredientTable" |
|
|
|
|
/> |
|
|
|
|
</p:commandButton> |
|
|
|
|
<p:commandButton value="Down" |
|
|
|
|
id="ctlDown" |
|
|
|
|
> |
|
|
|
|
<!-- <f:ajax |
|
|
|
|
listener="recipeDetailBean.ajaxMoveDown" |
|
|
|
|
execute="ingredientTable" |
|
|
|
|
render="ingredientTable" |
|
|
|
|
/> --> |
|
|
|
|
</p:button> |
|
|
|
|
<f:ajax |
|
|
|
|
listener="#{recipeDetailBean.ajaxMoveDown}" |
|
|
|
|
execute="ingredientTable" |
|
|
|
|
render="ingredientTable" |
|
|
|
|
/> |
|
|
|
|
</p:commandButton> |
|
|
|
|
<p:button value="Add Group" |
|
|
|
|
disabled="true" |
|
|
|
|
/> |
|
|
|
@ -162,17 +165,16 @@ |
|
|
|
|
disabled="true" |
|
|
|
|
/> |
|
|
|
|
<p:button value="Paste" /> |
|
|
|
|
<p:button value="Delete" |
|
|
|
|
<p:commandButton value="Delete" |
|
|
|
|
id="ctlDelete" |
|
|
|
|
immediate="true" |
|
|
|
|
disabled="not #{recipeDetailBean.selectionActive}" |
|
|
|
|
> |
|
|
|
|
<!-- <f:ajax |
|
|
|
|
listener="recipeDetailBean.ajaxDeleteItems" |
|
|
|
|
immediate="true" |
|
|
|
|
render="ingredientTable" |
|
|
|
|
/> --> |
|
|
|
|
</p:button> |
|
|
|
|
<f:ajax |
|
|
|
|
listener="#{recipeDetailBean.ajaxDeleteItems}" |
|
|
|
|
immediate="true" |
|
|
|
|
render="ingredientTable" |
|
|
|
|
/> |
|
|
|
|
</p:commandButton> |
|
|
|
|
</h:panelGroup> |
|
|
|
|
<h:panelGrid columns="1" |
|
|
|
|
id="ingredientsDiv" |
|
|
|
@ -197,9 +199,12 @@ |
|
|
|
|
/> --> |
|
|
|
|
</p:selectBooleanCheckbox> |
|
|
|
|
</p:column> |
|
|
|
|
<p:column label="Amt" |
|
|
|
|
style="width: 4em" |
|
|
|
|
<p:column |
|
|
|
|
style="width: 4.4em" |
|
|
|
|
> |
|
|
|
|
<f:facet name="header"> |
|
|
|
|
Amt. |
|
|
|
|
</f:facet> |
|
|
|
|
<p:inputText id="ingAmt" |
|
|
|
|
size="5" |
|
|
|
|
value="#{item.displayAmount}" |
|
|
|
@ -208,9 +213,10 @@ |
|
|
|
|
> |
|
|
|
|
</p:inputText> |
|
|
|
|
</p:column> |
|
|
|
|
<p:column label="Units" |
|
|
|
|
style="width: 7em" |
|
|
|
|
> |
|
|
|
|
<p:column style="width: 7em"> |
|
|
|
|
<f:facet name="header"> |
|
|
|
|
Units |
|
|
|
|
</f:facet> |
|
|
|
|
<p:inputText id="ingUnit" |
|
|
|
|
value="#{item.unit}" |
|
|
|
|
size="10" |
|
|
|
@ -218,11 +224,12 @@ |
|
|
|
|
> |
|
|
|
|
</p:inputText> |
|
|
|
|
</p:column> |
|
|
|
|
<p:column label="Item" |
|
|
|
|
style="width: 22em" |
|
|
|
|
> |
|
|
|
|
<p:column style="width: 26em"> |
|
|
|
|
<f:facet name="header"> |
|
|
|
|
Item |
|
|
|
|
</f:facet> |
|
|
|
|
<p:inputText id="ingItem" |
|
|
|
|
size="35" |
|
|
|
|
size="42" |
|
|
|
|
value="#{item.item}" |
|
|
|
|
> |
|
|
|
|
</p:inputText> |
|
|
|
@ -231,51 +238,69 @@ |
|
|
|
|
align="center" |
|
|
|
|
styleClass="ingSel" |
|
|
|
|
> |
|
|
|
|
<f:facet name="header"> |
|
|
|
|
Opt. |
|
|
|
|
</f:facet> |
|
|
|
|
<p:selectBooleanCheckbox |
|
|
|
|
id="ingOpt" |
|
|
|
|
value="#{item.optionalCB}" |
|
|
|
|
rendered="#{not item.ingGroup}" |
|
|
|
|
/> |
|
|
|
|
</p:column> |
|
|
|
|
<p:column label="Key"> |
|
|
|
|
<p:column style="width: 13em"> |
|
|
|
|
<f:facet name="header"> |
|
|
|
|
Ing. Key |
|
|
|
|
</f:facet> |
|
|
|
|
<p:inputText id="ingKey" |
|
|
|
|
value="#{item.ingkey}" |
|
|
|
|
size="20" |
|
|
|
|
rendered="#{not item.ingGroup}" |
|
|
|
|
/> |
|
|
|
|
</p:column> |
|
|
|
|
<p:column |
|
|
|
|
label="Shopping Category" |
|
|
|
|
> |
|
|
|
|
<p:inputText id="shopCat" |
|
|
|
|
<p:column> |
|
|
|
|
<f:facet name="header"> |
|
|
|
|
Shop. Cat. |
|
|
|
|
</f:facet> |
|
|
|
|
<p:autoComplete |
|
|
|
|
id="shopCat" |
|
|
|
|
value="#{item.shopCat}" |
|
|
|
|
rendered="#{not item.ingGroup}" |
|
|
|
|
tip="Note that changing Shopping category for an ingredient key changes it for all users of that key." |
|
|
|
|
editable="true" |
|
|
|
|
forceSelection="false" |
|
|
|
|
autoSelection="false" |
|
|
|
|
dropdown="true" |
|
|
|
|
cache="true" |
|
|
|
|
title="Note that changing Shopping category for an ingredient key changes it for all users of that key." |
|
|
|
|
completeMethod="#{recipeDetailBean.shopcatList}" |
|
|
|
|
> |
|
|
|
|
<p:autoComplete |
|
|
|
|
minimumCharacters="1" |
|
|
|
|
completeMethod="#{recipeDetailBean.shopcatPartial}" |
|
|
|
|
> |
|
|
|
|
</p:autoComplete> |
|
|
|
|
</p:inputText> |
|
|
|
|
<p:ajax event="blur" |
|
|
|
|
listener="#{recipeDetailBean.ajaxShopcat}" |
|
|
|
|
/> |
|
|
|
|
</p:autoComplete> |
|
|
|
|
</p:column> |
|
|
|
|
</p:dataTable> |
|
|
|
|
</h:panelGrid> |
|
|
|
|
<h:panelGroup id="addIng"> |
|
|
|
|
<p:inputText |
|
|
|
|
label="Add Ingredient: " |
|
|
|
|
id="ctlAddIng" focus="true" |
|
|
|
|
<h:panelGroup id="pnlIng"> |
|
|
|
|
<p:remoteCommand name="ingButton" |
|
|
|
|
action="#{recipeDetailBean.doAddIngredient}" |
|
|
|
|
process="@this ctlAddIngTxt" |
|
|
|
|
update="pnlIngredients" |
|
|
|
|
/> |
|
|
|
|
<p:outputLabel for="@next" |
|
|
|
|
value="Add Ingredient: " |
|
|
|
|
/> |
|
|
|
|
<p:inputTextarea id="ctlAddIngTxt" |
|
|
|
|
focus="true" rows="1" |
|
|
|
|
cols="65" |
|
|
|
|
value="#{recipeDetailBean.ingredientText}" |
|
|
|
|
tip="You can paste in multiple ingredients here!" |
|
|
|
|
title="You can paste in multiple ingredients here!" |
|
|
|
|
onkeydown="if (event.keyCode === 13) { ingButton(); this.focus(); return false; }" |
|
|
|
|
/> |
|
|
|
|
<p:button value="+ Add" |
|
|
|
|
defaultCommand="true" |
|
|
|
|
<p:commandButton id="ctlAddIng" |
|
|
|
|
value="+ Add" |
|
|
|
|
onclick="ingButton(); return false;" |
|
|
|
|
> |
|
|
|
|
<!-- <f:ajax execute="ctlAddIng" |
|
|
|
|
render="ingredientTable ctlAddIng" |
|
|
|
|
listener="recipeDetailBean.ajaxAddIngredient" |
|
|
|
|
/> --> |
|
|
|
|
</p:button> |
|
|
|
|
</p:commandButton> |
|
|
|
|
</h:panelGroup> |
|
|
|
|
</p:panel> |
|
|
|
|
</p:tab> |
|
|
|
|