[Bps-public-commit] rt-extension-formtools branch form-home-icon-upload created. 0.53-23-g143c3aa

BPS Git Server git at git.bestpractical.com
Mon Sep 25 21:01:46 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, form-home-icon-upload has been created
        at  143c3aaf1c889c6fb7c13f8e6f69afe962879004 (commit)

- Log -----------------------------------------------------------------
commit 143c3aaf1c889c6fb7c13f8e6f69afe962879004
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Sep 25 17:01:38 2023 -0400

    Add clickable default graphics for forms

diff --git a/html/Elements/Forms/ListForms b/html/Elements/Forms/ListForms
index 63dc6e2..73185f1 100644
--- a/html/Elements/Forms/ListForms
+++ b/html/Elements/Forms/ListForms
@@ -1,15 +1,21 @@
 <&|/Widgets/TitleBox, title => '', class => 'fullwidth' &>
+<div class="container">
+% my $item_number = 1;
 % while ( my $form_attribute = $forms->Next ) {
 %    my $form = $form_attribute->Content;
 <div class="row border border-primary">
-  <div class="col-4 text-center">
-    <p><% $form_attribute->Description %></p>
+  <div class="col-4">
+    <a href="<% RT->Config->Get('WebPath') %>/SelfService/Forms/<% $form_attribute->Description %>">
+      <% $m->scomp('/Elements/Forms/ShowFormGraphic', FormName => $form_attribute->Description, ItemNumber => $item_number) |n %>
+    </a>
   </div>
-  <div class="col-8 text-left">
-    <% $form->{'form-description'} %>
+  <div class="col">
+    <% $form->{'form-description'} |n %>
   </div>
 </div>
+% $item_number++;
 % }
+</div>
 </&>
 <%init>
 my $forms = RT::Attributes->new( RT->SystemUser );
diff --git a/html/Elements/Forms/ShowFormGraphic b/html/Elements/Forms/ShowFormGraphic
new file mode 100644
index 0000000..37679ea
--- /dev/null
+++ b/html/Elements/Forms/ShowFormGraphic
@@ -0,0 +1,21 @@
+<div class="formtools-form-graphic w-50 mt-2 mb-2">
+  <div class="rounded pt-5 pb-5" style="background-color: <%$color%>;">
+    <p class="text-center" style="font-color: white; font-weight: bold; font-size: 2rem;">
+      <% $FormName %>
+    </p>
+  </div>
+</div>
+<%init>
+
+my $color_list = [
+    "#1f77b4", "#ff7f0e", "#2ca02c", "#d62728",
+    "#9467bd", "#8c564b", "#e377c2", "#7f7f7f"
+];
+
+my $color = $color_list->[ $ItemNumber % 8 ];
+
+</%init>
+<%args>
+$FormName => "Form"
+$ItemNumber => 1
+</%args>
diff --git a/html/SelfService/Forms/dhandler b/html/SelfService/Forms/dhandler
new file mode 100644
index 0000000..62e18bf
--- /dev/null
+++ b/html/SelfService/Forms/dhandler
@@ -0,0 +1,2 @@
+% # Shim for SelfService to run the Forms page
+% $m->comp('/Forms/dhandler', %ARGS);

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


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


More information about the Bps-public-commit mailing list