1 [%- USE JSON -%][%- USE HTML %][%- USE L %][%- USE LxERP %][%- USE P -%]
3 <h1>[%- HTML.escape(SELF.requirement_spec.displayable_name('format', 'with_customer')) %]
5 [% HTML.escape(SELF.requirement_spec.customer.displayable_name) -%]
8 [%- L.hidden_tag('requirement_spec_id', SELF.requirement_spec.id) -%]
10 <div id="requirement_spec_version">
11 [%- INCLUDE 'requirement_spec/_version.html' requirement_spec=SELF.requirement_spec -%]
14 <div id="column-container">
15 <div id="tree-column" style="border-right: 1px solid black">
16 <div style="min-height: 32px; height: 32px;">
17 <div style="float: left">
18 [% L.button_tag("new_section_form()", LxERP.t8("New section"), id="new-section-button") %]
20 <div id="spinner" class="clearfix" 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>
26 <div id="content-column" class="clearfix">
27 [% L.hidden_tag('current_content_type', SELF.requirement_spec_item.id ? 'section' : '') %]
28 [% L.hidden_tag('current_content_id', SELF.requirement_spec_item.id) %]
30 <div id="column-content">
31 [%- IF SELF.requirement_spec_item -%]
32 [%- INCLUDE 'requirement_spec_item/_single_section.html' requirement_spec_item=SELF.requirement_spec_item -%]
35 [%#- render :partial => 'requirement_spec_items/no_section' -%]
41 <script type="text/javascript">
44 { data: [% JSON.json(LxERP.t8("Text blocks front")) %],
45 metadata: { type: "textblocks-front" },
46 attr: { id: "tb-front", class: "text-block-context-menu" },
48 [% FOREACH tb = SELF.requirement_spec.text_blocks_for_position(0) %]
49 [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %]
54 { data: [% JSON.json(LxERP.t8("Sections")) %],
55 metadata: { type: "sections" },
56 attr: { id: "sections" },
59 [% FOREACH section = SELF.requirement_spec.sections %]
60 [% P.requirement_spec_item_jstree_data(section).json %][% IF !loop.last %],[% END %]
65 { data: [% JSON.json(LxERP.t8("Text blocks back")) %],
66 metadata: { type: "textblocks-back" },
67 attr: { id: "tb-back", class: "text-block-context-menu" },
69 [% FOREACH tb = SELF.requirement_spec.text_blocks_for_position(1) %]
70 [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %]
80 initially_open: [ "tb-front", "tb-back", "sections"
81 [%- FOREACH section = SELF.requirement_spec.sections -%]
82 , "fb-[% section.id %]"
83 [%- FOREACH function_block = section.children -%]
84 , "fb-[% function_block.id -%]"
94 check_move: requirement_spec_tree_check_move,
99 theme: "requirement-spec"
101 plugins: [ "themes", "json_data", "ui", "crrm", "dnd" ]
103 .bind("move_node.jstree", requirement_spec_tree_node_moved)
104 .bind("click.jstree", requirement_spec_tree_node_clicked);
105 [%- IF SELF.requirement_spec_item -%]
106 $.jstree._reference("#tree").select_node('fb-[% SELF.requirement_spec_item.id %]', true);
110 function ask_delete_text_block(key, opt) {
111 if (confirm("[% LxERP.t8("Are you sure?") %]"))
112 delete_text_block(key, opt);
118 selector: '.text-block-context-menu',
120 add: { name: "[% LxERP.t8('Add text block') %]", icon: "add", callback: add_text_block },
121 edit: { name: "[% LxERP.t8('Edit text block') %]", icon: "edit", callback: edit_text_block, disabled: disable_edit_text_block_commands },
122 delete: { name: "[% LxERP.t8('Delete text block') %]", icon: "delete", callback: ask_delete_text_block, disabled: disable_edit_text_block_commands },
124 copy: { name: "[% LxERP.t8('Copy') %]", icon: "copy", disabled: disable_edit_text_block_commands },
125 paste: { name: "[% LxERP.t8('Paste') %]", icon: "paste", disabled: disable_edit_text_block_commands }