stuff
This commit is contained in:
35
lib/CW/Template/Board.pm
Normal file
35
lib/CW/Template/Board.pm
Normal 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;
|
||||
Reference in New Issue
Block a user