Pflichtenhefte: Erste Version Baumansicht Textblöcke/Abschnitte/Funktionsblöcke
[kivitendo-erp.git] / templates / webpages / requirement_spec / tree.html
1 [%- USE HTML %][%- USE L %][%- USE LxERP %][% USE P %][% USE JSON %]
2
3 [%- L.hidden_tag('requirement_spec_id', SELF.requirement_spec.id) -%]
4
5 <div id="page" class="ym-grid ym-equalize">
6  <div class="ym-g25 ym-gl" style="border-right: 1px solid black">
7   <div style="min-height: 32px; height: 32px;">
8    <div style="float: left">
9     [% L.button_tag("new_section_form()", LxERP.t8("New section"), id="new-section-button") %]
10    </div>
11    <div id="spinner" style="float: right; display: none; background:url('js/themes/requirement-spec/throbber.gif') center center no-repeat !important; min-height: 32px; height: 32px; min-width: 32px; width: 32px;"></div>
12    <div style="clear: both"></div>
13   </div>
14
15   <div id="tree"></div>
16  </div>
17
18  <div class="ym-gl">
19   <div id="content-column">
20    <p>There's beauty in the breakdown. 0</p>
21    <p>There's beauty in the breakdown. 1</p>
22    <p>There's beauty in the breakdown. 2</p>
23    <p>There's beauty in the breakdown. 3</p>
24    <p>There's beauty in the breakdown. 4</p>
25    <p>There's beauty in the breakdown. 5</p>
26    <p>There's beauty in the breakdown. 6</p>
27    <p>There's beauty in the breakdown. 7</p>
28    <p>There's beauty in the breakdown. 8</p>
29    <p>There's beauty in the breakdown. 9</p>
30    <p>There's beauty in the breakdown. 10</p>
31    <p>There's beauty in the breakdown. 11</p>
32    <p>There's beauty in the breakdown. 12</p>
33    <p>There's beauty in the breakdown. 13</p>
34    <p>There's beauty in the breakdown. 14</p>
35    <p>There's beauty in the breakdown. 15</p>
36    <p>There's beauty in the breakdown. 16</p>
37    <p>There's beauty in the breakdown. 17</p>
38    <p>There's beauty in the breakdown. 18</p>
39    <p>There's beauty in the breakdown. 19</p>
40    <p>There's beauty in the breakdown. 20</p>
41    <p>There's beauty in the breakdown. 21</p>
42    <p>There's beauty in the breakdown. 22</p>
43    <!-- <p>There's beauty in the breakdown. 23</p> -->
44    <!-- <p>There's beauty in the breakdown. 24</p> -->
45    <!-- <p>There's beauty in the breakdown. 25</p> -->
46    <!-- <p>There's beauty in the breakdown. 26</p> -->
47    <!-- <p>There's beauty in the breakdown. 27</p> -->
48    <!-- <p>There's beauty in the breakdown. 28</p> -->
49    <!-- <p>There's beauty in the breakdown. 29</p> -->
50    <!-- <p>There's beauty in the breakdown. 30</p> -->
51    <!-- <p>There's beauty in the breakdown. 31</p> -->
52    <!-- <p>There's beauty in the breakdown. 32</p> -->
53    <!-- <p>There's beauty in the breakdown. 33</p> -->
54    <!-- <p>There's beauty in the breakdown. 34</p> -->
55    <!-- <p>There's beauty in the breakdown. 35</p> -->
56   </div>
57  </div>
58 </div>
59
60 <script type="text/javascript">
61  <!--
62      var tree_data = [
63        { "data": [% JSON.json(LxERP.t8("Text blocks front")) %],
64          "metadata": { "type": "textblocks-front" },
65          "attr": { "id": "tb-front" },
66          "children": [
67 [% FOREACH tb = SELF.requirement_spec.text_blocks_for_position(0) %]
68  [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %]
69 [% END %]
70          ]
71        },
72
73        { "data": [% JSON.json(LxERP.t8("Sections")) %],
74          "metadata": { "type": "sections" },
75          "attr": { "id": "sections" },
76          "children": [
77
78 [% FOREACH section = SELF.requirement_spec.sections %]
79  [% P.requirement_spec_item_jstree_data(section).json %][% IF !loop.last %],[% END %]
80 [% END %]
81          ]
82        },
83
84        { "data": [% JSON.json(LxERP.t8("Text blocks back")) %],
85          "metadata": { "type": "textblocks-back" },
86          "attr": { "id": "tb-back" },
87          "children": [
88 [% FOREACH tb = SELF.requirement_spec.text_blocks_for_position(1) %]
89  [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %]
90 [% END %]
91          ]
92        }
93      ];
94
95      $(function() {
96        $('#tree').jstree({
97          "core": {
98            "animation": 0,
99            "initially_open": [ "tb-front", "tb-back", "sections"
100 [%- FOREACH section = SELF.requirement_spec.sections -%]
101  , "fb-[% section.id %]"
102  [%- FOREACH function_block = section.children -%]
103   , "fb-[% function_block.id -%]"
104  [%- END -%]
105 [%- END -%]
106  ]
107          },
108          "json_data": {
109            "data": tree_data
110          },
111          "crrm": {
112            "move": {
113              "check_move": check_move,
114              "open_move": true
115            }
116          },
117          "themes": {
118            "theme": "requirement-spec"
119          },
120          "plugins": [ "themes", "json_data", "ui", "crrm", "dnd" ]
121        })
122        .bind("move_node.jstree", node_moved);
123      });
124
125      $(document).ajaxSend(function() {
126        $('#spinner').show();
127      }).ajaxStop(function() {
128        $('#spinner').hide();
129      });
130   -->
131 </script>