X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=templates%2Fwebpages%2Frequirement_spec%2Fshow.html;h=c41e87d84ca9895f5852cea38afb9ad5a78b1878;hb=237aee7f7b1ed637b3e329e575887f5d4015ee7d;hp=8442d05838f5bef43221e6a55c0c65eac36fa482;hpb=2ea806480ef25ecd3a61a32d80e216e87210c39d;p=kivitendo-erp.git diff --git a/templates/webpages/requirement_spec/show.html b/templates/webpages/requirement_spec/show.html index 8442d0583..c41e87d84 100644 --- a/templates/webpages/requirement_spec/show.html +++ b/templates/webpages/requirement_spec/show.html @@ -1,23 +1,29 @@ [%- USE JSON -%][%- USE HTML %][%- USE L %][%- USE LxERP %][%- USE P -%] +[% SET sections = SELF.requirement_spec.sections_sorted || [] %] [%- INCLUDE 'common/flash.html' %] [%- INCLUDE 'requirement_spec/_header.html' %] -[%- L.hidden_tag('requirement_spec_id', SELF.requirement_spec.id) -%] +[%- L.hidden_tag('requirement_spec_id', SELF.requirement_spec.id, 'data-is-template'=(SELF.requirement_spec.is_template ? 1 : 0)) -%] -
+
-
-
+
+ [%- UNLESS SELF.requirement_spec.is_template %] +
[%- INCLUDE 'requirement_spec/_version.html' requirement_spec=SELF.requirement_spec -%] -
+
+ [%- END %]
@@ -57,7 +63,7 @@ $(function() { metadata: { type: "sections" }, attr: { id: "sections", class: "section-context-menu" }, children: [ -[% FOREACH section = SELF.requirement_spec.sections %] +[% FOREACH section = sections %] [% P.requirement_spec_item_jstree_data(section).json %][% IF !loop.last %],[% END %] [% END %] ]}, @@ -69,40 +75,26 @@ $(function() { [% FOREACH tb = SELF.requirement_spec.text_blocks_sorted(output_position=1) %] [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %] [% END %] - ]}]; + ]} + ]; - $('#tree').jstree({ - core: { - animation: 0, - initially_open: [ "tb-front", "tb-back", "sections" -[%- FOREACH section = SELF.requirement_spec.sections -%] + var initially_open = ['tb-front', 'tb-back', 'sections' +[%- FOREACH section = sections -%] , "fb-[% section.id %]" [%- FOREACH function_block = section.children -%] , "fb-[% function_block.id -%]" [%- END -%] [%- END -%] - ]}, - 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.initialize_requirement_spec({ + initially_open: initially_open + , tree_data: tree_data + , is_template: [% SELF.requirement_spec.is_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 %] - - kivi.requirement_spec.create_context_menus(); + }); }); -->