aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/Widget/Field/Container.pm
diff options
context:
space:
mode:
authorgroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-08-21 00:55:12 +0000
committergroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-08-21 00:55:12 +0000
commite984a788c5ee855209cb6a4cc4fc07c085009b47 (patch)
treecb48986956e4992460aa4008711e0b34d851dc29 /lib/Reaction/UI/Widget/Field/Container.pm
parent599c1172394e3377d8e3e28c06557a99a1a10d1e (diff)
downloadreaction-e984a788c5ee855209cb6a4cc4fc07c085009b47.tar.gz
reaction-e984a788c5ee855209cb6a4cc4fc07c085009b47.zip
svk add FAIL
Diffstat (limited to 'lib/Reaction/UI/Widget/Field/Container.pm')
-rw-r--r--lib/Reaction/UI/Widget/Field/Container.pm56
1 files changed, 56 insertions, 0 deletions
diff --git a/lib/Reaction/UI/Widget/Field/Container.pm b/lib/Reaction/UI/Widget/Field/Container.pm
new file mode 100644
index 0000000..ba7fa28
--- /dev/null
+++ b/lib/Reaction/UI/Widget/Field/Container.pm
@@ -0,0 +1,56 @@
+package Reaction::UI::Widget::Field::Container;
+
+use Reaction::UI::WidgetClass;
+
+use namespace::clean -except => [ qw(meta) ];
+
+before fragment widget {
+ arg name => $_{viewport}->name;
+};
+
+implements fragment maybe_label {
+ return unless $_{viewport}->has_label;
+ arg label => $_{viewport}->label;
+ render 'label';
+};
+
+implements fragment field_list {
+ render field => over $_{viewport}->fields;
+};
+
+implements fragment field {
+ render 'viewport';
+};
+
+__PACKAGE__->meta->make_immutable;
+
+1;
+
+__END__;
+
+=head1 NAME
+
+Reaction::UI::Widget::Field::Container
+
+=head1 DESCRIPTION
+
+=head1 FRAGMENTS
+
+=head2 field_list
+
+Sequentially renders the C<fields> of the viewport;
+
+=head2 field
+
+Renders the C<field> viewport passed by C<field_list>
+
+=head1 AUTHORS
+
+See L<Reaction::Class> for authors.
+
+=head1 LICENSE
+
+See L<Reaction::Class> for the license.
+
+=cut
+