From 031152bc29ed553714716e4acb4f6fe8521ebf1f Mon Sep 17 00:00:00 2001 From: purge Date: Fri, 11 Sep 2009 09:51:11 +0000 Subject: make_immutable for new moose --- lib/Reaction/Class.pm | 2 ++ lib/Reaction/Object.pm | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/Reaction/Class.pm b/lib/Reaction/Class.pm index a57dcdf..9f61bbf 100644 --- a/lib/Reaction/Class.pm +++ b/lib/Reaction/Class.pm @@ -233,6 +233,8 @@ sub next_import { sub next_import_package { 'Moose' } +__PACKAGE__->meta->make_immutable; + 1; #---------#---------#---------#---------#---------#---------#---------#--------# diff --git a/lib/Reaction/Object.pm b/lib/Reaction/Object.pm index 7440bd3..de4c740 100644 --- a/lib/Reaction/Object.pm +++ b/lib/Reaction/Object.pm @@ -7,6 +7,8 @@ use Moose qw(extends); extends 'Moose::Object'; +__PACKAGE__->meta->make_immutable; + no Moose; 1; -- cgit v1.2.3 From 937a063b53e0f0c039e513dc14c4bb86ae742bd5 Mon Sep 17 00:00:00 2001 From: mateu Date: Sun, 13 Sep 2009 22:18:07 +0000 Subject: Bump version of SQL::Translator required for testing so t/im_dbic.t passes. --- Makefile.PL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.PL b/Makefile.PL index 705461c..f25c126 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -50,7 +50,7 @@ requires 'signatures' => '0.05'; test_requires 'Test::Class' => '0.31'; test_requires 'Test::WWW::Mechanize::Catalyst' => '0.51'; test_requires 'Test::Memory::Cycle' => '1.04'; -test_requires 'SQL::Translator' => '0.09004'; +test_requires 'SQL::Translator' => '0.11002'; install_share; -- cgit v1.2.3 From eb374b76229f7137a0ab70b4756bd68ee3ab331f Mon Sep 17 00:00:00 2001 From: wreis Date: Mon, 14 Sep 2009 17:35:30 +0000 Subject: fixed child_event_sinks for SearchableListViewContainer vp --- lib/Reaction/UI/ViewPort/SearchableListViewContainer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Reaction/UI/ViewPort/SearchableListViewContainer.pm b/lib/Reaction/UI/ViewPort/SearchableListViewContainer.pm index d83941b..4468275 100644 --- a/lib/Reaction/UI/ViewPort/SearchableListViewContainer.pm +++ b/lib/Reaction/UI/ViewPort/SearchableListViewContainer.pm @@ -74,7 +74,7 @@ override BUILDARGS => sub { }; override child_event_sinks => method () { - ((map $self->$_, 'listview', 'search_form'), super); + ((map $self->$_, 'search_form', 'listview'), super); }; 1; -- cgit v1.2.3 From a0ff2c8198d7cfcdefad1cbbaf339bd849a9c2c0 Mon Sep 17 00:00:00 2001 From: wreis Date: Mon, 14 Sep 2009 17:35:58 +0000 Subject: collection-grid already does Pager and Actions --- lib/Reaction/UI/ViewPort/ListViewWithSearch.pm | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/Reaction/UI/ViewPort/ListViewWithSearch.pm b/lib/Reaction/UI/ViewPort/ListViewWithSearch.pm index ee5f738..c199f7d 100644 --- a/lib/Reaction/UI/ViewPort/ListViewWithSearch.pm +++ b/lib/Reaction/UI/ViewPort/ListViewWithSearch.pm @@ -6,8 +6,6 @@ extends 'Reaction::UI::ViewPort::Collection::Grid'; with 'Reaction::UI::ViewPort::Collection::Role::UseSearchSpec'; with 'Reaction::UI::ViewPort::Collection::Role::Order'; -with 'Reaction::UI::ViewPort::Collection::Role::Pager'; -with 'Reaction::UI::ViewPort::Role::Actions'; __PACKAGE__->meta->make_immutable; -- cgit v1.2.3 From 13070d3447af4f02bee3e139744440c433755f6f Mon Sep 17 00:00:00 2001 From: edenc Date: Tue, 15 Sep 2009 03:51:37 +0000 Subject: added search spec sample to demo app --- lib/ComponentUI/Controller/TestModel/Foo.pm | 12 +++++++++++ .../TestModel/Foo/Action/SearchSpec/Update.pm | 15 ++++++++++++++ lib/ComponentUI/TestModel/Foo/SearchSpec.pm | 24 ++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 lib/ComponentUI/TestModel/Foo/Action/SearchSpec/Update.pm create mode 100644 lib/ComponentUI/TestModel/Foo/SearchSpec.pm diff --git a/lib/ComponentUI/Controller/TestModel/Foo.pm b/lib/ComponentUI/Controller/TestModel/Foo.pm index 917ea17..d636c6c 100644 --- a/lib/ComponentUI/Controller/TestModel/Foo.pm +++ b/lib/ComponentUI/Controller/TestModel/Foo.pm @@ -3,6 +3,10 @@ package ComponentUI::Controller::TestModel::Foo; use base 'Reaction::UI::Controller::Collection::CRUD'; use Reaction::Class; +use aliased 'Reaction::UI::ViewPort::SearchableListViewContainer'; +use aliased 'ComponentUI::TestModel::Foo::SearchSpec'; +use aliased 'ComponentUI::TestModel::Foo::Action::SearchSpec::Update'; + __PACKAGE__->config( model_name => 'TestModel', collection_name => 'Foo', @@ -49,10 +53,18 @@ for my $action (qw/view create update/){ ); } +override _build_action_viewport_map => sub { + my $map = super(); + $map->{list} = SearchableListViewContainer; + $map; +}; + sub _build_action_viewport_args { my $self = shift; my $args = $self->next::method(@_); $args->{list}{action_prototypes}{delete_all}{label} = 'Delete All Records'; + $args->{list}{spec_class} = SearchSpec; + $args->{list}{action_class} = Update; return $args; } diff --git a/lib/ComponentUI/TestModel/Foo/Action/SearchSpec/Update.pm b/lib/ComponentUI/TestModel/Foo/Action/SearchSpec/Update.pm new file mode 100644 index 0000000..97d2feb --- /dev/null +++ b/lib/ComponentUI/TestModel/Foo/Action/SearchSpec/Update.pm @@ -0,0 +1,15 @@ +package ComponentUI::TestModel::Foo::Action::SearchSpec::Update; +use Reaction::Class; +use namespace::autoclean; + +use MooseX::Types::Common::String qw/NonEmptySimpleStr/; + +extends 'Reaction::InterfaceModel::Action'; +with 'Reaction::InterfaceModel::Search::UpdateSpec'; + +has 'first_name' => (isa => NonEmptySimpleStr, is => 'rw', required => 0); +has 'last_name' => (isa => NonEmptySimpleStr, is => 'rw', required => 0); + +sub _reflection_info {{ normal => [qw/first_name last_name/] }} + +1; diff --git a/lib/ComponentUI/TestModel/Foo/SearchSpec.pm b/lib/ComponentUI/TestModel/Foo/SearchSpec.pm new file mode 100644 index 0000000..4664ec6 --- /dev/null +++ b/lib/ComponentUI/TestModel/Foo/SearchSpec.pm @@ -0,0 +1,24 @@ +package ComponentUI::TestModel::Foo::SearchSpec; +use Reaction::Class; +use namespace::autoclean; + +use MooseX::Types::Common::String qw/NonEmptySimpleStr/; + +with 'Reaction::InterfaceModel::Search::Spec'; + +has 'first_name' => (isa => NonEmptySimpleStr, is => 'rw', required => 0); +has 'last_name' => (isa => NonEmptySimpleStr, is => 'rw', required => 0); + +sub _build__search_spec { + my($self) = @_; + my %search; + $search{first_name} = $self->first_name if $self->has_first_name; + $search{last_name} = $self->last_name if $self->has_last_name; + return [\%search]; +} + +# no special packing/unpacking required for Foo +sub _to_string_pack_value { $_[1] } +sub _from_string_unpack_value { $_[1] } + +1; -- cgit v1.2.3 From 28d2d47d3d0780bf8a8841f6168cec263900ed8e Mon Sep 17 00:00:00 2001 From: wreis Date: Tue, 15 Sep 2009 15:36:30 +0000 Subject: no divs in base skin --- share/skin/base/layout/action.tt | 14 ++++++-------- share/skin/base/layout/collection.tt | 4 +--- share/skin/base/layout/field/array.tt | 4 +--- share/skin/base/layout/field/collection.tt | 4 +--- share/skin/base/layout/field/container.tt | 4 +--- share/skin/base/layout/field/mutable.tt | 2 +- share/skin/base/layout/field/mutable/choose_many.tt | 12 ++++-------- share/skin/default/layout/action.tt | 6 ++++++ share/skin/default/layout/field/array.tt | 6 ++++++ share/skin/default/layout/field/collection.tt | 6 ++++++ share/skin/default/layout/field/mutable.tt | 4 ++++ share/skin/default/layout/field/mutable/choose_many.tt | 11 +++++++---- 12 files changed, 44 insertions(+), 33 deletions(-) diff --git a/share/skin/base/layout/action.tt b/share/skin/base/layout/action.tt index b5cb708..dba41d0 100644 --- a/share/skin/base/layout/action.tt +++ b/share/skin/base/layout/action.tt @@ -1,13 +1,11 @@ =for layout widget -
-
- [% header %] - [% container_list %] - [% buttons %] - [% footer %] -
-
+
+ [% header %] + [% container_list %] + [% buttons %] + [% footer %] +
=for layout header diff --git a/share/skin/base/layout/collection.tt b/share/skin/base/layout/collection.tt index 6becfb1..da0cd2f 100644 --- a/share/skin/base/layout/collection.tt +++ b/share/skin/base/layout/collection.tt @@ -6,9 +6,7 @@ =for layout body -
- [% members %] -
+[% members %] =for layout footer diff --git a/share/skin/base/layout/field/array.tt b/share/skin/base/layout/field/array.tt index cd9c0c2..ac62db7 100644 --- a/share/skin/base/layout/field/array.tt +++ b/share/skin/base/layout/field/array.tt @@ -9,11 +9,9 @@ =for layout list -
    -[% content %] + [% content %]
-
=for layout item diff --git a/share/skin/base/layout/field/collection.tt b/share/skin/base/layout/field/collection.tt index 2203344..1f6ae9e 100644 --- a/share/skin/base/layout/field/collection.tt +++ b/share/skin/base/layout/field/collection.tt @@ -9,11 +9,9 @@ =for layout list -
    -[% call_next %] + [% call_next %]
-
=for layout item diff --git a/share/skin/base/layout/field/container.tt b/share/skin/base/layout/field/container.tt index c504e55..d9e0ced 100644 --- a/share/skin/base/layout/field/container.tt +++ b/share/skin/base/layout/field/container.tt @@ -11,8 +11,6 @@ =for layout field -
- [% call_next %] -
+[% call_next %] =cut diff --git a/share/skin/base/layout/field/mutable.tt b/share/skin/base/layout/field/mutable.tt index d21e979..333a27a 100644 --- a/share/skin/base/layout/field/mutable.tt +++ b/share/skin/base/layout/field/mutable.tt @@ -1,6 +1,6 @@ =for layout widget -
[% label_fragment %] [% field %] [% message_fragment %]
+[% label_fragment %] [% field %] [% message_fragment %] =for layout label diff --git a/share/skin/base/layout/field/mutable/choose_many.tt b/share/skin/base/layout/field/mutable/choose_many.tt index 51f315e..9d19fff 100644 --- a/share/skin/base/layout/field/mutable/choose_many.tt +++ b/share/skin/base/layout/field/mutable/choose_many.tt @@ -8,7 +8,6 @@ =for layout field -
@@ -19,7 +18,6 @@
[% available_values %]
-
=for layout available_values @@ -43,12 +41,10 @@ =for layout action_buttons -
- - - - -
+ + + + =for layout message diff --git a/share/skin/default/layout/action.tt b/share/skin/default/layout/action.tt index a18e51d..e1b003f 100644 --- a/share/skin/default/layout/action.tt +++ b/share/skin/default/layout/action.tt @@ -1,5 +1,11 @@ =extends NEXT +=for layout widget + +
+ [% call_next %] +
+ =for layout container [% call_next %]
diff --git a/share/skin/default/layout/field/array.tt b/share/skin/default/layout/field/array.tt index acb2cce..60c86b1 100644 --- a/share/skin/default/layout/field/array.tt +++ b/share/skin/default/layout/field/array.tt @@ -4,4 +4,10 @@ [% content | html %]: +=for layout list + +
+ [% call_next %] +
+ =cut diff --git a/share/skin/default/layout/field/collection.tt b/share/skin/default/layout/field/collection.tt index f513e94..16789bf 100644 --- a/share/skin/default/layout/field/collection.tt +++ b/share/skin/default/layout/field/collection.tt @@ -4,4 +4,10 @@ [% label %]: +=for layout list + +
+ [% call_next %] +
+ =cut diff --git a/share/skin/default/layout/field/mutable.tt b/share/skin/default/layout/field/mutable.tt index 615e14e..ec10a4c 100644 --- a/share/skin/default/layout/field/mutable.tt +++ b/share/skin/default/layout/field/mutable.tt @@ -1,5 +1,9 @@ =extends NEXT +=for layout widget + +
[% call_next %]
+ =for layout message [% call_next %]
diff --git a/share/skin/default/layout/field/mutable/choose_many.tt b/share/skin/default/layout/field/mutable/choose_many.tt index e01a1ba..117f39e 100644 --- a/share/skin/default/layout/field/mutable/choose_many.tt +++ b/share/skin/default/layout/field/mutable/choose_many.tt @@ -6,13 +6,16 @@ [% message_fragment %] [% field %] +=for layout field + +
+ [% call_next %] +
+ =for layout action_buttons
-
-
-
-
+ [% call_next %]
=cut -- cgit v1.2.3 From a841aae8c18238dc34d87e5eda150ab2f0770475 Mon Sep 17 00:00:00 2001 From: purge Date: Thu, 17 Sep 2009 14:21:58 +0000 Subject: pass through layout_args to actions --- lib/Reaction/UI/ViewPort/Role/Actions.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Reaction/UI/ViewPort/Role/Actions.pm b/lib/Reaction/UI/ViewPort/Role/Actions.pm index 32c7bbb..89b5ae3 100644 --- a/lib/Reaction/UI/ViewPort/Role/Actions.pm +++ b/lib/Reaction/UI/ViewPort/Role/Actions.pm @@ -62,12 +62,14 @@ sub _build_actions { my $uri = $proto->{uri} or confess('uri is required in prototype action'); my $label = exists $proto->{label} ? $proto->{label} : $proto_name; my $layout = exists $proto->{layout} ? $proto->{layout} : 'uri'; + my $layout_args = exists $proto->{layout_args} ? $proto->{layout_args} : {}; my $action = Reaction::UI::ViewPort::URI->new( location => join ('-', $loc, 'action', $i++), uri => ( ref($uri) eq 'CODE' ? $uri->($target, $ctx) : $uri ), display => ( ref($label) eq 'CODE' ? $label->($target, $ctx) : $label ), layout => ( ref($layout) eq 'CODE' ? $layout->($target, $ctx) : $layout ), + layout_args => ( ref($layout_args) eq 'CODE' ? $layout_args->($target, $ctx) : $layout_args ), ); push(@act, $action); } -- cgit v1.2.3 From 987fc6e26baea18fa0c3c48fb1208c5c350a4bc1 Mon Sep 17 00:00:00 2001 From: edenc Date: Thu, 17 Sep 2009 18:14:04 +0000 Subject: compatibility fixes for Class::MOP 0.93 --- lib/Reaction/UI/Controller.pm | 3 ++- lib/Reaction/UI/Skin.pm | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Reaction/UI/Controller.pm b/lib/Reaction/UI/Controller.pm index 8ed781f..2d1b843 100644 --- a/lib/Reaction/UI/Controller.pm +++ b/lib/Reaction/UI/Controller.pm @@ -11,7 +11,8 @@ with 'Catalyst::Component::InstancePerContext'; sub build_per_context_instance { my ($self, $c, @args) = @_; - my $newself = $self->new($self->_application, {%$self, context => $c, @args}); + my $class = ref($self) || $self; + my $newself = $class->new($self->_application, {%$self, context => $c, @args}); return $newself; } diff --git a/lib/Reaction/UI/Skin.pm b/lib/Reaction/UI/Skin.pm index 237279d..0683258 100644 --- a/lib/Reaction/UI/Skin.pm +++ b/lib/Reaction/UI/Skin.pm @@ -71,6 +71,7 @@ sub _find_skin_dir { }; sub _load_skin_config { my ($self, $args) = @_; + my $class = ref($self) || $self; my $base = $self->skin_dir; my $lst = sub { (ref $_[0] eq 'ARRAY') ? $_[0] : [$_[0]] }; my @files = ( @@ -84,7 +85,7 @@ sub _load_skin_config { })} ); if (my $super_name = $cfg{extends}) { - my $super = $self->new( + my $super = $class->new( name => $super_name, view => $self->view, skin_base_dir => $args->{skin_base_dir}, -- cgit v1.2.3