2013-12-12 20:48:23 +00:00
|
|
|
- var links = { "/": "Home" }
|
|
|
|
|
|
|
|
mixin navlink(page, title, active)
|
|
|
|
if active
|
|
|
|
li.active
|
|
|
|
a(href=page)= title
|
|
|
|
else
|
|
|
|
li
|
|
|
|
a(href=page)= title
|
|
|
|
|
|
|
|
mixin navheader()
|
|
|
|
.navbar-header
|
|
|
|
button.navbar-toggle(type="button", data-toggle="collapse", data-target="#nav-collapsible")
|
|
|
|
span.icon-bar
|
|
|
|
span.icon-bar
|
|
|
|
span.icon-bar
|
|
|
|
a.navbar-brand(href="/")= siteTitle
|
|
|
|
|
|
|
|
mixin navdefaultlinks(page)
|
|
|
|
each t, p in links
|
|
|
|
if p == page
|
2013-12-26 03:15:51 +00:00
|
|
|
mixin navlink(p, t, true)
|
2013-12-12 20:48:23 +00:00
|
|
|
else
|
2013-12-26 03:15:51 +00:00
|
|
|
mixin navlink(p, t, false)
|
2013-12-12 20:48:23 +00:00
|
|
|
li.dropdown
|
|
|
|
a.dropdown-toggle(href="#", data-toggle="dropdown") Account
|
|
|
|
b.caret
|
|
|
|
ul.dropdown-menu
|
|
|
|
if loggedIn
|
|
|
|
li: a(href="/logout?redirect=#{page}") Logout
|
|
|
|
li.divider
|
2014-01-25 19:55:00 +00:00
|
|
|
li: a(href="/account/channels") Channels
|
2013-12-12 20:48:23 +00:00
|
|
|
li: a(href="/account/profile") Profile
|
|
|
|
li: a(href="/account/edit") Change Password/Email
|
|
|
|
else
|
|
|
|
li: a(href="/login") Login
|
|
|
|
li: a(href="/register") Register
|
|
|
|
|
|
|
|
mixin navloginlogout(redirect)
|
|
|
|
if loggedIn
|
2013-12-26 03:15:51 +00:00
|
|
|
mixin navlogoutform(redirect)
|
2013-12-12 20:48:23 +00:00
|
|
|
else
|
2013-12-26 03:15:51 +00:00
|
|
|
mixin navloginform(redirect)
|
2013-12-12 20:48:23 +00:00
|
|
|
|
|
|
|
mixin navloginform(redirect)
|
|
|
|
.visible-md.visible-lg
|
2014-02-26 16:50:59 +00:00
|
|
|
if loginDomain == null
|
|
|
|
- loginDomain = ""
|
|
|
|
form#loginform.navbar-form.navbar-right(action="#{loginDomain}/login", method="post")
|
2013-12-12 20:48:23 +00:00
|
|
|
input(type="hidden", name="redirect", value=redirect)
|
|
|
|
.form-group
|
|
|
|
input#username.form-control(type="text", name="name", placeholder="Username")
|
|
|
|
.form-group
|
|
|
|
input#password.form-control(type="password", name="password", placeholder="Password")
|
|
|
|
button#login.btn.btn-default(type="submit") Login
|
|
|
|
|
|
|
|
mixin navlogoutform(redirect)
|
2014-06-07 07:20:52 +00:00
|
|
|
if loginDomain == null
|
|
|
|
- loginDomain = ""
|
2013-12-12 20:48:23 +00:00
|
|
|
if redirect
|
2014-06-07 07:20:52 +00:00
|
|
|
- url = "logout?redirect=" + redirect
|
2013-12-12 20:48:23 +00:00
|
|
|
else
|
2014-06-07 07:20:52 +00:00
|
|
|
- url = "logout"
|
2013-12-12 20:48:23 +00:00
|
|
|
p#logoutform.navbar-text.pull-right
|
|
|
|
span#welcome Welcome, #{loginName}
|
|
|
|
span ·
|
2014-06-07 07:20:52 +00:00
|
|
|
a#logout.navbar-link(href="#{loginDomain}/#{url}") Logout
|