From 9487aa7a606a7df6cadc8b91a41558edee0b6224 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch <p.jentsch@uni-bielefeld.de>
Date: Mon, 13 Nov 2023 15:53:14 +0100
Subject: [PATCH] Restructure modals and base template

---
 app/main/routes.py                            |  6 ---
 .../_modals/_manual}/_01_introduction.html.j2 |  0
 .../_02_registration_and_log_in.html.j2       |  0
 .../_modals/_manual}/_03_dashboard.html.j2    |  0
 .../_modals/_manual}/_06_services.html.j2     |  0
 ...closer_look_at_the_corpus_analysis.html.j2 |  0
 .../_manual}/_08_cqp_query_language.html.j2   |  0
 .../_manual}/_09_query_builder.html.j2        |  0
 .../_modals/_manual}/_10_tagsets.html.j2      |  0
 .../_modals/manual.html.j2}                   | 16 +++----
 .../_modals/terms_of_use.html.j2}             |  0
 .../{_footer.html.j2 => _base/footer.html.j2} |  0
 app/templates/_base/modals.html.j2            |  5 +++
 .../{_navbar.html.j2 => _base/navbar.html.j2} |  0
 .../roadmap.html.j2}                          |  0
 .../scripts.html.j2}                          |  0
 .../sidenav.html.j2}                          |  0
 .../{_styles.html.j2 => _base/styles.html.j2} |  0
 app/templates/base.html.j2                    | 18 +++-----
 app/templates/main/user_manual.html.j2        | 43 -------------------
 20 files changed, 19 insertions(+), 69 deletions(-)
 rename app/templates/{main/_manual_modal => _base/_modals/_manual}/_01_introduction.html.j2 (100%)
 rename app/templates/{main/_manual_modal => _base/_modals/_manual}/_02_registration_and_log_in.html.j2 (100%)
 rename app/templates/{main/_manual_modal => _base/_modals/_manual}/_03_dashboard.html.j2 (100%)
 rename app/templates/{main/_manual_modal => _base/_modals/_manual}/_06_services.html.j2 (100%)
 rename app/templates/{main/_manual_modal => _base/_modals/_manual}/_07_a_closer_look_at_the_corpus_analysis.html.j2 (100%)
 rename app/templates/{main/_manual_modal => _base/_modals/_manual}/_08_cqp_query_language.html.j2 (100%)
 rename app/templates/{main/_manual_modal => _base/_modals/_manual}/_09_query_builder.html.j2 (100%)
 rename app/templates/{main/_manual_modal => _base/_modals/_manual}/_10_tagsets.html.j2 (100%)
 rename app/templates/{main/_manual_modal.html.j2 => _base/_modals/manual.html.j2} (72%)
 rename app/templates/{_terms_of_use_modal.html.j2 => _base/_modals/terms_of_use.html.j2} (100%)
 rename app/templates/{_footer.html.j2 => _base/footer.html.j2} (100%)
 create mode 100644 app/templates/_base/modals.html.j2
 rename app/templates/{_navbar.html.j2 => _base/navbar.html.j2} (100%)
 rename app/templates/{_roadmap.html.j2 => _base/roadmap.html.j2} (100%)
 rename app/templates/{_scripts.html.j2 => _base/scripts.html.j2} (100%)
 rename app/templates/{_sidenav.html.j2 => _base/sidenav.html.j2} (100%)
 rename app/templates/{_styles.html.j2 => _base/styles.html.j2} (100%)
 delete mode 100644 app/templates/main/user_manual.html.j2

diff --git a/app/main/routes.py b/app/main/routes.py
index faf579b0..255edb2d 100644
--- a/app/main/routes.py
+++ b/app/main/routes.py
@@ -45,12 +45,6 @@ def dashboard():
     )
 
 
