fixes for base collection widget+template
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Collection.pm
1 package Reaction::UI::Widget::Collection;
2
3 use Reaction::UI::WidgetClass;
4
5 use namespace::clean -except => [ qw(meta) ];
6
7 implements fragment members {
8   render member => over $_{viewport}->members;
9 };
10
11 implements fragment member {
12   render 'viewport';
13 };
14
15 implements fragment actions {
16   render action => over $_{viewport}->actions;
17 };
18
19 implements fragment action {
20   render 'viewport';
21 };
22
23 __PACKAGE__->meta->make_immutable;
24
25
26 1;
27
28 __END__;
29
30 =head1 NAME
31
32 Reaction::UI::Widget::Collection - Render the current viewport's member viewports
33
34 =head1 DESCRIPTION
35
36 This widget will allow you to render the viewports stored in the current viewports
37 C<members> attribute.
38
39 =head1 FRAGMENTS
40
41 =head2 members
42
43 Renders the C<member> fragment for every entry in the viewports C<members> attribute.
44
45 =head2 member
46
47 Renders the C<viewport> fragment, which will in turn render the C<_> argument. That
48 will be one of the viewports in the current viewport's C<members> attribute when
49 called from C<members>.
50
51 =head1 LAYOUT SETS
52
53   share/skin/base/layout/collection.tt
54
55 The following layouts are provided:
56
57 =over 4
58
59 =item widget
60
61 Renders a C<div> element with a class attribute of C<collection_members> and the
62 C<members> fragment as the content.
63
64 =back
65
66 =head1 SEE ALSO
67
68 =over 4
69
70 =item * L<Reaction::UI::Widget::Collection::Grid>
71
72 =item * L<Reaction::UI::ViewPort::Collection>
73
74 =back
75
76 =head1 AUTHORS
77
78 See L<Reaction::Class> for authors.
79
80 =head1 LICENSE
81
82 See L<Reaction::Class> for the license.
83
84 =cut