[Bps-public-commit] rt-extension-formtools branch dynamic-forms-from-config updated. 0.53-38-g2dff552

BPS Git Server git at git.bestpractical.com
Fri Oct 6 18:07:06 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, dynamic-forms-from-config has been updated
       via  2dff55212f2f659cbce609bf7a46c78f7657caa7 (commit)
      from  fb77f2726982b6f26f453c2f3ffcb5a3ebcf208c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2dff55212f2f659cbce609bf7a46c78f7657caa7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Oct 6 14:05:08 2023 -0400

    Switch to LabeledValue for admin pages

diff --git a/html/Admin/FormTools/Advanced.html b/html/Admin/FormTools/Advanced.html
index 739c7a2..7605e5f 100644
--- a/html/Admin/FormTools/Advanced.html
+++ b/html/Admin/FormTools/Advanced.html
@@ -4,22 +4,12 @@
 
 <form action="<%RT->Config->Get('WebPath')%>/Admin/FormTools/Advanced.html" name="ModifyFormToolsAdvanced" method="post" enctype="multipart/form-data" class="mx-auto max-width-md">
   <input type="hidden" class="hidden" name="id" value="<% $id %>" />
-  <div class="form-row">
-    <div class="col-3 label">
-      <&|/l&>Name</&>:
-    </div>
-    <div class="col-9 value">
-      <input name="Description" class="form-control" value="<% $ARGS{Description} // $form_attribute->Description %>"/>
-    </div>
-  </div>
-  <div class="form-row">
-    <div class="col-3 label">
-      <&|/l&>Content</&>:
-    </div>
-    <div class="col-9 value">
-      <textarea class="form-control" rows="30" name="Content"><% $ARGS{Content} || $encoded_content %></textarea>
-    </div>
-  </div>
+  <&| /Elements/LabeledValue, Label => loc('Name') &>
+    <input name="Description" class="form-control" value="<% $ARGS{Description} // $form_attribute->Description %>"/>
+  </&>
+  <&| /Elements/LabeledValue, Label => loc('Content') &>
+    <textarea class="form-control" rows="30" name="Content"><% $ARGS{Content} || $encoded_content %></textarea>
+  </&>
 
   <div class="form-row">
     <div class="col-12">
diff --git a/html/Admin/FormTools/Create.html b/html/Admin/FormTools/Create.html
index cbe5b7a..062b839 100644
--- a/html/Admin/FormTools/Create.html
+++ b/html/Admin/FormTools/Create.html
@@ -3,24 +3,12 @@
 <& /Elements/ListActions, actions => \@results &>
 
 <form action="<%RT->Config->Get('WebPath')%>/Admin/FormTools/Create.html" name="CreateFormTools" method="post" enctype="multipart/form-data" class="mx-auto max-width-sm">
-  <div class="form-row">
-    <div class="col-3 label">
-      <&|/l&>Name</&>:
-    </div>
-    <div class="col-9 value">
-      <input name="Description" class="form-control" value="<% $ARGS{Description} // '' %>"/>
-    </div>
-  </div>
-  <div class="form-row">
-    <div class="col-3 label">
-      <span class="prev-icon-helper"><&|/l&>Queue</&>:</span>\
-      <span class="far fa-question-circle icon-helper" data-toggle="tooltip" data-placement="top" data-original-title="<% loc("Tickets will be created in this queue") %>"></span>
-    </div>
-    <div class="col-9 value">
-      <& /Elements/SelectQueue, Name => 'Queue', Default => $ARGS{Queue} &>
-    </div>
-  </div>
+  <&| /Elements/LabeledValue, Label => loc('Name') &>
+    <input name="Description" class="form-control" value="<% $ARGS{Description} // '' %>"/>
+  </&>
 
+  <& /Elements/LabeledValue, Label => loc('Queue'), LabelTooltip => loc('Tickets will be created in this queue'),
+                             RawValue => $m->scomp('/Elements/SelectQueue', Name => 'Queue', Default => $ARGS{Queue}) &>
   <div class="form-row">
     <div class="col-12">
       <& /Elements/Submit, Label => loc('Create'), Name => 'Create' &>
