Skip to content

Commit

Permalink
Merge pull request #22 from CodeForPhilly/fix/auth-ui
Browse files Browse the repository at this point in the history
fix(tpl): switch login/signup to profile/logout when logged in
  • Loading branch information
themightychris authored Sep 7, 2021
2 parents eb74d67 + f3d101a commit 1e02d11
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
32 changes: 22 additions & 10 deletions html-templates/designs/site-bootstrap4.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!DOCTYPE html>
{load_templates designs/site.subtemplates.tpl}
<html lang="en">

<head>
Expand Down Expand Up @@ -70,16 +71,27 @@
<ul class="dropdown-menu search" id="navbarSearchBarDropdown" aria-labelledby="navbarDropdown">
</ul>
</li>
<li class="nav-item show">
<a class="nav-link " href="/login?return=%2F" id="navbarDropdown" role="button" aria-haspopup="false" aria-expanded="false">
Login
</a>
</li>
<li class="nav-item show">
<a class="nav-link " href="/register?return=%2F" id="navbarDropdown" role="button" aria-haspopup="false" aria-expanded="false">
Signup
</a>
</li>
{if $.User}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{avatar $.User 18} {$.User->FirstName}
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
{include includes/site-bootstrap4.nav-userlinks.tpl}
</div>
</li>
{else}
<li class="nav-item show">
<a class="nav-link" href="/login?return={$.server.REQUEST_URI|escape:url}" id="navbarDropdown" role="button" aria-haspopup="false" aria-expanded="false">
{_ "Login"}
</a>
</li>
<li class="nav-item show">
<a class="nav-link" href="/register?return={$.server.REQUEST_URI|escape:url}" id="navbarDropdown" role="button" aria-haspopup="false" aria-expanded="false">
{_ "Signup"}
</a>
</li>
{/if}
</ul>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions html-templates/includes/site-bootstrap4.nav-userlinks.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<a class="dropdown-item nav-link" href="{$.User->getURL()}">{_ "View My Profile"}</a>
<a class="dropdown-item nav-link" href="/profile">{_ "Edit My Profile"}</a>
<a class="dropdown-item nav-link" href="/logout">{_ "Logout"}</a>

0 comments on commit 1e02d11

Please sign in to comment.