aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-06-14 10:32:45 -0500
committerFrederick Muriuki Muriithi2024-06-14 10:43:57 -0500
commit6043dabe8f1351f567843a6c0509958d6d56870a (patch)
treed1acecc86e20e754300729792c983cfcf84f1306
parent026d10646c2589d672b81c5f0b8e8ed6bc994122 (diff)
downloadgn-uploader-6043dabe8f1351f567843a6c0509958d6d56870a.tar.gz
jquery, bootstrap: update page dependencies
* Add jquery which is needed for bootstrap plugins. * Add the default bootstrap theme. * Provide route to serve up jquery libraries.
-rw-r--r--qc_app/base_routes.py7
-rw-r--r--qc_app/templates/base.html12
2 files changed, 17 insertions, 2 deletions
diff --git a/qc_app/base_routes.py b/qc_app/base_routes.py
index dbfcf48..9023fec 100644
--- a/qc_app/base_routes.py
+++ b/qc_app/base_routes.py
@@ -13,3 +13,10 @@ def bootstrap(filename):
"""Fetch bootstrap files."""
return send_from_directory(
appenv(), f"share/genenetwork2/javascript/bootstrap/{filename}")
+
+
+@base.route("/jquery/<path:filename>")
+def jquery(filename):
+ """Fetch jquery files."""
+ return send_from_directory(
+ appenv(), f"share/genenetwork2/javascript/jquery/{filename}")
diff --git a/qc_app/templates/base.html b/qc_app/templates/base.html
index 91faee8..3f1ccac 100644
--- a/qc_app/templates/base.html
+++ b/qc_app/templates/base.html
@@ -9,7 +9,12 @@
<title>GN Uploader: {%block title%}{%endblock%}</title>
<link rel="stylesheet" type="text/css"
- href="{{url_for('base.bootstrap', filename='css/bootstrap.css')}}" />
+ href="{{url_for('base.bootstrap',
+ filename='css/bootstrap.min.css')}}" />
+ <link rel="stylesheet" type="text/css"
+ href="{{url_for('base.bootstrap',
+ filename='css/bootstrap-theme.min.css')}}" />
+
<link rel="shortcut icon" type="image/png" sizes="64x64"
href="{{url_for('static', filename='images/CITGLogo.png')}}" />
@@ -18,7 +23,6 @@
<link rel="stylesheet" type="text/css" href="/static/css/styles.css" />
{%block css%}{%endblock%}
-
</head>
<body>
@@ -26,6 +30,10 @@
{%block contents%}{%endblock%}
</div>
+ <script src="{{url_for('base.jquery',
+ filename='jquery.min.js')}}"></script>
+ <script src="{{url_for('base.bootstrap',
+ filename='js/bootstrap.min.js')}}"></script>
{%block javascript%}{%endblock%}
</body>
</html>