Fix the is_admin helper
This commit is contained in:
parent
33e38e26f6
commit
65d98d594c
|
@ -58,6 +58,10 @@ sub startup($self) {
|
||||||
return undef;
|
return undef;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$self->helper(is_admin => sub ($c) {
|
||||||
|
$c->session->{'is_admin'} || undef
|
||||||
|
});
|
||||||
|
|
||||||
# Finish configuring some things
|
# Finish configuring some things
|
||||||
$self->secrets($self->config->{'secrets'}) || die $@;
|
$self->secrets($self->config->{'secrets'}) || die $@;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
<h1>Post::Text</h1>
|
<h1>Post::Text</h1>
|
||||||
<nav>
|
<nav>
|
||||||
<div>
|
<div>
|
||||||
<span>Navigate:</span>
|
|
||||||
<%= link_to List => 'threads_list' %>
|
<%= link_to List => 'threads_list' %>
|
||||||
<%= link_to New => 'post_thread' %>
|
<%= link_to New => 'post_thread' %>
|
||||||
<% unless (is_mod) { =%>
|
<% unless (is_mod) { =%>
|
||||||
|
@ -24,7 +23,7 @@
|
||||||
<% } =%>
|
<% } =%>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<% if (is_mod && session->{'is_admin'}) { =%>
|
<% if (is_mod && is_admin) { =%>
|
||||||
<span>Admin:</span>
|
<span>Admin:</span>
|
||||||
<%= link_to Create => 'create_mod' %>
|
<%= link_to Create => 'create_mod' %>
|
||||||
<% } =%>
|
<% } =%>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user