[Bps-public-commit] rt-extension-formtools branch, master, updated. 0.50-11-ga7dac1a

Craig Kaiser craig at bestpractical.com
Thu Apr 30 09:29:52 EDT 2020


The branch, master has been updated
       via  a7dac1a02446c43916dbf8f6873af566313e9cc4 (commit)
       via  9166d10a57a7d2a27f2d26330cac0d70d17f25c3 (commit)
       via  15be9389ed9724f74dd3c8e3f6651ef0c44c418c (commit)
       via  a13c330e847b7df576aef467c85a37dd76e89f8d (commit)
      from  08d8d22ea61b8477ce38830ff3ee0c3872d16da9 (commit)

Summary of changes:
 Changes                       |  4 +++
 META.yml                      |  2 +-
 html/FormTools/Field          | 67 +++++++++++++++++++++++++++++++------------
 lib/RT/Extension/FormTools.pm |  2 +-
 4 files changed, 55 insertions(+), 20 deletions(-)

- Log -----------------------------------------------------------------
commit 15be9389ed9724f74dd3c8e3f6651ef0c44c418c
Merge: 08d8d22 a13c330
Author: Craig <craig at bestpractical.com>
Date:   Thu Apr 30 09:14:11 2020 -0400

    Merge branch 'set-default-value-to-submitted-args-first'


commit 9166d10a57a7d2a27f2d26330cac0d70d17f25c3
Author: Matt Zagrabelny <mzagrabe at d.umn.edu>
Date:   Wed Jul 24 12:12:21 2019 -0500

    Add labels for radio and check inputs
    
    Increase usability with labels.

diff --git a/html/FormTools/Field b/html/FormTools/Field
index 8683750..3f753c9 100644
--- a/html/FormTools/Field
+++ b/html/FormTools/Field
@@ -199,15 +199,32 @@ $default = '' unless defined $default;
 % } elsif ($render_as =~ /^radio/)  {
 %       my $selected = 0;
 % if ($empty_allowed) {
-        <input type="radio" name="<% $input_name %>" value="" <% !$default ?  'CHECKED' : '' %>><span class="radio-label"><&|/l&>(no value)</&></span>
-%        if ($render_as =~ /vertical/) { 
+        <input
+            type="radio"
+            id="<% $input_name %>"
+            name="<% $input_name %>"
+            value=""
+            <% !$default ? 'CHECKED' : '' %>
+        >
+        <label
+            for="<% $input_name %>"
+            class="radio-label"
+        >
+            <&|/l&>(no value)</&>
+        </label>
+%        if ($render_as =~ /vertical/) {
             <br/>
 %        }
 
 % }
 % my $CFVs = $cf->Values;
 % while ($CFVs and my $value = $CFVs->Next ) {
-        <input type="radio" name="<% $input_name %>"  value="<%$value->Name%>" 
+%       my $labelid = "$input_name-". $value->id;
+        <input
+            type="radio"
+            id="<% $labelid %>"
+            name="<% $input_name %>"
+            value="<%$value->Name%>"
 %  if ($default) {
 %       if (ref $default) {
             <% (grep { $_ eq $value->Name} @$default) ? 'CHECKED' : '' %>
@@ -215,9 +232,15 @@ $default = '' unless defined $default;
             <% ($default eq $value->Name) ? 'CHECKED' : '' %>
 %       }
 % }
-            ><span class="radio-label"><% $value->Name%></span>
-
-%        if ($render_as =~ /vertical/) { 
+        >
+        <label
+            for="<% $labelid %>"
+            class="radio-label"
+        >
+            <% $value->Name %>
+        </label>
+
+%        if ($render_as =~ /vertical/) {
             <br/>
 %        }
 
@@ -225,7 +248,12 @@ $default = '' unless defined $default;
 % } elsif ($render_as =~  /^check/i)  {
 % my $CFVs = $cf->Values;
 % while ($CFVs and my $value = $CFVs->Next ) {
-        <input type="checkbox" name="<% $input_name %>"  value="<%$value->Name%>" 
+%       my $labelid = "$input_name-". $value->id;
+        <input
+            type="checkbox"
+            id="<% $labelid %>"
+            name="<% $input_name %>"
+            value="<%$value->Name%>"
 %  if ($default) {
 %       if (ref $default) {
             <% (grep { $_ eq $value->Name} @$default) ? 'CHECKED' : '' %>
@@ -233,13 +261,18 @@ $default = '' unless defined $default;
             <% ($default eq $value->Name) ? 'CHECKED' : '' %>
 %       }
 % }
-            ><% $value->Name%>
+        >
+        <label
+            for="<% $labelid %>"
+        >
+            <% $value->Name %>
+        </label>
 
 % if (defined $item_labels->{$value->Name}) {
     <% $item_labels->{$value->Name} %>
 % }
 
-%        if ($render_as =~ /vertical/) { 
+%        if ($render_as =~ /vertical/) {
             <br/>
 %        }
 

commit a7dac1a02446c43916dbf8f6873af566313e9cc4
Author: Craig <craig at bestpractical.com>
Date:   Thu Apr 30 09:18:25 2020 -0400

    Release 0.52

diff --git a/Changes b/Changes
index 7b99ab1..be38149 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for RT-Extension-FormTools
 
+0.52 2020-04-30
+ - Prioritize user submitted args before default values in field component
+ - Add labels for radio and check inputs (Thanks Matt!)
+
 0.51 2018-07-24
 
  - Add enable_persisting argument to Form component
diff --git a/META.yml b/META.yml
index dd75b74..a127edc 100644
--- a/META.yml
+++ b/META.yml
@@ -23,6 +23,6 @@ requires:
 resources:
   license: http://opensource.org/licenses/gpl-license.php
   repository: https://github.com/bestpractical/rt-extension-formtools
-version: '0.51'
+version: '0.52'
 x_module_install_rtx_version: '0.40'
 x_requires_rt: 4.0.0
diff --git a/lib/RT/Extension/FormTools.pm b/lib/RT/Extension/FormTools.pm
index 498549d..4e5ba60 100644
--- a/lib/RT/Extension/FormTools.pm
+++ b/lib/RT/Extension/FormTools.pm
@@ -3,7 +3,7 @@ use strict;
 
 package RT::Extension::FormTools;
 
-our $VERSION = '0.51';
+our $VERSION = '0.52';
 
 =head1 NAME
 

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


More information about the Bps-public-commit mailing list