Vordefinierte Pflichtenhefttextblöcke: HTML nutzen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 13 Jan 2014 10:31:53 +0000 (11:31 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 1 Apr 2014 11:12:25 +0000 (13:12 +0200)
SL/Controller/RequirementSpecPredefinedText.pm
SL/DB/RequirementSpecPredefinedText.pm
templates/webpages/requirement_spec_predefined_text/form.html
templates/webpages/requirement_spec_predefined_text/list.html

index 8a86f2c..959a770 100644 (file)
@@ -14,6 +14,7 @@ use Rose::Object::MakeMethods::Generic
 );
 
 __PACKAGE__->run_before('check_auth');
+__PACKAGE__->run_before('setup');
 __PACKAGE__->run_before('load_requirement_spec_predefined_text', only => [ qw(edit update destroy) ]);
 
 #
@@ -80,6 +81,10 @@ sub check_auth {
   $::auth->assert('config');
 }
 
+sub setup {
+  $::request->layout->use_javascript("${_}.js")  for qw(ckeditor/ckeditor ckeditor/adapters/jquery);
+}
+
 #
 # helpers
 #
index 33738ea..c2ab0c8 100644 (file)
@@ -5,10 +5,13 @@ use strict;
 use SL::DB::MetaSetup::RequirementSpecPredefinedText;
 use SL::DB::Manager::RequirementSpecPredefinedText;
 use SL::DB::Helper::ActsAsList;
+use SL::DB::Helper::AttrHTML;
 use SL::Locale::String;
 
 __PACKAGE__->meta->initialize;
 
+__PACKAGE__->attr_html('text');
+
 sub validate {
   my ($self) = @_;
 
index 9a79038..2d34c58 100755 (executable)
@@ -8,7 +8,7 @@
   <table>
    <tr>
     <td>[% LxERP.t8("Description") %]</sup></td>
-    <td>[% L.input_tag("requirement_spec_predefined_text.description", SELF.requirement_spec_predefined_text.description, size=60) %]</td>
+    <td>[% L.input_tag("requirement_spec_predefined_text.description", SELF.requirement_spec_predefined_text.description, size=60, class='initial_focus') %]</td>
    </tr>
 
    <tr>
@@ -16,9 +16,9 @@
     <td>[% L.input_tag("requirement_spec_predefined_text.title", SELF.requirement_spec_predefined_text.title, size=60) %]</td>
    </tr>
 
-   <tr>
+   <tr valign="top">
     <td>[% LxERP.t8("Content") %]</td>
-    <td>[% L.textarea_tag("requirement_spec_predefined_text.text", SELF.requirement_spec_predefined_text.text, rows=10, cols=80) %]</td>
+    <td>[% L.textarea_tag("requirement_spec_predefined_text.text_as_restricted_html", SELF.requirement_spec_predefined_text.text_as_restricted_html, class='texteditor', style='width: 800px; height: 300px') %]</td>
    </tr>
   </table>
 
index c8251b1..358d646 100644 (file)
@@ -32,7 +32,7 @@
      </td>
 
      <td>[% HTML.escape(requirement_spec_predefined_text.title) %]</td>
-     <td>[% HTML.escape(L.truncate(requirement_spec_predefined_text.text)) %]</td>
+     <td>[% HTML.escape(L.truncate(requirement_spec_predefined_text.text_as_stripped_html)) %]</td>
     </tr>
     [%- END %]
     </tbody>