-# @bp.route('/user_manual')
-# @register_breadcrumb(bp, '.user_manual', '<i class="material-icons left">help</i>User manual')
-# def user_manual():
-#     return render_template('main/user_manual.html.j2', title='User manual')
-
-
 @bp.route('/news')
 @register_breadcrumb(bp, '.news', '<i class="material-icons left">email</i>News')
 def news():
diff --git a/app/templates/main/_manual_modal/_01_introduction.html.j2 b/app/templates/_base/_modals/_manual/_01_introduction.html.j2
similarity index 100%
rename from app/templates/main/_manual_modal/_01_introduction.html.j2
rename to app/templates/_base/_modals/_manual/_01_introduction.html.j2
diff --git a/app/templates/main/_manual_modal/_02_registration_and_log_in.html.j2 b/app/templates/_base/_modals/_manual/_02_registration_and_log_in.html.j2
similarity index 100%
rename from app/templates/main/_manual_modal/_02_registration_and_log_in.html.j2
rename to app/templates/_base/_modals/_manual/_02_registration_and_log_in.html.j2
diff --git a/app/templates/main/_manual_modal/_03_dashboard.html.j2 b/app/templates/_base/_modals/_manual/_03_dashboard.html.j2
similarity index 100%
rename from app/templates/main/_manual_modal/_03_dashboard.html.j2
rename to app/templates/_base/_modals/_manual/_03_dashboard.html.j2
diff --git a/app/templates/main/_manual_modal/_06_services.html.j2 b/app/templates/_base/_modals/_manual/_06_services.html.j2
similarity index 100%
rename from app/templates/main/_manual_modal/_06_services.html.j2
rename to app/templates/_base/_modals/_manual/_06_services.html.j2
diff --git a/app/templates/main/_manual_modal/_07_a_closer_look_at_the_corpus_analysis.html.j2 b/app/templates/_base/_modals/_manual/_07_a_closer_look_at_the_corpus_analysis.html.j2
similarity index 100%
rename from app/templates/main/_manual_modal/_07_a_closer_look_at_the_corpus_analysis.html.j2
rename to app/templates/_base/_modals/_manual/_07_a_closer_look_at_the_corpus_analysis.html.j2
diff --git a/app/templates/main/_manual_modal/_08_cqp_query_language.html.j2 b/app/templates/_base/_modals/_manual/_08_cqp_query_language.html.j2
similarity index 100%
rename from app/templates/main/_manual_modal/_08_cqp_query_language.html.j2
rename to app/templates/_base/_modals/_manual/_08_cqp_query_language.html.j2
diff --git a/app/templates/main/_manual_modal/_09_query_builder.html.j2 b/app/templates/_base/_modals/_manual/_09_query_builder.html.j2
similarity index 100%
rename from app/templates/main/_manual_modal/_09_query_builder.html.j2
rename to app/templates/_base/_modals/_manual/_09_query_builder.html.j2
diff --git a/app/templates/main/_manual_modal/_10_tagsets.html.j2 b/app/templates/_base/_modals/_manual/_10_tagsets.html.j2
similarity index 100%
rename from app/templates/main/_manual_modal/_10_tagsets.html.j2
rename to app/templates/_base/_modals/_manual/_10_tagsets.html.j2
diff --git a/app/templates/main/_manual_modal.html.j2 b/app/templates/_base/_modals/manual.html.j2
similarity index 72%
rename from app/templates/main/_manual_modal.html.j2
rename to app/templates/_base/_modals/manual.html.j2
index 9233fb0d..34ce1877 100644
--- a/app/templates/main/_manual_modal.html.j2
+++ b/app/templates/_base/_modals/manual.html.j2
@@ -13,35 +13,35 @@
     </ul>
     <div id="manual-modal-introduction">
       <br>
-      {% include "main/_manual_modal/_01_introduction.html.j2" %}
+      {% include "_base/_modals/_manual/_01_introduction.html.j2" %}
     </div>
     <div id="manual-modal-registration-and-log-in">
       <br>
