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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | recipe.module.yieldchange1.patch | 1.72 KB | drawk |
| recipe.module.yieldchange0.patch | 1.19 KB | drawk |
Comments
Comment #1
drawk commentedAlso 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.
Comment #2
marble commentedDouble 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.
Comment #3
drawk commentedOops, 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.
Comment #4
drawk commentedHere 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.
Comment #5
drawk commentedThe 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; }
Comment #6
marble commentedApplied patch for halve/double, thanks.
Comment #7
drawk commentedThanks 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?
Comment #8
marble commentedSorry, 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?
Comment #9
drawk commentedAh, 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?
Comment #10
marble commentedOK.
Comment #11
marble commented