Revision 90f4ba5d
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
SL/Controller/RequirementSpecItem.pm | ||
---|---|---|
23 | 23 |
'scalar --get_set_init' => [ qw(complexities risks) ], |
24 | 24 |
); |
25 | 25 |
|
26 |
__PACKAGE__->run_before('load_requirement_spec_item', only => [ qw(dragged_and_dropped ajax_update ajax_edit ajax_delete) ]); |
|
26 |
__PACKAGE__->run_before('load_requirement_spec_item', only => [ qw(dragged_and_dropped ajax_update ajax_edit ajax_delete ajax_flag) ]);
|
|
27 | 27 |
__PACKAGE__->run_before('init_visible_section'); |
28 | 28 |
|
29 | 29 |
# |
... | ... | |
322 | 322 |
->render($self); |
323 | 323 |
} |
324 | 324 |
|
325 |
sub action_ajax_flag { |
|
326 |
my ($self) = @_; |
|
327 |
|
|
328 |
$self->item->update_attributes(is_flagged => !$self->item->is_flagged); |
|
329 |
|
|
330 |
my $is_visible = $self->visible_section && ($self->visible_section->id == $self->item->get_section->id); |
|
331 |
|
|
332 |
SL::ClientJS->new |
|
333 |
->action_if($is_visible, 'toggleClass', '#' . $self->item->get_type . '-' . $self->item->id, 'flagged') |
|
334 |
->toggleClass('#fb-' . $self->item->id, 'flagged') |
|
335 |
->render($self); |
|
336 |
} |
|
337 |
|
|
325 | 338 |
# |
326 | 339 |
# filters |
327 | 340 |
# |
SL/Controller/RequirementSpecTextBlock.pm | ||
---|---|---|
19 | 19 |
'scalar --get_set_init' => [ qw(predefined_texts) ], |
20 | 20 |
); |
21 | 21 |
|
22 |
__PACKAGE__->run_before('load_requirement_spec_text_block', only => [qw(ajax_edit ajax_update ajax_delete dragged_and_dropped)]); |
|
22 |
__PACKAGE__->run_before('load_requirement_spec_text_block', only => [qw(ajax_edit ajax_update ajax_delete ajax_flag dragged_and_dropped)]);
|
|
23 | 23 |
|
24 | 24 |
# |
25 | 25 |
# actions |
... | ... | |
172 | 172 |
->render($self); |
173 | 173 |
} |
174 | 174 |
|
175 |
sub action_ajax_flag { |
|
176 |
my ($self) = @_; |
|
177 |
|
|
178 |
$self->text_block->update_attributes(is_flagged => !$self->text_block->is_flagged); |
|
179 |
|
|
180 |
my $current_where = $self->output_position_from_id($::form->{current_content_id}, $::form->{current_content_type}); |
|
181 |
|
|
182 |
SL::ClientJS->new |
|
183 |
->action_if($current_where == $self->text_block->output_position, 'toggleClass', '#text-block-' . $self->text_block->id, 'flagged') |
|
184 |
->toggleClass('#tb-' . $self->text_block->id, 'flagged') |
|
185 |
->render($self); |
|
186 |
} |
|
187 |
|
|
175 | 188 |
sub action_dragged_and_dropped { |
176 | 189 |
my ($self) = @_; |
177 | 190 |
|
SL/Presenter/RequirementSpecItem.pm | ||
---|---|---|
20 | 20 |
|
21 | 21 |
my @children = map { $self->requirement_spec_item_jstree_data($_, %params) } @{ $item->sorted_children }; |
22 | 22 |
my $type = !$item->parent_id ? 'section' : 'function-block'; |
23 |
my $class = $type . '-context-menu'; |
|
24 |
$class .= ' flagged' if $item->is_flagged; |
|
23 | 25 |
|
24 | 26 |
return { |
25 | 27 |
data => $self->requirement_spec_item_tree_node_title($item), |
26 | 28 |
metadata => { id => $item->id, type => $type }, |
27 |
attr => { id => "fb-" . $item->id, href => $params{href} || '#', class => $type . '-context-menu' },
|
|
29 |
attr => { id => "fb-" . $item->id, href => $params{href} || '#', class => $class },
|
|
28 | 30 |
children => \@children, |
29 | 31 |
}; |
30 | 32 |
} |
SL/Presenter/RequirementSpecTextBlock.pm | ||
---|---|---|
14 | 14 |
sub requirement_spec_text_block_jstree_data { |
15 | 15 |
my ($self, $text_block, %params) = @_; |
16 | 16 |
|
17 |
my $class = 'text-block-context-menu'; |
|
18 |
$class .= ' flagged' if $text_block->is_flagged; |
|
19 |
|
|
17 | 20 |
return { |
18 | 21 |
data => $text_block->title || '', |
19 | 22 |
metadata => { id => $text_block->id, type => 'text-block' }, |
20 |
attr => { id => "tb-" . $text_block->id, href => $params{href} || '#', class => 'text-block-context-menu' },
|
|
23 |
attr => { id => "tb-" . $text_block->id, href => $params{href} || '#', class => $class },
|
|
21 | 24 |
}; |
22 | 25 |
} |
23 | 26 |
|
css/requirement_spec.css | ||
---|---|---|
1 |
/* ------------------------------------------------------------ */ |
|
2 |
/* General page layout */ |
|
3 |
/* ------------------------------------------------------------ */ |
|
4 |
|
|
1 | 5 |
input.rs_input_field, select.rs_input_field, |
2 | 6 |
table.rs_input_field input, table.rs_input_field select { |
3 | 7 |
width: 300px; |
... | ... | |
26 | 30 |
color: #bbb; |
27 | 31 |
} |
28 | 32 |
|
33 |
/* ------------------------------------------------------------ */ |
|
34 |
/* Special things that apply to the tree */ |
|
35 |
/* ------------------------------------------------------------ */ |
|
36 |
|
|
37 |
#tree li.flagged > a > ins { |
|
38 |
background-image: url("../image/flag-red.png") !important; |
|
39 |
background-position: 0; |
|
40 |
} |
|
41 |
|
|
42 |
/* ------------------------------------------------------------ */ |
|
43 |
/* Special things that apply to the context menu */ |
|
44 |
/* ------------------------------------------------------------ */ |
|
45 |
|
|
46 |
.context-menu-item.icon-flag { background-image: url("../image/flag-red.png"); } |
|
47 |
|
|
48 |
|
|
49 |
/* ------------------------------------------------------------ */ |
|
50 |
/* Sections & function blocks */ |
|
51 |
/* ------------------------------------------------------------ */ |
|
52 |
|
|
29 | 53 |
.function-block { |
30 | 54 |
border-bottom: 1px solid #bbb; |
31 | 55 |
} |
... | ... | |
43 | 67 |
|
44 | 68 |
.sub-function-block { |
45 | 69 |
border-bottom: 1px solid #ccc; |
70 |
background-color: #fff; |
|
46 | 71 |
} |
47 | 72 |
|
48 | 73 |
.sub-function-block-container { |
... | ... | |
62 | 87 |
border: 1px solid rgb(0, 100, 0); |
63 | 88 |
} |
64 | 89 |
|
90 |
.function-block-number { |
|
91 |
font-weight: bold; |
|
92 |
} |
|
93 |
|
|
65 | 94 |
.function-block-form > div { |
66 | 95 |
padding: 5px; |
67 | 96 |
} |
97 |
|
|
98 |
/* Flagged sections, function blocks, text blocks */ |
|
99 |
|
|
100 |
.section.flagged .section-description { |
|
101 |
background-color: #feece3; |
|
102 |
border: 1px solid #fe5f14; |
|
103 |
} |
|
104 |
|
|
105 |
.section.flagged .section-description > .section-description-heading { |
|
106 |
background-color: #fe5f14; |
|
107 |
color: #fff; |
|
108 |
} |
|
109 |
|
|
110 |
|
|
111 |
.function-block.flagged { |
|
112 |
background-color: #feece3; |
|
113 |
border: 1px solid #fe5f14; |
|
114 |
} |
|
115 |
|
|
116 |
.function-block.flagged > .function-block-content > div > .function-block-number { |
|
117 |
background-color: #fe5f14; |
|
118 |
color: #fff; |
|
119 |
} |
|
120 |
|
|
121 |
.sub-function-block.flagged { |
|
122 |
background-color: #feece3; |
|
123 |
border: 1px solid #fe5f14; |
|
124 |
} |
|
125 |
|
|
126 |
.sub-function-block.flagged > .sub-function-block-content > div > .function-block-number { |
|
127 |
background-color: #fe5f14; |
|
128 |
color: #fff; |
|
129 |
} |
|
130 |
|
|
131 |
/* ------------------------------------------------------------ */ |
|
132 |
/* Text blocks */ |
|
133 |
/* ------------------------------------------------------------ */ |
|
134 |
|
|
135 |
.requirement-spec-text-block { |
|
136 |
margin-top: 10px; |
|
137 |
} |
|
138 |
|
|
139 |
.requirement-spec-text-block > h2 { |
|
140 |
margin-top: 0px; |
|
141 |
} |
|
142 |
|
|
143 |
.requirement-spec-text-block.flagged { |
|
144 |
background-color: #feece3; |
|
145 |
border: 1px solid #fe5f14; |
|
146 |
} |
|
147 |
|
|
148 |
.requirement-spec-text-block.flagged > h2 { |
|
149 |
background-color: #fe5f14; |
|
150 |
color: #fff; |
|
151 |
} |
locale/de/all | ||
---|---|---|
2463 | 2463 |
'To Date' => 'Bis', |
2464 | 2464 |
'To continue please change the taxkey 0 to another value.' => 'Um fortzufahren, ändern Sie bitte den Steuerschlüssel 0 auf einen anderen Wert.', |
2465 | 2465 |
'To user login' => 'Zum Benutzerlogin', |
2466 |
'Toggle marker' => 'Markierung umschalten', |
|
2466 | 2467 |
'Top' => 'Oben', |
2467 | 2468 |
'Top (CSS)' => 'Oben (mit CSS)', |
2468 | 2469 |
'Top (Javascript)' => 'Oben (mit Javascript)', |
templates/webpages/requirement_spec/show.html | ||
---|---|---|
115 | 115 |
edit: { name: "[% LxERP.t8('Edit text block') %]", icon: "edit", callback: standard_text_block_ajax_call, disabled: disable_edit_text_block_commands }, |
116 | 116 |
delete: { name: "[% LxERP.t8('Delete text block') %]", icon: "delete", callback: ask_delete_text_block, disabled: disable_edit_text_block_commands }, |
117 | 117 |
sep1: "---------", |
118 |
flag: { name: "[% LxERP.t8('Toggle marker') %]", icon: "flag", callback: standard_text_block_ajax_call, disabled: disable_edit_text_block_commands }, |
|
119 |
sep2: "---------", |
|
118 | 120 |
copy: { name: "[% LxERP.t8('Copy') %]", icon: "copy", disabled: disable_edit_text_block_commands }, |
119 | 121 |
paste: { name: "[% LxERP.t8('Paste') %]", icon: "paste", disabled: disable_edit_text_block_commands } |
120 | 122 |
} |
... | ... | |
129 | 131 |
sep1: "---------", |
130 | 132 |
edit: { name: "[% LxERP.t8('Edit') %]", icon: "edit", callback: standard_item_ajax_call, disabled: disable_edit_item_commands }, |
131 | 133 |
delete: { name: "[% LxERP.t8('Delete') %]", icon: "delete", callback: ask_delete_item, disabled: disable_edit_item_commands }, |
132 |
sep2: "---------", |
|
134 |
sep2: "---------", |
|
135 |
flag: { name: "[% LxERP.t8('Toggle marker') %]", icon: "flag", callback: standard_item_ajax_call, disabled: disable_edit_item_commands }, |
|
136 |
sep3: "---------", |
|
133 | 137 |
copy: { name: "[% LxERP.t8('Copy') %]", icon: "copy", disabled: disable_edit_item_commands }, |
134 | 138 |
paste: { name: "[% LxERP.t8('Paste') %]", icon: "paste", disabled: disable_edit_item_commands } |
135 | 139 |
} |
... | ... | |
144 | 148 |
edit: { name: "[% LxERP.t8('Edit') %]", icon: "edit", callback: standard_item_ajax_call, disabled: disable_edit_item_commands }, |
145 | 149 |
delete: { name: "[% LxERP.t8('Delete') %]", icon: "delete", callback: ask_delete_item, disabled: disable_edit_item_commands }, |
146 | 150 |
sep2: "---------", |
151 |
flag: { name: "[% LxERP.t8('Toggle marker') %]", icon: "flag", callback: standard_item_ajax_call, disabled: disable_edit_item_commands }, |
|
152 |
sep3: "---------", |
|
147 | 153 |
copy: { name: "[% LxERP.t8('Copy') %]", icon: "copy", disabled: disable_edit_item_commands }, |
148 | 154 |
paste: { name: "[% LxERP.t8('Paste') %]", icon: "paste", disabled: disable_edit_item_commands } |
149 | 155 |
} |
templates/webpages/requirement_spec_item/_function_block.html | ||
---|---|---|
1 | 1 |
[%- USE HTML -%][%- USE LxERP -%][%- USE P -%][%- USE L -%] |
2 |
<div id="function-block-[% requirement_spec_item.id %]" class="function-block"> |
|
2 |
<div id="function-block-[% requirement_spec_item.id %]" class="function-block[%- IF requirement_spec_item.is_flagged -%] flagged[%- END -%]">
|
|
3 | 3 |
|
4 |
<div id="function-block-content-[%- requirement_spec_item.id -%]" class="function-block-content[%- IF requirement_spec_item.flagged -%] flagged[%- END -%] function-block-context-menu">
|
|
4 |
<div id="function-block-content-[%- requirement_spec_item.id -%]" class="function-block-content function-block-context-menu"> |
|
5 | 5 |
|
6 | 6 |
[% INCLUDE 'requirement_spec_item/_function_block_content_top.html' id_prefix='' %] |
7 | 7 |
|
templates/webpages/requirement_spec_item/_function_block_content_top.html | ||
---|---|---|
1 | 1 |
[%- USE HTML -%][%- USE L -%]<div id="[% id_prefix %]function-block-content-top-[% requirement_spec_item.id %]"> |
2 |
<b>[%- HTML.escape(requirement_spec_item.fb_number) -%]</b> <[% requirement_spec_item.id %]>
|
|
2 |
<div class="function-block-number">[%- HTML.escape(requirement_spec_item.fb_number) -%] <[% requirement_spec_item.id %]></div>
|
|
3 | 3 |
[%- L.simple_format(requirement_spec_item.description) -%] |
4 | 4 |
</div> |
templates/webpages/requirement_spec_item/_section.html | ||
---|---|---|
1 | 1 |
[%- USE HTML -%][%- USE LxERP -%][%- USE L -%] |
2 |
<div id="full-section-content">
|
|
2 |
<div id="section-[% requirement_spec_item.id %]" class="section[%- IF requirement_spec_item.is_flagged -%]flagged[%- END -%]">
|
|
3 | 3 |
<div class="section-context-menu" id="section-header-[% requirement_spec_item.id %]"> |
4 | 4 |
[%- INCLUDE 'requirement_spec_item/_section_header.html' %] |
5 | 5 |
</div> |
templates/webpages/requirement_spec_item/_sub_function_block.html | ||
---|---|---|
1 | 1 |
[%- USE HTML -%][%- USE LxERP -%][%- USE P -%] |
2 |
<div id="sub-function-block-[% requirement_spec_item.id %]" class="sub-function-block"> |
|
2 |
<div id="sub-function-block-[% requirement_spec_item.id %]" class="sub-function-block[%- IF requirement_spec_item.is_flagged -%] flagged[%- END -%]">
|
|
3 | 3 |
|
4 |
<div id="sub-function-block-content-[%- requirement_spec_item.id -%]" class="sub-function-block-content[%- IF requirement_spec_item.flagged -%] flagged[%- END -%] sub-function-block-context-menu">
|
|
4 |
<div id="sub-function-block-content-[%- requirement_spec_item.id -%]" class="sub-function-block-content sub-function-block-context-menu"> |
|
5 | 5 |
[% INCLUDE 'requirement_spec_item/_function_block_content_top.html' id_prefix='sub-' %] |
6 | 6 |
[% INCLUDE 'requirement_spec_item/_function_block_content_bottom.html' id_prefix='sub-' %] |
7 | 7 |
</div> |
templates/webpages/requirement_spec_text_block/_text_block.html | ||
---|---|---|
1 | 1 |
[%- USE HTML -%][%- USE L -%][%- USE LxERP -%] |
2 |
<div id="text-block-[% HTML.escape(text_block.id) %]" class="requirement-spec-text-block text-block-context-menu"> |
|
2 |
<div id="text-block-[% HTML.escape(text_block.id) %]" class="requirement-spec-text-block text-block-context-menu[% IF text_block.is_flagged %] flagged[% END %]">
|
|
3 | 3 |
<h2 class="requirement-spec-text-block-title">[% IF !text_block.title %]<span class="dimmed-text">[%- LxERP.t8("No title yet") %]</span>[% END %][%- HTML.escape(text_block.title) %]</h2> |
4 | 4 |
|
5 | 5 |
[% IF !text_block.text %] |
Auch abrufbar als: Unified diff
Pflichtenhefte: Textblöcke, Abschnitte und Funktionsblöcke markieren können