Style sidebar according to context

This commit is contained in:
2016-11-01 16:16:04 +01:00
parent fe714e10d1
commit aa2f97c7c9
3 changed files with 23 additions and 4 deletions

View File

@@ -6,6 +6,24 @@ body
bottom: 0
background-color: $color-background-light
&[data-context="task"]
nav.sidebar .navbar-item.tasks
background-color: $color-background-nav
box-shadow: inset 3px 0 0 $color-primary
color: white
&[data-context="shot"]
nav.sidebar .navbar-item.shots
background-color: $color-background-nav
box-shadow: inset 3px 0 0 $color-primary
color: white
&[data-context="dashboard"]
nav.sidebar .navbar-item.attract
background-color: $color-background-nav
box-shadow: inset 3px 0 0 $color-primary
color: white
#app-main
display: flex
align-items: stretch

View File

@@ -1,4 +1,5 @@
| {% extends 'attract/layout.html' %}
| {% block bodyattrs %}{{ super() }} data-context='dashboard'{% endblock %}
| {% block page_title %}Attract{% endblock %}
| {% block body %}

View File

@@ -27,20 +27,20 @@ html(lang="en")
nav.sidebar(role="navigation")
ul
li
a.navbar-item(href="{{ url_for('attract.index') }}",
a.navbar-item.attract(href="{{ url_for('attract.index') }}",
title='Attract')
i.pi-attract
| {% if project %}
li
a.navbar-item(href="{{ url_for('attract.tasks.perproject.index', project_url=project.url) }}",
a.navbar-item.tasks(href="{{ url_for('attract.tasks.perproject.index', project_url=project.url) }}",
title='Tasks for project {{ project.name }}') T
li
a.navbar-item(href="{{ url_for('attract.shots.perproject.index', project_url=project.url) }}",
a.navbar-item.shots(href="{{ url_for('attract.shots.perproject.index', project_url=project.url) }}",
title='Shots for project {{ project.name }}') S
| {% else %}
| {% if current_user.is_authenticated %}
li
a.navbar-item(href="{{ url_for('attract.tasks.index') }}",
a.navbar-item.tasks(href="{{ url_for('attract.tasks.index') }}",
title='Your tasks') T
| {% endif %}
| {% endif %}