Commit | Line | Data |
---|---|---|
d445674b | 1 | <:wrap admin/base.tmpl title => "Edit Product Option", menuitem=>"none", showtitle=>"1", js => "admin_editprodopt.js" :> |
58baa27b TC |
2 | <:include admin/product_menu.tmpl:> |
3 | <form action="<:script:>" method="post"> | |
5b816615 TC |
4 | <input type="hidden" name="id" value="<:=article.id:>" /> |
5 | <input type="hidden" name="option_id" value="<:=option.id:>" /> | |
58baa27b | 6 | <input type="hidden" name="_t" value="prodopts" /> |
5b816615 | 7 | <input type="hidden" name="newvaluecount" id="newvaluecount" value="<:= cgi.param("newvalue_count") or 0 :>" /> |
58baa27b TC |
8 | <:csrfp admin_save_option hidden:> |
9 | <input type="hidden" name="save_enabled" value="1" /> | |
8a3b8db8 | 10 | <table class="editform editformsmall"> |
58baa27b TC |
11 | <tr> |
12 | <th>Name:</th> | |
5b816615 TC |
13 | <td><input type="text" name="name" value="<:.call "old", field: "name", default: option.name :>" /></td> |
14 | <td class="help"><:.call "error_img", field: "name" :></td> | |
58baa27b TC |
15 | </tr> |
16 | <tr> | |
17 | <th>Enabled:</th> | |
5b816615 | 18 | <td><input type="checkbox" name="enabled" value="1" <:.if cgi.param("save_enabled") ? cgi.param("enabled") : option.enabled:>checked="checked"<:.end if:> /></td> |
58baa27b TC |
19 | <td class="help"><:error_img name:></td> |
20 | </tr> | |
21 | <tr> | |
22 | <th>Values:</th> | |
d445674b | 23 | <td id="product_option_values"> |
58baa27b TC |
24 | <table class="editform"> |
25 | <tr> | |
26 | <td colspan="2"></td> | |
5b816615 | 27 | <th>Default<:.call "error_img", field:"default_value":></th> |
58baa27b | 28 | </tr> |
5b816615 | 29 | <:.for value in [ option.values ] :> |
58baa27b TC |
30 | <tr> |
31 | <th>Value:</th> | |
5b816615 TC |
32 | <td><input type="text" name="value<:= value.id:>" value="<:= cgi.param("save_enabled") ? cgi.param("value" _ value.id) : value.value:>" /><:.call "error_img", field:"value" _ value.id:></td> |
33 | <td class="check"><input type="radio" name="default_value" value="<:= value.id:>" <:.if value.id == option.default_value:>checked="checked"<:.end if:> /></td> | |
58baa27b | 34 | </tr> |
5b816615 | 35 | <:.end for:> |
58baa27b | 36 | </table> |
5b816615 TC |
37 | <:.if cgi.param("newvaluecount"):> |
38 | <:.for i in [ 1 .. cgi.param("newvaluecount") ] :> | |
39 | <div><label for="newvalue<:= i:>">Value:</label> | |
40 | <input type="text" name="newvalue<:= i:>" value="<:=cgi.param("newvalue" _ i) :>:>" /><:.call "error_img", field:"newvalue" _ i :></div> | |
41 | <:.end for :> | |
42 | <:.end if :> | |
58baa27b TC |
43 | </td> |
44 | <td class="help"></td> | |
45 | </tr> | |
46 | <tr> | |
47 | <td colspan="2" class="buttons"><input type="submit" name="a_save_option" value="Save" /> | |
48 | <input type="submit" value="Return to product options" /></td> | |
49 | <td></td> | |
50 | </tr> | |
51 | </table> | |
4de47893 | 52 | </form> |