WebshopApi: templates
[kivitendo-erp.git] / templates / webpages / shop_part / categories.html
1 [%- USE HTML %]
2 [%- USE T8 %]
3 [%- USE L -%]
4 [%- USE P -%]
5 [%- USE LxERP -%]
6
7 [%  LxERP.t8("Part") %]: [% HTML.escape(SELF.shop_part.part.displayable_name) %]<br>
8 [%  LxERP.t8("Shop") %]: [% HTML.escape(SELF.shop_part.shop.description) %]<br>
9
10 <form action="controller.pl" method="post">
11   [% BLOCK recurse %]
12     [% # path = '' %]<!-- TODO: Pfad wg neuer Kategorie im Shop anlegen -->
13     [% FOREACH obj = data %]
14       <ul>
15         <li>
16         [% checked = '' %]
17         [% # path = path _ obj.name %]
18         [% # test = path.split('\|') %]
19         [% IF SELF.shop_part.shop_category.1.grep(obj.name).size %]
20           [% checked = 'checked' %]
21         [% ELSE %]
22           [% FOREACH cat_row = SELF.shop_part.shop_category %]
23             [% IF cat_row.1.grep(obj.name).size %]
24               [% checked = 'checked' %]
25             [% END %]
26           [% END %]
27         [% END %]
28           [% L.checkbox_tag('categories[]',value=obj.id, checked=checked) %][% HTML.escape(obj.name) %][% L.hidden_tag("cat_id_" _ obj.id, obj.name) %]</li>
29         [% IF obj.childrenCount >= 1 %]
30           [% # path = path _ '|' %]
31           [% INCLUDE recurse data=obj.children %]
32         [% END %]
33       </ul>
34     [% END %]
35   [% END %]
36   <div><h2>[% LxERP.t8("Shopcategories") %]</h2>
37       [% FOREACH row = CATEGORIES %]
38 <!-- TODO: Is still hardcoded 'Root' is shopware specified -->
39         [% IF row.name == 'Root' %]
40           [% IF row.childrenCount >= 1 %]
41             [% path = '' %]
42             [% INCLUDE recurse data=row.children path=path %]
43           [% END %]
44         [% END %]
45       [% END %]
46   </div>
47     [% L.button_tag("kivi.ShopPart.save_categories(" _ SELF.shop_part.id _", " _ SELF.shop_part.shop.id _")", LxERP.t8("Save"))  %]</td>
48 </form>