Revision 90f4ba5d
Von Moritz Bunkus vor fast 11 Jahren hinzugefügt
SL/Controller/RequirementSpecItem.pm | ||
---|---|---|
'scalar --get_set_init' => [ qw(complexities risks) ],
|
||
);
|
||
|
||
__PACKAGE__->run_before('load_requirement_spec_item', only => [ qw(dragged_and_dropped ajax_update ajax_edit ajax_delete) ]);
|
||
__PACKAGE__->run_before('load_requirement_spec_item', only => [ qw(dragged_and_dropped ajax_update ajax_edit ajax_delete ajax_flag) ]);
|
||
__PACKAGE__->run_before('init_visible_section');
|
||
|
||
#
|
||
... | ... | |
->render($self);
|
||
}
|
||
|
||
sub action_ajax_flag {
|
||
my ($self) = @_;
|
||
|
||
$self->item->update_attributes(is_flagged => !$self->item->is_flagged);
|
||
|
||
my $is_visible = $self->visible_section && ($self->visible_section->id == $self->item->get_section->id);
|
||
|
||
SL::ClientJS->new
|
||
->action_if($is_visible, 'toggleClass', '#' . $self->item->get_type . '-' . $self->item->id, 'flagged')
|
||
->toggleClass('#fb-' . $self->item->id, 'flagged')
|
||
->render($self);
|
||
}
|
||
|
||
#
|
||
# filters
|
||
#
|
SL/Controller/RequirementSpecTextBlock.pm | ||
---|---|---|
'scalar --get_set_init' => [ qw(predefined_texts) ],
|
||
);
|
||
|
||
__PACKAGE__->run_before('load_requirement_spec_text_block', only => [qw(ajax_edit ajax_update ajax_delete dragged_and_dropped)]);
|
||
__PACKAGE__->run_before('load_requirement_spec_text_block', only => [qw(ajax_edit ajax_update ajax_delete ajax_flag dragged_and_dropped)]);
|
||
|
||
#
|
||
# actions
|
||
... | ... | |
->render($self);
|
||
}
|
||
|
||
sub action_ajax_flag {
|
||
my ($self) = @_;
|
||
|
||
$self->text_block->update_attributes(is_flagged => !$self->text_block->is_flagged);
|
||
|
||
my $current_where = $self->output_position_from_id($::form->{current_content_id}, $::form->{current_content_type});
|
||
|
||
SL::ClientJS->new
|
||
->action_if($current_where == $self->text_block->output_position, 'toggleClass', '#text-block-' . $self->text_block->id, 'flagged')
|
||
->toggleClass('#tb-' . $self->text_block->id, 'flagged')
|
||
->render($self);
|
||
}
|
||
|
||
sub action_dragged_and_dropped {
|
||
my ($self) = @_;
|
||
|
SL/Presenter/RequirementSpecItem.pm | ||
---|---|---|
|
||
my @children = map { $self->requirement_spec_item_jstree_data($_, %params) } @{ $item->sorted_children };
|
||
my $type = !$item->parent_id ? 'section' : 'function-block';
|
||
my $class = $type . '-context-menu';
|
||
$class .= ' flagged' if $item->is_flagged;
|
||
|
||
return {
|
||
data => $self->requirement_spec_item_tree_node_title($item),
|
||
metadata => { id => $item->id, type => $type },
|
||
attr => { id => "fb-" . $item->id, href => $params{href} || '#', class => $type . '-context-menu' },
|
||
attr => { id => "fb-" . $item->id, href => $params{href} || '#', class => $class },
|
||
children => \@children,
|
||
};
|
||
}
|
SL/Presenter/RequirementSpecTextBlock.pm | ||
---|---|---|
sub requirement_spec_text_block_jstree_data {
|
||
my ($self, $text_block, %params) = @_;
|
||
|
||
my $class = 'text-block-context-menu';
|
||
$class .= ' flagged' if $text_block->is_flagged;
|
||
|
||
return {
|
||
data => $text_block->title || '',
|
||
metadata => { id => $text_block->id, type => 'text-block' },
|
||
attr => { id => "tb-" . $text_block->id, href => $params{href} || '#', class => 'text-block-context-menu' },
|
||
attr => { id => "tb-" . $text_block->id, href => $params{href} || '#', class => $class },
|
||
};
|
||
}
|
||
|
css/requirement_spec.css | ||
---|---|---|
/* ------------------------------------------------------------ */
|
||
/* General page layout */
|
||
/* ------------------------------------------------------------ */
|
||
|
||
input.rs_input_field, select.rs_input_field,
|
||
table.rs_input_field input, table.rs_input_field select {
|
||
width: 300px;
|
||
... | ... | |
color: #bbb;
|
||
}
|
||
|
||
/* ------------------------------------------------------------ */
|
||
/* Special things that apply to the tree */
|
||
/* ------------------------------------------------------------ */
|
||
|
||
#tree li.flagged > a > ins {
|
||
background-image: url("../image/flag-red.png") !important;
|
||
background-position: 0;
|
||
}
|
||
|
||
/* ------------------------------------------------------------ */
|
||
/* Special things that apply to the context menu */
|
||
/* ------------------------------------------------------------ */
|
||
|
||
.context-menu-item.icon-flag { background-image: url("../image/flag-red.png"); }
|
||
|
||
|
||
/* ------------------------------------------------------------ */
|
||
/* Sections & function blocks */
|
||
/* ------------------------------------------------------------ */
|
||
|
||
.function-block {
|
||
border-bottom: 1px solid #bbb;
|
||
}
|
||
... | ... | |
|
||
.sub-function-block {
|
||
border-bottom: 1px solid #ccc;
|
||
background-color: #fff;
|
||
}
|
||
|
||
.sub-function-block-container {
|
||
... | ... | |
border: 1px solid rgb(0, 100, 0);
|
||
}
|
||
|
||
.function-block-number {
|
||
font-weight: bold;
|
||
}
|
||
|
||
.function-block-form > div {
|
||
padding: 5px;
|
||
}
|
||
|
||
/* Flagged sections, function blocks, text blocks */
|
||
|
||
.section.flagged .section-description {
|
||
background-color: #feece3;
|
||
border: 1px solid #fe5f14;
|
||
}
|
||
|
||
.section.flagged .section-description > .section-description-heading {
|
||
background-color: #fe5f14;
|
||
color: #fff;
|
||
}
|
||
|
||
|
||
.function-block.flagged {
|
||
background-color: #feece3;
|
||
border: 1px solid #fe5f14;
|
||
}
|
||
|
||
.function-block.flagged > .function-block-content > div > .function-block-number {
|
||
background-color: #fe5f14;
|
||
color: #fff;
|
||
}
|
||
|
||
.sub-function-block.flagged {
|
||
background-color: #feece3;
|
||
border: 1px solid #fe5f14;
|
||
}
|
||
|
||
.sub-function-block.flagged > .sub-function-block-content > div > .function-block-number {
|
||
background-color: #fe5f14;
|
||
color: #fff;
|
||
}
|
||
|
||
/* ------------------------------------------------------------ */
|
||
/* Text blocks */
|
||
/* ------------------------------------------------------------ */
|
||
|
||
.requirement-spec-text-block {
|
||
margin-top: 10px;
|
||
}
|
||
|
||
.requirement-spec-text-block > h2 {
|
||
margin-top: 0px;
|
||
}
|
||
|
||
.requirement-spec-text-block.flagged {
|
||
background-color: #feece3;
|
||
border: 1px solid #fe5f14;
|
||
}
|
||
|
||
.requirement-spec-text-block.flagged > h2 {
|
||
background-color: #fe5f14;
|
||
color: #fff;
|
||
}
|
locale/de/all | ||
---|---|---|
'To Date' => 'Bis',
|
||
'To continue please change the taxkey 0 to another value.' => 'Um fortzufahren, ändern Sie bitte den Steuerschlüssel 0 auf einen anderen Wert.',
|
||
'To user login' => 'Zum Benutzerlogin',
|
||
'Toggle marker' => 'Markierung umschalten',
|
||
'Top' => 'Oben',
|
||
'Top (CSS)' => 'Oben (mit CSS)',
|
||
'Top (Javascript)' => 'Oben (mit Javascript)',
|
templates/webpages/requirement_spec/show.html | ||
---|---|---|
edit: { name: "[% LxERP.t8('Edit text block') %]", icon: "edit", callback: standard_text_block_ajax_call, disabled: disable_edit_text_block_commands },
|
||
delete: { name: "[% LxERP.t8('Delete text block') %]", icon: "delete", callback: ask_delete_text_block, disabled: disable_edit_text_block_commands },
|
||
sep1: "---------",
|
||
flag: { name: "[% LxERP.t8('Toggle marker') %]", icon: "flag", callback: standard_text_block_ajax_call, disabled: disable_edit_text_block_commands },
|
||
sep2: "---------",
|
||
copy: { name: "[% LxERP.t8('Copy') %]", icon: "copy", disabled: disable_edit_text_block_commands },
|
||
paste: { name: "[% LxERP.t8('Paste') %]", icon: "paste", disabled: disable_edit_text_block_commands }
|
||
}
|
||
... | ... | |
sep1: "---------",
|
||
edit: { name: "[% LxERP.t8('Edit') %]", icon: "edit", callback: standard_item_ajax_call, disabled: disable_edit_item_commands },
|
||
delete: { name: "[% LxERP.t8('Delete') %]", icon: "delete", callback: ask_delete_item, disabled: disable_edit_item_commands },
|
||
sep2: "---------",
|
||
sep2: "---------",
|
||
flag: { name: "[% LxERP.t8('Toggle marker') %]", icon: "flag", callback: standard_item_ajax_call, disabled: disable_edit_item_commands },
|
||
sep3: "---------",
|
||
copy: { name: "[% LxERP.t8('Copy') %]", icon: "copy", disabled: disable_edit_item_commands },
|
||
paste: { name: "[% LxERP.t8('Paste') %]", icon: "paste", disabled: disable_edit_item_commands }
|
||
}
|
||
... | ... | |
edit: { name: "[% LxERP.t8('Edit') %]", icon: "edit", callback: standard_item_ajax_call, disabled: disable_edit_item_commands },
|
||
delete: { name: "[% LxERP.t8('Delete') %]", icon: "delete", callback: ask_delete_item, disabled: disable_edit_item_commands },
|
||
sep2: "---------",
|
||
flag: { name: "[% LxERP.t8('Toggle marker') %]", icon: "flag", callback: standard_item_ajax_call, disabled: disable_edit_item_commands },
|
||
sep3: "---------",
|
||
copy: { name: "[% LxERP.t8('Copy') %]", icon: "copy", disabled: disable_edit_item_commands },
|
||
paste: { name: "[% LxERP.t8('Paste') %]", icon: "paste", disabled: disable_edit_item_commands }
|
||
}
|
templates/webpages/requirement_spec_item/_function_block.html | ||
---|---|---|
[%- USE HTML -%][%- USE LxERP -%][%- USE P -%][%- USE L -%]
|
||
<div id="function-block-[% requirement_spec_item.id %]" class="function-block">
|
||
<div id="function-block-[% requirement_spec_item.id %]" class="function-block[%- IF requirement_spec_item.is_flagged -%] flagged[%- END -%]">
|
||
|
||
<div id="function-block-content-[%- requirement_spec_item.id -%]" class="function-block-content[%- IF requirement_spec_item.flagged -%] flagged[%- END -%] function-block-context-menu">
|
||
<div id="function-block-content-[%- requirement_spec_item.id -%]" class="function-block-content function-block-context-menu">
|
||
|
||
[% INCLUDE 'requirement_spec_item/_function_block_content_top.html' id_prefix='' %]
|
||
|
templates/webpages/requirement_spec_item/_function_block_content_top.html | ||
---|---|---|
[%- USE HTML -%][%- USE L -%]<div id="[% id_prefix %]function-block-content-top-[% requirement_spec_item.id %]">
|
||
<b>[%- HTML.escape(requirement_spec_item.fb_number) -%]</b> <[% requirement_spec_item.id %]>
|
||
<div class="function-block-number">[%- HTML.escape(requirement_spec_item.fb_number) -%] <[% requirement_spec_item.id %]></div>
|
||
[%- L.simple_format(requirement_spec_item.description) -%]
|
||
</div>
|
templates/webpages/requirement_spec_item/_section.html | ||
---|---|---|
[%- USE HTML -%][%- USE LxERP -%][%- USE L -%]
|
||
<div id="full-section-content">
|
||
<div id="section-[% requirement_spec_item.id %]" class="section[%- IF requirement_spec_item.is_flagged -%]flagged[%- END -%]">
|
||
<div class="section-context-menu" id="section-header-[% requirement_spec_item.id %]">
|
||
[%- INCLUDE 'requirement_spec_item/_section_header.html' %]
|
||
</div>
|
templates/webpages/requirement_spec_item/_sub_function_block.html | ||
---|---|---|
[%- USE HTML -%][%- USE LxERP -%][%- USE P -%]
|
||
<div id="sub-function-block-[% requirement_spec_item.id %]" class="sub-function-block">
|
||
<div id="sub-function-block-[% requirement_spec_item.id %]" class="sub-function-block[%- IF requirement_spec_item.is_flagged -%] flagged[%- END -%]">
|
||
|
||
<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">
|
||
<div id="sub-function-block-content-[%- requirement_spec_item.id -%]" class="sub-function-block-content sub-function-block-context-menu">
|
||
[% INCLUDE 'requirement_spec_item/_function_block_content_top.html' id_prefix='sub-' %]
|
||
[% INCLUDE 'requirement_spec_item/_function_block_content_bottom.html' id_prefix='sub-' %]
|
||
</div>
|
templates/webpages/requirement_spec_text_block/_text_block.html | ||
---|---|---|
[%- USE HTML -%][%- USE L -%][%- USE LxERP -%]
|
||
<div id="text-block-[% HTML.escape(text_block.id) %]" class="requirement-spec-text-block text-block-context-menu">
|
||
<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 %]">
|
||
<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>
|
||
|
||
[% IF !text_block.text %]
|
Auch abrufbar als: Unified diff
Pflichtenhefte: Textblöcke, Abschnitte und Funktionsblöcke markieren können