Remember last-visited Attract project in session
This allows us to keep rendering the "Shots" and "Assets" links in the sidebar, even when someone navigates away from the project scope.
This commit is contained in:
@@ -37,16 +37,17 @@ html(lang="en")
|
||||
a.navbar-item.attract(href="{{ url_for('attract.index') }}",
|
||||
title='Attract')
|
||||
i.pi-attract
|
||||
| {% if project %}
|
||||
| {% if session.get('attract_last_project') %}
|
||||
| {% set attract_last_project = session.get('attract_last_project') %}
|
||||
li
|
||||
a.navbar-item.tasks(href="{{ url_for('attract.tasks.perproject.index', project_url=project.url) }}",
|
||||
title='Tasks for project {{ project.name }}') Tasks
|
||||
a.navbar-item.tasks(href="{{ url_for('attract.tasks.perproject.index', project_url=attract_last_project.url) }}",
|
||||
title='Tasks for project {{ attract_last_project.name }}') Tasks
|
||||
li
|
||||
a.navbar-item.shots(href="{{ url_for('attract.shots.perproject.index', project_url=project.url) }}",
|
||||
title='Shots for project {{ project.name }}') Shots
|
||||
a.navbar-item.shots(href="{{ url_for('attract.shots.perproject.index', project_url=attract_last_project.url) }}",
|
||||
title='Shots for project {{ attract_last_project.name }}') Shots
|
||||
li
|
||||
a.navbar-item.assets(href="{{ url_for('attract.assets.perproject.index', project_url=project.url) }}",
|
||||
title='Assets for project {{ project.name }}') Assets
|
||||
a.navbar-item.assets(href="{{ url_for('attract.assets.perproject.index', project_url=attract_last_project.url) }}",
|
||||
title='Assets for project {{ attract_last_project.name }}') Assets
|
||||
| {% else %}
|
||||
| {% if current_user.is_authenticated %}
|
||||
li
|
||||
|
Reference in New Issue
Block a user