Fix the is_admin helper

This commit is contained in:
swag 2023-04-16 15:15:39 -04:00
parent 33e38e26f6
commit 65d98d594c
2 changed files with 5 additions and 2 deletions

View File

@ -58,6 +58,10 @@ sub startup($self) {
return undef;
});
$self->helper(is_admin => sub ($c) {
$c->session->{'is_admin'} || undef
});
# Finish configuring some things
$self->secrets($self->config->{'secrets'}) || die $@;

View File

@ -8,7 +8,6 @@
<h1>Post::Text</h1>
<nav>
<div>
<span>Navigate:</span>
<%= link_to List => 'threads_list' %>
<%= link_to New => 'post_thread' %>
<% unless (is_mod) { =%>
@ -24,7 +23,7 @@
<% } =%>
</div>
<div>
<% if (is_mod && session->{'is_admin'}) { =%>
<% if (is_mod && is_admin) { =%>
<span>Admin:</span>
<%= link_to Create => 'create_mod' %>
<% } =%>