This commit is contained in:
2026-08-22 23:59:41 -06:00
parent 84893662ca
commit a89b275313
23 changed files with 374 additions and 39 deletions

35
lib/CW/Template/Board.pm Normal file
View File

@@ -0,0 +1,35 @@
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;