From 95418846c782b7e50e2784d09608b58330c95060 Mon Sep 17 00:00:00 2001
From: thomaswoehlke <thomas.woehlke@gmail.com>
Date: Mon, 18 Jan 2021 19:52:02 +0100
Subject: [PATCH] ### 0.0.8 Release * Fixed #13 /who/imported/ * Fixed #14
 /europe/imported/ * Fixed #15 /who/update: Download * Fixed #16 /who/update:
 Import File to DB * Issue #17 /who/update: Update DB * Issue #3 ORM: 3NF for
 ecdc_europa_data_import * Issue #4 data update for 3NF
 ecdc_europa_data_import

---
 templates/fragment_pagination.html       | 74 ++++++++++++------------
 templates/who/who_country_all.html       |  3 +-
 templates/who/who_date_reported_all.html |  3 +-
 templates/who/who_region_all.html        |  5 +-
 templates/who/who_region_countries.html  |  3 +-
 templates/who/who_region_country.html    | 35 ++++++-----
 6 files changed, 59 insertions(+), 64 deletions(-)

diff --git a/templates/fragment_pagination.html b/templates/fragment_pagination.html
index e54202b7..65df8fa2 100644
--- a/templates/fragment_pagination.html
+++ b/templates/fragment_pagination.html
@@ -1,43 +1,43 @@
 {% macro pagination_for_url( url_for_pagination ) -%}
-                <!-- previous page -->
-                <ul class="pagination">
-                    {% if page_data.has_prev %}
+    <!-- previous page -->
+    <ul class="pagination">
+        {% if page_data.has_prev %}
+        <li class="page-item">
+            <a class="page-link"
+               href="{{ url_for( url_for_pagination, country_id=who_country.id, page=page_data.prev_num) }}">
+                Previous
+            </a>
+        </li>
+        {% endif %}
+        <!-- all page numbers -->
+        {% for page_num in page_data.iter_pages() %}
+            {% if page_num %}
+                {% if page_num != page_data.page %}
                     <li class="page-item">
                         <a class="page-link"
-                           href="{{ url_for( url_for_pagination, country_id=who_country.id, page=page_data.prev_num) }}">
-                            Previous
+                           href="{{ url_for( url_for_pagination, country_id=who_country.id, page=page_num) }}">
+                            {{ page_num }}
                         </a>
                     </li>
-                    {% endif %}
-                    <!-- all page numbers -->
-                    {% for page_num in page_data.iter_pages() %}
-                        {% if page_num %}
-                            {% if page_num != page_data.page %}
-                                <li class="page-item">
-                                    <a class="page-link"
-                                       href="{{ url_for( url_for_pagination, country_id=who_country.id, page=page_num) }}">
-                                        {{ page_num }}
-                                    </a>
-                                </li>
-                            {% else %}
-                                <li class="page-item active">
-                                    <a class="page-link" href="#">{{ page_num }}</a>
-                                </li>
-                            {% endif %}
-                       {% else %}
-                           <li class="page-item">
-                               <span class="ellipsis page-link my-page-item-ellipsis-page-link">…</span>
-                           </li>
-                       {% endif %}
-                    {% endfor %}
-                    <!-- next page -->
-                    {% if page_data.has_next %}
-                    <li class="page-item">
-                        <a class="page-link"
-                           href="{{ url_for( url_for_pagination, country_id=who_country.id, page=page_data.next_num) }}">
-                            Next
-                        </a>
+                {% else %}
+                    <li class="page-item active">
+                        <a class="page-link" href="#">{{ page_num }}</a>
                     </li>
-                    {% endif %}
-                </ul>
-            {%- endmacro %}
\ No newline at end of file
+                {% endif %}
+           {% else %}
+               <li class="page-item">
+                   <span class="ellipsis page-link my-page-item-ellipsis-page-link">…</span>
+               </li>
+           {% endif %}
+        {% endfor %}
+        <!-- next page -->
+        {% if page_data.has_next %}
+        <li class="page-item">
+            <a class="page-link"
+               href="{{ url_for( url_for_pagination, country_id=who_country.id, page=page_data.next_num) }}">
+                Next
+            </a>
+        </li>
+        {% endif %}
+    </ul>
+{%- endmacro %}
\ No newline at end of file
diff --git a/templates/who/who_country_all.html b/templates/who/who_country_all.html
index 55f1d096..309c4088 100644
--- a/templates/who/who_country_all.html
+++ b/templates/who/who_country_all.html
@@ -1,7 +1,5 @@
 {% extends 'layout.html' %}
 
-{% include 'fragment_pagination.html' %}
-
 {% block navigation_breadcrumb %}
     <nav aria-label="breadcrumb">
         <ol class="breadcrumb">
@@ -70,6 +68,7 @@
         {% endfor %}
         </tbody>
     </table>
+
 {% endblock %}
 
 {% block footer_container %}
diff --git a/templates/who/who_date_reported_all.html b/templates/who/who_date_reported_all.html
index fc0bd104..4f193136 100644
--- a/templates/who/who_date_reported_all.html
+++ b/templates/who/who_date_reported_all.html
@@ -1,7 +1,5 @@
 {% extends 'layout.html' %}
 
-{% include 'fragment_pagination.html' %}
-
 {% block navigation_breadcrumb %}
     <nav aria-label="breadcrumb">
         <ol class="breadcrumb">
@@ -66,6 +64,7 @@
         {% endfor %}
         </tbody>
     </table>
