scrap the hoverclass, it doesn't do what I want
[bse.git] / site / templates / admin / edit_prodopts.tmpl
CommitLineData
4de47893 1<:wrap admin/xbase.tmpl title=>"[articleType] Options", showtitle=>1, menuitem=>prodopts, js=>"admin_prodopts.js":>
58baa27b
TC
2<:ifMessage:><div id="message"><:message:></div><:or:><:eif:>
3<:include admin/product_menu.tmpl:>
4
5<:if Dboptions:>
6<h2>Product options</h2>
9b3a5df0 7<:if UserCan bse_edit_prodopt_move:article:>
4de47893
TC
8<div id="prodoptmenu">All options:
9<a id="sortoptions" href="<:script:>?a_option_reorder=1&amp;_t=prodopts&amp;id=<:article id:>&amp;_csrfp=<:csrfp admin_move_option:>&amp;option_ids=<:arithmetic join ",", map $_->{id}, sort { lc $a->{name} cmp lc $b->{name} } Products->getByPkey([article id])->db_options:>">Sort</a>
10<a id="reverseoptions" href="<:script:>?a_option_reorder=1&amp;_t=prodopts&amp;id=<:article id:>&amp;_csrfp=<:csrfp admin_move_option:>&amp;option_ids=<:arithmetic join ",", map $_->{id}, reverse Products->getByPkey([article id])->db_options:>">Reverse</a>
5825cab3 11<img src="/images/admin/busy.gif" id="busy_img" style="visibility: hidden" />
4de47893 12</div>
9b3a5df0 13<:or UserCan:><:eif UserCan:>
1660ce30 14<div id="productoptions" <:ifUserCan bse_edit_prodopt_move:>class="moveable"<:or:><:eif:>>
58baa27b
TC
15<:iterator begin dboptions:>
16<div id="prodopt<:dboption id:>" class="prodopt">
1660ce30 17<div id="prodoptmenu<:dboption id:>" class="prodoptmenu">Option:<span id="prodoptname<:dboption id:>"><:dboption name:></span>
1dbed965 18<div class="prodoptmenuoptions">
9b3a5df0 19<:if UserCan bse_edit_prodopt_edit:article :>
5708b3ac 20<a id="editoption<:dboption id:>" href="<:script:>?id=<:article id:>&amp;a_edit_option=1&amp;option_id=<:dboption id:>">Edit</a>
4de47893
TC
21<a href="<:script:>?id=<:article id:>&amp;a_delconf_option=1&amp;option_id=<:dboption id:>">Delete</a>
22<a id="sortvals<:dboption id:>" href="<:script:>?id=<:article id:>&amp;a_option_value_reorder=1&amp;option_id=<:dboption id:>&amp;_csrfp=<:csrfp admin_move_option_value:>&amp;_t=prodopts&amp;value_ids=<:arithmetic join ',', map $_->{id}, sort { lc $a->{value} cmp lc $b->{value} } BSE::TB::ProductOptions->getByPkey([dboption id])->values:>">Sort</a>
23<a id="reversevals<:dboption id:>" href="<:script:>?id=<:article id:>&amp;a_option_value_reorder=1&amp;option_id=<:dboption id:>&amp;_csrfp=<:csrfp admin_move_option_value:>&amp;_t=prodopts&amp;value_ids=<:arithmetic join ',', map $_->{id}, reverse BSE::TB::ProductOptions->getByPkey([dboption id])->values:>">Reverse</a>
9b3a5df0
TC
24<:or UserCan:><:eif UserCan:>
25<:ifUserCan bse_edit_prodopt_move:article:><:dboption_move:><:or:><:eif:>
4de47893 26</div>
1dbed965 27</div>
5f3a2963 28<div id="vallist<:dboption id:>" class="prodoptvalues">
58baa27b 29<:iterator begin dboptionvalues:>
5f3a2963 30<div id="valentry<:dboptionvalue id:>" class="valueentry<:ifMatch [dboptionvalue_index] "[13579]$":> odd<:or:><:eif:>"><span id="prodoptvalue<:dboptionvalue id:>"><:dboptionvalue value:></span>
9b3a5df0
TC
31<:ifEq [dboptionvalue id] [dboption default_value]:>(default)<:or:><:eif:>
32<:if UserCan bse_edit_prodopt_edit:article:>
5f3a2963 33<div class="valueentrymenu">
9b3a5df0
TC
34<a href="<:script:>?id=<:product id:>&amp;value_id=<:dboptionvalue id:>&amp;a_edit_option_value=1">Edit</a>
35<a href="<:script:>?id=<:product id:>&amp;value_id=<:dboptionvalue id:>&amp;a_confdel_option_value=1">Delete</a>
36<:dboptionvalue_move:>
5f3a2963 37</div>
9b3a5df0 38<:or UserCan:><:eif UserCan:>
5f3a2963 39</div>
58baa27b 40<:iterator end dboptionvalues:>
5f3a2963 41</div>
9b3a5df0 42<:if UserCan bse_edit_prodopt_edit:article:>
5f3a2963
TC
43<div class="addvalueform">
44<form action="<:script:>" method="post" id="valform<:dboption id:>" class="addvalue"><input type="hidden" name="id" value="<:article id:>" /><input type="hidden" name="option_id" value="<:dboption id:>" /><input type="hidden" name="_t" value="prodopts" /><:csrfp admin_add_option_value hidden:><input type="text" name="value" class="add_field" /><input type="submit" name="a_add_option_value" value="Add Value" class="add_submit" /></form>
45</div>
9b3a5df0 46<:or UserCan:><:eif UserCan:>
58baa27b
TC
47</div>
48<:iterator end dboptions:>
49</div>
50<:or Dboptions:><:eif Dboptions:>
9b3a5df0 51<:if UserCan bse_edit_prodopt_add:article:>
58baa27b
TC
52<div id="addoptionform">
53<form action="<:script:>" method="post">
54<:csrfp admin_add_option hidden:>
55<input type="hidden" name="_t" value="prodopts" />
56<input type="hidden" name="id" value="<:article id:>" />
9b3a5df0 57<table class="editform editformsmall">
58baa27b
TC
58 <tr>
59 <th>Name</th>
60 <td><input type="text" name="name" value="<:old name:>" size="40" maxlength="40" /><:error_img name:></td>
61 </tr>
62 <tr>
63 <th>Values</th>
64 <td><input type="text" name="value1" value="<:old value1:>" size="40" maxlength="40" /><:error_img value1:><br />
65<input type="text" name="value2" value="<:old value2:>" size="40" maxlength="40" /><:error_img value2:><br />
66<input type="text" name="value3" value="<:old value3:>" size="40" maxlength="40" /><:error_img value3:><br />
67<input type="text" name="value4" value="<:old value4:>" size="40" maxlength="40" /><:error_img value4:><br />
68<input type="text" name="value5" value="<:old value5:>" size="40" maxlength="40" /><:error_img value5:><br /></td>
69 </tr>
70 <tr>
71 <td colspan="2"><input type="submit" name="a_add_option" value="Add New Option" /></td>
72 </tr>
73</table>
74</form>
75</div>
76<div id="addoptionbutton" style="display: none">
77<a href="#" onclick="javascript: document.getElementById('addoptionform').style.display='block'; return false;">Add an option</a>
78</div>
9b3a5df0 79<:or UserCan:><:eif UserCan:>
58baa27b
TC
80<script>
81
58baa27b 82var prodopts = <:dboptionsjson:>;
58baa27b
TC
83var reorder_values_csrf = '<:csrfp admin_move_option_value:>';
84var reorder_options_csrf = '<:csrfp admin_move_option:>';
5708b3ac 85var edit_option_csrf = '<:csrfp admin_save_option:>';
1660ce30 86var edit_value_csrf = '<:csrfp admin_save_option_value:>';
4de47893
TC
87var article_id = "<:article id:>";
88var edit_script = "<:script:>";
58baa27b 89
9b3a5df0
TC
90var user_can_edit_option = <:ifUserCan bse_edit_prodopt_edit:>1<:or:>0<:eif:>;
91var user_can_delete_option = <:ifUserCan bse_edit_prodopt_delete:>1<:or:>0<:eif:>;
92var user_can_move_option = <:ifUserCan bse_edit_prodopt_move:>1<:or:>0<:eif:>;
58baa27b 93
5f3a2963
TC
94var show_add_form = <:ifCgi a_add_option:>true<:or:>false<:eif:>;
95
58baa27b 96</script>