diff options
author | groditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2007-09-28 18:01:42 +0000 |
---|---|---|
committer | groditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2007-09-28 18:01:42 +0000 |
commit | 5a1a893ef93c22e0aba72a346749753ace194d66 (patch) | |
tree | e0e205313394669a385715c0139d7cf18a072127 /lib/Reaction | |
parent | 9de685fc288409d8b92e41f1e23b67562ea407f8 (diff) | |
download | reaction-5a1a893ef93c22e0aba72a346749753ace194d66.tar.gz reaction-5a1a893ef93c22e0aba72a346749753ace194d66.zip |
more work towards widgets, split up the templates and added some super basic POD
Diffstat (limited to 'lib/Reaction')
24 files changed, 428 insertions, 328 deletions
diff --git a/lib/Reaction/UI/View.pm b/lib/Reaction/UI/View.pm index 5c26113..4778c25 100644 --- a/lib/Reaction/UI/View.pm +++ b/lib/Reaction/UI/View.pm @@ -57,7 +57,7 @@ class View which { implements 'widget_class_for' => as { my ($self, $layout_set) = @_; - my $base = ref($self); + my $base = $self->blessed; my $tail = $layout_set->widget_type; my $class = join('::', $base, 'Widget', $tail); Class::MOP::load_class($class); diff --git a/lib/Reaction/UI/Widget/ActionForm.pm b/lib/Reaction/UI/Widget/ActionForm.pm index 484453c..a631130 100644 --- a/lib/Reaction/UI/Widget/ActionForm.pm +++ b/lib/Reaction/UI/Widget/ActionForm.pm @@ -6,7 +6,7 @@ class ActionForm, which { widget renders [qw/header fields buttons footer/ => { viewport => func('self','viewport') } ]; - fields renders [viewport over func('self','ordered_fields')]; + fields renders [viewport over func('viewport','ordered_fields')]; buttons renders [ string {"DUMMY"} ], {message => func('viewport','message'); header renders [ string {"DUMMY"} ]; @@ -18,45 +18,44 @@ class ActionForm, which { __END__; -=for layout widget - <form action="" method="post" enctype="multipart/form-data"> - [% header %] - [% fields %] - [% buttons %] - [% footer %] - </form> +=head1 NAME -=for layout header +Reaction::UI::Widget::ActionForm -<h2>Le Header</h2> +=head1 DESCRIPTION -=for layout fields +=head1 FRAGMENTS -[% content %] <br /> +=head2 widget -=for layout buttons +Additional variables available in topic hash: "viewport". - [% IF message; %] - <span>[% message %]</span> <br /> - [% END; %] +Renders "header", "fields", "buttons" and "footer" - [% allowed_events = viewport.accept_events; %] - [% IF allowed_events.grep('^ok$').size; %] - <input type="submit" name="[% viewport.event_id_for('ok') | html%]" value="ok" /> - [% END; %] +=head2 fields - [% IF (viewport.ordered_fields.size != 0) && allowed_events.grep('^apply$').size; %] - <input type="submit" name="[% viewport.event_id_for('apply') | html%]" value="apply" /> - [% END; %] +Sequentially renders the C<ordered_fields> of the viewport - [% IF allowed_events.grep('^close$').size; %] - <input type="submit" name="[% viewport.event_id_for('close') | html%]" value="cancel" /> - [% END; %] - <br /> +=head2 buttons -=for layout footer +Additional variables available in topic hash: "message" - <h2>Le Footer</h2> +=head2 header + +Content is a dummy value + +=head2 footer + +Content is a dummy value + +=head1 AUTHORS + +See L<Reaction::Class> for authors. + +=head1 LICENSE + +See L<Reaction::Class> for the license. =cut + diff --git a/lib/Reaction/UI/Widget/DisplayField.pm b/lib/Reaction/UI/Widget/DisplayField.pm new file mode 100644 index 0000000..c454188 --- /dev/null +++ b/lib/Reaction/UI/Widget/DisplayField.pm @@ -0,0 +1,43 @@ +package Reaction::UI::Widget::DisplayField; + +use Reaction::UI::WidgetClass; + +class Text, which { + widget renders [ qw/label value/ => { viewport => func(self => 'viewport') } ]; + label renders [ string { $_{viewport}->label } ]; + value renders [ string { $_{viewport}->value } ]; +}; + +1; + +=head1 NAME + +Reaction::UI::Widget::DisplayField + +=head1 DESCRIPTION + +=head1 FRAGMENTS + +=head2 widget + +Additional variables available in topic hash: "viewport". + +Renders "label" and "field" + +=head2 field + + C<content> will contain the value, if any, of the field. + +=head2 label + + C<content> will contain the label, if any, of the field. + +=head1 AUTHORS + +See L<Reaction::Class> for authors. + +=head1 LICENSE + +See L<Reaction::Class> for the license. + +=cut diff --git a/lib/Reaction/UI/Widget/DisplayField/Boolean.pm b/lib/Reaction/UI/Widget/DisplayField/Boolean.pm index e1d9e9a..93dfc59 100644 --- a/lib/Reaction/UI/Widget/DisplayField/Boolean.pm +++ b/lib/Reaction/UI/Widget/DisplayField/Boolean.pm @@ -2,9 +2,7 @@ package Reaction::UI::Widget::DisplayField::Boolean; use Reaction::UI::WidgetClass; -class Boolean, which { - widget renders [ qw/label value/ => { viewport => func(self => 'viewport') } ]; - label renders [ string { $_{viewport}->label } ]; +class Boolean is 'Reaction::UI::Widget::DisplayField', which { value renders [ string { $_{viewport}->value_string } ]; }; @@ -12,17 +10,26 @@ class Boolean, which { __END__; -=for layout widget +=head1 NAME -[% content %] +Reaction::UI::Widget::DisplayField::Boolean -=for layout label +=head1 DESCRIPTION -<strong > [ % content %]: </strong> +See L<Reaction::UI::Widget::DisplayField> -=for layout value +=head1 FRAGMENTS -[% content %] +=head2 value -=cut +C<content> contains the viewport's value_string + +=head1 AUTHORS + +See L<Reaction::Class> for authors. +=head1 LICENSE + +See L<Reaction::Class> for the license. + +=cut diff --git a/lib/Reaction/UI/Widget/DisplayField/Collection.pm b/lib/Reaction/UI/Widget/DisplayField/Collection.pm index 4e65331..a64c657 100644 --- a/lib/Reaction/UI/Widget/DisplayField/Collection.pm +++ b/lib/Reaction/UI/Widget/DisplayField/Collection.pm @@ -3,33 +3,47 @@ package Reaction::UI::Widget::DisplayField::Collection; use Reaction::UI::WidgetClass; class Collection, which { - widget renders [ qw/label list item/ => { viewport => func(self => 'viewport') } ]; + widget renders [ qw/label list/ => { viewport => func(self => 'viewport') } ]; label renders [ string { $_{viewport}->label } ]; list renders [ item over func('viewport', 'value_names') ]; - item renders [ string { $_{_} } ]; + item renders [ string { $_ } ]; }; 1; __END__; -=for layout widget -[% label %] -[% list %] +=head1 NAME -=for layout label +Reaction::UI::Widget::DisplayField::Collection -<strong > [ % content %]: </strong> +=head1 DESCRIPTION -=for layout list +=head1 FRAGMENTS -<ul> -[% item %] -</ul> +=head2 widget -=for layout item +renders C<label> and C<list> passing additional variable "viewport" -<li>[% content %]</li> +=head2 label + +C<content> contains the viewport's label + +=head2 list + +renders fragment item over the viewport's C<value_names> + +=head2 item + +C<content> contains the value of the current item ($_ / $_{_}) + +=head1 AUTHORS + +See L<Reaction::Class> for authors. + +=head1 LICENSE + +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/DisplayField/DateTime.pm b/lib/Reaction/UI/Widget/DisplayField/DateTime.pm index d6d0446..e403a9a 100644 --- a/lib/Reaction/UI/Widget/DisplayField/DateTime.pm +++ b/lib/Reaction/UI/Widget/DisplayField/DateTime.pm @@ -2,26 +2,34 @@ package Reaction::UI::Widget::DisplayField::DateTime; use Reaction::UI::WidgetClass; -class DateTime, which { - widget renders [ qw/label value/ => { viewport => func(self => 'viewport') } ]; - label renders [ string { $_{viewport}->label } ]; - value renders [ string { $_{viewport}->value_string } ]; +class DateTime is 'Reaction::UI::Widget::DisplayField', which { + value renders [ string { $_{viewport}->value_string } ]; }; 1; __END__; -=for layout widget +=head1 NAME -[% content %] +Reaction::UI::Widget::DisplayField::DateTime -=for layout label +=head1 DESCRIPTION -<strong > [ % content %]: </strong> +See L<Reaction::UI::Widget::DisplayField> -=for layout value +=head1 FRAGMENTS -[% content %] +=head2 value + +C<content> contains the viewport's value_string + +=head1 AUTHORS + +See L<Reaction::Class> for authors. + +=head1 LICENSE + +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/DisplayField/List.pm b/lib/Reaction/UI/Widget/DisplayField/List.pm index 06e7cb4..3b3d779 100644 --- a/lib/Reaction/UI/Widget/DisplayField/List.pm +++ b/lib/Reaction/UI/Widget/DisplayField/List.pm @@ -13,23 +13,36 @@ class List, which { __END__; -=for layout widget +=head1 NAME -[% label %] -[% list %] +Reaction::UI::Widget::DisplayField::List -=for layout label +=head1 DESCRIPTION -<strong > [ % content %]: </strong> +=head1 FRAGMENTS -=for layout list +=head2 widget -<ul> -[% item %] -</ul> +renders C<label> and C<list> passing additional variable "viewport" -=for layout item +=head2 label -<li>[% content %]</li> +C<content> contains the viewport's label + +=head2 list + +renders fragment item over the viewport's C<value_names> + +=head2 item + +C<content> contains the value of the current item ($_ / $_{_}) + +=head1 AUTHORS + +See L<Reaction::Class> for authors. + +=head1 LICENSE + +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/DisplayField/Number.pm b/lib/Reaction/UI/Widget/DisplayField/Number.pm index 7f9d928..9260c2e 100644 --- a/lib/Reaction/UI/Widget/DisplayField/Number.pm +++ b/lib/Reaction/UI/Widget/DisplayField/Number.pm @@ -2,26 +2,28 @@ package Reaction::UI::Widget::DisplayField::Number; use Reaction::UI::WidgetClass; -class Number, which { - widget renders [ qw/label value/ => { viewport => func(self => 'viewport') } ]; - label renders [ string { $_{viewport}->label } ]; - value renders [ string { $_{viewport}->value } ]; +class Number is 'Reaction::UI::Widget::DisplayField', which { + }; 1; __END__; -=for layout widget +=head1 NAME + +Reaction::UI::Widget::DisplayField::Numberx + +=head1 DESCRIPTION -[% content %] +See L<Reaction::UI::Widget::DisplayField> -=for layout label +=head1 AUTHORS -<strong > [ % content %]: </strong> +See L<Reaction::Class> for authors. -=for layout value +=head1 LICENSE -[% content %] +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/DisplayField/RelatedObject.pm b/lib/Reaction/UI/Widget/DisplayField/RelatedObject.pm index 58f1b78..fa415e7 100644 --- a/lib/Reaction/UI/Widget/DisplayField/RelatedObject.pm +++ b/lib/Reaction/UI/Widget/DisplayField/RelatedObject.pm @@ -2,9 +2,7 @@ package Reaction::UI::Widget::DisplayField::RelatedObject; use Reaction::UI::WidgetClass; -class RelatedObject, which { - widget renders [ qw/label value/ => { viewport => func(self => 'viewport') } ]; - label renders [ string { $_{viewport}->label } ]; +class RelatedObject is 'Reaction::UI::Widget::DisplayField', which { value renders [ string { $_{viewport}->value_string } ]; }; @@ -12,16 +10,26 @@ class RelatedObject, which { __END__; -=for layout widget +=head1 NAME -[% content %] +Reaction::UI::Widget::DisplayField::RelatedObject -=for layout label +=head1 DESCRIPTION -<strong > [ % content %]: </strong> +See L<Reaction::UI::Widget::DisplayField> -=for layout value +=head1 FRAGMENTS -[% content %] +=head2 value + +C<content> contains the viewport's value_string + +=head1 AUTHORS + +See L<Reaction::Class> for authors. + +=head1 LICENSE + +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/DisplayField/String.pm b/lib/Reaction/UI/Widget/DisplayField/String.pm index 9530996..0301a15 100644 --- a/lib/Reaction/UI/Widget/DisplayField/String.pm +++ b/lib/Reaction/UI/Widget/DisplayField/String.pm @@ -2,26 +2,28 @@ package Reaction::UI::Widget::DisplayField::String; use Reaction::UI::WidgetClass; -class String, which { - widget renders [ qw/label value/ => { viewport => func(self => 'viewport') } ]; - label renders [ string { $_{viewport}->label } ]; - value renders [ string { $_{viewport}->value } ]; +class String is 'Reaction::UI::Widget::DisplayField', which { + }; 1; __END__; -=for layout widget +=head1 NAME + +Reaction::UI::Widget::DisplayField::String + +=head1 DESCRIPTION -[% content %] +See L<Reaction::UI::Widget::DisplayField> -=for layout label +=head1 AUTHORS -<strong > [ % content %]: </strong> +See L<Reaction::Class> for authors. -=for layout value +=head1 LICENSE -[% content %] +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/DisplayField/Text.pm b/lib/Reaction/UI/Widget/DisplayField/Text.pm index fd9c111..d7c4c2e 100644 --- a/lib/Reaction/UI/Widget/DisplayField/Text.pm +++ b/lib/Reaction/UI/Widget/DisplayField/Text.pm @@ -2,26 +2,28 @@ package Reaction::UI::Widget::DisplayField::Text; use Reaction::UI::WidgetClass; -class Text, which { - widget renders [ qw/label value/ => { viewport => func(self => 'viewport') } ]; - label renders [ string { $_{viewport}->label } ]; - value renders [ string { $_{viewport}->value } ]; +class Text is 'Reaction::UI::Widget::DisplayField', which { + }; 1; __END__; -=for layout widget +=head1 NAME + +Reaction::UI::Widget::DisplayField::Text + +=head1 DESCRIPTION -[% content %] +See L<Reaction::UI::Widget::DisplayField> -=for layout label +=head1 AUTHORS -<strong > [ % content %]: </strong> +See L<Reaction::Class> for authors. -=for layout value +=head1 LICENSE -[% content %] +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/Field.pm b/lib/Reaction/UI/Widget/Field.pm index f3caf3b..6425f15 100644 --- a/lib/Reaction/UI/Widget/Field.pm +++ b/lib/Reaction/UI/Widget/Field.pm @@ -25,3 +25,58 @@ class Field, which { 1; +=head1 NAME + +Reaction::UI::Widget::Field + +=head1 DESCRIPTION + +=head1 ATTRIBUTES + +=head2 id + +Str, lazy builds. + +=head2 name + +Str, lazy builds. + +=head1 METHODS + +=head2 build_id + +Returns the viewport's C<event_id_for('value')> + +=head2 build_name + +Returns the viewport's C<event_id_for('value')> + +=head1 FRAGMENTS + +=head2 widget + +Additional variables available in topic hash: "viewport", "id", "name". + +Renders "label","field" and "message" + +=head2 field + + C<content> will contain the value, if any, of the field. + +=head2 label + + C<content> will contain the label, if any, of the field. + +=head2 message + + C<content> will contain the message, if any, of the field. + +=head1 AUTHORS + +See L<Reaction::Class> for authors. + +=head1 LICENSE + +See L<Reaction::Class> for the license. + +=cut diff --git a/lib/Reaction/UI/Widget/Field/Boolean.pm b/lib/Reaction/UI/Widget/Field/Boolean.pm index c6afaff..536764c 100644 --- a/lib/Reaction/UI/Widget/Field/Boolean.pm +++ b/lib/Reaction/UI/Widget/Field/Boolean.pm @@ -8,35 +8,20 @@ class Boolean is 'Reaction::UI::Widget::Field', which { 1; -=for layout widget +=head1 NAME -[% label %] [% field %] [% message %] <br> +Reaction::UI::Widget::Field::Boolean -=for layout field +=head1 DESCRIPTION -[% - IF content; - checked = 'checked="checked"'; - ELSE; - checked = ""; - END; -%] +See L<Reaction::UI::Widget::Field> -<!-- We need a replacement for process_attrs --> -<input type="checkbox" id="[% id | html %]" name="[% name | html %]" value="1" [% checked %] /> +=head1 AUTHORS -=for layout label +See L<Reaction::Class> for authors. -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <label for="[% id %]"> [% content | html %]: </label> -[% END %] +=head1 LICENSE -=for layout message - -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <span> [% content | html %] </span> -[% END %] +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/Field/ChooseMany.pm b/lib/Reaction/UI/Widget/Field/ChooseMany.pm index 6d10b3f..bd11672 100644 --- a/lib/Reaction/UI/Widget/Field/ChooseMany.pm +++ b/lib/Reaction/UI/Widget/Field/ChooseMany.pm @@ -18,69 +18,48 @@ class ChooseMany is 'Reaction::UI::Widget::Field', which { 1; -=for layout widget +=head1 NAME -[% label %] -<br /> -[% message %] -[% field %] +Reaction::UI::Widget::Field::ChooseMany -=for layout field +=head1 DESCRIPTION -<table> - <tr> - <td> [% available_values %] </td> - <td> [% action_buttons %] </td> - <td> - [% selected_values %] - [% current_values %] - </td> - </tr> -</table> +See L<Reaction::UI::Widget::Field> -=for layout available_values +This needs a refactor to not be tied to a dual select box, but ENOTIME -<select size="10" multiple="multiple" name="[% viewport.event_id_for('add_values') | html %]"> - [% content %] -</select> +=head1 FRAGMENTS -=for layout selected_values +=head2 field -<select size="10" multiple="multiple" name="[% viewport.event_id_for('remove_values') | html %]"> - [% content %] -</select> +renders C<available_values>, C<action_buttons>, C<selected_values> and C<current_values> -=for layout current_values +=head2 current values -[% content %] +renders the viewport's current_value_choices over hidden_value -=for layout hidden_value +=head2 hidden_value -<input type="hidden" name="[% viewport.event_id_for('value') | html %]" value="[% content | html %]"> +C<content> is the value of the current choice -=for layout option +=head2 available_value -<option value="[% v_value | html %]">[% v_name | html %]</option> +rendersthe viewport's current_available_value_choices over the option fragment -=for layout action_buttons +=head2 selected_value -<input type="submit" value=">>" name="[% viewport.event_id_for('add_all_values') | html %]" /> -<input type="submit" value=">" name="[% viewport.event_id_for('do_add_values') | html %]" /> <br /> -<input type="submit" value="<" name="[% viewport.event_id_for('do_remove_values') | html %]" /> <br /> -<input type="submit" value="<<" name="[% viewport.event_id_for('remove_all_values') | html %]" /> <br /> +rendersthe viewport's current_selected_value_choices over the option fragment -=for layout label +=head2 option -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <label> [% content | html %]: </label> -[% END %] +C<content> is a dummy value but C<v_value> and C<v_name> are both set. -=for layout message +=head1 AUTHORS -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <span> [% content | html %] </span> <br /> -[% END %] +See L<Reaction::Class> for authors. + +=head1 LICENSE + +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/Field/ChooseOne.pm b/lib/Reaction/UI/Widget/Field/ChooseOne.pm index 3422261..7ac1898 100644 --- a/lib/Reaction/UI/Widget/Field/ChooseOne.pm +++ b/lib/Reaction/UI/Widget/Field/ChooseOne.pm @@ -18,43 +18,34 @@ class ChooseOne is 'Reaction::UI::Widget::Field', which { 1; -=for layout widget -[% label %] [% field %] [% message %] +=head1 NAME -=for layout field +Reaction::UI::Widget::Field::ChooseOne -<!-- We need a replacement for process_attrs --> -<select name="[% name | html %]" id="[% id | html %]"> - [% IF is_required %] - <option value="">--</option> - [% END %] - [% content %] -</select> +=head1 DESCRIPTION -=for layout option +See L<Reaction::UI::Widget::Field> - [% IF is_selected; - selected = ' selected="selected"'; - ELSE; - selected = ''; - END; - %] - <!-- I should convert this stuff to process_attrs to keep it cleaner --> - <option value="[% v_value | html%]" [% selected %]> [% v_name | html %]</option> +=head1 FRAGMENTS -=for layout label +=head2 field -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <label for="[% id | html %]"> [% content | html %]: </label> -[% END %] +Renders a series fragment C<option> for each C<value_choices> in the viewport -=for layout message +Additional varibles set: C<is_required> - Boolean, self-explanatory -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <span> [% content | html %] </span> -[% END %] +=head2 option + +C<content> is a dummy variable, but th additional variables C<v_value>, C<v_name> +and C<is_selected> are set + +=head1 AUTHORS + +See L<Reaction::Class> for authors. + +=head1 LICENSE + +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/Field/DateTime.pm b/lib/Reaction/UI/Widget/Field/DateTime.pm index f328cd7..9181387 100644 --- a/lib/Reaction/UI/Widget/Field/DateTime.pm +++ b/lib/Reaction/UI/Widget/Field/DateTime.pm @@ -10,27 +10,27 @@ class DateTime is 'Reaction::UI::Widget::Field', which { 1; -=for layout widget -[% label %] [% field %] [% message %] +=head1 NAME -=for layout field +Reaction::UI::Widget::Field::DateTime -<!-- We need a replacement for process_attrs --> -<input type="text" name="[% name | html %]" id="[% id | html%]" value="[% content | html %]" /> +=head1 DESCRIPTION -=for layout label +See L<Reaction::UI::Widget::Field> -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <label for="[% id | html %]"> [% content | html %]: </label> -[% END %] +=head1 FRAGMENTS -=for layout message +=head2 field -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <span> [% content | html %] </span> -[% END %] +C<content> contains viewport's C<value_string> + +=head1 AUTHORS + +See L<Reaction::Class> for authors. + +=head1 LICENSE + +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/Field/File.pm b/lib/Reaction/UI/Widget/Field/File.pm index b0c11cc..aa079c7 100644 --- a/lib/Reaction/UI/Widget/Field/File.pm +++ b/lib/Reaction/UI/Widget/Field/File.pm @@ -9,26 +9,20 @@ class File is 'Reaction::UI::Widget::Field', which { 1; -=for layout widget +=head1 NAME -[% label %] [% field %] [% message %] +Reaction::UI::Widget::Field::File -=for layout field +=head1 DESCRIPTION -<input type="file" name="[% name | html%]" id="[% id | html %]" /> +See L<Reaction::UI::Widget::Field> -=for layout label +=head1 AUTHORS -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <label for="[% id | html %]"> [% content | html %]: </label> -[% END %] +See L<Reaction::Class> for authors. -=for layout message +=head1 LICENSE -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <span> [% content | html %] </span> -[% END %] +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/Field/HiddenArray.pm b/lib/Reaction/UI/Widget/Field/HiddenArray.pm index 010e458..05cdd45 100644 --- a/lib/Reaction/UI/Widget/Field/HiddenArray.pm +++ b/lib/Reaction/UI/Widget/Field/HiddenArray.pm @@ -12,20 +12,30 @@ class HiddenArray is 'Reaction::UI::Widget::Field', which { 1; -=for layout widget +=head1 NAME -[% field %] +Reaction::UI::Widget::Field::HiddenArray -=for layout field +=head1 DESCRIPTION -[% item %] +See L<Reaction::UI::Widget::Field> -=for layout item +=head1 FRAGMENTS -<input type="hidden" name="[% name | html %]" value="[% content | html %]" /> +=head2 field -=for layout label +renders fragment C<item> over the values of 'value' arrayref -=for layout message +=head2 item + +C<content> is $_{_} / $_ (current item in the 'value' array) + +=head1 AUTHORS + +See L<Reaction::Class> for authors. + +=head1 LICENSE + +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/Field/Number.pm b/lib/Reaction/UI/Widget/Field/Number.pm index 2cd371f..859e7c2 100644 --- a/lib/Reaction/UI/Widget/Field/Number.pm +++ b/lib/Reaction/UI/Widget/Field/Number.pm @@ -8,27 +8,21 @@ class Number is 'Reaction::UI::Widget::Field', which { 1; -=for layout widget -[% label %] [% field %] [% message %] +=head1 NAME -=for layout field +Reaction::UI::Widget::Field::Number -<!-- We need a replacement for process_attrs --> -<input type="text" name="[% name | html%]" id="[% id | html %]" value="[% content | html %]" /> +=head1 DESCRIPTION -=for layout label +See L<Reaction::UI::Widget::Field> -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <label for="[% id | html %]"> [% content | html %]: </label> -[% END %] +=head1 AUTHORS -=for layout message +See L<Reaction::Class> for authors. -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <span> [% content | html %] </span> -[% END %] +=head1 LICENSE + +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/Field/Password.pm b/lib/Reaction/UI/Widget/Field/Password.pm index 1b794e0..3b53b54 100644 --- a/lib/Reaction/UI/Widget/Field/Password.pm +++ b/lib/Reaction/UI/Widget/Field/Password.pm @@ -8,27 +8,21 @@ class Password is 'Reaction::UI::Widget::Field', which { 1; -=for layout widget -[% label %] [% field %] [% message %] +=head1 NAME -=for layout field +Reaction::UI::Widget::Field::Password -<!-- We need a replacement for process_attrs --> -<input type="password" name="[% name | html %]" id="[% id | html %]" value="[% content | html %]" /> +=head1 DESCRIPTION -=for layout label +See L<Reaction::UI::Widget::Field> -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <label for="[% id | html %]"> [% content | html %]: </label> -[% END %] +=head1 AUTHORS -=for layout message +See L<Reaction::Class> for authors. -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <span> [% content | html %] </span> -[% END %] +=head1 LICENSE + +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/Field/String.pm b/lib/Reaction/UI/Widget/Field/String.pm index f2380dd..eb25c8f 100644 --- a/lib/Reaction/UI/Widget/Field/String.pm +++ b/lib/Reaction/UI/Widget/Field/String.pm @@ -8,27 +8,20 @@ class String is 'Reaction::UI::Widget::Field', which { 1; -=for layout widget +=head1 NAME -[% label %] [% field %] [% message %] +Reaction::UI::Widget::Field::String -=for layout field +=head1 DESCRIPTION -<!-- We need a replacement for process_attrs --> -<input type="text" name="[% name | html %]" id="[% id | html %]" value="[% content | html %]" /> +See L<Reaction::UI::Widget::Field> -=for layout label +=head1 AUTHORS -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <label for="[% id | html %]"> [% content | html %]: </label> -[% END %] +See L<Reaction::Class> for authors. -=for layout message +=head1 LICENSE -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <span> [% content | html %] </span> -[% END %] +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/Field/Text.pm b/lib/Reaction/UI/Widget/Field/Text.pm index 9bc152c..1066633 100644 --- a/lib/Reaction/UI/Widget/Field/Text.pm +++ b/lib/Reaction/UI/Widget/Field/Text.pm @@ -8,29 +8,21 @@ class Text is 'Reaction::UI::Widget::Field', which { 1; -=for layout widget -[% label %] [% field %] [% message %] +=head1 NAME -=for layout field +Reaction::UI::Widget::Field::Text -<!-- We need a replacement for process_attrs --> -<textarea name="[% name | html %]" id="[% id | html %]"> - [% content | html %] -</textarea> +=head1 DESCRIPTION -=for layout label +See L<Reaction::UI::Widget::Field> -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <label for="[% id | html %]"> [% content | html %]: </label> -[% END %] +=head1 AUTHORS -=for layout message +See L<Reaction::Class> for authors. -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <span> [% content | html %] </span> -[% END %] +=head1 LICENSE + +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/Field/TimeRange.pm b/lib/Reaction/UI/Widget/Field/TimeRange.pm index a23e951..f96a2c8 100644 --- a/lib/Reaction/UI/Widget/Field/TimeRange.pm +++ b/lib/Reaction/UI/Widget/Field/TimeRange.pm @@ -9,26 +9,22 @@ class TimeRange is 'Reaction::UI::Widget::Field', which { 1; -=for layout widget +=head1 NAME -[% label %] [% field %] [% message %] +Reaction::UI::Widget::Field::TimeRange -=for layout field +=head1 DESCRIPTION -TODO +Warning: INCOMPLETE CLASS -=for layout label +See L<Reaction::UI::Widget::Field> -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <label for="[% id | html %]"> [% content | html %]: </label> -[% END %] +=head1 AUTHORS -=for layout message +See L<Reaction::Class> for authors. -<!-- This conditional goes away when mst comes up with something better --> -[% IF content %] - <span> [% content | html %] </span> -[% END %] +=head1 LICENSE + +See L<Reaction::Class> for the license. =cut diff --git a/lib/Reaction/UI/Widget/ObjectView.pm b/lib/Reaction/UI/Widget/ObjectView.pm index 8b8a941..28614b6 100644 --- a/lib/Reaction/UI/Widget/ObjectView.pm +++ b/lib/Reaction/UI/Widget/ObjectView.pm @@ -4,19 +4,38 @@ use Reaction::UI::WidgetClass; class ObjectView, which { widget renders [ fields => { viewport => func('self', 'viewport') } ]; - field renders [ viewport over func('viewport','ordered_fields') } ]; + fields renders [ viewport over func('viewport','ordered_fields') } ]; }; 1; __END__; -=for layout widget - [% field %] +=head1 NAME -=for layout field +Reaction::UI::Widget::ObjectView - [% content %]<br> +=head1 DESCRIPTION + +=head1 FRAGMENTS + +=head2 widget + +Additional variables available in topic hash: "viewport". + +Renders "fields" + +=head2 fields + +Sequentially renders the C<ordered_fields> of the viewport + +=head1 AUTHORS + +See L<Reaction::Class> for authors. + +=head1 LICENSE + +See L<Reaction::Class> for the license. =cut |