36 lines
986 B
Perl
36 lines
986 B
Perl
package CW::Template::Board;
|
|
|
|
use Moo;
|
|
|
|
extends 'CW::Template';
|
|
|
|
sub render {
|
|
my ($self) = @_;
|
|
|
|
my $board_id = $self->ctx->{board}->{id};
|
|
my $posts = $self->ctx->{posts};
|
|
|
|
return [
|
|
div => { class => "board-catalog-wrapper" } => [
|
|
map {
|
|
(
|
|
div => { class => "board-catalog-post" } => [
|
|
img => {
|
|
class => "board-catalog-post-img",
|
|
src => "/static/images/userdata/" . $_->{image}
|
|
},
|
|
a => { href => "/" . $board_id . "/" . $_->{id} } => [
|
|
h4 => { class => "board-catalog-post-title" } =>
|
|
[ $_->{title} ]
|
|
],
|
|
p => { class => "board-catalog-post-body" } =>
|
|
[ $_->{body} ]
|
|
]
|
|
)
|
|
} @$posts
|
|
]
|
|
];
|
|
}
|
|
|
|
1;
|