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;
|
||||
20
lib/CW/Template/Error/404.pm
Normal file
20
lib/CW/Template/Error/404.pm
Normal file
@@ -0,0 +1,20 @@
|
||||
package CW::Template::Error::404;
|
||||
|
||||
use Moo;
|
||||
|
||||
extends 'CW::Template';
|
||||
|
||||
sub render {
|
||||
return [
|
||||
h2 => { style => "margin: 0" } =>
|
||||
[q[You are searching for something that seemingly doesn't exist.]],
|
||||
div => [
|
||||
p => { style => "margin: 0" } =>
|
||||
["Perhaps this is the sign you needed to create it yourself?"],
|
||||
img =>
|
||||
{ class => 'alexandria', src => "/static/images/alexandria.jpg" }
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
1;
|
||||
28
lib/CW/Template/Error/500.pm
Normal file
28
lib/CW/Template/Error/500.pm
Normal file
@@ -0,0 +1,28 @@
|
||||
package CW::Template::Error::500;
|
||||
|
||||
use Moo;
|
||||
|
||||
extends 'CW::Template';
|
||||
|
||||
sub render {
|
||||
my ($self) = @_;
|
||||
return [
|
||||
h2 => { style => "margin: 0" } =>
|
||||
[q[Something has gone terribly wrong.]],
|
||||
div => [
|
||||
p => { style => "margin: 0" } =>
|
||||
["Please re-try whatever it is you were doing, later."],
|
||||
img => {
|
||||
class => 'alexandria',
|
||||
src => "/static/images/alexandria_fire.jpg"
|
||||
},
|
||||
(
|
||||
$self->ctx->{show_errors}
|
||||
? ( p => [ $self->ctx->{error} ] )
|
||||
: ()
|
||||
)
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -9,18 +9,32 @@ sub render {
|
||||
|
||||
my @boards = @{ $self->ctx->{boards} };
|
||||
return [
|
||||
map {
|
||||
(
|
||||
li => [
|
||||
a => {
|
||||
href => '/' . $_->{id} . '/',
|
||||
class => 'index-board-link'
|
||||
} => [ '/' . $_->{id} . '/ - ' . $_->{name} ],
|
||||
p => { class => 'index-board-description' } =>
|
||||
[ $_->{description} ]
|
||||
]
|
||||
)
|
||||
} @boards
|
||||
div => { class => "index-content" } => [
|
||||
h2 => ["Boards"],
|
||||
ul => { class => "board-list" } => [
|
||||
map {
|
||||
(
|
||||
li => { class => "board-list-item" } => [
|
||||
a => {
|
||||
href => '/' . $_->{id} . '/',
|
||||
class => 'index-board-link'
|
||||
} => [ '/' . $_->{id} . '/ - ' . $_->{name} ],
|
||||
|
||||
# p => {
|
||||
# style => "margin: 0",
|
||||
# class => 'index-board-description'
|
||||
# } => [ $_->{description} ]
|
||||
]
|
||||
)
|
||||
} @boards
|
||||
]
|
||||
],
|
||||
div => { class => "index-content" } => [
|
||||
h2 => ["Changelog"],
|
||||
ul => { class => 'changelog-list' } => [
|
||||
li => ["Absofuckinglutely nothing"]
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user