Commit | Line | Data |
---|---|---|
ddd1dc65 | 1 | package Reaction::UI::Widget::Field::Image; |
2 | ||
3 | use Reaction::UI::WidgetClass; | |
4 | ||
bae75bee | 5 | use namespace::clean -except => [ qw(meta) ]; |
6 | extends 'Reaction::UI::Widget::Field'; | |
ddd1dc65 | 7 | |
bae75bee | 8 | |
9 | ||
10 | implements fragment image { | |
11 | if($_{viewport}->value_string) { | |
12 | arg uri => $_{viewport}->uri; | |
13 | render 'has_image'; | |
14 | } else { | |
15 | render 'no_image'; | |
16 | } | |
ddd1dc65 | 17 | }; |
18 | ||
bae75bee | 19 | __PACKAGE__->meta->make_immutable; |
20 | ||
21 | ||
ddd1dc65 | 22 | 1; |