Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (74 sloc) 2.36 KB
<can-import from="can-stache-route-helpers" />
<nav class="navbar navbar-default">
<div class="navbar-collapse" id="bs-example-navbar-collapse-1">
<a href="/" class="pull-left main-logo">BitBalls</a>
<ul class="main-menu nav navbar-nav">
<li role="presentation" {{# is(app.page, 'tournaments') }}class='active'{{/ is }}>
<a href="{{ routeUrl(page='tournaments') }}">Tournaments</a>
</li>
<li role="presentation" {{# is(app.page, 'players') }}class='active'{{/ is }}>
<a href="{{ routeUrl(page='players') }}">Players</a>
</li>
</ul>
<ul class="session-menu nav navbar-nav navbar-right">
{{# if(app.session) }}
{{# if(app.session.isAdmin() ) }}
<li {{# is(app.page, 'users') }}class='active'{{/ is }}>
<a href="{{ routeUrl(page='users') }}">Users</a>
</li>
{{/ if }}
<li {{# is(app.page, 'account') }}class='active'{{/ is }}>
<a href="{{ routeUrl(page='account') }}">Account</a>
</li>
<li>
<a href="javascript://" on:click="scope.vm.logout()">Logout</a>
</li>
{{ else }}
<li class="dropdown">
<a href="javascript://"
class="dropdown-toggle"
data-toggle="dropdown"
role="button"
aria-haspopup="true"
aria-expanded="false"
>
Login <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
<form on:submit="scope.vm.createSession(scope.event)" action="">
<div class="form-group form-group-sm">
<input
class="form-control"
id="user-email-nav"
placeholder="email"
value:bind="loginSession.user.email"
>
</div>
<div class="form-group form-group-sm">
<input
placeholder="password"
class="form-control"
type="password"
id="user-password-nav"
value:bind="loginSession.user.password"
>
</div>
<button type="submit" class="btn btn-primary btn-sm" >Login</button>
<a href="{{ routeUrl(page='register') }}"
class="register-btn btn btn-link"
on:click="scope.vm.closeDropdown(scope.element)"
>
or register
</a>
{{# if(sessionPromise.isRejected) }}
<p class="text-danger">{{ sessionPromise.reason.responseJSON.message }}</p>
{{/ if }}
</form>
</li>
</ul>
</li>
{{/ if }}
</ul>
</div>
</nav>