Use automatic template context rather than passing the path through

Saves me having to push a bunch of common stuff through, which just
makes sense
This commit is contained in:
Eli Ribble 2016-06-09 10:18:30 -06:00
parent 31d810b65d
commit e1f39bb852
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@
<!-- Collect the nav links, forms, and other content for toggling --> <!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li class="{{ 'active' if path == '/accounts' else ''}}"><a href="/accounts">Accounts<span class="sr-only">(current)</span></a></li> <li class="{{ 'active' if request.path == '/accounts/' else ''}}"><a href="/accounts">Accounts<span class="sr-only">(current)</span></a></li>
</ul> </ul>
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li class="dropdown"> <li class="dropdown">

View File

@ -4,4 +4,4 @@ blueprint = flask.Blueprint('index', __name__)
@blueprint.route('/', methods=['GET']) @blueprint.route('/', methods=['GET'])
def index(): def index():
return flask.render_template('index.html', path='/') return flask.render_template('index.html')