From 56654331eac46d7b4a99e0dfc36b93f3b06b0f1d Mon Sep 17 00:00:00 2001
From: Bo-Chun Louis Chen <louistw@uab.edu>
Date: Thu, 1 Jun 2023 22:10:13 -0500
Subject: [PATCH] Pass doc url as variable to other pages

---
 app/__init__.py                         | 4 ++++
 app/templates/account/certify.html      | 2 +-
 app/templates/account/hold.html         | 2 +-
 app/templates/account/unauthorized.html | 2 +-
 app/templates/auth/SignUp.html          | 2 +-
 5 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/app/__init__.py b/app/__init__.py
index da1fdca..659bf45 100644
--- a/app/__init__.py
+++ b/app/__init__.py
@@ -76,12 +76,14 @@ def create_app(config_name):
                 return render_template(
                     "account/unauthorized.html",
                     unauthorized_msg=messages.unauthorized_message,
+                    docs_url=app_vars.docs_url,
                 )
 
         if rc_util.check_state(session["user"].get("username")) == "hold":
             return render_template(
                 "account/hold.html",
                 account_hold_msg=messages.account_hold_message,
+                docs_url=app_vars.docs_url,
             )
 
         if (
@@ -101,6 +103,7 @@ def create_app(config_name):
                 cancel_msg=messages.cancel_message,
                 pre_certification_msg=messages.pre_certification_message,
                 certification_msg=messages.certification_message,
+                docs_url=app_vars.docs_url,
             )
         if rc_util.check_state(session["user"].get("username")) == "ok":
             return render_template(
@@ -120,6 +123,7 @@ def create_app(config_name):
             welcome_msg=messages.welcome_message,
             cancel_msg=messages.cancel_message,
             error_msg=messages.error_message,
+            docs_url=app_vars.docs_url,
         )
 
     # misc page error catching
diff --git a/app/templates/account/certify.html b/app/templates/account/certify.html
index 8afa6f4..c120c44 100644
--- a/app/templates/account/certify.html
+++ b/app/templates/account/certify.html
@@ -63,7 +63,7 @@
         <div class="navbar-right">
           <ul class="nav navbar-nav">
           <li>
-            <a target="_blank" href="https://uabrc.github.io/">
+            <a target="_blank" href="{[ docs_url }}">
               <i class="fas fa-info-circle fa-fw"></i> Online Documentation
             </a>
           </li>
diff --git a/app/templates/account/hold.html b/app/templates/account/hold.html
index c8c9203..08341c4 100644
--- a/app/templates/account/hold.html
+++ b/app/templates/account/hold.html
@@ -33,7 +33,7 @@
         <div class="navbar-right">
           <ul class="nav navbar-nav">
           <li>
-            <a target="_blank" href="https://uabrc.github.io/">
+            <a target="_blank" href="{{ docs_url }}">
               <i class="fas fa-info-circle fa-fw"></i> Online Documentation
             </a>
           </li>
diff --git a/app/templates/account/unauthorized.html b/app/templates/account/unauthorized.html
index 5dce0d2..c3d84a8 100644
--- a/app/templates/account/unauthorized.html
+++ b/app/templates/account/unauthorized.html
@@ -33,7 +33,7 @@
         <div class="navbar-right">
           <ul class="nav navbar-nav">
           <li>
-            <a target="_blank" href="https://uabrc.github.io/">
+            <a target="_blank" href="{{ docs_url }}">
               <i class="fas fa-info-circle fa-fw"></i> Online Documentation
             </a>
           </li>
diff --git a/app/templates/auth/SignUp.html b/app/templates/auth/SignUp.html
index 26c1aaa..cea9ace 100644
--- a/app/templates/auth/SignUp.html
+++ b/app/templates/auth/SignUp.html
@@ -63,7 +63,7 @@
         <div class="navbar-right">
           <ul class="nav navbar-nav">
           <li>
-            <a target="_blank" href="https://uabrc.github.io/">
+            <a target="_blank" href="{{ docs_url }}">
               <i class="fas fa-info-circle fa-fw"></i> Online Documentation
             </a>
           </li>
-- 
GitLab