Browse Source

Add login to navbar

master
Burathar 4 years ago
parent
commit
1e7acfce7a
  1. 22
      biscd/biscd/templates/base.html
  2. 3
      installation-files/users_example.yaml

22
biscd/biscd/templates/base.html

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
<div class="bs-component">
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand" href="#">Navbar</a>
<a class="navbar-brand" href="{{ url_for('index') }}">Biscd</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
@ -23,9 +23,9 @@ @@ -23,9 +23,9 @@
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="{{ url_for('index') }}">Home
<span class="sr-only">(current)</span>
</a>
</li>
<!--
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Dropdown</a>
<div class="dropdown-menu">
@ -36,11 +36,29 @@ @@ -36,11 +36,29 @@
<a class="dropdown-item" href="#">Separated link</a>
</div>
</li>
-->
</ul>
<ul class="navbar-nav pr-3">
{% if current_user.is_anonymous %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('login') }}">Login</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('register') }}">Register</a>
</li>
{% else %}
<li class="nav-item">
<a class="nav-link" href="{{ url_for('logout') }}">Logout</a>
</li>
{% endif %}
</ul>
<!--
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="text" placeholder="Search">
<button class="btn btn-secondary my-2 my-sm-0" type="submit">Search</button>
</form>
-->
</div>
</nav>
</div>

3
installation-files/users_example.yaml

@ -2,3 +2,6 @@ users: @@ -2,3 +2,6 @@ users:
- henk:
email: mymail@mail.com
password_hash: pbkdf2:sha256:150000$uuFRyvLs$ee9863f169db786e82b9e2abe0c2cf3434e925479d0919f3b4046ebbfa0aeb28
- Carl:
email: carl@mail.com
password_hash: pbkdf2:sha256:150000$v4UyXVie$898ba71cdf3adefd7c1b6ed611897a3c8ca3151bd2628b490a052f554bae113e

Loading…
Cancel
Save