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
|
2015-02-28 08:26:49 +00:00
|
|
|
li: a(href="/logout?dest=#{encodeURIComponent(baseUrl + page)}&_csrf=#{csrfToken}") Logout
|
2013-12-12 20:48:23 +00:00
|
|
|
li.divider
|
2015-03-29 16:34:27 +00:00
|
|
|
li: a(href="#{loginDomain}/account/channels") Channels
|
|
|
|
li: a(href="#{loginDomain}/account/profile") Profile
|
2015-02-28 08:02:59 +00:00
|
|
|
li: a(href="#{loginDomain}/account/edit") Change Password/Email
|
2013-12-12 20:48:23 +00:00
|
|
|
else
|
2015-02-28 08:20:24 +00:00
|
|
|
li: a(href="#{loginDomain}/login?dest=#{encodeURIComponent(baseUrl + page)}") Login
|
2015-02-28 08:02:59 +00:00
|
|
|
li: a(href="#{loginDomain}/register") Register
|
2013-12-12 20:48:23 +00:00
|
|
|
|
|
|
|
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)
|
2015-02-14 19:21:42 +00:00
|
|
|
if loginDomain == null
|
|
|
|
- loginDomain = ""
|
|
|
|
.visible-lg
|
2014-02-26 16:50:59 +00:00
|
|
|
form#loginform.navbar-form.navbar-right(action="#{loginDomain}/login", method="post")
|
2015-02-23 00:15:22 +00:00
|
|
|
input(type="hidden", name="_csrf", value=csrfToken)
|
2015-02-24 17:08:10 +00:00
|
|
|
input(type="hidden", name="dest", value=baseUrl + redirect)
|
2013-12-12 20:48:23 +00:00
|
|
|
.form-group
|
|
|
|
input#username.form-control(type="text", name="name", placeholder="Username")
|
|
|
|
.form-group
|
|
|
|
input#password.form-control(type="password", name="password", placeholder="Password")
|
2015-02-07 21:13:28 +00:00
|
|
|
.form-group
|
|
|
|
.checkbox
|
|
|
|
label
|
|
|
|
input(type="checkbox", name="remember")
|
2015-02-20 02:30:35 +00:00
|
|
|
span.navbar-text-nofloat Remember me
|
2013-12-12 20:48:23 +00:00
|
|
|
button#login.btn.btn-default(type="submit") Login
|
2015-02-14 19:21:42 +00:00
|
|
|
.visible-md
|
|
|
|
p#loginform.navbar-text.pull-right
|
2015-02-24 17:08:10 +00:00
|
|
|
a#login.navbar-link(href="#{loginDomain}/login?dest=#{encodeURIComponent(baseUrl + redirect)}") Log in
|
2015-02-28 08:37:32 +00:00
|
|
|
span ·
|
2015-02-14 19:21:42 +00:00
|
|
|
a#register.navbar-link(href="/register") Register
|
|
|
|
|
2013-12-12 20:48:23 +00:00
|
|
|
|
|
|
|
mixin navlogoutform(redirect)
|
|
|
|
p#logoutform.navbar-text.pull-right
|
|
|
|
span#welcome Welcome, #{loginName}
|
|
|
|
span ·
|
2015-02-28 08:51:30 +00:00
|
|
|
a#logout.navbar-link(href="/logout?dest=#{encodeURIComponent(baseUrl + redirect)}&_csrf=#{csrfToken}") Logout
|
2015-03-29 16:34:27 +00:00
|
|
|
|