This patch changes the yield form to include buttons for "halve" and "double". These buttons will automatically reduce by .5 or increase by 1.5 whatever the currently viewed yield is.

Outstanding issues:
* It isn't immediately clear to me how to move the existing "Update" button beside the custom yield text entry area. I think it would look better to have "Update" beside the custom yield textfield, and the "Halve" and "Double" buttons on a new line below it. Currently "Update", "Halve", "Double" are all side by side.

* I plan to change the text of the "Update" button to something like "Change". I remember that when I first started playing with the recipe module, I wasn't sure if clicking "Update" would permanently change the yield in the database. I've found that people playing with the recipe area on my site have the same concerns -- "Update" sounds like something permanent, rather than simply changing the display.

Changing the button text is a very easy change, but I'm waiting until I've got it next to the textfield to do so, otherwise it isn't clear *what* is being changed.

Comments

drawk’s picture

Also planned: a 'yield type' dropdown box on the recipe content creation page that defaults to "servings". This is to allow things like "14 Litres" or "14 Gallons" that aren't currently intuitive with the design of the yield entry.

marble’s picture

Double multiplies it by 1.5?
This will require a DB change (an additional column to {recipe} to store the yield unit type), but it should be easy to default it for existing recipes.

drawk’s picture

Oops, I was tired when I wrote that. No, "double" multiplies it by 2 as expected.

Ok, should the yield unit type be hardcoded in the DB like ingredient unit types, or customizable through a textarea in the settings page? I'm leaning towards the customizable textarea.

drawk’s picture

StatusFileSize
new1.72 KB

Here is an updated patch. This changes the "Update" button to a "Change" button, and puts it in a fieldset with the custom yield text entry area.

I'll do the yield unit type modifications as a seperate patch.

drawk’s picture

The following changes to recipe.css remove the border and put the textfield and "Change" button side by side:

#recipe_custom_yield fieldset .form-item { display: inline; }
#recipe_custom_yield fieldset .form-submit { display: inline; }
#recipe_custom_yield fieldset { border: none; }

marble’s picture

Applied patch for halve/double, thanks.

drawk’s picture

Thanks for commiting the patch, marble.

Should we mark this as fixed, or do you plan to integrate the alterations to the update button (second patch) as well?

marble’s picture

Sorry, I assumed the second patch was an update to the first patch, so applied that one. I should have been clearer, but I think what made it into CVS is what we wanted, right?

drawk’s picture

Ah, yes, I misunderstood you. What made it into CVS is great. Shall me mark this as fixed and I'll open a new issue for the yield type dropdown?

marble’s picture

Status: Active » Fixed

OK.

marble’s picture

Status: Fixed » Closed (fixed)