MaterialComponents: modal test page
authorSven Schöling <s.schoeling@googlemail.com>
Fri, 23 Apr 2021 13:13:43 +0000 (15:13 +0200)
committerSven Schöling <s.schoeling@googlemail.com>
Fri, 25 Jun 2021 13:51:32 +0000 (15:51 +0200)
SL/Controller/MaterializeTest.pm
menus/mobile/00-erp.yaml
templates/mobile_webpages/test/modal.html [new file with mode: 0644]

index de79182..cbf25d5 100644 (file)
@@ -3,8 +3,12 @@ package SL::Controller::MaterializeTest;
 use strict;
 use parent qw(SL::Controller::Base);
 
-sub action_test {
+sub action_components {
   $_[0]->render("test/components");
 }
 
+sub action_modal {
+  $_[0]->render("test/modal");
+}
+
 1;
index 62231c8..a5e30b1 100644 (file)
@@ -14,4 +14,9 @@
   name: Component Test
   order: 200
   params:
-    action: MaterializeTest/test
+    action: MaterializeTest/components
+- id: modal_test
+  name: Modal Test
+  order: 300
+  params:
+    action: MaterializeTest/modal
diff --git a/templates/mobile_webpages/test/modal.html b/templates/mobile_webpages/test/modal.html
new file mode 100644 (file)
index 0000000..2d40229
--- /dev/null
@@ -0,0 +1,49 @@
+[% USE P %]
+
+<h1>Material Modal Tests</h1>
+
+
+<div>
+
+Button triggered modal, no close/agree button:<br>
+
+[% P.M.button_tag("", "Modal", class="modal-trigger", href="#modal1") %]
+<!-- Modal Structure -->
+<div id="modal1" class="modal">
+  <div class="modal-content">
+    <h4>Modal Header</h4>
+    <p>A bunch of text</p>
+  </div>
+</div>
+
+</div>
+
+
+<div>
+Button triggered modal, close/agree button:<br>
+
+[% P.M.button_tag("", "Modal", class="modal-trigger", href="#modal2") %]
+<!-- Modal Structure -->
+<div id="modal2" class="modal">
+  <div class="modal-content">
+    <h4>Modal Header</h4>
+    <p>A bunch of text</p>
+  </div>
+  <div class="modal-footer">
+    [% P.M.button_tag('', 'Cancel', class="modal-close", flat=1) %]
+    [% P.M.button_tag('', 'Agree', class="modal-close", flat=1) %]
+  </div>
+</div>
+
+</div>
+
+<div>
+Javascript triggered modal:<br>
+[% P.M.button_tag("\$('#modal1').modal('open')", "Open!") %]
+</div>
+
+
+<div>
+popup_dialog modal with given html:<br>
+[% P.M.button_tag("kivi.popup_dialog({ html: 'Testtext'})", "Testtext") %]
+</div>