X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=templates%2Fwebpages%2Frequirement_spec%2Fshow.html;h=3cd23ef75a8a0cd72bbee8d28a17397d9a587c22;hb=e3dfdb7a78f6e0bc8ac1075fedc36f8247c6fd92;hp=bc4d5dbd3984dbcc001260322d4d352cec2b1838;hpb=786437b68e64cc7c8496792b2a34717f60ca3a22;p=kivitendo-erp.git
diff --git a/templates/webpages/requirement_spec/show.html b/templates/webpages/requirement_spec/show.html
index bc4d5dbd3..3cd23ef75 100644
--- a/templates/webpages/requirement_spec/show.html
+++ b/templates/webpages/requirement_spec/show.html
@@ -1,4 +1,5 @@
-[%- USE JSON -%][%- USE HTML %][%- USE L %][%- USE LxERP %][%- USE P -%]
+[%- USE JSON -%][%- USE HTML %][%- USE L %][%- USE LxERP %][%- USE P -%][%- USE JavaScript -%]
+[% SET sections = SELF.requirement_spec.sections_sorted || [] %]
[%- INCLUDE 'common/flash.html' %]
@@ -10,7 +11,8 @@
-
+
+
[%- UNLESS SELF.requirement_spec.is_template %]
@@ -54,7 +56,7 @@ $(function() {
attr: { id: "tb-front", class: "text-block-context-menu" },
children: [
[% FOREACH tb = SELF.requirement_spec.text_blocks_sorted(output_position=0) %]
- [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %]
+ [% tb.presenter.jstree_data.json %][% IF !loop.last %],[% END %]
[% END %]
]},
@@ -62,8 +64,8 @@ $(function() {
metadata: { type: "sections" },
attr: { id: "sections", class: "section-context-menu" },
children: [
-[% FOREACH section = SELF.requirement_spec.sections %]
- [% P.requirement_spec_item_jstree_data(section).json %][% IF !loop.last %],[% END %]
+[% FOREACH section = sections %]
+ [% section.presenter.jstree_data.json %][% IF !loop.last %],[% END %]
[% END %]
]},
@@ -72,13 +74,13 @@ $(function() {
attr: { id: "tb-back", class: "text-block-context-menu" },
children: [
[% FOREACH tb = SELF.requirement_spec.text_blocks_sorted(output_position=1) %]
- [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %]
+ [% tb.presenter.jstree_data.json %][% IF !loop.last %],[% END %]
[% END %]
]}
];
var initially_open = ['tb-front', 'tb-back', 'sections'
-[%- FOREACH section = SELF.requirement_spec.sections -%]
+[%- FOREACH section = sections -%]
, "fb-[% section.id %]"
[%- FOREACH function_block = section.children -%]
, "fb-[% function_block.id -%]"
@@ -86,37 +88,20 @@ $(function() {
[%- END -%]
];
- $('#tree')
- .bind('loaded.jstree', function() {
- kivi.reinit_widgets();
+ kivi.requirement_spec.initialize_requirement_spec({
+ initially_open: initially_open
+ , tree_data: tree_data
+ , is_template: [% SELF.requirement_spec.is_template ? 'true' : 'false' %]
+ , html_template_exists: [% SELF.html_template ? 'true' : 'false' %]
[% IF SELF.requirement_spec_item %]
- $.jstree._reference("#tree").select_node('#fb-[% SELF.requirement_spec_item.id %]', true);
+ , initially_selected_node: '#fb-[% SELF.requirement_spec_item.id %]'
[% END %]
- })
- .jstree({
- core: {
- animation: 0,
- initially_open: initially_open,
- },
- json_data: {
- data: tree_data
- },
- crrm: {
- move: {
- check_move: kivi.requirement_spec.tree_check_move,
- open_move: true
- }
- },
- themes: {
- theme: "requirement-spec"
- },
- plugins: [ "themes", "json_data", "ui", "crrm", "dnd" ]
- })
- .bind("move_node.jstree", kivi.requirement_spec.tree_node_moved)
- .bind("click.jstree", kivi.requirement_spec.tree_node_clicked);
-
- kivi.requirement_spec.create_context_menus([% SELF.requirement_spec.is_template ? 'true' : 'false' %]);
- $('#requirement_spec_tabs').on("tabsbeforeactivate", kivi.requirement_spec.tabs_before_activate);
+ , time_based_units: {
+ [% FOREACH unit = SELF.time_based_units %]
+ [% UNLESS loop.first %], [% END %] "[% JavaScript.escape(unit.name) %]": true
+ [% END %]
+ }
+ });
});
-->