-      {% include "main/_manual_modal/_02_registration_and_log_in.html.j2" %}
+      {% include "_base/_modals/_manual/_02_registration_and_log_in.html.j2" %}
     </div>
     <div id="manual-modal-dashboard">
       <br>
-      {% include "main/_manual_modal/_03_dashboard.html.j2" %}
+      {% include "_base/_modals/_manual/_03_dashboard.html.j2" %}
     </div>
     <div id="manual-modal-services">
       <br>
-      {% include "main/_manual_modal/_06_services.html.j2" %}
+      {% include "_base/_modals/_manual/_06_services.html.j2" %}
     </div>
     <div id="manual-modal-a-closer-look-at-the-corpus-analysis">
       <br>
-      {% include "main/_manual_modal/_07_a_closer_look_at_the_corpus_analysis.html.j2" %}
+      {% include "_base/_modals/_manual/_07_a_closer_look_at_the_corpus_analysis.html.j2" %}
     </div>
     <div id="manual-modal-cqp-query-language">
       <br>
-      {% include "main/_manual_modal/_08_cqp_query_language.html.j2" %}
+      {% include "_base/_modals/_manual/_08_cqp_query_language.html.j2" %}
     </div>
     <div id="manual-modal-query-builder">
       <br>
-      {% include "main/_manual_modal/_09_query_builder.html.j2" %}
+      {% include "_base/_modals/_manual/_09_query_builder.html.j2" %}
     </div>
     <div id="manual-modal-tagsets">
       <br>
-      {% include "main/_manual_modal/_10_tagsets.html.j2" %}
+      {% include "_base/_modals/_manual/_10_tagsets.html.j2" %}
     </div>
   </div>
   <div class="modal-footer">
diff --git a/app/templates/_terms_of_use_modal.html.j2 b/app/templates/_base/_modals/terms_of_use.html.j2
similarity index 100%
rename from app/templates/_terms_of_use_modal.html.j2
rename to app/templates/_base/_modals/terms_of_use.html.j2
diff --git a/app/templates/_footer.html.j2 b/app/templates/_base/footer.html.j2
similarity index 100%
rename from app/templates/_footer.html.j2
rename to app/templates/_base/footer.html.j2
diff --git a/app/templates/_base/modals.html.j2 b/app/templates/_base/modals.html.j2
new file mode 100644
index 00000000..829fcbb4
--- /dev/null
+++ b/app/templates/_base/modals.html.j2
@@ -0,0 +1,5 @@
+{% include "_base/_modals/manual.html.j2" %}
+
+{% if current_user.is_authenticated and not current_user.terms_of_use_accepted %}
+{% include "_base/_modals/terms_of_use.html.j2" %}
+{% endif %}
diff --git a/app/templates/_navbar.html.j2 b/app/templates/_base/navbar.html.j2
similarity index 100%
rename from app/templates/_navbar.html.j2
rename to app/templates/_base/navbar.html.j2
diff --git a/app/templates/_roadmap.html.j2 b/app/templates/_base/roadmap.html.j2
similarity index 100%
rename from app/templates/_roadmap.html.j2
rename to app/templates/_base/roadmap.html.j2
diff --git a/app/templates/_scripts.html.j2 b/app/templates/_base/scripts.html.j2
similarity index 100%
rename from app/templates/_scripts.html.j2
rename to app/templates/_base/scripts.html.j2
diff --git a/app/templates/_sidenav.html.j2 b/app/templates/_base/sidenav.html.j2
similarity index 100%
rename from app/templates/_sidenav.html.j2
rename to app/templates/_base/sidenav.html.j2
diff --git a/app/templates/_styles.html.j2 b/app/templates/_base/styles.html.j2
similarity index 100%
rename from app/templates/_styles.html.j2
rename to app/templates/_base/styles.html.j2
diff --git a/app/templates/base.html.j2 b/app/templates/base.html.j2
index 9dd20f08..067d2cb6 100644
--- a/app/templates/base.html.j2
+++ b/app/templates/base.html.j2
@@ -16,16 +16,16 @@
 
 {% block styles %}
 {{ super() }}
