aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction
diff options
context:
space:
mode:
authorgroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-01-02 18:49:19 +0000
committergroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-01-02 18:49:19 +0000
commitc8fbb8ad6185f3f14717138aaf8bb95d6b2d27b2 (patch)
tree03f004e2e8b59e5b809444d323c48b4b9c7221fd /lib/Reaction
parent2f670e13aa8f30bbf6ba910f2d8ef97aa8a9e3e5 (diff)
downloadreaction-c8fbb8ad6185f3f14717138aaf8bb95d6b2d27b2.tar.gz
reaction-c8fbb8ad6185f3f14717138aaf8bb95d6b2d27b2.zip
work in progress, listview still broken
Diffstat (limited to 'lib/Reaction')
-rw-r--r--lib/Reaction/InterfaceModel/Collection.pm2
-rw-r--r--lib/Reaction/InterfaceModel/Collection/DBIC/Role/Base.pm22
-rw-r--r--lib/Reaction/InterfaceModel/Collection/DBIC/Role/Where.pm4
-rw-r--r--lib/Reaction/InterfaceModel/Reflector/DBIC.pm2
-rw-r--r--lib/Reaction/UI/Controller/Collection.pm6
-rw-r--r--lib/Reaction/UI/Controller/Collection/CRUD.pm8
-rw-r--r--lib/Reaction/UI/LayoutSet.pm1
-rw-r--r--lib/Reaction/UI/ViewPort/Action.pm3
-rw-r--r--lib/Reaction/UI/ViewPort/Action/Link.pm2
-rw-r--r--lib/Reaction/UI/ViewPort/Collection.pm11
-rw-r--r--lib/Reaction/UI/ViewPort/Collection/Grid.pm5
-rw-r--r--lib/Reaction/UI/ViewPort/Collection/Grid/Member.pm4
-rw-r--r--lib/Reaction/UI/ViewPort/Field/Mutable/Array.pm2
-rw-r--r--lib/Reaction/UI/ViewPort/Field/Mutable/ChooseOne.pm4
-rw-r--r--lib/Reaction/UI/ViewPort/Field/Mutable/DateTime.pm7
-rw-r--r--lib/Reaction/UI/ViewPort/Field/Mutable/Number.pm2
-rw-r--r--lib/Reaction/UI/ViewPort/Field/Role/Choices.pm2
-rw-r--r--lib/Reaction/UI/ViewPort/Field/Role/Mutable.pm4
-rw-r--r--lib/Reaction/UI/ViewPort/ListView.pm14
-rw-r--r--lib/Reaction/UI/ViewPort/Object.pm8
-rw-r--r--lib/Reaction/UI/ViewPort/Role/Actions.pm5
-rw-r--r--lib/Reaction/UI/Widget/Field/Array.pm (renamed from lib/Reaction/UI/Widget/Field/List.pm)6
-rw-r--r--lib/Reaction/UI/Widget/ListView.pm2
23 files changed, 66 insertions, 60 deletions
diff --git a/lib/Reaction/InterfaceModel/Collection.pm b/lib/Reaction/InterfaceModel/Collection.pm
index 9b962bd..068e1c0 100644
--- a/lib/Reaction/InterfaceModel/Collection.pm
+++ b/lib/Reaction/InterfaceModel/Collection.pm
@@ -33,6 +33,8 @@ class Collection is "Reaction::InterfaceModel::Object", which {
metaclass => DomainModelAttribute,
);
+ has 'member_type' => (is => 'ro', isa => 'ClassName');
+
implements _build__collection_store => as { [] };
implements members => as {
diff --git a/lib/Reaction/InterfaceModel/Collection/DBIC/Role/Base.pm b/lib/Reaction/InterfaceModel/Collection/DBIC/Role/Base.pm
index ee32997..b2a0685 100644
--- a/lib/Reaction/InterfaceModel/Collection/DBIC/Role/Base.pm
+++ b/lib/Reaction/InterfaceModel/Collection/DBIC/Role/Base.pm
@@ -14,11 +14,8 @@ role Base, which {
isa => 'DBIx::Class::ResultSet',
);
- has '_im_class' => (
- is => 'ro',
- isa => 'Str',
- lazy_build => 1,
- );
+ has 'member_type' => (is => 'ro', isa => 'ClassName', lazy_build => 1);
+
#implements BUILD => as {
# my $self = shift;
@@ -29,8 +26,10 @@ role Base, which {
# unless $self->_im_class->can("inflate_result");
#};
+
+
#Oh man. I have a bad feeling about this one.
- implements _build__im_class => as {
+ implements _build_member_type => as {
my $self = shift;
my $class = blessed($self) || $self;
$class =~ s/::Collection$//;
@@ -39,8 +38,7 @@ role Base, which {
implements _build__collection_store => as {
my $self = shift;
- my $im_class = $self->_im_class;
- [ $self->_source_resultset->search({}, {result_class => $im_class})->all ];
+ [ $self->_source_resultset->search({}, {result_class => $self->member_type})->all ];
};
implements clone => as {
@@ -49,7 +47,7 @@ role Base, which {
#should the clone include the arrayref of IM::Objects too?
return (blessed $self)->new(
_source_resultset => $rs,
- _im_class => $self->_im_class, @_
+ member_type => $self->member_type, @_
);
};
@@ -72,7 +70,7 @@ role Base, which {
my $rs = $self->_source_resultset->page(@_);
return (blessed $self)->new(
_source_resultset => $rs,
- _im_class => $self->_im_class,
+ member_type => $self->member_type,
);
};
@@ -101,10 +99,10 @@ Provides methods to allow a collection to be populated by a L<DBIx::Class::Resul
Required, Read-only. Contains the L<DBIx::Class::ResultSet> used to populate the
collection.
-=head2 _im_class
+=head2 member_type
Read-only, lazy_build. The name of the IM Object Class that the resultset inside this
-collection will inflate to. Predicate: C<_has_im_class>
+collection will inflate to. Predicate: C<has_member_type>
=head1 METHODS
diff --git a/lib/Reaction/InterfaceModel/Collection/DBIC/Role/Where.pm b/lib/Reaction/InterfaceModel/Collection/DBIC/Role/Where.pm
index 1faaa73..c5459ae 100644
--- a/lib/Reaction/InterfaceModel/Collection/DBIC/Role/Where.pm
+++ b/lib/Reaction/InterfaceModel/Collection/DBIC/Role/Where.pm
@@ -11,7 +11,7 @@ role Where, which {
my $rs = $self->_source_resultset->search_rs(@_);
return (blessed $self)->new(
_source_resultset => $rs,
- _im_class => $self->_im_class
+ member_type => $self->member_type
);
};
@@ -27,7 +27,7 @@ role Where, which {
implements find => as {
my $self = shift;
$self->_source_resultset
- ->search({},{result_class => $self->_im_class})
+ ->search({},{result_class => $self->member_type})
->find(@_);
};
};
diff --git a/lib/Reaction/InterfaceModel/Reflector/DBIC.pm b/lib/Reaction/InterfaceModel/Reflector/DBIC.pm
index 8df719b..c602e83 100644
--- a/lib/Reaction/InterfaceModel/Reflector/DBIC.pm
+++ b/lib/Reaction/InterfaceModel/Reflector/DBIC.pm
@@ -380,7 +380,7 @@ class DBIC, which {
my $make_immutable = $meta->is_immutable || $self->make_classes_immutable;;
$meta->make_mutable if $meta->is_immutable;
- $meta->add_method(_build__im_class => sub{ $object } );
+ $meta->add_method(_build_member_type => sub{ $object } );
#XXX as a default pass the domain model as a target_model until i come up with something
#better through the coercion method
my $def_act_args = sub {
diff --git a/lib/Reaction/UI/Controller/Collection.pm b/lib/Reaction/UI/Controller/Collection.pm
index d7d727b..2aff23e 100644
--- a/lib/Reaction/UI/Controller/Collection.pm
+++ b/lib/Reaction/UI/Controller/Collection.pm
@@ -6,7 +6,7 @@ use base 'Reaction::UI::Controller';
use Reaction::Class;
use aliased 'Reaction::UI::ViewPort::ListView';
-use aliased 'Reaction::UI::ViewPort::ObjectView';
+use aliased 'Reaction::UI::ViewPort::Object';
has 'model_name' => (isa => 'Str', is => 'rw', required => 1);
has 'collection_name' => (isa => 'Str', is => 'rw', required => 1);
@@ -17,7 +17,7 @@ has action_viewport_args => (isa => 'HashRef', is => 'rw', lazy_build => 1);
sub _build_action_viewport_map {
return {
list => ListView,
- view => ObjectView,
+ view => Object,
};
}
@@ -52,7 +52,7 @@ sub object :Chained('base') :PathPart('id') :CaptureArgs(1) {
sub view :Chained('object') :Args(0) {
my ($self, $c) = @_;
my $object :Stashed;
- $c->forward(basic_page => [{object => $object}]);
+ $c->forward(basic_page => [{model => $object}]);
}
sub basic_page : Private {
diff --git a/lib/Reaction/UI/Controller/Collection/CRUD.pm b/lib/Reaction/UI/Controller/Collection/CRUD.pm
index 8a2dcd0..3d04c1f 100644
--- a/lib/Reaction/UI/Controller/Collection/CRUD.pm
+++ b/lib/Reaction/UI/Controller/Collection/CRUD.pm
@@ -5,11 +5,11 @@ use warnings;
use base 'Reaction::UI::Controller::Collection';
use Reaction::Class;
-use aliased 'Reaction::UI::ViewPort::ActionForm';
+use aliased 'Reaction::UI::ViewPort::Action';
sub _build_action_viewport_map {
my $map = shift->next::method(@_);
- map{ $map->{$_} = ActionForm } qw/create update delete delete_all/;
+ map{ $map->{$_} = Action } qw/create update delete delete_all/;
return $map;
}
@@ -22,7 +22,7 @@ sub _build_action_viewport_args {
{ label => 'Delete all', action => sub {
[ '', 'delete_all', $_[1]->req->captures ] } },
],
- Entity =>
+ Member =>
{ action_prototypes =>
[ { label => 'View', action => sub {
[ '', 'view', [ @{$_[1]->req->captures}, $_[0]->__id ] ] } },
@@ -102,7 +102,7 @@ sub basic_model_action :Private {
return $self->push_viewport
(
$self->action_viewport_map->{$cat_action_name},
- action => $self->get_model_action($c, $im_action_name, $target),
+ model => $self->get_model_action($c, $im_action_name, $target),
%{ $vp_args || {} },
%{ $self->action_viewport_args->{$cat_action_name} || {} },
);
diff --git a/lib/Reaction/UI/LayoutSet.pm b/lib/Reaction/UI/LayoutSet.pm
index 4a9c533..da4ecdc 100644
--- a/lib/Reaction/UI/LayoutSet.pm
+++ b/lib/Reaction/UI/LayoutSet.pm
@@ -78,7 +78,6 @@ class LayoutSet which {
# doesn't have the match pos go past the latter = and lose name2
while ($data =~ m/=(.*?)\n(.*?)(?:\n(?==)|$)/sg) {
my ($data, $text) = ($1, $2);
-
if ($data =~ /^for layout (\S+)/) {
my $fname = $1;
$layouts->{$fname} = $text;
diff --git a/lib/Reaction/UI/ViewPort/Action.pm b/lib/Reaction/UI/ViewPort/Action.pm
index e7a21a5..9da7191 100644
--- a/lib/Reaction/UI/ViewPort/Action.pm
+++ b/lib/Reaction/UI/ViewPort/Action.pm
@@ -17,7 +17,8 @@ use aliased 'Reaction::UI::ViewPort::Field::Mutable::ChooseMany';
#use aliased 'Reaction::UI::ViewPort::InterfaceModel::Field::Mutable::TimeRange';
class Action is 'Reaction::UI::ViewPort::Object', which {
- has '+model' => (isa => 'Reaction::InterfaceModel::Action');
+ has model => (is => 'ro', isa => 'Reaction::InterfaceModel::Action', required => 1);
+ #has '+model' => (isa => 'Reaction::InterfaceModel::Action');
has next_action => (is => 'rw', isa => 'ArrayRef');
has on_apply_callback => (is => 'rw', isa => 'CodeRef');
diff --git a/lib/Reaction/UI/ViewPort/Action/Link.pm b/lib/Reaction/UI/ViewPort/Action/Link.pm
index 314c6a3..8bc8da8 100644
--- a/lib/Reaction/UI/ViewPort/Action/Link.pm
+++ b/lib/Reaction/UI/ViewPort/Action/Link.pm
@@ -1,4 +1,4 @@
-package Reaction::UI::ViewPort::InterfaceModel::Action::Link;
+package Reaction::UI::ViewPort::Action::Link;
use Reaction::Class;
diff --git a/lib/Reaction/UI/ViewPort/Collection.pm b/lib/Reaction/UI/ViewPort/Collection.pm
index c728f8e..a260bd7 100644
--- a/lib/Reaction/UI/ViewPort/Collection.pm
+++ b/lib/Reaction/UI/ViewPort/Collection.pm
@@ -17,21 +17,24 @@ class Collection is 'Reaction::UI::ViewPort', which {
implements BUILD => as {
my ($self, $args) = @_;
- my $entity_args = delete $args->{Member};
+ my $member_args = delete $args->{Member};
$self->member_args( $member_args ) if ref $member_args;
};
+ implements _build_member_args => as{ {} };
+
implements _build_member_class => as{ Object };
after clear_current_collection => sub{
- shift->clear_entities; #clear the entitiesis the current collection changes, duh
+ shift->clear_members; #clear the members the current collection changes, duh
};
implements _build_current_collection => as {
shift->collection;
};
- implements model
+ #I'm not really sure why this is here all of a sudden.
+ implements model => as { shift->current_collection };
implements _build_members => as {
my ($self) = @_;
@@ -50,7 +53,7 @@ class Collection is 'Reaction::UI::ViewPort', which {
my $builder_cache = $builders->{$type} ||= {};
my $member = $class->new(
ctx => $ctx,
- object => $obj,
+ model => $obj,
location => join('-', $loc, $i++),
builder_cache => $builder_cache,
%$args
diff --git a/lib/Reaction/UI/ViewPort/Collection/Grid.pm b/lib/Reaction/UI/ViewPort/Collection/Grid.pm
index 3314039..bc81a0c 100644
--- a/lib/Reaction/UI/ViewPort/Collection/Grid.pm
+++ b/lib/Reaction/UI/ViewPort/Collection/Grid.pm
@@ -25,13 +25,16 @@ class Grid is 'Reaction::UI::ViewPort::Collection', which {
return \%labels;
};
+ implements _build_field_order => as { []; };
+ implements _build_excluded_fields => as { []; };
+
implements _build_ordered_fields => as {
my ($self) = @_;
confess("current_collection lacks a value for 'member_type' attribute")
unless $self->current_collection->has_member_type;
my %excluded = map { $_ => undef } @{ $self->excluded_fields };
#treat _$field_name as private and exclude fields with no reader
- my @names = grep { $_ !~ /^_/ && !exists($exclude{$_})} map { $_->name }
+ my @names = grep { $_ !~ /^_/ && !exists($excluded{$_})} map { $_->name }
grep { defined $_->get_read_method }
$self->current_collection->member_type->meta->parameter_attributes;
return $self->sort_by_spec($self->field_order, \@names);
diff --git a/lib/Reaction/UI/ViewPort/Collection/Grid/Member.pm b/lib/Reaction/UI/ViewPort/Collection/Grid/Member.pm
index 0aa5e1d..c37e10e 100644
--- a/lib/Reaction/UI/ViewPort/Collection/Grid/Member.pm
+++ b/lib/Reaction/UI/ViewPort/Collection/Grid/Member.pm
@@ -2,7 +2,7 @@ package Reaction::UI::ViewPort::Collection::Grid::Member;
use Reaction::Class;
-Class Member is 'Reaction::UI::ViewPort::Object', which {
+class Member is 'Reaction::UI::ViewPort::Object', which {
around _build_fields_for_type_Num => sub {
$_[0]->(@_[1..3], { layout => 'value/number', %{ $_[4] } })
@@ -41,3 +41,5 @@ Class Member is 'Reaction::UI::ViewPort::Object', which {
around _build_fields_for_type_Reaction_InterfaceModel_Collection => sub { return };
};
+
+1;
diff --git a/lib/Reaction/UI/ViewPort/Field/Mutable/Array.pm b/lib/Reaction/UI/ViewPort/Field/Mutable/Array.pm
index 7fa3118..49e629b 100644
--- a/lib/Reaction/UI/ViewPort/Field/Mutable/Array.pm
+++ b/lib/Reaction/UI/ViewPort/Field/Mutable/Array.pm
@@ -9,7 +9,7 @@ class Array is 'Reaction::UI::ViewPort::Field::Array', which {
my $orig = shift;
my $self = shift;
return $orig->($self) unless @_;
- my $value = defined $_[0] ? $_[0] || [];
+ my $value = defined $_[0] ? $_[0] : [];
$orig->($self, (ref $value eq 'ARRAY' ? $value : [ $value ]));
$self->sync_to_action;
};
diff --git a/lib/Reaction/UI/ViewPort/Field/Mutable/ChooseOne.pm b/lib/Reaction/UI/ViewPort/Field/Mutable/ChooseOne.pm
index 3ab97b6..12d6d11 100644
--- a/lib/Reaction/UI/ViewPort/Field/Mutable/ChooseOne.pm
+++ b/lib/Reaction/UI/ViewPort/Field/Mutable/ChooseOne.pm
@@ -4,8 +4,8 @@ use Reaction::Class;
class ChooseOne is 'Reaction::UI::ViewPort::Field', which {
- does 'Reaction::UI::ViewPort::Object::Field::Role::Mutable';
- does 'Reaction::UI::ViewPort::Object::Field::Role::Choices';
+ does 'Reaction::UI::ViewPort::Field::Role::Mutable';
+ does 'Reaction::UI::ViewPort::Field::Role::Choices';
around value => sub {
my $orig = shift;
diff --git a/lib/Reaction/UI/ViewPort/Field/Mutable/DateTime.pm b/lib/Reaction/UI/ViewPort/Field/Mutable/DateTime.pm
index f792e5c..4950aa1 100644
--- a/lib/Reaction/UI/ViewPort/Field/Mutable/DateTime.pm
+++ b/lib/Reaction/UI/ViewPort/Field/Mutable/DateTime.pm
@@ -4,8 +4,7 @@ use Reaction::Class;
use Time::ParseDate;
use DateTime;
-class 'Reaction::UI::ViewPort::Field::Mutable::DateTime'
- is 'Reaction::UI::ViewPort::Field::DateTime', which {
+class 'Reaction::UI::ViewPort::Field::Mutable::DateTime', is 'Reaction::UI::ViewPort::Field::DateTime', which {
does 'Reaction::UI::ViewPort::Field::Role::Mutable';
@@ -26,9 +25,7 @@ class 'Reaction::UI::ViewPort::Field::Mutable::DateTime'
}
};
- override accept_events => sub {
- ('value_string', super());
- };
+ around accept_events => sub { ('value_string', shift->(@_)) };
};
diff --git a/lib/Reaction/UI/ViewPort/Field/Mutable/Number.pm b/lib/Reaction/UI/ViewPort/Field/Mutable/Number.pm
index d52121b..41308f3 100644
--- a/lib/Reaction/UI/ViewPort/Field/Mutable/Number.pm
+++ b/lib/Reaction/UI/ViewPort/Field/Mutable/Number.pm
@@ -2,7 +2,7 @@ package Reaction::UI::ViewPort::Field::Mutable::Number;
use Reaction::Class;
-class Number 'Reaction::UI::ViewPort::Field::Number', which {
+class Number is 'Reaction::UI::ViewPort::Field::Number', which {
does 'Reaction::UI::ViewPort::Field::Role::Mutable';
};
diff --git a/lib/Reaction/UI/ViewPort/Field/Role/Choices.pm b/lib/Reaction/UI/ViewPort/Field/Role/Choices.pm
index db1c3af..326dc54 100644
--- a/lib/Reaction/UI/ViewPort/Field/Role/Choices.pm
+++ b/lib/Reaction/UI/ViewPort/Field/Role/Choices.pm
@@ -1,6 +1,6 @@
package Reaction::UI::ViewPort::Field::Role::Choices;
-use Reaction::Class;
+use Reaction::Role;
use URI;
use Scalar::Util 'blessed';
diff --git a/lib/Reaction/UI/ViewPort/Field/Role/Mutable.pm b/lib/Reaction/UI/ViewPort/Field/Role/Mutable.pm
index 62191ca..db6c4f3 100644
--- a/lib/Reaction/UI/ViewPort/Field/Role/Mutable.pm
+++ b/lib/Reaction/UI/ViewPort/Field/Role/Mutable.pm
@@ -1,5 +1,7 @@
package Reaction::UI::ViewPort::Field::Role::Mutable;
+use Reaction::Role;
+
use aliased 'Reaction::InterfaceModel::Action';
use aliased 'Reaction::Meta::InterfaceModel::Action::ParameterAttribute';
@@ -44,3 +46,5 @@ role Mutable, which {
around accept_events => sub { ('value', shift->(@_)) };
};
+
+1;
diff --git a/lib/Reaction/UI/ViewPort/ListView.pm b/lib/Reaction/UI/ViewPort/ListView.pm
index 5d90c76..1c2247d 100644
--- a/lib/Reaction/UI/ViewPort/ListView.pm
+++ b/lib/Reaction/UI/ViewPort/ListView.pm
@@ -1,24 +1,24 @@
package Reaction::UI::ViewPort::ListView;
use Reaction::Class;
-use aliased 'Reaction::UI::ViewPort::GridView::Entity::WithActions';
+use aliased 'Reaction::UI::ViewPort::Collection::Grid::Member::WithActions';
-class ListView is 'Reaction::UI::ViewPort::GridView', which {
+class ListView is 'Reaction::UI::ViewPort::Collection::Grid', which {
- does 'Reaction::UI::ViewPort::GridView::Role::Order';
- does 'Reaction::UI::ViewPort::GridView::Role::Pager';
- does 'Reaction::UI::ViewPort::GridView::Role::Actions';
+ does 'Reaction::UI::ViewPort::Collection::Role::Order';
+ does 'Reaction::UI::ViewPort::Collection::Role::Pager';
+ does 'Reaction::UI::ViewPort::Role::Actions';
#If I decide that object actions and collection actions should be
#lumped together i oculd move these into the collection action role
#ooor we could create a third role that does this, but gah, no?
- implements _build_entity_class => as { WithActions };
+ implements _build_member_class => as { WithActions };
#You'se has to goes aways. sorry.
#if i saved the args as an attribute i could probably get around this....
implements object_action_count => as {
my $self = shift;
- for ( @{ $self->entities } ) {
+ for ( @{ $self->members } ) {
#pickup here, and of to the widget for listview
return scalar @{ $_->action_prototypes };
}
diff --git a/lib/Reaction/UI/ViewPort/Object.pm b/lib/Reaction/UI/ViewPort/Object.pm
index d7a70c1..8a40fbf 100644
--- a/lib/Reaction/UI/ViewPort/Object.pm
+++ b/lib/Reaction/UI/ViewPort/Object.pm
@@ -9,7 +9,7 @@ use aliased 'Reaction::UI::ViewPort::Field::Boolean';
use aliased 'Reaction::UI::ViewPort::Field::String';
use aliased 'Reaction::UI::ViewPort::Field::DateTime';
use aliased 'Reaction::UI::ViewPort::Field::RelatedObject';
-use aliased 'Reaction::UI::ViewPort::Field::List';
+use aliased 'Reaction::UI::ViewPort::Field::Array';
use aliased 'Reaction::UI::ViewPort::Field::Collection';
use aliased 'Reaction::InterfaceModel::Object' => 'IM_Object';
@@ -48,14 +48,14 @@ class Object is 'Reaction::UI::ViewPort', which {
my $field = $self->$meth($obj, $attr, ($args->{$field_name} || {}));
push(@fields, $field) if $field;
}
- return \@field;
+ return \@fields;
};
implements _build_ordered_fields => as {
my ($self) = @_;
my %excluded = map { $_ => undef } @{ $self->excluded_fields };
#treat _$field_name as private and exclude fields with no reader
- my @names = grep { $_ !~ /^_/ && !exists($exclude{$_})} map { $_->name }
+ my @names = grep { $_ !~ /^_/ && !exists($excluded{$_})} map { $_->name }
grep { defined $_->get_read_method } $self->model->meta->parameter_attributes;
return $self->sort_by_spec($self->field_order, \@names);
};
@@ -164,7 +164,7 @@ class Object is 'Reaction::UI::ViewPort', which {
implements _build_fields_for_type_ArrayRef => as {
my ($self, $attr, $args) = @_;
- $self->_build_simple_field(attribute => $attr, class => List, %$args);
+ $self->_build_simple_field(attribute => $attr, class => Array, %$args);
};
implements _build_fields_for_type_Reaction_InterfaceModel_Object => as {
diff --git a/lib/Reaction/UI/ViewPort/Role/Actions.pm b/lib/Reaction/UI/ViewPort/Role/Actions.pm
index d7641be..9c99077 100644
--- a/lib/Reaction/UI/ViewPort/Role/Actions.pm
+++ b/lib/Reaction/UI/ViewPort/Role/Actions.pm
@@ -13,15 +13,12 @@ role Actions, which {
my ($self) = @_;
my (@act, $i);
my $ctx = $self->ctx;
- #if i could abstract this vs ->object for row we could eliminate the entity
- #version of this role and just use one for both things. that would be cool.
- my $obj = $self->current_collection;
my $loc = $self->location;
foreach my $proto (@{ $self->action_prototypes }) {
my $action = Reaction::UI::ViewPort::Action::Link->new
(
ctx => $ctx,
- target => $obj,
+ target => $self->model,
location => join ('-', $loc, 'action', $i++),
%$proto,
);
diff --git a/lib/Reaction/UI/Widget/Field/List.pm b/lib/Reaction/UI/Widget/Field/Array.pm
index 57f9d92..cf318c9 100644
--- a/lib/Reaction/UI/Widget/Field/List.pm
+++ b/lib/Reaction/UI/Widget/Field/Array.pm
@@ -1,8 +1,8 @@
-package Reaction::UI::Widget::Field::List;
+package Reaction::UI::Widget::Field::Array;
use Reaction::UI::WidgetClass;
-class List, which {
+class Array, which {
before fragment widget {
arg 'label' => $_{viewport}->label;
@@ -24,7 +24,7 @@ __END__;
=head1 NAME
-Reaction::UI::Widget::DisplayField::List
+Reaction::UI::Widget::DisplayField::Array
=head1 DESCRIPTION
diff --git a/lib/Reaction/UI/Widget/ListView.pm b/lib/Reaction/UI/Widget/ListView.pm
index cfd8028..be6fc6c 100644
--- a/lib/Reaction/UI/Widget/ListView.pm
+++ b/lib/Reaction/UI/Widget/ListView.pm
@@ -2,7 +2,7 @@ package Reaction::UI::Widget::ListView;
use Reaction::UI::WidgetClass;
-class ListView is 'Reaction::UI::Widget::GridView', which {
+class ListView is 'Reaction::UI::Widget::Collection::Grid', which {
after fragment widget {
arg pager_obj => $_{viewport}->pager;