From ccf94c5dca76b164beeba398d4c493018a9b535b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 29 Sep 2016 14:00:09 +0200 Subject: [PATCH] Actionbar Layout mock --- SL/Layout/ActionBar.pm | 114 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 SL/Layout/ActionBar.pm diff --git a/SL/Layout/ActionBar.pm b/SL/Layout/ActionBar.pm new file mode 100644 index 000000000..3d9e4093a --- /dev/null +++ b/SL/Layout/ActionBar.pm @@ -0,0 +1,114 @@ +package SL::Layout::ActionBar; + +use strict; +use parent qw(SL::Layout::Base); + +use constant HTML_CLASS => 'layout-actionbar'; + +use Rose::Object::MakeMethods::Generic ( + 'scalar --get_set_init' => [ qw(actions) ], +); + + +###### Layout overrides + +sub pre_content { + $::request->presenter->html_tag('div', '', class => HTML_CLASS); +} + +sub inline_javascript { + # data for bar +} + +sub javascripts { + +} + +###### interface + +sub add_actions { + my ($self, @actions) = @_; + push @{ $self->actions }, @actions; +} + +sub init_actions { + [] +} + + + + +1; + +__END__ + +=encoding utf-8 + +=head1 NAME + +SL::Layout::ActionBar - Unified action buttons for controllers + +=head1 CONCEPT + +This is a layout block that does a unified action bar for any controller who +wants to use it. It's designed to be rendered above the content and to be +fixed when scrolling. + +While it can be used as a generic widget container, it's designed to be able to +provide commonly used functionality as a short cut. These shortcuts include: + +=over 4 + +=item * + +Calling a controller with parameters + +=item * + +Submitting a form with added parameters + +=item * + +Arrangement utility + +=back + + +=head1 METHODS + +=over 4 + +=item C + +Dispatches each each argument to C + +=item C + + +=item C + +=item Clayout->actionbar + +=head1 DOM MODEL + +The entire block is rendered into a div with the class 'layout-actionbar'. + +=head1 ACTION WIDGETS + +Each individual action must be an instance of C. + +=head1 BUGS + +none yet. :) + +=head1 AUTHOR + +Sven Schoeling Es.schoeling@linet-services.deE + +=cut -- 2.20.1