CyTube/templates/nav.pug
2017-08-22 17:33:29 -07:00

69 lines
2.1 KiB
Plaintext

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()
li
a(href="/") Home
li.dropdown
a.dropdown-toggle(href="#", data-toggle="dropdown") Account
b.caret
ul.dropdown-menu
if loggedIn
li: a(href="javascript:$('#logoutform').submit();") Log out
li.divider
li: a(href=loginDomain+"/account/channels") Channels
li: a(href=loginDomain+"/account/profile") Profile
li: a(href=loginDomain+"/account/edit") Change Password/Email
else
li: a(href=loginDomain+"/login") Login
li: a(href=loginDomain+"/register") Register
mixin navsuperadmin(newTab)
if superadmin
if newTab
li: a(href="/acp", target="_blank") ACP
else
li: a(href="/acp") ACP
mixin navloginlogout()
if loggedIn
+navlogoutform()
else
+navloginform()
mixin navloginform()
if loginDomain == null
- loginDomain = ""
.visible-lg
form#loginform.navbar-form.navbar-right(action=loginDomain+"/login", method="post")
input(type="hidden", name="_csrf", value=csrfToken)
.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") Log in
span  · 
a#register.navbar-link(href="/register") Register
mixin navlogoutform()
form#logoutform.navbar-text.pull-right(action="/logout", method="post")
input(type="hidden", name="_csrf", value=csrfToken)
span#welcome Welcome, #{loginName}
span  · 
input#logout.navbar-link(type="submit", value="Log out")