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