[Bps-public-commit] rt-extension-formtools branch master updated. 0.53-2-g2ce8ce4

BPS Git Server git at git.bestpractical.com
Wed May 4 21:41:47 UTC 2022


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, master has been updated
       via  2ce8ce4111c9248652e602a1476035f85e7f9c05 (commit)
       via  8404941c84ae287ad7cc79418df2564e88a9d8d1 (commit)
      from  dacca0173567983791c9f6dba0c3b8a984ef5cfd (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 2ce8ce4111c9248652e602a1476035f85e7f9c05
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu May 5 05:39:21 2022 +0800

    Require RT 5 and update doc accordingly

diff --git a/META.yml b/META.yml
index cb10c3a..7ab87ec 100644
--- a/META.yml
+++ b/META.yml
@@ -25,4 +25,4 @@ resources:
   repository: https://github.com/bestpractical/rt-extension-formtools
 version: '0.53'
 x_module_install_rtx_version: '0.43'
-x_requires_rt: 4.2.3
+x_requires_rt: 5.0.0
diff --git a/Makefile.PL b/Makefile.PL
index fea329c..4d0e2ec 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,6 +1,6 @@
 use inc::Module::Install;
 RTx('RT-Extension-FormTools');
-requires_rt('4.2.3');
+requires_rt('5.0.0');
 
 repository('https://github.com/bestpractical/rt-extension-formtools');
 
diff --git a/README b/README
index 406ec8b..2e3d8ff 100644
--- a/README
+++ b/README
@@ -9,7 +9,7 @@ DESCRIPTION
     their own forms in Mason.
 
 RT VERSION
-    Works with RT 4.2.3+
+    Works with RT 5.
 
 INSTALLATION
     perl Makefile.PL
@@ -17,13 +17,13 @@ INSTALLATION
     make install
         May need root permissions
 
-    Edit your /opt/rt4/etc/RT_SiteConfig.pm
+    Edit your /opt/rt5/etc/RT_SiteConfig.pm
         Add this line:
 
             Plugin('RT::Extension::FormTools');
 
     Clear your mason cache
-            rm -rf /opt/rt4/var/mason_data/obj
+            rm -rf /opt/rt5/var/mason_data/obj
 
     Restart your webserver
 
diff --git a/lib/RT/Extension/FormTools.pm b/lib/RT/Extension/FormTools.pm
index f4a59c8..8ff77d5 100644
--- a/lib/RT/Extension/FormTools.pm
+++ b/lib/RT/Extension/FormTools.pm
@@ -19,7 +19,7 @@ their own forms in Mason.
 
 =head1 RT VERSION
 
-Works with RT 4.2.3+
+Works with RT 5.
 
 =head1 INSTALLATION
 
@@ -33,7 +33,7 @@ Works with RT 4.2.3+
 
 May need root permissions
 
-=item Edit your F</opt/rt4/etc/RT_SiteConfig.pm>
+=item Edit your F</opt/rt5/etc/RT_SiteConfig.pm>
 
 Add this line:
 
@@ -41,7 +41,7 @@ Add this line:
 
 =item Clear your mason cache
 
-    rm -rf /opt/rt4/var/mason_data/obj
+    rm -rf /opt/rt5/var/mason_data/obj
 
 =item Restart your webserver
 

commit 8404941c84ae287ad7cc79418df2564e88a9d8d1
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu May 5 05:23:39 2022 +0800

    Migrate to RT 5 themes

diff --git a/html/FormTools/Field b/html/FormTools/Field
index f9ed1f7..bc74274 100644
--- a/html/FormTools/Field
+++ b/html/FormTools/Field
@@ -123,14 +123,18 @@ $default = '' unless defined $default;
 % } else {
 
 % if ($render_as ne 'hidden' && $show_label) { # no label if hidden
-<table style="display: inline; "><tr><th valign="top"><label><%$field_label%></label><% $after_label |n %></th><td style="display:block;">
+<div class="form-row">
+  <div class="label col-3"><%$field_label%><% $after_label |n %></div>
+  <div class="value col-9">
 % }
 
 % if ($field_type eq 'core') {
 
 % if ($name eq 'Attach') {
-
-<input name="<%$name%>" type="file" />
+<div class="custom-file">
+  <input type="file" id="<% $name %>" name="<% $name %>" class="custom-file-input" />
+  <label class="custom-file-label" for="<% $name %>"><&|/l&>Choose file</&></label>
+</div>
 <input type="hidden" class="hidden" name="UpdateAttach" value="1" />
 
 % } elsif ($render_as eq 'hidden') {
@@ -140,16 +144,16 @@ $default = '' unless defined $default;
 % } elsif ($render_as eq 'readonly' or $render_as eq 'readonly_plus_values') {
 
 % if (@values > 1) {
-    <ul>
+    <ul class="list-group list-group-borderless list-group-compact">
 % for (@values) {
-    <li class="readonly"><% $_ %></span>
+    <li class="readonly list-group-item"><% $_ %></span>
 %   if ($render_as eq 'readonly_plus_values') {
     <input type="hidden" name="<% $input_name %>" value="<% $_ %>"/>
 %   }
 % }
     </ul>
 % } else {
-    <span class="readonly"><% $default %></span>
+    <span class="readonly form-control current-value"><% $default %></span>
 %   if ($render_as eq 'readonly_plus_values') {
     <input type="hidden" name="<% $input_name %>" value="<% $default %>"/>
 %   }
@@ -165,7 +169,7 @@ $default = '' unless defined $default;
 % } elsif ( $name eq "Due" ) {
 <& /Elements/SelectDate, Name => $name, Default => $default, current => 0, (defined $cols ? (Size => $cols) : ()) &>
 % } else {
-<input type="text" name="<%$name%>" size="<% $cols || 20 %>" value="<%$default%>">
+<input class="form-control" type="text" name="<%$name%>" size="<% $cols || 20 %>" value="<%$default%>">
 % }
 
 % } else { # CF
@@ -189,20 +193,23 @@ $default = '' unless defined $default;
             ($default ? (Default => $default) : ())
             &>
 % if ($show_validation && $cf->FriendlyPattern) {
-    <% loc("Input must match [_1]", $cf->FriendlyPattern) %>
+    <span class="cfhints"><% loc("Input must match [_1]", $cf->FriendlyPattern) %></span>
 %}
 % } elsif ($render_as =~  /^boolean/i)  {
 %       my $value = 'Yes';
-        <input type="checkbox" name="<% $input_name %>"  value="<% $value %>"
+<div class="custom-control custom-checkbox" style="margin-top: 5px">
+  <input class="custom-control-input" type="checkbox" name="<% $input_name %>" id="<% $input_name %>" value="<% $value %>"
 % my $checked = 0;
 %  if ($default) {
 %       $checked = ref $default? (grep { $_ eq $value} @$default) : $default eq $value;
 % }
-        <% $checked? 'CHECKED' : '' %>
+        <% $checked? 'checked="checked"' : '' |n %>
 % if ( my $disable = $disables->{$value} ) {
         onclick="disable_form_field(this.checked, '<% $disable %>');"
 % }
         />
+  <label class="custom-control-label" for="<% $input_name %>"><% $value %></label>
+</div>
 
 % if ( $checked and my $disable = $disables->{$value} ) {
     <script>
@@ -212,9 +219,9 @@ $default = '' unless defined $default;
 % } elsif ($render_as eq 'readonly' or $render_as eq 'readonly_plus_values') {
 
 % if (@values > 1) {
-    <ul>
+    <ul class="list-group list-group-borderless list-group-compact">
 % for (@values) {
-    <li name="<% $input_name %>" class="readonly"><% $_ %></li>
+    <li name="<% $input_name %>" class="readonly list-group-item"><% $_ %></li>
 %   if ($render_as eq 'readonly_plus_values') {
     <input type="hidden" name="<% $input_name %>" value="<% $_ %>"/>
 %   }
@@ -227,7 +234,7 @@ $default = '' unless defined $default;
     </script>
 
 % } else {
-    <span name="<% $input_name %>" class="readonly"><% $default %></span>
+    <span name="<% $input_name %>" class="form-control current-value readonly"><% $default %></span>
 %   if ($render_as eq 'readonly_plus_values') {
     <input type="hidden" name="<% $input_name %>" value="<% $default %>"/>
 %   }
@@ -244,6 +251,6 @@ $default = '' unless defined $default;
 
 % }
 % if ($render_as ne 'hidden' && $show_label) {
-</td><% $after_input |n %></tr></table>
+<% $after_input |n %></div></div>
 % }
 % }
diff --git a/html/FormTools/Next b/html/FormTools/Next
index 9038f37..b0747a3 100644
--- a/html/FormTools/Next
+++ b/html/FormTools/Next
@@ -1 +1,5 @@
-<& /Elements/Submit, %ARGS &>
+<div class="form-row">
+  <div class="col-12">
+    <& /Elements/Submit, %ARGS &>
+  </div>
+</div>
diff --git a/html/FormTools/ShowChoices b/html/FormTools/ShowChoices
index 9dfd6f8..176f306 100644
--- a/html/FormTools/ShowChoices
+++ b/html/FormTools/ShowChoices
@@ -3,18 +3,28 @@ my $queue = $m->notes('queue');
 
 my %all_fields = $m->request_args;
 </%init>
-<table>
 % foreach my $field (keys %all_fields) {
 % next if $field =~ /-Magic/;
 % my $cf = RT::CustomField->new($session{'CurrentUser'});
 % if ($field =~ /CustomField-(\d+)/) {
 % my $id = $1;
 %$cf->Load($id);
-<tr><td><b><%$cf->Name%></b></td><td><% ref ($all_fields{$field}) ? join(', ',@{$all_fields{$field}}) : $all_fields{$field}%></td></tr>
+<div class="form-row">
+  <div class="col-3 label"><%$cf->Name%></div>
+  <div class="col-9 value">
+    <span class="current-value">
+      <% ref ($all_fields{$field}) ? join(', ',@{$all_fields{$field}}) : $all_fields{$field}%>
+    </span>
+  </div>
+</div>
 % } elsif (RT::Extension::FormTools::is_core_field($field)) {
-
-<tr><td><b><%$field%></b></td><td><% $all_fields{$field} %></td></tr>
+<div class="form-row">
+  <div class="col-3 label"><%$field%></div>
+  <div class="col-9 value">
+    <span class="current-value">
+      <% $all_fields{$field} %>
+    </span>
+  </div>
+</div>
 %}
-
 % }
-</table>

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

Summary of changes:
 META.yml                      |  2 +-
 Makefile.PL                   |  2 +-
 README                        |  6 +++---
 html/FormTools/Field          | 35 +++++++++++++++++++++--------------
 html/FormTools/Next           |  6 +++++-
 html/FormTools/ShowChoices    | 22 ++++++++++++++++------
 lib/RT/Extension/FormTools.pm |  6 +++---
 7 files changed, 50 insertions(+), 29 deletions(-)


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


More information about the Bps-public-commit mailing list