Files
compiled.world/lib/CW/Template/Board.pm
2026-08-22 23:59:41 -06:00

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;