-{% include "_styles.html.j2" %}
+{% include "_base/styles.html.j2" %}
 {% endblock styles %}
 
 {% block navbar %}
-{% include "_navbar.html.j2" %}
+{% include "_base/navbar.html.j2" %}
 {% endblock navbar %}
 
 {% block sidenav %}
 {% if current_user.is_authenticated %}
-{% include "_sidenav.html.j2" %}
+{% include "_base/sidenav.html.j2" %}
 {% endif %}
 {% endblock sidenav %}
 
@@ -34,23 +34,17 @@
 {% block page_content %}{% endblock page_content %}
 <div id="modals">
   {% block modals %}
-  {% include "main/_manual_modal.html.j2" %}
-  {# {% if current_user.is_authenticated %}
-  {% include "_roadmap.html.j2" %}
-  {% endif %} #}
-  {% if current_user.is_authenticated and not current_user.terms_of_use_accepted %}
-    {% include "_terms_of_use_modal.html.j2" %}
-  {% endif %}
+  {% include "_base/modals.html.j2" %}
   {% endblock modals %}
 </div>
 {% endblock main %}
 
 {% block footer_attribs %} class="page-footer primary-variant-color"{% endblock footer_attribs %}
 {% block footer %}
-{% include "_footer.html.j2" %}
+{% include "_base/footer.html.j2" %}
 {% endblock footer %}
 
 {% block scripts %}
 {{ super() }}
-{% include "_scripts.html.j2" %}
+{% include "_base/scripts.html.j2" %}
 {% endblock scripts %}
diff --git a/app/templates/main/user_manual.html.j2 b/app/templates/main/user_manual.html.j2
deleted file mode 100644
index 2ef1da01..00000000
--- a/app/templates/main/user_manual.html.j2
+++ /dev/null
@@ -1,43 +0,0 @@
-{% extends "base.html.j2" %}
-
-{% block page_content %}
-<div class="container">
-  <div class="row">
-    <div class="col s12">
-      <h1 id="title">{{ title }}</h1>
-    </div>
-
-    <div class="col s12 m10">
-      <div class="section scrollspy" id="introduction">
-        {% include "main/manual/_01_introduction.html.j2" %}
-      </div>
-      <div class="section scrollspy" id="registration-and-log-in">
-        {% include "main/manual/_02_registration_and_log_in.html.j2" %}
-      </div>
-      <div class="section scrollspy" id="dashboard">
-        {% include "main/manual/_03_dashboard.html.j2" %}
-      </div>
-      <div class="section scrollspy" id="services">
-        {% include "main/manual/_06_services.html.j2" %}
-      </div>
-      <div class="section scrollspy" id="a-closer-look-at-the-corpus-analysis">
-        {% include "main/manual/_07_a_closer_look_at_the_corpus_analysis.html.j2" %}
-      </div>
-      <div class="section scrollspy" id="cqp-query-language">
-        {% include "main/manual/_08_cqp_query_language.html.j2" %}
-      </div>
-    </div>
-
-    <div class="col m2 hide-on-small-only">
-      <ul class="section table-of-contents" style="position: fixed !important;">
-        <li><a href="#introduction">Introduction</a></li>
-        <li><a href="#registration-and-log-in">Registration and Log in</a></li>
-        <li><a href="#dashboard">Dashboard</a></li>
-        <li><a href="#services">Services</a></li>
-        <li><a href="#a-closer-look-at-the-corpus-analysis">A closer look at the Corpus Analysis</a></li>
-        <li><a href="#cqp-query-language">CQP Query Language</a></li>
-      </ul>
-    </div>
-  </div>
-</div>
-{% endblock page_content %}
-- 
GitLab