excluded_fields => [qw/id/],
},
},
+ delete => {
+ ViewPort => {message => 'Are you sure you want to delete this Foo?'}
+ },
},
);
use Reaction::Class;
-use MooseX::Types::Moose qw/Int/;
+use MooseX::Types::Moose qw/Int Str/;
use Reaction::Types::Core qw/NonEmptySimpleStr/;
use namespace::clean -except => [ qw(meta) ];
extends 'Reaction::UI::ViewPort::Object::Mutable';
with 'Reaction::UI::ViewPort::Action::Role::OK';
+has message => (is => 'rw', isa => Str);
+has error_message => (is => 'rw', isa => Str);
+
#this has to fucking go. it BLOWS.
has method => (
is => 'rw',
arg 'method' => $_{viewport}->method;
};
+implements fragment message {
+ return unless $_{viewport}->has_message;
+ arg message_string => $_{viewport}->message;
+ render 'message_layout';
+};
+
+implements fragment error_message {
+ return unless $_{viewport}->has_error_message;
+ arg message_string => $_{viewport}->error_message;
+ render 'error_message_layout';
+};
+
implements fragment ok_button_fragment {
if (grep { $_ eq 'ok' } $_{viewport}->accept_events) {
arg 'event_id' => event_id 'ok';
=for layout header
+[% error_message %]
+
=for layout container_list
[% call_next %]
=for layout message_layout
-<span class="action_message">[% as_string %]</span>
+<span class="action_message">[% message_string %]</span>
+
+=for layout message_layout
+
+<span class="action_error_message">[% message_string %]</span>
=for layout standard_button