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

View File

@@ -14,7 +14,6 @@ sub render {
if ( !$ctx->{nav} ) {
$ctx->{nav} = [];
my @path = split '/', $ctx->{env}->{PATH_INFO};
if (@path) {
my $nav = [];
for ( 0 .. $#path ) {
@@ -41,7 +40,10 @@ sub render {
push @additional_links, $self->_make_nav_link("logout");
}
my $board = $ctx->{board} // 'cw';
my $board = 'cw';
if ( $ctx->{board} ) {
$board = $ctx->{board}->{id};
}
return [
head => [
@@ -68,18 +70,18 @@ sub render {
rel => 'stylesheet'
},
link => {
href => '/static/css/' . $board . '.css',
href => '/static/css/cw.css',
rel => 'stylesheet'
}
],
body => [
header => [
header => { style => "margin-top: 1rem" } => [
div => [
div => {
class => "header-wrapper"
} => [
img => {
src => "/static/images/$board.svg",
src => "/static/images/cw.svg",
class => "logo"
},
div => [
@@ -108,18 +110,27 @@ sub render {
],
]
],
hr => { style => 'margin: 1rem; display: block;' },
main => [
nav => { class => "quicknav" } => [
map {
(
li => [
"/",
a => { href => $_->{path} } => [ $_->{text} ]
]
)
} @{ $ctx->{nav} }
],
div => $self->template->render
(
@{ $ctx->{nav} }
? (
nav => { class => "quicknav" } => [
map {
(
li => [
"/",
a => { href => $_->{path} } =>
[ $_->{text} ]
]
)
} @{ $ctx->{nav} }
]
)
: ()
),
div => { class => "main-content-wrapper" } =>
$self->template->render
],
footer => []
]