Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 217e508f

Von Werner Hahn vor 27 Tagen hinzugefügt

  • ID 217e508f3f6eb5abe463215ecdff0a466d21d0c9
  • Vorgänger e8ce945f
  • Nachfolger 86d460a0

Hierarcische Warengruppen: Tempates Design 4.0

Unterschiede anzeigen:

templates/design40_webpages/partsgroup/_parts_table_body.html
1
[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%][% USE P %]
2
[% FOREACH part = PARTS %]
3
  <tr>
4
   <td>[% L.checkbox_tag('part_ids[]', value=part.id, checked=part.selected, "data-checkall"=1) %]</td>
5
   <td><a href="[% SELF.url_for(controller = 'Part', action = 'edit', 'part.id' = part.id) %]">[% part.displayable_name | html %]</a></td>
6
  </tr>
7
[% END %]
8

  
9
[% # L.dump(PARTS) %]
templates/design40_webpages/partsgroup/_subgroups_table_body.html
1
[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%][% USE P %]
2
[% FOREACH child = CHILDREN %]
3
    <tr class="listrow" id="partsgroup_id_[% child.id %]">
4
     <td align="center" class="dragdrop"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></td>
5
     <td><a href="[% SELF.url_for(action='edit', id=child.id) %]">[% HTML.escape(child.partsgroup) %]</a></td>
6
     <td>[% IF child.obsolete %][% 'Yes' | $T8 %][% ELSE %][% 'No' | $T8 %][% END %]</td>
7
  </tr>
8
[% END %]
templates/design40_webpages/partsgroup/form.html
1
[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE P -%][%- USE T8 -%]
2
[% INCLUDE 'common/flash.html' %]
3

  
4
<h1>[% HTML.escape(title) %]</h1>
5
[% SET style="width: 400px" %]
6

  
7
<form action="controller.pl" method="post" id="form">
8
[%- L.hidden_tag("id", SELF.partsgroup.id) %]
9

  
10
<div class="wrapper">
11
<table class="tbl-horizontal">
12
  <tr>
13
    <th align="right">[% 'Partsgroup' | $T8 %]</th>
14
    <td>[%- L.input_tag("partsgroup.partsgroup", SELF.partsgroup.partsgroup, "data-validate"="required", "data-title"=LxERP.t8("Description")) %]</td>
15
  </tr>
16
  <tr>
17
    <th align="right">[% 'Description' | $T8 %]</th>
18
    <td>[%- L.textarea_tag("partsgroup.description", SELF.partsgroup.description, cols = 50 rows = 2, "data-title"=LxERP.t8("Description")) %]</td>
19
  </tr>
20
  <tr>
21
    <th align="right">[% 'Obsolete' | $T8 %]</th>
22
    <td>[% L.checkbox_tag('partsgroup.obsolete', checked = SELF.partsgroup.obsolete, for_submit=1) %]</td>
23
  </tr>
24

  
25
  [% IF SELF.partsgroup.id %]
26
  <tr>
27
    <th align="right">[% 'Parents' | $T8 %]</th>
28
    <td>
29
    [% FOREACH ancestor = SELF.partsgroup.ancestors %]
30
      [% IF loop.last %]
31
      [%- L.select_tag('partsgroup.parent_id', PARTSGROUPS, default=SELF.partsgroup.parent_id, title_key='indented_name', value_key='id', with_empty=1 style='width: 200px') %]
32
      [% ELSE %]
33
    <a href="[% SELF.url_for(action='edit', id=ancestor.id) %]">[% HTML.escape(ancestor.partsgroup) %]</a> ->
34
      [% END %]
35
    [% END %]
36
    [% IF SELF.partsgroup.ancestors.size == 0 %]
37
      [%- L.select_tag('partsgroup.parent_id', PARTSGROUPS, title_key='indented_name', value_key='id', with_empty=1 style='width: 200px') %]
38
    [% END %]
39
    </td>
40
  </tr>
41
  [% END %]
42
 </table>
43

  
44
</form>
45

  
46
  [% IF SELF.partsgroup.id %]
47

  
48
<h2>[% 'Subgroups' | $T8 %]</h2>
49
<table id="subgroups">
50
 <thead>
51
  <tr>
52
    <th align="center" width="1%"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
53
    <th align="left">[% 'Subgroups' | $T8 %]</th>
54
    <th align="left">[% 'Obsolete'  | $T8 %]</th>
55
  </tr>
56
 </thead>
57

  
58
 <tbody id="subgroups_table_body">
59
  [% PROCESS 'partsgroup/_subgroups_table_body.html', CHILDREN = SELF.partsgroup.children_sorted %]
60
  </tbody>
61
</table>
62

  
63
[% L.sortable_element('#subgroups tbody', url=SELF.url_for(action='reorder'), with='partsgroup_id') %]
64

  
65
[%- L.input_tag("new_partsgroup", '', "data-title"=LxERP.t8("Partsgroup")) %] [% L.button_tag("add_partsgroup()", LxERP.t8('Insert new')) %]
66

  
67
<h2>[% 'Parts' | $T8 %]</h2>
68

  
69
<form id="parts_form" name="parts_form">
70
<table id="parts_in_partsgroup">
71
 <table>
72
  <thead>
73
   <tr class="listheading">
74
    <th>[% L.checkbox_tag("", id="check_all", checkall="[data-checkall=1]") %]</th>
75
    <th>[% LxERP.t8("Part Number") %]</th>
76
   </tr>
77
  </thead>
78
  <tbody id="parts_table_body">
79
  [% PROCESS 'partsgroup/_parts_table_body.html', PARTS = SELF.partsgroup.parts %]
80
  </tbody>
81
</table>
82
</form>
83

  
84
<table>
85
<body>
86
<tr>
87
 <th align="right">[% 'Partsgroup' | $T8 %]</th>
88
 <td>[%- L.select_tag('selected_partsgroup', PARTSGROUPS, title_key='indented_name', value_key='id', with_empty=1 style='width: 200px') %]</td>
89
 <td>[% L.button_tag('move_parts_to_partsgroup()', LxERP.t8('Move selected parts to partsgroup')) %]</td>
90
</tr>
91
</body>
92
</table>
93

  
94
<table>
95
<tr>
96
 <th align="right">[% 'Part' | $T8 %]</th>
97
 <td>[% P.part.picker('add_part_id', '', style='width: 300px') %]</td>
98
 <td>[% L.button_tag("add_part()", LxERP.t8('Insert new')) %]</td>
99
</tr>
100
</table>
101
</div>
102
[% END %]
103

  
104
<script type='text/javascript'>
105
  function move_parts_to_partsgroup() {
106
    var data = $('#parts_form').serializeArray();
107
    data.push({ name: 'current_partsgroup_id',  value: '[% SELF.partsgroup.id %]' });
108
    data.push({ name: 'selected_partsgroup_id', value: $("#selected_partsgroup").val() });
109
    data.push({ name: 'action',                   value: 'PartsGroup/update_partsgroup_for_parts' });
110
    $.post("controller.pl", data, kivi.eval_json_result);
111
  }
112

  
113
  function add_part() {
114
    var data = {
115
      action:        'PartsGroup/add_part',
116
      part_id:       $('#add_part_id').val(),
117
      partsgroup_id: $('#id').val()
118
    };
119
    $.post("controller.pl", data, kivi.eval_json_result);
120
  }
121

  
122
  function add_partsgroup() {
123
    var data = {
124
      action:          'PartsGroup/add_partsgroup',
125
      parent_id:       $('#id').val(),
126
      partsgroup_name: $('#new_partsgroup').val()
127
    };
128
    $.post("controller.pl", data, kivi.eval_json_result);
129
  }
130
</script>
templates/design40_webpages/partsgroup/list.html
1
[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%]
2
[%- INCLUDE 'common/flash.html' %]
3

  
4
<h1>[% title %]</h1>
5

  
6
<div class="wrapper">
7
<table class="tbl-vertical">
8
  <thead>
9
   <tr>
10
    <th>[% 'Partsgroup'      | $T8 %]</th>
11
    <th>[% 'Number of parts' | $T8 %]</th>
12
    <th>[% 'Obsolete'        | $T8 %]</th>
13
   </tr>
14
  </thead>
15

  
16
  <tbody>
17
   [%- FOREACH pg = PARTSGROUPS %]
18
    <tr class="listrow" id="pg_id_[% pg.id %]">
19
     <td style="padding-left:[% (pg.level) * 2 %]em"><a href="[% SELF.url_for(action='edit', id=pg.id) %]">[% HTML.escape(pg.partsgroup) %]
20
[% # pg.level %]</a></td>
21
    <td>[% pg.partscount | html %]</td>
22
    <td>[% IF pg.obsolete %][% 'Yes' | $T8 %][% ELSE %][% 'No' | $T8 %][% END %]</td>
23
   [%- END %]
24
  </tbody>
25
 </table>
26
</div>
templates/design40_webpages/partsgroup/sort_roots.html
1
[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE P -%][%- USE T8 -%]
2
[% INCLUDE 'common/flash.html' %]
3

  
4
<h1>[% HTML.escape(title) %]</h1>
5
[% SET style="width: 400px" %]
6

  
7
<table id="subgroups">
8
 <thead>
9
  <tr>
10
    <th align="center"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
11
    <th align="left">[% 'Partsgroups' | $T8 %]</th>
12
    <th align="left">[% 'Obsolete'    | $T8 %]</th>
13
  </tr>
14
 </thead>
15

  
16
 <tbody id="subgroups_table_body">
17
  [% PROCESS 'partsgroup/_subgroups_table_body.html', CHILDREN = PARTSGROUPS %]
18
  </tbody>
19
</table>
20
</div>
21

  
22
[% L.sortable_element('#subgroups tbody', url=SELF.url_for(action='reorder'), with='partsgroup_id') %]
23

  
24
[%- L.input_tag("new_partsgroup", '', "data-title"=LxERP.t8("Partsgroup")) %] [% L.button_tag("add_partsgroup()", LxERP.t8('Add')) %]
25

  
26
<script type='text/javascript'>
27
  function add_partsgroup() {
28
    console.log('called add_part');
29
    var data = {
30
      action:          'PartsGroup/add_partsgroup',
31
      // parent_id:       $('#id').val(),
32
      partsgroup_name: $('#new_partsgroup').val()
33
    };
34
    $.post("controller.pl", data, kivi.eval_json_result);
35
  }
36
</script>

Auch abrufbar als: Unified diff