From fff7579c4333dc543b987f447b454772a8abe28f Mon Sep 17 00:00:00 2001 From: wreis Date: Fri, 31 Jul 2009 12:06:05 +0000 Subject: working example on ComponentUI --- lib/ComponentUI/Controller/TestModel/Bar.pm | 3 ++ share/skin/componentui/layout/bar/collection.tt | 51 +++++++++++++++++++++++++ share/skin/componentui/layout/bar/member.tt | 21 ++++++++++ 3 files changed, 75 insertions(+) create mode 100644 share/skin/componentui/layout/bar/collection.tt create mode 100644 share/skin/componentui/layout/bar/member.tt diff --git a/lib/ComponentUI/Controller/TestModel/Bar.pm b/lib/ComponentUI/Controller/TestModel/Bar.pm index 4859b7d..c649d78 100644 --- a/lib/ComponentUI/Controller/TestModel/Bar.pm +++ b/lib/ComponentUI/Controller/TestModel/Bar.pm @@ -12,6 +12,9 @@ __PACKAGE__->config( ViewPort => { enable_order_by => [qw/name foo published_at/], coerce_order_by => { foo => ['foo.last_name', 'foo.first_name'] }, + layout => 'bar/collection', + member_class => 'Reaction::UI::ViewPort::Object', + Member => { layout => 'bar/member' } } } }, diff --git a/share/skin/componentui/layout/bar/collection.tt b/share/skin/componentui/layout/bar/collection.tt new file mode 100644 index 0000000..9c8f5bd --- /dev/null +++ b/share/skin/componentui/layout/bar/collection.tt @@ -0,0 +1,51 @@ +=widget ListView + +=extends collection + +=for layout header + +[% pager_fragment %] + +=for layout footer + +[% pager_fragment %] + +[% actions %] + +=for layout actions + + + +=for layout action + +
  • [% call_next %]
  • + +=for layout pager + + + +=for layout numbered_page_this_page + +
  • [% page_number %]
  • + +=for layout numbered_page + +
  • [% page_number %]
  • + +=for layout named_page + +
  • [% page_name %]
  • + +=for layout named_page_no_page + +
  • [% page_name %]
  • + +=cut diff --git a/share/skin/componentui/layout/bar/member.tt b/share/skin/componentui/layout/bar/member.tt new file mode 100644 index 0000000..6d18c95 --- /dev/null +++ b/share/skin/componentui/layout/bar/member.tt @@ -0,0 +1,21 @@ +=widget Collection::Grid::Member::WithActions + +=for layout widget + +
    +
    + [% actions %] +
    + [% field_list %] +

    + +=for layout field +[% call_next %]
    + +=for layout action + + + [% call_next %] + + +=cut -- cgit v1.2.3-54-g00ecf