class Index which {
- widget renders [ string {"DUMMY"} ];
+ fragment widget [ string {"DUMMY"} ];
};
class Layout which {
- widget renders [ qw(menu sidebar header main_content) ];
+ fragment widget [ qw(menu sidebar header main_content) ];
- menu renders [ string { "DUMMY" } ];
- sidebar renders [ string { "Sidebar Shit" } ];
- header renders [ string { "DUMMY" } ];
- main_content renders [ viewport over func('viewport', 'inner')];
+ fragment menu [ string { "DUMMY" } ];
+ fragment sidebar [ string { "Sidebar Shit" } ];
+ fragment header [ string { "DUMMY" } ];
+ fragment main_content [ viewport over func('viewport', 'inner')];
};
use Reaction::UI::WidgetClass;
class ActionForm, which {
- widget renders [ qw/header fields buttons footer/ ];
+ fragment widget [ qw/header field_list buttons footer/ ];
- fields renders [field over func('viewport','ordered_fields')];
- field renders [ 'viewport' ];
+ fragment field_list [field over func('viewport','ordered_fields')];
+ fragment field [ 'viewport' ];
#move button logic here
- buttons renders [ string {"DUMMY"} ],
+ fragment buttons [ string {"DUMMY"} ],
{message => sub{ $_{viewport}->can('message') ? $_{viewport}->message : "" } };
- header renders [ string {"DUMMY"} ];
- footer renders [ string {"DUMMY"} ];
+ fragment header [ string {"DUMMY"} ];
+ fragment footer [ string {"DUMMY"} ];
};
Additional variables available in topic hash: "viewport".
-Renders "header", "fields", "buttons" and "footer"
+Renders "header", "field_list", "buttons" and "footer"
-=head2 fields
+=head2 field_list
Sequentially renders the C<ordered_fields> of the viewport
use Reaction::UI::WidgetClass;
class DisplayField, which {
- widget renders [ qw/label value/ ];
- label renders [ string { $_{viewport}->label } ];
- value renders [ string { $_{viewport}->value } ];
+ fragment widget [ qw/label value/ ];
+ fragment label [ string { $_{viewport}->label } ];
+ fragment value [ string { $_{viewport}->value } ];
};
1;
use Reaction::UI::WidgetClass;
class Boolean is 'Reaction::UI::Widget::DisplayField', which {
- value renders [ string { $_{viewport}->value_string } ];
+ fragment value [ string { $_{viewport}->value_string } ];
};
1;
use Reaction::UI::WidgetClass;
class Collection, which {
- widget renders [ qw/label list/ ];
- label renders [ string { $_{viewport}->label } ];
- list renders [ item over func('viewport', 'value_names') ];
- item renders [ string { $_ } ];
+ fragment widget [ qw/label list/ ];
+ fragment label [ string { $_{viewport}->label } ];
+ fragment list [ item over func('viewport', 'value_names') ];
+ fragment item [ string { $_ } ];
};
1;
use Reaction::UI::WidgetClass;
class DateTime is 'Reaction::UI::Widget::DisplayField', which {
- value renders [ string { $_{viewport}->value_string } ];
+ fragment value [ string { $_{viewport}->value_string } ];
};
1;
use Reaction::UI::WidgetClass;
class List, which {
- widget renders [ qw/label list item/ ];
- label renders [ string { $_{viewport}->label } ];
- list renders [ item over func('viewport', 'value_names') ];
- item renders [ string { $_ } ];
+ fragment widget [ qw/label list item/ ];
+ fragment label [ string { $_{viewport}->label } ];
+ fragment list [ item over func('viewport', 'value_names') ];
+ fragment item [ string { $_ } ];
};
1;
use Reaction::UI::WidgetClass;
class RelatedObject is 'Reaction::UI::Widget::DisplayField', which {
- value renders [ string { $_{viewport}->value_string } ];
+ fragment value [ string { $_{viewport}->value_string } ];
};
1;
implements build_id => as { shift->viewport->event_id_for('value'); };
implements build_name => as { shift->viewport->event_id_for('value'); };
- widget renders [qw/label field message/
+ fragment widget [qw/label field message/
=> { id => func('self', 'id'),
name => func('self', 'name'), }
];
- field renders [ string { $_{viewport}->value }, ];
+ fragment field [ string { $_{viewport}->value }, ];
- label renders [ string { $_{viewport}->label }, ];
- message renders [ string { $_{viewport}->message }, ];
+ fragment label [ string { $_{viewport}->label }, ];
+ fragment message [ string { $_{viewport}->message }, ];
};
class ChooseMany is 'Reaction::UI::Widget::Field', which {
- field renders [qw/available_values action_buttons selected_values current_values/];
+ fragment field [qw/available_values action_buttons selected_values current_values/];
- current_values renders [ hidden_value over func('viewport', 'current_value_choices') ];
- hidden_value renders [ string { $_->{value} } ];
+ fragment current_values [ hidden_value over func('viewport', 'current_value_choices') ];
+ fragment hidden_value [ string { $_->{value} } ];
- available_values renders [ option over func('viewport', 'available_value_choices') ];
- selected_values renders [ option over func('viewport', 'current_value_choices') ];
- option renders [string {"DUMMY"}], { v_value => sub {$_->{value}}, v_name => sub {$_->{name}} };
- action_buttons renders [ string {"DUMMY"} ];
+ fragment available_values [ option over func('viewport', 'available_value_choices') ];
+ fragment selected_values [ option over func('viewport', 'current_value_choices') ];
+ fragment option [string {"DUMMY"}], { v_value => sub {$_->{value}}, v_name => sub {$_->{name}} };
+ fragment action_buttons [ string {"DUMMY"} ];
};
class ChooseOne is 'Reaction::UI::Widget::Field', which {
- field renders [ option over func('viewport', 'value_choices') ],
+ fragment field [ option over func('viewport', 'value_choices') ],
{ is_required => sub{ $_{viewport}->attribute->required } };
- option renders [string {"DUMMY"}],
+ fragment option [string {"DUMMY"}],
{
v_value => sub { $_->{value} },
v_name => sub { $_->{name} },
class DateTime is 'Reaction::UI::Widget::Field', which {
- field renders [ string { $_{viewport}->value_string }, ];
+ fragment field [ string { $_{viewport}->value_string }, ];
};
class HiddenArray is 'Reaction::UI::Widget::Field', which {
- field renders [ item over func('viewport', 'value') ];
- item renders [ string { $_ } ];
+ fragment field [ item over func('viewport', 'value') ];
+ fragment item [ string { $_ } ];
};
use Reaction::UI::WidgetClass;
class GridView, which {
- widget renders [ qw/header body footer/ ];
+ fragment widget [ qw/header body footer/ ];
- header renders [ 'header_row' ];
- header_row renders [ header_cell over func('viewport', 'field_order'),
+ fragment header [ 'header_row' ];
+ fragment header_row [ header_cell over func('viewport', 'field_order'),
{ labels => func(viewport => 'field_labels') } ];
- header_cell renders [ string { $_{labels}->{$_} } ], { field_name => $_ };
+ fragment header_cell [ string { $_{labels}->{$_} } ], { field_name => $_ };
- footer renders [ 'footer_row' ];
- footer_row renders [ footer_cell over func('viewport', 'field_order'),
+ fragment footer [ 'footer_row' ];
+ fragment footer_row [ footer_cell over func('viewport', 'field_order'),
{ labels => func(viewport => 'field_labels') } ];
- footer_cell renders [ string { $_{labels}->{$_} } ], { field_name => $_ };
+ fragment footer_cell [ string { $_{labels}->{$_} } ], { field_name => $_ };
- body renders [ viewport over func('viewport','entities')];
+ fragment body [ viewport over func('viewport','entities')];
};
use Reaction::UI::WidgetClass;
class Action, which {
- widget renders [ string{ "DUMMY" } ],
+ fragment widget [ string{ "DUMMY" } ],
{ uri => func(viewport => 'uri'), label => func(viewport => 'label') };
};
class Entity, which {
#this could be flattened if i could do:
- # widget renders [field over sub{ $_{self}->viewport->fields } ];
+ # fragment widget [field over sub{ $_{self}->viewport->fields } ];
#to be honest, I think that the key viewport should be available by default in %_
- widget renders [ 'fields' ];
- fields renders [ field over func('viewport', 'fields') ];
- field renders [ 'viewport' ];
+ fragment widget [ 'field_list' ];
+ fragment field_list [ field over func('viewport', 'fields') ];
+ fragment field [ 'viewport' ];
};
1;
Additional variables available in topic hash: "viewport".
-Renders "fields"
+Renders "field_list"
-=head2 fields
+=head2 field_list
Sequentially renders the C<fields> of the viewport as "field"
#should I use inheritance here??
class WithActions, which {
- widget renders [ qw/fields actions/ ];
- fields renders [ field over func(viewport => 'fields') ];
- field renders [ 'viewport' ];
+ fragment widget [ qw(field_list actions) ];
+ fragment field_list [ field over func('viewport', 'fields') ];
+ fragment field [ 'viewport' ];
- actions renders [ action over func(viewport => 'actions')];
- action renders [ 'viewport' ];
+ fragment actions [ action over func(viewport => 'actions')];
+ fragment action [ 'viewport' ];
};
1;
use Reaction::UI::WidgetClass;
class ListView is 'Reaction::UI::Widget::GridView', which {
- widget renders [ qw/pager header body footer actions/,
+ fragment widget [ qw/pager header body footer actions/,
{
pager => sub{ $_{viewport}->pager },
object_action_count => sub{ $_{viewport}->object_action_count },
}
];
- pager renders
+ fragment pager
[ qw/first_page previous_page current_page next_page last_page page_list/,
{
first_page => sub{ $_{pager}->first_page },
}
];
- first_page renders [ string{ "First" } ],
+ fragment first_page [ string{ "First" } ],
{ uri => sub{ $_{self}->connect_uri( {page => $_{first_page} } ) } };
- previous_page renders [ string{ "Previous" } ],
+ fragment previous_page [ string{ "Previous" } ],
{ uri => sub{ $_{self}->connect_uri( {page => $_{previous_page} } ) } };
- current_page renders [ string{ "Current" } ],
+ fragment current_page [ string{ "Current" } ],
{ uri => sub{ $_{self}->connect_uri( {page => $_{current_page} } ) } };
- next_page renders [ string{ "Next" } ],
+ fragment next_page [ string{ "Next" } ],
{ uri => sub{ $_{self}->connect_uri( {page => $_{next_page} } ) } };
- last_page renders [ string{ "Last" } ],
+ fragment last_page [ string{ "Last" } ],
{ uri => sub{ $_{self}->connect_uri( {page => $_{last_page} } ) } };
- page_list renders [ page over $_{page_list} ];
- page renders [ string{ $_ } ],
+ fragment page_list [ page over $_{page_list} ];
+ fragment page [ string{ $_ } ],
{ uri => sub{ $_{self}->connect_uri( {page => $_ } ) } };
- actions renders [ action over func(viewport => 'actions') ];
- action renders [ 'viewport' ];
+ fragment actions [ action over func(viewport => 'actions') ];
+ fragment action [ 'viewport' ];
- header_cell renders [ string { $_{labels}->{$_} } ],
+ fragment header_cell [ string { $_{labels}->{$_} } ],
{ uri => sub{
my $ev = {order_by => $_, order_by_desc => $_{viewport}->order_by_desc ? 0 : 1 };
return $_{self}->connect_uri($ev);
}
};
- footer_cell renders [ string { $_{labels}->{$_} } ],
+ fragment footer_cell [ string { $_{labels}->{$_} } ],
{ uri => sub{
my $ev = {order_by => $_, order_by_desc => $_{viewport}->order_by_desc ? 0 : 1 };
return $_{self}->connect_uri($ev);
use Reaction::UI::WidgetClass;
class ObjectView, which {
- widget renders [ 'fields' ];
- fields renders [ field over func('viewport', 'ordered_fields') ];
- field renders [ 'viewport' ];
+ fragment widget [ 'field_list' ];
+ fragment field_list [ field over func('viewport', 'ordered_fields') ];
+ fragment field [ 'viewport' ];
};
1;
Additional variables available in topic hash: "viewport".
-Renders "fields"
+Renders "field_list"
-=head2 fields
+=head2 field_list
Sequentially renders the C<ordered_fields> of the viewport
use Reaction::UI::WidgetClass;
class Value, which {
- widget renders [ string {""} ],
+ fragment widget [ string {""} ],
{ value => sub{
my $vp = $_{viewport};
$vp->can('value_string') ? $vp->value_string : $vp->value;
use Reaction::UI::WidgetClass;
class Collection, which {
- widget renders [ qw/list/ ];
- list renders [ item over func('viewport', 'value_names') ];
- item renders [ string {""} ], { value => $_ };
+ fragment widget [ qw/list/ ];
+ fragment list [ item over func('viewport', 'value_names') ];
+ fragment item [ string {""} ], { value => $_ };
};
1;
use Reaction::UI::WidgetClass;
class List, which {
- widget renders [ qw/list/ ];
- list renders [ item over func('viewport', 'value_names') ];
- item renders [ string {""} ], { value => $_ };
+ fragment widget [ qw/list/ ];
+ fragment list [ item over func('viewport', 'value_names') ];
+ fragment item [ string {""} ], { value => $_ };
};
1;
<form action="" method="post" enctype="multipart/form-data">
[% header %]
- [% fields %]
+ [% field_list %]
[% buttons %]
[% footer %]
</form>
<h2>Le Header</h2>
-=for layout fields
+=for layout field_list
<p> [% content %] </p>
[% content %]
<tr>
-=for layout fields
+=for layout field_list
[% content %]
<td>[% content %]</td>
-=cut
\ No newline at end of file
+=cut
=for layout widget
<tr>
- [% fields %]
- [% actions %]
+ [% field_list %]
+ [% actions %]
<tr>
-=for layout fields
+=for layout field_list
[% content %]
<td>[% content %]</td>
-=cut
\ No newline at end of file
+=cut
=for layout widget
- [% fields %]
+ [% field_list %]
-=for layout fields
+=for layout field_list
<p> [% content %] </p>