[Bps-public-commit] rt-extension-formtools branch, add-form-display-hooks, created. 0.12-1-ga92697d

Jim Brandt jbrandt at bestpractical.com
Tue Nov 20 10:51:29 EST 2012


The branch, add-form-display-hooks has been created
        at  a92697dccb38492a5c6d5b4769e86c698d2c1265 (commit)

- Log -----------------------------------------------------------------
commit a92697dccb38492a5c6d5b4769e86c698d2c1265
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Tue Nov 20 10:47:11 2012 -0500

    Add configuration hooks for form labels and input fields
    
    FormTools creates tables for each form element it creates
    and you sometimes want to add some text next to the label
    that is not part of the label, like a link or footnote.
    Likewise, you sometimes want to add some additional text after
    the input field in the table created for the input.
    
    This commit adds two configuration variables that can accept HTML to
    add this additional text.

diff --git a/html/FormTools/Field b/html/FormTools/Field
index 6e6a2ee..f1d9155 100644
--- a/html/FormTools/Field
+++ b/html/FormTools/Field
@@ -12,6 +12,8 @@ $show_label         => 1
 $disables           => {}
 $enabled_by         => []
 $container_selector => undef
+$after_label       => ''
+$after_input        => ''
 </%args>
 <%init>
 use RT::Extension::FormTools;
@@ -119,7 +121,7 @@ $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></th><td style="display:block;">
+<table style="display: inline; "><tr><th valign="top"><label><%$field_label%></label><% $after_label |n %></th><td style="display:block;">
 % }
 
 % if ($field_type eq 'core') {
@@ -283,6 +285,6 @@ $default = '' unless defined $default;
 
 % }
 % if ($render_as ne 'hidden' && $show_label) {
-</td></tr></table>
+</td><% $after_input |n %></tr></table>
 % }
 % }

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



More information about the Bps-public-commit mailing list