| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <html>
- <head>
- <title>Add New Recipe</title>
- <link rel="stylesheet" href="styles.css" />
- </head>
- <body>
- <h1>Add new recipe</h1>
- <form action="#" method="POST">
- <table class="form">
- <tr>
- <th>Name:</th>
- <td colspan="3"><input type="text" name="recipe.name" class="excerpt"/></td>
- </tr>
- <tr>
- <th>Base:</th>
- <td>
- <select name="recipe.base.baseId">
- <option></option>
- <option>Chicken</option>
- <option>Vegie</option>
- </select>
- </td>
- <th>Prep time:</th>
- <td>
- <select name="recipe.prepTime.prepTimeId">
- <option></option>
- <option>< 15 minutes</option>
- <option>15 - 30 minutes</option>
- <option>30 - 45 minutes</option>
- <option>45 - 60 minutes</option>
- </select>
- </td>
- </tr>
- <tr>
- <th>Ethnicity:</th>
- <td>
- <select name="recipe.ethnicity.ethnicityId">
- <option></option>
- <option>American</option>
- <option>French</option>
- <option>Indian</option>
- </select>
- </td>
- <th>Difficulty:</th>
- <td>
- <select name="recipe.difficulty.difficultId">
- <option></option>
- <option>Snap</option>
- <option>Easy</option>
- <option>Moderate</option>
- <option>Difficult</option>
- </select>
- </td>
- </tr>
- <tr>
- <th>Course:</th>
- <td>
- <select name="recipe.course.ethnicityId">
- <option></option>
- <option>Breakfast</option>
- <option>Lunch</option>
- <option>Dessert</option>
- </select>
- </td>
- <th>Serves:</th>
- <td>
- <input type="text" name="recipe.servings" class="smallnum"/>
- </td>
- </tr>
- <tr>
- <th>Excerpt:</th>
- <td colspan="3">
- <textarea name="recipe.excerpt" class="excerpt"></textarea>
- </td>
- </tr>
- </table>
- <hr class="sep" />
- <script type="text/javascript">
- var numIngredients = 1;
- function addIngredient() {
- // get the ingredient table
- var row = document.getElementById('ingredient_row');
-
- // get the add row to insert the cloned row into
- var addRow = document.getElementById('ingredient_add_row');
-
- // clone the ingredient row
- var newRow = row.cloneNode(true);
-
- // find all 'name' attributes, and increment index values
-
-
- // insert into table
- addRow.parentNode.insertBefore(newRow,addRow);
-
- }
- function set
- </script>
- <div class="formLabel">
- Ingredients:
- </div>
- <table class="form" id="ingredient_table">
- <tr id="ingredient_row">
- <td>
- <input type="text" name="recipe.ingredients[0].quantity" class="vsmallnum"/>
- <select name="recipe.ingredients[0].unit">
- <option></option>
- <option>Teaspoon</option>
- <option>Tablespoon</option>
- </select>
- <select name="recipe.ingredients[0].ingredientId">
- <option></option>
- <option>Flour</option>
- <option>Sugar</option>
- </select>
- <input type="text" name="recipe.ingredients[0].qualifier" />
- </td>
- <td>
- <a href="#" title="Remove Ingredient" class="minus">
- <span class="alt">Remove Ingredient</span>
- </a>
- </td>
- </tr>
- <tr id="ingredient_add_row">
- <td>
- <a href="javascript:addIngredient()" title="Add Ingredient" class="plus">
- <span class="alt">Add Ingredient</span>
- </a>
- </td>
- <td></td>
- </tr>
- </table>
- </form>
- </body>
- </html>
|