mirror of https://github.com/calzoneman/sync.git
73 lines
2.1 KiB
Plaintext
73 lines
2.1 KiB
Plaintext
- 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
|
|
mixin navlink(p, t, true)
|
|
else
|
|
mixin navlink(p, t, false)
|
|
li.dropdown
|
|
a.dropdown-toggle(href="#", data-toggle="dropdown") Account
|
|
b.caret
|
|
ul.dropdown-menu
|
|
if loggedIn
|
|
li: a(href="/logout?dest=#{page}") Logout
|
|
li.divider
|
|
li: a(href="/account/channels") Channels
|
|
li: a(href="/account/profile") Profile
|
|
li: a(href="/account/edit") Change Password/Email
|
|
else
|
|
li: a(href="/login?dest=#{page}") Login
|
|
li: a(href="/register") Register
|
|
|
|
mixin navloginlogout(redirect)
|
|
if loggedIn
|
|
mixin navlogoutform(redirect)
|
|
else
|
|
mixin navloginform(redirect)
|
|
|
|
mixin navloginform(redirect)
|
|
if loginDomain == null
|
|
- loginDomain = ""
|
|
.visible-lg
|
|
form#loginform.navbar-form.navbar-right(action="#{loginDomain}/login", method="post")
|
|
input(type="hidden", name="dest", 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")
|
|
.form-group
|
|
.checkbox
|
|
label
|
|
input(type="checkbox", name="remember")
|
|
span.navbar-text-nofloat Remember me
|
|
button#login.btn.btn-default(type="submit") Login
|
|
.visible-md
|
|
p#loginform.navbar-text.pull-right
|
|
a#login.navbar-link(href="#{loginDomain}/login?dest=#{redirect}") Log in
|
|
span ·
|
|
a#register.navbar-link(href="/register") Register
|
|
|
|
|
|
mixin navlogoutform(redirect)
|
|
p#logoutform.navbar-text.pull-right
|
|
span#welcome Welcome, #{loginName}
|
|
span ·
|
|
a#logout.navbar-link(href="/logout?dest=#{redirect}") Logout
|