diff --git a/html/Admin/FormTools/Modify.html b/html/Admin/FormTools/Modify.html
index 9b23c46..82162a2 100644
--- a/html/Admin/FormTools/Modify.html
+++ b/html/Admin/FormTools/Modify.html
@@ -79,18 +79,12 @@
                     </a>
                   </div>
                   <div class="modal-body">
-                    <div class="form-row">
-                      <div class="col-3 label"><&|/l&>Label</&>:</div>
-                      <div class="col-9 value">
-                        <input name="label" type="text" class="form-control" placeholder="<% $item %>" value="" />
-                      </div>
-                    </div>
-                    <div class="form-row">
-                      <div class="col-3 label"><&|/l&>Default Value</&>:</div>
-                      <div class="col-9 value">
-                        <input name="default" type="text" class="form-control" placeholder="<% $default_values{$item} %>" value="" />
-                      </div>
-                    </div>
+                    <&| /Elements/LabeledValue, Label => loc('Label') &>
+                      <input name="label" type="text" class="form-control" placeholder="<% $item %>" value="" />
+                    </&>
+                    <&| /Elements/LabeledValue, Label => loc('Default Value') &>
+                      <input name="default" type="text" class="form-control" placeholder="<% $default_values{$item} %>" value="" />
+                    </&>
                   </div>
                   <div class="modal-footer">
                     <button type="submit" class="btn btn-primary button form-control"><% loc('Save') %></button>
@@ -126,29 +120,20 @@
                     </a>
                   </div>
                   <div class="modal-body">
-                    <div class="form-row">
-                      <div class="col-3 label"><&|/l&>Label</&>:</div>
-                      <div class="col-9 value">
-                        <input name="label" type="text" class="form-control" placeholder="<% $item %>" value="" />
-                      </div>
-                    </div>
-                    <div class="form-row">
-                      <div class="col-3 label"><&|/l&>Default Value</&>:</div>
-                      <div class="col-9 value">
-                        <input name="default" type="text" class="form-control" placeholder="<% $default_values{$item} %>" value="" />
-                      </div>
-                    </div>
-                    <div class="form-row">
-                      <div class="col-3 label"></div>
-                      <div class="col-9 value">
-                        <div class="custom-control custom-checkbox">
-                          <input class="custom-control-input" id="<% CSSClass($item) %>-validation" type="checkbox" name="show_validation" value="1" checked="checked" />
-                          <label class="custom-control-label" for="<% CSSClass($item) %>-validation">
-                            <&|/l&>Show validation</&>
-                          </label>
-                        </div>
+                    <&| /Elements/LabeledValue, Label => loc('Label') &>
+                      <input name="label" type="text" class="form-control" placeholder="<% $item %>" value="" />
+                    </&>
+                    <&| /Elements/LabeledValue, Label => loc('Default Value') &>
+                      <input name="default" type="text" class="form-control" placeholder="<% $default_values{$item} %>" value="" />
+                    </&>
+                    <&| /Elements/LabeledValue, Label => '' &>
+                      <div class="custom-control custom-checkbox">
+                        <input class="custom-control-input" id="<% CSSClass($item) %>-validation" type="checkbox" name="show_validation" value="1" checked="checked" />
+                        <label class="custom-control-label" for="<% CSSClass($item) %>-validation">
+                          <&|/l&>Show validation</&>
+                        </label>
                       </div>
-                    </div>
+                    </&>
                   </div>
                   <div class="modal-footer">
                     <button type="submit" class="btn btn-primary button form-control"><% loc('Save') %></button>
@@ -189,18 +174,12 @@
                     </a>
                   </div>
                   <div class="modal-body">
