aboutsummaryrefslogtreecommitdiff
path: root/uploader
diff options
context:
space:
mode:
Diffstat (limited to 'uploader')
-rw-r--r--uploader/base_routes.py10
-rw-r--r--uploader/genotypes/views.py2
-rw-r--r--uploader/samples/views.py16
-rw-r--r--uploader/static/css/styles.css7
-rw-r--r--uploader/templates/base.html46
-rw-r--r--uploader/ui.py1
6 files changed, 52 insertions, 30 deletions
diff --git a/uploader/base_routes.py b/uploader/base_routes.py
index a20b7ff..742a254 100644
--- a/uploader/base_routes.py
+++ b/uploader/base_routes.py
@@ -2,15 +2,15 @@
import os
from urllib.parse import urljoin
-from flask import (
- Blueprint,
- render_template,
- current_app as app,
- send_from_directory)
+from flask import (Blueprint,
+ current_app as app,
+ send_from_directory)
+from uploader.ui import make_template_renderer
from uploader.oauth2.client import user_logged_in
base = Blueprint("base", __name__)
+render_template = make_template_renderer("home")
@base.route("/favicon.ico", methods=["GET"])
diff --git a/uploader/genotypes/views.py b/uploader/genotypes/views.py
index 4158491..d69dc28 100644
--- a/uploader/genotypes/views.py
+++ b/uploader/genotypes/views.py
@@ -7,6 +7,7 @@ from flask import (flash,
render_template,
current_app as app)
+from uploader.ui import make_template_renderer
from uploader.authorisation import require_login
from uploader.db_utils import database_connection
from uploader.species.models import all_species, species_by_id
@@ -20,6 +21,7 @@ from .models import (genotype_markers,
genocode_by_population)
genotypesbp = Blueprint("genotypes", __name__)
+render_template = make_template_renderer("genotypes")
@genotypesbp.route("populations/genotypes", methods=["GET"])
@require_login
diff --git a/uploader/samples/views.py b/uploader/samples/views.py
index fd3c601..9ba1df8 100644
--- a/uploader/samples/views.py
+++ b/uploader/samples/views.py
@@ -8,17 +8,16 @@ from typing import Iterator
import MySQLdb as mdb
from redis import Redis
from MySQLdb.cursors import DictCursor
-from flask import (
- flash,
- request,
- url_for,
- redirect,
- Blueprint,
- render_template,
- current_app as app)
+from flask import (flash,
+ request,
+ url_for,
+ redirect,
+ Blueprint,
+ current_app as app)
from uploader import jobs
from uploader.files import save_file
+from uploader.ui import make_template_renderer
from uploader.authorisation import require_login
from uploader.input_validation import is_integer_input
from uploader.datautils import order_by_family, enumerate_sequence
@@ -37,6 +36,7 @@ from uploader.population.models import(save_population,
from .models import samples_by_species_and_population
samplesbp = Blueprint("samples", __name__)
+render_template = make_template_renderer("samples")
@samplesbp.route("/samples", methods=["GET"])
@require_login
diff --git a/uploader/static/css/styles.css b/uploader/static/css/styles.css
index fab42b8..574f53e 100644
--- a/uploader/static/css/styles.css
+++ b/uploader/static/css/styles.css
@@ -118,3 +118,10 @@ input[type="submit"], .btn {
border-color: #AAAAAA;
padding: 0.5em;
}
+
+.activemenu {
+ border-style: solid;
+ border-radius: 0.5em;
+ border-color: #AAAAAA;
+ background-color: #EFEFEF;
+}
diff --git a/uploader/templates/base.html b/uploader/templates/base.html
index 171e8fa..74de77e 100644
--- a/uploader/templates/base.html
+++ b/uploader/templates/base.html
@@ -43,23 +43,35 @@
<aside id="nav-sidebar" class="container-fluid">
<ul class="nav flex-column">
- <li><a href="/" >Home</a></li>
- <li><a href="{{url_for('species.list_species')}}"
- title="View and manage species information.">Species</a></li>
- <li><a href="{{url_for('species.populations.index')}}"
- title="View and manage species populations.">Populations</a></li>
- <li><a href="{{url_for('species.populations.samples.index')}}"
- title="Upload population samples.">Samples</a></li>
- <li><a href="{{url_for('species.populations.genotypes.index')}}"
- title="Upload Genotype data.">Genotype Data</a></li>
- <li><a href="{{url_for('expression-data.index.index')}}"
- title="Upload expression data.">Expression Data</a></li>
- <li><a href="#"
- title="Upload phenotype data.">Phenotype Data</a></li>
- <li><a href="#"
- title="Upload individual data.">Individual Data</a></li>
- <li><a href="#"
- title="Upload RNA-Seq data.">RNA-Seq Data</a></li>
+ <li {%if activemenu=="home"%}class="activemenu"{%endif%}>
+ <a href="/" >Home</a></li>
+ <li {%if activemenu=="species"%}class="activemenu"{%endif%}>
+ <a href="{{url_for('species.list_species')}}"
+ title="View and manage species information.">Species</a></li>
+ <li {%if activemenu=="platforms"%}class="activemenu"{%endif%}>
+ <a href="{{url_for('species.platforms.index')}}"
+ title="View and manage species platforms.">Sequencing Platforms</a></li>
+ <li {%if activemenu=="populations"%}class="activemenu"{%endif%}>
+ <a href="{{url_for('species.populations.index')}}"
+ title="View and manage species populations.">Populations</a></li>
+ <li {%if activemenu=="samples"%}class="activemenu"{%endif%}>
+ <a href="{{url_for('species.populations.samples.index')}}"
+ title="Upload population samples.">Samples</a></li>
+ <li {%if activemenu=="genotypes"%}class="activemenu"{%endif%}>
+ <a href="{{url_for('species.populations.genotypes.index')}}"
+ title="Upload Genotype data.">Genotype Data</a></li>
+ <li {%if activemenu=="expression-data"%}class="activemenu"{%endif%}>
+ <a href="{{url_for('species.populations.expression-data.index')}}"
+ title="Upload expression data.">Expression Data</a></li>
+ <li {%if activemenu=="phenotypes"%}class="activemenu"{%endif%}>
+ <a href="#"
+ title="Upload phenotype data.">Phenotype Data</a></li>
+ <li {%if activemenu=="individuals"%}class="activemenu"{%endif%}>
+ <a href="#"
+ title="Upload individual data.">Individual Data</a></li>
+ <li {%if activemenu=="rna-seq"%}class="activemenu"{%endif%}>
+ <a href="#"
+ title="Upload RNA-Seq data.">RNA-Seq Data</a></li>
</ul>
</aside>
diff --git a/uploader/ui.py b/uploader/ui.py
index 4115b02..1994056 100644
--- a/uploader/ui.py
+++ b/uploader/ui.py
@@ -8,6 +8,7 @@ def make_template_renderer(default):
template,
**{
**kwargs,
+ "activemenu": default,
"activelink": kwargs.get("activelink", default)
})
return render_template