From 8a058ac45e6ef5a4c7cd7141332b7951bc01f49c Mon Sep 17 00:00:00 2001
From: jwansek <eddie.atten.ea29@gmail.com>
Date: Fri, 5 May 2023 15:58:07 +0100
Subject: Finished search bar, started adding <div>s for chart content

---
 templates/index.html.j2    | 13 ++++++++++++-
 templates/search.html.j2   | 16 ++++++++++++++++
 templates/template.html.j2 |  8 ++++----
 3 files changed, 32 insertions(+), 5 deletions(-)
 create mode 100644 templates/search.html.j2

(limited to 'templates')

diff --git a/templates/index.html.j2 b/templates/index.html.j2
index 91f314e..40ff005 100644
--- a/templates/index.html.j2
+++ b/templates/index.html.j2
@@ -1,4 +1,15 @@
 {% extends "template.html.j2" %}
 {% block content %}
-    <p>foo</p>
+    <div id="multicharts">
+        <ul>
+            {% for elem in charts %}
+                <li>
+                    <div class="chart_container">
+                        <div class="minichart" id="/minichart{{ elem['url'] }}">
+                        <a href="{{ elem['url'] }}">{{ elem['title'] }}</a>
+                    </div>
+                </li>
+            {% endfor %}
+        </ul>
+    </div>  
 {% endblock %}
\ No newline at end of file
diff --git a/templates/search.html.j2 b/templates/search.html.j2
new file mode 100644
index 0000000..4de432c
--- /dev/null
+++ b/templates/search.html.j2
@@ -0,0 +1,16 @@
+{% extends "template.html.j2" %}
+{% block content %}
+    <div id="search">
+        {% if companies == [] %}
+            <a>There were no results for that search. Please refine your search.</a>
+        {% else %}
+            <ul>
+                {% for name, id_ in companies %}
+                    <li>
+                        <a href="{{ '/company/%s' % id_ }}">{{ name }}</a>
+                    </li>  
+                {% endfor %}
+            </ul>
+        {% endif %}
+    </div>
+{% endblock %}
\ No newline at end of file
diff --git a/templates/template.html.j2 b/templates/template.html.j2
index 89539d2..4c08853 100644
--- a/templates/template.html.j2
+++ b/templates/template.html.j2
@@ -25,14 +25,14 @@
 
 <body>
     <header>
-        <h1>{{ title }}</h1>
+        <a href="/"><h1>{{ title }}</h1></a>
         <p>Data provided by the <a href="https://gender-pay-gap.service.gov.uk/">UK Government</a></p>
     </header>
 
     <aside>
-        <form id="searchform">
-            <input type="search" value="Search...">
-            <input type="submit" value="Search">
+        <form id="searchform" action="/search_click" method="POST">
+            <input type="search" id="search_entry" name="search" required>
+            <input type="submit" value="Search" id="search_btn">
         </form>
         <h4>Filter...</h4>
     </aside>
-- 
cgit v1.2.3