-                    <div class="form-row">
-                      <div class="col-3 label"><&|/l&>Name</&>:</div>
-                      <div class="col-9 value">
-                        <input name="name" type="text" class="form-control" value="" />
-                      </div>
-                    </div>
-                    <div class="form-row">
-                      <div class="col-3 label"><&|/l&>Value</&>:</div>
-                      <div class="col-9 value">
-                        <input name="value" type="text" class="form-control" value="" />
-                      </div>
-                    </div>
+                    <&| /Elements/LabeledValue, Label => loc('Name') &>
+                      <input name="name" type="text" class="form-control" value="" />
+                    </&>
+                    <&| /Elements/LabeledValue, Label => loc('Value') &>
+                      <input name="value" type="text" class="form-control" value="" />
+                    </&>
                   </div>
                   <div class="modal-footer">
                     <button type="submit" class="btn btn-primary button form-control"><% loc('Save') %></button>
@@ -239,37 +218,26 @@
       <div id="formtools-content-<% $form_page_id{$page_name} %>" class="tab-pane <% $form_page_id{$page_name} eq $active_context->{tab} ? 'show active' : 'fade' %>" role="tabpanel">
         <&| /Widgets/TitleBox, title => loc('Basic Info'), titleright_raw => qq{} &>
         <form>
-          <div class="form-row">
-            <div class="col-3 label"><&|/l&>Name</&>:</div>
-            <div class="col-9 value">
-              <input name="name" class="form-control" value="<% $form->{'formtools-pages'}{$page_name}{name} %>" />
-            </div>
-          </div>
-          <div class="form-row">
-            <div class="col-3 label"><&|/l&>Sort order</&>:</div>
-            <div class="col-9 value">
-              <input name="sort_order" class="form-control" value="<% $form->{'formtools-pages'}{$page_name}{sort_order} %>" />
+          <&| /Elements/LabeledValue, Label => loc('Name') &>
+            <input name="name" class="form-control" value="<% $form->{'formtools-pages'}{$page_name}{name} %>" />
+          </&>
+          <&| /Elements/LabeledValue, Label => loc('Sort Order') &>
+            <input name="sort_order" class="form-control" value="<% $form->{'formtools-pages'}{$page_name}{sort_order} %>" />
+          </&>
+          <&| /Elements/LabeledValue, Label => '' &>
+            <div class="custom-control custom-checkbox">
+              <input class="custom-control-input" id="<% $form_page_id{$page_name} %>-validation" type="checkbox" name="validation" value="1" <% $form->{'formtools-pages'}{$page_name}{validation} ? 'checked="checked"' : '' |n%> />
+              <label class="custom-control-label" for="<% $form_page_id{$page_name} %>-validation">
+                <&|/l&>Enable validation</&>
+              </label>
             </div>
-          </div>
-          <div class="form-row">
-            <div class="col-3 label"></div>
-            <div class="col-9 value">
-              <div class="custom-control custom-checkbox">
-                <input class="custom-control-input" id="<% $form_page_id{$page_name} %>-validation" type="checkbox" name="validation" value="1" <% $form->{'formtools-pages'}{$page_name}{validation} ? 'checked="checked"' : '' |n%> />
-                <label class="custom-control-label" for="<% $form_page_id{$page_name} %>-validation">
-                  <&|/l&>Enable validation</&>
-                </label>
-              </div>
-            </div>
-          </div>
+          </&>
+
 %         # Do not delete the last one
 %         if ( $form->{'formtools-pages'}{$page_name}{next} ) {
-          <div class="form-row">
-            <div class="col-3 label"></div>
-            <div class="col-9 value">
-              <a class="formtools-delete-page btn btn-primary button" data-page="<% $page_name %>" href="#"><% loc('Delete Page') %></a>
-            </div>
-          </div>
+          <&| /Elements/LabeledValue, Label => '' &>
+            <a class="formtools-delete-page btn btn-primary button" data-page="<% $page_name %>" href="#"><% loc('Delete Page') %></a>
+          </&>
 %         }
         </form>
         </&>
