diff --git a/templates/includes/auth_block.html.ep b/templates/includes/auth_block.html.ep new file mode 100644 index 0000000..22cb2f5 --- /dev/null +++ b/templates/includes/auth_block.html.ep @@ -0,0 +1,10 @@ +% my $user = session 'useruid'; + <ul class="ui-block"> +% if ($user) { + <li><span style="color: black;"><%= $user %></span></li> + <li><a href="/user/profile" rel="nofollow">Профиль</a></li> + <li><a href="/user/logout" rel="nofollow">Выйти</a></li> +% } else { + <li><a href="/user/login" rel="nofollow">Войти</a></li> +% } + </ul> diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index eb01318..c47b077 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -35,9 +35,7 @@ <li><a href="/wiki/wiki/index">Служебные</a></li> <li><a href="/forum/">Форум</a></li> </ul> - <ul class="ui-block"> - <li><a href="/user/login" rel="nofollow">Войти</a></li> - </ul> +%= include 'includes/auth_block'; </div> <div id="content" class="ui-block">