Benutzerdef. Var. als HTML-Feld: Pflichtenhefte
authorMoritz Bunkus <m.bunkus@linet.de>
Wed, 10 Nov 2021 13:42:55 +0000 (14:42 +0100)
committerMoritz Bunkus <m.bunkus@linet.de>
Wed, 10 Nov 2021 15:07:50 +0000 (16:07 +0100)
SL/Controller/RequirementSpec.pm
templates/webpages/requirement_spec/_show_basic_settings.html

index 6ba1c4e..afbe2bb 100644 (file)
@@ -87,6 +87,7 @@ sub action_ajax_edit {
   $self->js
     ->hide('#basic_settings')
     ->after('#basic_settings', $html)
+    ->reinit_widgets
     ->render;
 }
 
@@ -333,7 +334,8 @@ sub setup {
 
   $::auth->assert('requirement_spec_edit');
   $::request->{layout}->use_stylesheet("${_}.css") for qw(jquery.contextMenu requirement_spec);
-  $::request->{layout}->use_javascript("${_}.js")  for qw(jquery.jstree jquery/jquery.contextMenu jquery/jquery.hotkeys requirement_spec ckeditor/ckeditor ckeditor/adapters/jquery kivi.Part kivi.CustomerVendor);
+  $::request->{layout}->use_javascript("${_}.js")  for qw(jquery.jstree jquery/jquery.contextMenu jquery/jquery.hotkeys requirement_spec ckeditor/ckeditor ckeditor/adapters/jquery kivi.Part kivi.CustomerVendor
+                                                          ckeditor/ckeditor ckeditor/adapters/jquery);
   $self->init_visible_section;
 
   return 1;
index af75628..54166f1 100644 (file)
@@ -1,4 +1,4 @@
-[%- USE HTML -%][%- USE LxERP -%]
+[%- USE HTML -%][%- USE LxERP -%][%- USE L -%]
 <div id="basic_settings" class="basic-settings-context-menu">
  <h2>
   [% IF SELF.requirement_spec.is_template %]
   [% FOREACH var = cvars %]
    <tr class="listrow">
     <td>[% HTML.escape(var.config.description) %]</td>
-    <td>[% HTML.escape(var.value_as_text) %]</td>
+    <td>
+      [%- IF var.config.type == 'htmlfield' -%]
+        [%- L.restricted_html(var.value_as_text) -%]
+      [%- ELSE -%]
+        [%- HTML.escape(var.value_as_text) -%]
+      [%- END -%]
+    </td>
    </tr>
   [% END %]