[Bps-public-commit] rt-extension-formtools branch improve-form-spacing created. 0.53-41-g37be40d

BPS Git Server git at git.bestpractical.com
Fri Oct 6 20:55:30 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt-extension-formtools".

The branch, improve-form-spacing has been created
        at  37be40da238d22c94e12923089b156d09e5f512a (commit)

- Log -----------------------------------------------------------------
commit 37be40da238d22c94e12923089b156d09e5f512a
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Oct 6 16:55:12 2023 -0400

    Skip creating a ticket if validation fails

diff --git a/html/FormTools/Form b/html/FormTools/Form
index 3b7939d..e300468 100644
--- a/html/FormTools/Form
+++ b/html/FormTools/Form
@@ -64,6 +64,9 @@ if ($validation && $real_next) {
     }
 
     unless (@results) {
+        # Flag to show validation passed
+        $ARGS{'validation_ok'} = 1;
+
         $real_next = $m->caller(1)->dir_path . '/' . $real_next
             unless $real_next =~ m'^/';
         $m->subexec("$real_next", %ARGS, %request_args);
diff --git a/html/Forms/dhandler b/html/Forms/dhandler
index 4a600c4..f8ca419 100644
--- a/html/Forms/dhandler
+++ b/html/Forms/dhandler
@@ -92,6 +92,13 @@ $base_path = '/SelfService' . $base_path if $SelfService;
 # "create_ticket" is submitted as an arg from the second-to-last
 # page.
 
+my $validation = $form_config->{'formtools-pages'}{$page}{'validation'};
+
+if ( $validation and not $ARGS{'validation_ok'} ) {
+    # If validation is enabled and it didn't pass, don't create
+    $create_ticket = 0;
+}
+
 my ($ticket_obj, @results);
 if ( $create_ticket ) {
 

commit 489f1a624aa1e94166caa05ae9c941a0d46ec24e
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Oct 6 14:58:06 2023 -0400

    Build a non-SelfService link for Privileged users

diff --git a/html/Elements/Forms/ListForms b/html/Elements/Forms/ListForms
index f14f482..c72637e 100644
--- a/html/Elements/Forms/ListForms
+++ b/html/Elements/Forms/ListForms
@@ -5,7 +5,7 @@
 %    my $form = $form_attribute->Content;
 <div class="row mt-3 mb-3">
   <div class="col-4">
-    <a href="<% RT->Config->Get('WebPath') %>/SelfService/Forms/<% $form_attribute->Description %>">
+    <a href="<% RT->Config->Get('WebPath') %><% $SelfServicePath %>/Forms/<% $form_attribute->Description %>">
       <% $m->scomp('/Elements/Forms/ShowFormGraphic', FormObj => $form_attribute, ItemNumber => $item_number) |n %>
     </a>
   </div>
@@ -22,6 +22,12 @@
 <%init>
 my $forms = RT::Attributes->new( RT->SystemUser );
 $forms->Limit( FIELD => 'Name', VALUE => 'FormTools Form' );
+
+my $SelfServicePath = '/SelfService';
+
+if ( $session{'CurrentUser'}->Privileged ) {
+    $SelfServicePath = '';
+}
 </%init>
 <%args>
 </%args>

commit 7ea379bd4854ef3861b459e694ff9d16d9d32fe2
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Oct 6 14:52:50 2023 -0400

    Show menus when displaying forms

diff --git a/html/Forms/dhandler b/html/Forms/dhandler
index 45da273..4a600c4 100644
--- a/html/Forms/dhandler
+++ b/html/Forms/dhandler
@@ -2,6 +2,8 @@
     validation => $form_config->{'formtools-pages'}{$page}{'validation'},
     next_for_validation => $base_path . $form_name . '/' . $page,
     results_ref => \@results,
+    self_service => $SelfService,
+    include_tabs => 1,
 &>
 
 <%perl>

commit 84c3dd1278592506cabbbb8e4d55ca047ed737ce
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Oct 6 13:45:08 2023 -0400

    Improve spacing around displayed form

diff --git a/html/FormTools/Form b/html/FormTools/Form
index 58418b6..3b7939d 100644
--- a/html/FormTools/Form
+++ b/html/FormTools/Form
@@ -106,7 +106,7 @@ $next_for_validation ||= $m->caller(1)->path;
 % }
 
 <& /Elements/ListActions, actions => \@results &>
-
+<div id="formtools-form-body" class="container p-4 formtools-base-style">
 <form
     method="POST"
     action="<% $validation ? $next_for_validation : $next %>"
@@ -132,3 +132,4 @@ $next_for_validation ||= $m->caller(1)->path;
 % }
 
 </form>
+</div>
\ No newline at end of file
diff --git a/static/css/rt-extension-formtools.css b/static/css/rt-extension-formtools.css
index b5d719f..743981e 100644
--- a/static/css/rt-extension-formtools.css
+++ b/static/css/rt-extension-formtools.css
@@ -1,3 +1,6 @@
+#formtools-form-body {
+    max-width: 700px;
+}
 
 div .formtools-content {
     min-height: 400px;

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt-extension-formtools


More information about the Bps-public-commit mailing list