Browse Source

Make navbar a template

mistress
Daniel Muckerman 4 years ago
parent
commit
cb0b81deaa
3 changed files with 38 additions and 49 deletions
  1. +1
    -20
      templates/bookmarklet.j2
  2. +36
    -0
      templates/fragments/navbar.j2
  3. +1
    -29
      templates/list.j2

+ 1
- 20
templates/bookmarklet.j2 View File

@ -7,26 +7,7 @@
{% endblock %}
{% block navbar %}
<div id="navbar" class="navbar navbar-expand-lg sticky-top navbar-dark bg-dark">
<div class="navbar-brand">Read TI Later</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown"
aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="{{ url_for('index') }}">My List</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('archived') }}">Archived</a>
</li>
</ul>
<form class="form-inline ml-auto">
<a class="btn btn-primary" href="/logout" role="button">Logout</a>
</form>
</div>
</div>
{% include "fragments/navbar.j2" %}
{% endblock %}
{% block content %}

+ 36
- 0
templates/fragments/navbar.j2 View File

@ -0,0 +1,36 @@
<div id="navbar" class="navbar navbar-expand-lg sticky-top navbar-dark bg-dark">
<div class="navbar-brand">Read TI Later</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown"
aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
{% if request.path == url_for('index') %}
<li class="nav-item active">
{% else %}
<li class="nav-item">
{% endif %}
<a class="nav-link" href="{{ url_for('index') }}">My List</a>
</li>
{% if request.path == url_for('archived') %}
<li class="nav-item active">
{% else %}
<li class="nav-item">
{% endif %}
<a class="nav-link" href="{{ url_for('archived') }}">Archived</a>
</li>
{% if request.path == url_for('bookmarklet') %}
<li class="nav-item active">
{% else %}
<li class="nav-item">
{% endif %}
<a class="nav-link" href="{{ url_for('archived') }}">Bookmarklet</a>
</li>
</ul>
<form class="form-inline ml-auto">
<a class="btn btn-info" href="#addLink" onclick="openLinkModal();" role="button" style="margin-right: 20px;">Add Link</a>
<a class="btn btn-primary" href="/logout" role="button">Logout</a>
</form>
</div>
</div>

+ 1
- 29
templates/list.j2 View File

@ -7,35 +7,7 @@
{% endblock %}
{% block navbar %}
<div id="navbar" class="navbar navbar-expand-lg sticky-top navbar-dark bg-dark">
<div class="navbar-brand">Read TI Later</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown"
aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
{% if request.path == url_for('index') %}
<li class="nav-item active">
{% else %}
<li class="nav-item">
{% endif %}
<a class="nav-link" href="{{ url_for('index') }}">My List</a>
</li>
{% if request.path == url_for('archived') %}
<li class="nav-item active">
{% else %}
<li class="nav-item">
{% endif %}
<a class="nav-link" href="{{ url_for('archived') }}">Archived</a>
</li>
</ul>
<form class="form-inline ml-auto">
<a class="btn btn-info" href="#addLink" onclick="openLinkModal();" role="button" style="margin-right: 20px;">Add Link</a>
<a class="btn btn-primary" href="/logout" role="button">Logout</a>
</form>
</div>
</div>
{% include "fragments/navbar.j2" %}
{% endblock %}
{% block content %}

Loading…
Cancel
Save