Changeset 11 in text-formbuilder for trunk/lib/Text/FormBuilder.pm


Ignore:
Timestamp:
10/22/04 10:10:54 (20 years ago)
Author:
peter
Message:

added a !head directive for section headers in forms
removed generated Parser.pm file from version control

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Text/FormBuilder.pm

    r7 r11  
    9292                TYPE       => 'STRING', 
    9393                SOURCE     => $self->_template, 
    94                 DELIMETERS => [ qw(<% %>) ], 
     94                DELIMITERS => [ qw(<% %>) ], 
    9595            }, 
    9696            data => { 
    97                 author => $self->{form_spec}{author}, 
     97                headings => $self->{form_spec}{headings}, 
     98                author   => $self->{form_spec}{author}, 
    9899            }, 
    99100        }, 
     
    125126  <style type="text/css"> 
    126127    #author, #footer { font-style: italic; } 
    127     th { font-weight: normal; text-align: right; vertical-align: top; } 
     128    th { text-align: left; } 
     129    th h2 { padding: .125em .5em; background: #eee; } 
     130    th.label { font-weight: normal; text-align: right; vertical-align: top; } 
    128131  </style> 
    129132</head> 
     
    135138<% $start %> 
    136139<table> 
    137 <% foreach (@fields) { 
     140<% my $i; foreach(@fields) { 
     141    $OUT .= qq[  <tr><th colspan="2"><h2>$headings[$i]</h2></th></tr>\n] if $headings[$i]; 
    138142    $OUT .= qq[  <tr>]; 
    139     $OUT .= '<th>' . ($$_{required} ? qq[<strong class="required">$$_{label}:</strong>] : "$$_{label}:") . '</th>'; 
    140     $OUT .= qq[<td>$$_{field} $$_{comment}</td></tr>\n] 
     143    $OUT .= '<th class="label">' . ($$_{required} ? qq[<strong class="required">$$_{label}:</strong>] : "$$_{label}:") . '</th>'; 
     144    $OUT .= qq[<td>$$_{field} $$_{comment}</td></tr>\n]; 
     145    $i++; 
    141146} %> 
    142147  <tr><th></th><td style="padding-top: 1em;"><% $submit %></td></tr> 
Note: See TracChangeset for help on using the changeset viewer.