Highlight current page in lexicon sidebar

This commit is contained in:
Tim Van Baak 2020-01-22 12:44:24 -08:00
parent cace76ff0d
commit 9c41b3863e
6 changed files with 28 additions and 5 deletions

View File

@ -65,6 +65,12 @@ div#sidebar table a {
table a:hover {
background-color: #cccccc;
}
div#sidebar table a.current-page {
background-color: #bbbbbb;
}
div#sidebar table a.current-page:hover {
background-color: #bbbbbb;
}
div#sidebar table td {
padding: 0px; margin: 3px 0;
border-bottom: 8px solid transparent;

View File

@ -1,4 +1,5 @@
{% extends "lexicon/lexicon.html" %}
{% set current_page = "contents" %}
{% block title %}Index | {{ lexicon_title }}{% endblock %}
{% block main %}

View File

@ -11,11 +11,24 @@
{% endblock %}
{% block sb_logo %}{% endblock %}
{% block sb_home %}<a href="{{ url_for('home.home') }}">Home</a>{% endblock %}
{% block sb_contents %}<a href="{{ url_for('lexicon.contents', name=g.lexicon.name) }}">Contents</a>{% endblock %}
{% block sb_rules %}<a href="{{ url_for('lexicon.rules', name=g.lexicon.name) }}">Rules</a>{% endblock %}
{% block sb_session %}<a href="{{ url_for('lexicon.session', name=g.lexicon.name) }}">Session</a>{% endblock %}
{% block sb_stats %}<a href="{{ url_for('lexicon.stats', name=g.lexicon.name) }}">Statistics</a>{% endblock %}
{% block sb_home %}<a href="{{ url_for('home.home') }}">Home</a>
{% endblock %}
{% block sb_contents %}<a
{% if current_page == "contents" %}class="current-page"
{% else %}href="{{ url_for('lexicon.contents', name=g.lexicon.name) }}"
{% endif %}>Contents</a>{% endblock %}
{% block sb_rules %}<a
{% if current_page == "rules" %}class="current-page"
{% else %}href="{{ url_for('lexicon.rules', name=g.lexicon.name) }}"
{% endif %}>Rules</a>{% endblock %}
{% block sb_session %}<a
{% if current_page == "session" %}class="current-page"
{% else %}href="{{ url_for('lexicon.session', name=g.lexicon.name) }}"
{% endif %}>Session</a>{% endblock %}
{% block sb_stats %}<a
{% if current_page == "statistics" %}class="current-page"
{% else %}href="{{ url_for('lexicon.stats', name=g.lexicon.name) }}"
{% endif %}>Statistics</a>{% endblock %}
{% set template_sidebar_rows = [
self.sb_logo(),

View File

@ -1,4 +1,5 @@
{% extends "lexicon/lexicon.html" %}
{% set current_page = "rules" %}
{% block title %}Rules | {{ lexicon_title }}{% endblock %}
{% block main %}

View File

@ -1,4 +1,5 @@
{% extends "lexicon/lexicon.html" %}
{% set current_page = "session" %}
{% block title %}Session | {{ lexicon_title }}{% endblock %}
{% block main %}

View File

@ -1,4 +1,5 @@
{% extends "lexicon/lexicon.html" %}
{% set current_page = "statistics" %}
{% block title %}Session | {{ lexicon_title }}{% endblock %}
{% block main %}