+
 {% endblock %}
 
 {% block footer_container %}
diff --git a/templates/who/who_region_all.html b/templates/who/who_region_all.html
index 2e26937e..9211a06e 100644
--- a/templates/who/who_region_all.html
+++ b/templates/who/who_region_all.html
@@ -1,7 +1,5 @@
 {% extends 'layout.html' %}
 
-{% include 'fragment_pagination.html' %}
-
 {% block navigation_breadcrumb %}
     <nav aria-label="breadcrumb">
         <ol class="breadcrumb">
@@ -39,7 +37,7 @@
                 {% endif %}
            {% else %}
                <li>
-                   <span class="ellipsis" style="white-space; nowrap; overflow: hidden; text-overflow: ellipsis">…</span>
+                   <span class="ellipsis page-link my-page-item-ellipsis-page-link">…</span>
                </li>
            {% endif %}
         {% endfor %}
@@ -64,6 +62,7 @@
         {% endfor %}
         </tbody>
     </table>
+
 {% endblock %}
 
 {% block footer_container %}
diff --git a/templates/who/who_region_countries.html b/templates/who/who_region_countries.html
index 71bb6c57..0fc9be5d 100644
--- a/templates/who/who_region_countries.html
+++ b/templates/who/who_region_countries.html
@@ -1,7 +1,5 @@
 {% extends 'layout.html' %}
 
-{% include 'fragment_pagination.html' %}
-
 {% block navigation_breadcrumb %}
     <nav aria-label="breadcrumb">
         <ol class="breadcrumb">
@@ -71,6 +69,7 @@
         {% endfor %}
         </tbody>
     </table>
+
 {% endblock %}
 
 
diff --git a/templates/who/who_region_country.html b/templates/who/who_region_country.html
index ddfc9839..74f32707 100644
--- a/templates/who/who_region_country.html
+++ b/templates/who/who_region_country.html
@@ -1,7 +1,5 @@
 {% extends 'layout.html' %}
 
-{% include 'fragment_pagination.html' %}
-
 {% block navigation_breadcrumb %}
     <nav aria-label="breadcrumb">
         <ol class="breadcrumb">
@@ -16,23 +14,26 @@
   {% include 'fragment_navtabs_who.html' %}
 {% endblock %}
 
-
 {% block main_container %}
 
     {% if page_data.pages > 1 %}
-    <!-- previous page -->
-        <ul class="pagination">
+    <ul class="pagination">
         {% if page_data.has_prev %}
         <li class="page-item">
-            <a class="page-link" href="{{ url_for('url_who_region_country', country_id=who_country.id , page=page_data.prev_num) }}">Previous</a>
+            <a class="page-link"
+               href="{{ url_for( 'url_who_region_country', country_id=who_country.id, page=page_data.prev_num) }}">
+                Previous
+            </a>
         </li>
         {% endif %}
-        <!-- all page numbers -->
         {% for page_num in page_data.iter_pages() %}
             {% if page_num %}
                 {% if page_num != page_data.page %}
                     <li class="page-item">
-                        <a class="page-link" href="{{ url_for('url_who_region_country', country_id=who_country.id ,page=page_num) }}">{{ page_num }}</a>
+                        <a class="page-link"
+                           href="{{ url_for( 'url_who_region_country', country_id=who_country.id, page=page_num) }}">
+                            {{ page_num }}
+                        </a>
                     </li>
                 {% else %}
                     <li class="page-item active">
@@ -41,25 +42,25 @@
                 {% endif %}
            {% else %}
                <li class="page-item">
-                   <span class="ellipsis page-link" style="white-space; nowrap; overflow: hidden; text-overflow: ellipsis">…</span>
+                   <span class="ellipsis page-link my-page-item-ellipsis-page-link">…</span>
                </li>
            {% endif %}
         {% endfor %}
-        <!-- next page -->
         {% if page_data.has_next %}
         <li class="page-item">
-            <a class="page-link" href="{{ url_for('url_who_region_country', country_id=who_country.id , page=page_data.next_num) }}">Next</a>
+            <a class="page-link"
+               href="{{ url_for( 'url_who_region_country', country_id=who_country.id, page=page_data.next_num) }}">
+                Next
+            </a>
         </li>
         {% endif %}
-        </ul>
+    </ul>
     {% endif %}
 
-    {{ pagination_for_url(url_for_pagination) }}
-
     <table class="table table-hover table-striped">
         <thead>
         <tr>
-            <th scope="col">who_date_reported</th>
+            <th scope="col">date_reported</th>
             <th scope="col">deaths_new</th>
             <th scope="col">cases_new</th>
             <th scope="col">deaths_cumulative</th>
@@ -72,7 +73,7 @@
         <tbody>
         {% for who_global_data in page_data.items %}
             <tr>
-                <th><a href="/who/date_reported/{{ who_global_data.date_reported_id }}">{{ who_global_data.date_reported }}</a></th>
+                <th>{{ who_global_data.date_reported.date_reported }}</th>
                 <td>{{ who_global_data.deaths_new }}</td>
                 <td>{{ who_global_data.cases_new }}</td>
                 <td>{{ who_global_data.deaths_cumulative }}</td>
@@ -85,8 +86,6 @@
         </tbody>
     </table>
 
-    {{ pagination_for_url(url_for_pagination) }}
-
 {% endblock %}
 
 
-- 
GitLab