@@ -336,44 +304,29 @@
 %                       }
                         </&>
 %                     } elsif ( $item->{type} eq 'component' && $item->{comp_name} eq 'Field' ) {
-                        <div class="form-row">
-                          <div class="col-3 label"><&|/l&>Label</&>:</div>
-                          <div class="col-9 value">
-                            <input name="label" type="text" class="form-control" placeholder="<% $item->{arguments}{name} %>" value="<% $item->{arguments}{label} // ''  %>" />
-                          </div>
-                        </div>
-                        <div class="form-row">
-                          <div class="col-3 label"><&|/l&>Default Value</&>:</div>
-                          <div class="col-9 value">
-                            <input name="default" type="text" class="form-control" placeholder="<% $default_values{$item->{arguments}{name}} %>" value="<% $item->{arguments}{default} // '' %>" />
-                          </div>
-                        </div>
+                        <&| /Elements/LabeledValue, Label => loc('Label') &>
+                          <input name="label" type="text" class="form-control" placeholder="<% $item->{arguments}{name} %>" value="<% $item->{arguments}{label} // ''  %>" />
+                        </&>
+                        <&| /Elements/LabeledValue, Label => loc('Default Value') &>
+                          <input name="default" type="text" class="form-control" placeholder="<% $default_values{$item->{arguments}{name}} %>" value="<% $item->{arguments}{default} // '' %>" />
+                        </&>
 %                       if ( !RT::Extension::FormTools::is_core_field($item->{arguments}{name}) ) {
-                        <div class="form-row">
-                          <div class="col-3 label"></div>
-                          <div class="col-9 value">
-                            <div class="custom-control custom-checkbox">
-                              <input class="custom-control-input" id="formtools-element-<% $form_page_id{$page_name} %>-<% $i %>-validation" type="checkbox" name="show_validation" value="1" <% $item->{arguments}{show_validation} ? q{checked="checked"} : '' |n %> />
-                              <label class="custom-control-label" for="formtools-element-<% $form_page_id{$page_name} %>-<% $i %>-validation">
-                                <&|/l&>Show validation</&>
-                              </label>
-                            </div>
+                        <&| /Elements/LabeledValue, Label => '' &>
+                          <div class="custom-control custom-checkbox">
+                            <input class="custom-control-input" id="formtools-element-<% $form_page_id{$page_name} %>-<% $i %>-validation" type="checkbox" name="show_validation" value="1" <% $item->{arguments}{show_validation} ? q{checked="checked"} : '' |n %> />
+                            <label class="custom-control-label" for="formtools-element-<% $form_page_id{$page_name} %>-<% $i %>-validation">
+                              <&|/l&>Show validation</&>
+                            </label>
                           </div>
-                        </div>
+                        </&>
 %                       }
 %                     } elsif ( $item->{type} eq 'hidden' ) {
-                        <div class="form-row">
-                          <div class="col-3 label"><&|/l&>Name</&>:</div>
-                          <div class="col-9 value">
-                            <input name="name" type="text" class="form-control" value="<% $item->{'input-name'} // ''  %>" />
-                          </div>
-                        </div>
-                        <div class="form-row">
-                          <div class="col-3 label"><&|/l&>Value</&>:</div>
-                          <div class="col-9 value">
-                            <input name="value" type="text" class="form-control" value="<% $item->{'input-value'} // '' %>" />
-                          </div>
-                        </div>
+                        <&| /Elements/LabeledValue, Label => loc('Name') &>
+                          <input name="name" type="text" class="form-control" value="<% $item->{'input-name'} // ''  %>" />
+                        </&>
+                        <&| /Elements/LabeledValue, Label => loc('Value') &>
+                          <input name="value" type="text" class="form-control" value="<% $item->{'input-value'} // '' %>" />
+                        </&>
 %                     }
                       </div>
                       <div class="modal-footer">

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

Summary of changes:
 html/Admin/FormTools/Advanced.html |  22 ++---
 html/Admin/FormTools/Create.html   |  22 ++---
 html/Admin/FormTools/Modify.html   | 169 +++++++++++++------------------------
 3 files changed, 72 insertions(+), 141 deletions(-)


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


More information about the Bps-public-commit mailing list