From 08165446ece6a6ee33f1d1e8f4b5985529ff9240 Mon Sep 17 00:00:00 2001 From: thomaswoehlke <thomas.woehlke@gmail.com> Date: Wed, 17 Feb 2021 15:17:14 +0100 Subject: [PATCH] ### 0.0.17 Release * Fixed #123 split RkiBundeslaenderService into two Services, one for bundeslaender and one for landkreise * Fixed #128 add fields from csv to RkiLandkreiseImport * Fixed #139 refactor RkiBundeslaenderServiceDownload to new method scheme introduced 07.02.2021 * Fixed #140 move WhoImport to RKI in: rk_service_import.py * Fixed #125 implement RkiLandkreise * Fixed #126 implement RkiBundeslaenderImport ### 0.0.18 Release * Fixed #39 SQLalchemy instead of SQL: AllModelClasses.remove_all() * Fixed #40 SQLalchemy instead of SQL: EcdcImport.get_date_rep() * Fixed #41 SQLalchemy instead of SQL: EcdcImport.get_countries_of_continent() * Fixed #107 SQLalchemy instead of SQL in: EcdcImport.get_countries_of_continent * Fixed #109 SQLalchemy instead of SQL in: EcdcImport.get_date_rep * Fixed #110 SQLalchemy instead of SQL in: EcdcImport.get_continent --- .../rki_vaccination/rki_vaccination_views.py | 24 ------- ...gment_rki_vaccination_data_pagination.html | 43 ++++++++++++ .../fragment_rki_vaccination_data_table.html | 46 +++++++++++++ ...ment_rki_vaccination_data_table_head.html} | 0 ...t_rki_vaccination_imported_pagination.html | 43 ++++++++++++ ...gment_rki_vaccination_navbar_dropdown.html | 10 +-- ...ki_vaccination_timeline_germany_table.html | 46 ------------- .../rki_vaccination/rki_vaccination_data.html | 46 +------------ .../rki_vaccination_imported.html | 46 +------------ .../fragment_who_imported_pagination.html | 37 ++++++++++ .../fragment_who_imported_table.html | 28 ++++++++ .../fragment_who_table_who_country.html | 11 ++- .../who/region/who_region_one_pagination.html | 64 ++++++++++++++++++ .../who/region/who_region_one_table.html | 65 ++++++++++++++++++ .../who/templates/who/who_imported.html | 67 +------------------ .../who/templates/who/who_info.html | 38 ++++++++--- 16 files changed, 367 insertions(+), 247 deletions(-) create mode 100644 src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_data_pagination.html create mode 100644 src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_data_table.html rename src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/{fragment_rki_vaccination_timeline_germany_table_head.html => fragment_rki_vaccination_data_table_head.html} (100%) create mode 100644 src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_imported_pagination.html delete mode 100644 src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_timeline_germany_table.html create mode 100644 src/covid19/blueprints/who/templates/who/fragments/fragment_who_imported_pagination.html create mode 100644 src/covid19/blueprints/who/templates/who/fragments/fragment_who_imported_table.html create mode 100644 src/covid19/blueprints/who/templates/who/region/who_region_one_pagination.html create mode 100644 src/covid19/blueprints/who/templates/who/region/who_region_one_table.html diff --git a/src/covid19/blueprints/rki_vaccination/rki_vaccination_views.py b/src/covid19/blueprints/rki_vaccination/rki_vaccination_views.py index 5c3f050b..8c2b477b 100644 --- a/src/covid19/blueprints/rki_vaccination/rki_vaccination_views.py +++ b/src/covid19/blueprints/rki_vaccination/rki_vaccination_views.py @@ -154,30 +154,6 @@ def url_vaccination_data(page=1): page_info=page_info) -@app_rki_vaccination.route('/date-reported/all/page/<int:page>') -@app_rki_vaccination.route('/date-reported/all') -def url_vaccination_datereported_all(page=1): - page_info = ApplicationPage('Vaccination', "Germany Timeline") - page_data = RkiVaccinationDateReported.get_all_as_page(page) - return render_template( - 'rki_vaccination/rki_vaccination_timeline_germany.html', - page_data=page_data, - page_info=page_info) - - -@app_rki_vaccination.route('/date-reported/<int:vaccination_date_reported_id>/page/<int:page>') -@app_rki_vaccination.route('/date-reported/<int:vaccination_date_reported_id>') -def url_vaccination_datereported_one(page=1, vaccination_date_reported_id=0): - page_info = ApplicationPage('Vaccination', "Germany Timeline") - datereported = RkiVaccinationDateReported.find_by_id(vaccination_date_reported_id) - page_data = RkiVaccinationData.find_by_datum(page, datereported) - return render_template( - 'rki_vaccination/rki_vaccination_timeline_germany.html', - datereported=datereported, - page_data=page_data, - page_info=page_info) - - @app_rki_vaccination.route('/task/download/only') def url_vaccination_task_download_only(): flash("url_vaccination_task_download_only started") diff --git a/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_data_pagination.html b/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_data_pagination.html new file mode 100644 index 00000000..fc3c7bab --- /dev/null +++ b/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_data_pagination.html @@ -0,0 +1,43 @@ +{% if page_data.pages > 1 %} + <!-- previous page --> + <ul class="pagination"> + {% if page_data.has_prev %} + <li class="page-item"> + <a class="page-link" + href="{{ url_for('rki_vaccination.url_vaccination_data', 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('rki_vaccination.url_vaccination_data', 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('rki_vaccination.url_vaccination_data', page=page_data.next_num) }}"> + Next + </a> + </li> + {% endif %} + </ul> + {% endif %} \ No newline at end of file diff --git a/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_data_table.html b/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_data_table.html new file mode 100644 index 00000000..619b498d --- /dev/null +++ b/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_data_table.html @@ -0,0 +1,46 @@ + +<div class="table-responsive"> + <table class="table table-hover table-striped table-sm table-bordered"> + <thead> + {% include 'rki_vaccination/fragments/fragment_rki_vaccination_data_table_head.html' %} + </thead> + <tbody> + {% for data_item in page_data.items %} + <tr> + <td class="text-center table-dark" nowrap>{{ data_item.datum }}</td> + + <td class="text-right table-secondary">{{ data_item.dosen_differenz_zum_vortag }}</td> + + <td class="text-right table-warning">{{ data_item.dosen_kumulativ }}</td> + <td class="text-right table-warning">{{ data_item.dosen_biontech_kumulativ }}</td> + <td class="text-right table-warning">{{ data_item.dosen_moderna_kumulativ }}</td> + + <td class="text-right table-light">{{ data_item.personen_erst_kumulativ }}</td> + <td class="text-right table-light">{{ data_item.personen_voll_kumulativ }}</td> + + <td class="text-right table-danger">{{ data_item.impf_quote_erst }}</td> + <td class="text-right table-danger">{{ data_item.impf_quote_voll }}</td> + + <td class="text-right table-light">{{ data_item.indikation_alter_dosen }}</td> + <td class="text-right table-light">{{ data_item.indikation_alter_erst }}</td> + <td class="text-right table-light">{{ data_item.indikation_alter_voll }}</td> + + <td class="text-right table-secondary">{{ data_item.indikation_pflegeheim_dosen }}</td> + <td class="text-right table-secondary">{{ data_item.indikation_pflegeheim_erst }}</td> + <td class="text-right table-secondary">{{ data_item.indikation_pflegeheim_voll }}</td> + + <td class="text-right table-light">{{ data_item.indikation_beruf_dosen }}</td> + <td class="text-right table-light">{{ data_item.indikation_beruf_erst }}</td> + <td class="text-right table-light">{{ data_item.indikation_beruf_erst }}</td> + + <td class="text-right table-secondary">{{ data_item.indikation_medizinisch_dosen }}</td> + <td class="text-right table-secondary">{{ data_item.indikation_medizinisch_erst }}</td> + <td class="text-right table-secondary">{{ data_item.indikation_medizinisch_voll }}</td> + </tr> + {% endfor %} + </tbody> + <tfoot> + {% include 'rki_vaccination/fragments/fragment_rki_vaccination_timeline_germany_table_head.html' %} + </tfoot> + </table> +</div> \ No newline at end of file diff --git a/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_timeline_germany_table_head.html b/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_data_table_head.html similarity index 100% rename from src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_timeline_germany_table_head.html rename to src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_data_table_head.html diff --git a/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_imported_pagination.html b/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_imported_pagination.html new file mode 100644 index 00000000..3489edc4 --- /dev/null +++ b/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_imported_pagination.html @@ -0,0 +1,43 @@ +{% if page_data.pages > 1 %} + <!-- previous page --> + <ul class="pagination"> + {% if page_data.has_prev %} + <li class="page-item"> + <a class="page-link" + href="{{ url_for('rki_vaccination.url_vaccination_imported', 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('rki_vaccination.url_vaccination_imported', 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('rki_vaccination.url_vaccination_imported', page=page_data.next_num) }}"> + Next + </a> + </li> + {% endif %} + </ul> + {% endif %} \ No newline at end of file diff --git a/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_navbar_dropdown.html b/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_navbar_dropdown.html index 65a3dd38..b85894a6 100644 --- a/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_navbar_dropdown.html +++ b/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_navbar_dropdown.html @@ -19,12 +19,6 @@ </a> <div class="dropdown-divider"></div> - <a class="dropdown-item" - href="{{ url_for( 'rki_vaccination.url_vaccination_datereported_all') }}"> - RKI Vaccination :: url_vaccination_datereported_all - </a> - <div class="dropdown-divider"></div> - <a class="dropdown-item" href="{{ url_for( 'rki_vaccination.url_vaccination_task_download_only') }}"> RKI Vaccination :: TASK:: url_vaccination_task_download_only @@ -57,12 +51,12 @@ <div class="dropdown-divider"></div> <a class="dropdown-item" href="{{ url_for( 'rki_vaccination.url_vaccination_data') }}"> - RKI Vaccination Timeline Germany Data + RKI Vaccination :: Data (Timeline Germany) </a> <!-- Tasks --> <a class="dropdown-item" href="{{ url_for( 'rki_vaccination.url_vaccination_imported') }}"> - RKI Vaccination Timeline Germany imported + RKI Vaccination :: imported (Timeline Germany) </a> </div> </li> \ No newline at end of file diff --git a/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_timeline_germany_table.html b/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_timeline_germany_table.html deleted file mode 100644 index 8775bbe8..00000000 --- a/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/fragments/fragment_rki_vaccination_timeline_germany_table.html +++ /dev/null @@ -1,46 +0,0 @@ - -<div class="table-responsive"> - <table class="table table-hover table-striped table-sm table-bordered"> - <thead> - {% include 'rki_vaccination/fragments/fragment_rki_vaccination_timeline_germany_table_head.html' %} - </thead> - <tbody> - {% for vaccination_germany_timeline in page_data.items %} - <tr> - <td class="text-center table-dark" nowrap>{{ vaccination_germany_timeline.datum }}</td> - - <td class="text-right table-secondary">{{ vaccination_germany_timeline.dosen_differenz_zum_vortag }}</td> - - <td class="text-right table-warning">{{ vaccination_germany_timeline.dosen_kumulativ }}</td> - <td class="text-right table-warning">{{ vaccination_germany_timeline.dosen_biontech_kumulativ }}</td> - <td class="text-right table-warning">{{ vaccination_germany_timeline.dosen_moderna_kumulativ }}</td> - - <td class="text-right table-light">{{ vaccination_germany_timeline.personen_erst_kumulativ }}</td> - <td class="text-right table-light">{{ vaccination_germany_timeline.personen_voll_kumulativ }}</td> - - <td class="text-right table-danger">{{ vaccination_germany_timeline.impf_quote_erst }}</td> - <td class="text-right table-danger">{{ vaccination_germany_timeline.impf_quote_voll }}</td> - - <td class="text-right table-light">{{ vaccination_germany_timeline.indikation_alter_dosen }}</td> - <td class="text-right table-light">{{ vaccination_germany_timeline.indikation_alter_erst }}</td> - <td class="text-right table-light">{{ vaccination_germany_timeline.indikation_alter_voll }}</td> - - <td class="text-right table-secondary">{{ vaccination_germany_timeline.indikation_pflegeheim_dosen }}</td> - <td class="text-right table-secondary">{{ vaccination_germany_timeline.indikation_pflegeheim_erst }}</td> - <td class="text-right table-secondary">{{ vaccination_germany_timeline.indikation_pflegeheim_voll }}</td> - - <td class="text-right table-light">{{ vaccination_germany_timeline.indikation_beruf_dosen }}</td> - <td class="text-right table-light">{{ vaccination_germany_timeline.indikation_beruf_erst }}</td> - <td class="text-right table-light">{{ vaccination_germany_timeline.indikation_beruf_erst }}</td> - - <td class="text-right table-secondary">{{ vaccination_germany_timeline.indikation_medizinisch_dosen }}</td> - <td class="text-right table-secondary">{{ vaccination_germany_timeline.indikation_medizinisch_erst }}</td> - <td class="text-right table-secondary">{{ vaccination_germany_timeline.indikation_medizinisch_voll }}</td> - </tr> - {% endfor %} - </tbody> - <tfoot> - {% include 'rki_vaccination/fragments/fragment_rki_vaccination_timeline_germany_table_head.html' %} - </tfoot> - </table> -</div> \ No newline at end of file diff --git a/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/rki_vaccination_data.html b/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/rki_vaccination_data.html index ec93246f..ebe60202 100644 --- a/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/rki_vaccination_data.html +++ b/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/rki_vaccination_data.html @@ -7,54 +7,12 @@ <div class="container"> <div class="row"> <div class="col"> - {% if page_data.pages > 1 %} - <!-- previous page --> - <ul class="pagination"> - {% if page_data.has_prev %} - <li class="page-item"> - <a class="page-link" - href="{{ url_for('rki_vaccination.url_vaccination_timeline_germany', 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('rki_vaccination.url_vaccination_timeline_germany', 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('rki_vaccination.url_vaccination_timeline_germany', page=page_data.next_num) }}"> - Next - </a> - </li> - {% endif %} - </ul> - {% endif %} + {% include 'rki_vaccination/fragments/fragment_rki_vaccination_data_pagination.html' %} </div> </div> <div class="row"> <div class="col"> - {% include 'rki_vaccination/fragments/fragment_rki_vaccination_timeline_germany_table.html' %} + {% include 'rki_vaccination/fragments/fragment_rki_vaccination_data_table.html' %} </div> </div> </div> diff --git a/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/rki_vaccination_imported.html b/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/rki_vaccination_imported.html index ec93246f..b3cdb577 100644 --- a/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/rki_vaccination_imported.html +++ b/src/covid19/blueprints/rki_vaccination/templates/rki_vaccination/rki_vaccination_imported.html @@ -7,54 +7,12 @@ <div class="container"> <div class="row"> <div class="col"> - {% if page_data.pages > 1 %} - <!-- previous page --> - <ul class="pagination"> - {% if page_data.has_prev %} - <li class="page-item"> - <a class="page-link" - href="{{ url_for('rki_vaccination.url_vaccination_timeline_germany', 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('rki_vaccination.url_vaccination_timeline_germany', 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('rki_vaccination.url_vaccination_timeline_germany', page=page_data.next_num) }}"> - Next - </a> - </li> - {% endif %} - </ul> - {% endif %} + {% include 'rki_vaccination/fragments/fragment_rki_vaccination_imported_pagination.html' %} </div> </div> <div class="row"> <div class="col"> - {% include 'rki_vaccination/fragments/fragment_rki_vaccination_timeline_germany_table.html' %} + {% include 'rki_vaccination/fragments/fragment_rki_vaccination_data_table.html' %} </div> </div> </div> diff --git a/src/covid19/blueprints/who/templates/who/fragments/fragment_who_imported_pagination.html b/src/covid19/blueprints/who/templates/who/fragments/fragment_who_imported_pagination.html new file mode 100644 index 00000000..d0d56482 --- /dev/null +++ b/src/covid19/blueprints/who/templates/who/fragments/fragment_who_imported_pagination.html @@ -0,0 +1,37 @@ + {% if page_data.pages > 1 %} + <!-- previous page --> + <ul class="pagination"> + {% if page_data.has_prev %} + <li class="page-item"> + <a class="page-link" + href="{{ url_for('who.url_who_imported', 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('who.url_who_imported', 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('who.url_who_imported', page=page_data.next_num) }}">Next</a> + </li> + {% endif %} + </ul> + {% endif %} \ No newline at end of file diff --git a/src/covid19/blueprints/who/templates/who/fragments/fragment_who_imported_table.html b/src/covid19/blueprints/who/templates/who/fragments/fragment_who_imported_table.html new file mode 100644 index 00000000..941f320b --- /dev/null +++ b/src/covid19/blueprints/who/templates/who/fragments/fragment_who_imported_table.html @@ -0,0 +1,28 @@ + <table class="table table-hover table-striped table-dark"> + <thead> + <tr> + <th scope="col">date reported</th> + <th scope="col">country</th> + <th scope="col">country code</th> + <th scope="col">who region</th> + <th scope="col">new cases</th> + <th scope="col">cumulative cases</th> + <th scope="col">new deaths</th> + <th scope="col">cumulative deaths</th> + </tr> + </thead> + <tbody> + {% for who_global_data_import in page_data.items %} + <tr> + <td>{{ who_global_data_import.date_reported }}</td> + <td>{{ who_global_data_import.country }}</td> + <td>{{ who_global_data_import.country_code }}</td> + <td>{{ who_global_data_import.who_region }}</td> + <td>{{ who_global_data_import.new_cases }}</td> + <td>{{ who_global_data_import.cumulative_cases }}</td> + <td>{{ who_global_data_import.new_deaths }}</td> + <td>{{ who_global_data_import.cumulative_deaths }}</td> + </tr> + {% endfor %} + </tbody> + </table> \ No newline at end of file diff --git a/src/covid19/blueprints/who/templates/who/fragments/fragment_who_table_who_country.html b/src/covid19/blueprints/who/templates/who/fragments/fragment_who_table_who_country.html index b6b96d35..29c2c8c5 100644 --- a/src/covid19/blueprints/who/templates/who/fragments/fragment_who_table_who_country.html +++ b/src/covid19/blueprints/who/templates/who/fragments/fragment_who_table_who_country.html @@ -1,7 +1,6 @@ <table class="table table-hover table-striped table-dark"> <thead class="table-secondary"> <tr> - <!-- TODO: change URL to for_url() --> <th scope="col"> country </th> @@ -9,7 +8,7 @@ country code </th> <th scope="col"> - <a href="/who/region/all">region</a> + <a href="{{ url_for('who.url_who_region_all') }}">region</a> </th> </tr> </thead> @@ -17,17 +16,17 @@ {% for who_country in page_data.items %} <tr> <td> - <a href="/who/country/{{ who_country.id }}"> + <a href="{{ url_for('who.url_who_country', country_id=who_country.id) }}"> {{ who_country.country }} </a> </td> <td> - <a href="/who/country/{{ who_country.id }}"> + <a href="{{ url_for('who.url_who_country', country_id=who_country.id) }}"> {{ who_country.country_code }} </a> </td> <th> - <a href="/who/region/{{ who_country.region.id }}"> + <a href="{{ url_for('who.url_who_region', region_id=who_country.region.id) }}"> {{ who_country.region.region }} </a> </th> @@ -43,7 +42,7 @@ country code </th> <th scope="col"> - <a href="/who/region/all">region</a> + <a href="{{ url_for('who.url_who_region_all') }}">region</a> </th> </tr> </tfoot> diff --git a/src/covid19/blueprints/who/templates/who/region/who_region_one_pagination.html b/src/covid19/blueprints/who/templates/who/region/who_region_one_pagination.html new file mode 100644 index 00000000..3c231fdf --- /dev/null +++ b/src/covid19/blueprints/who/templates/who/region/who_region_one_pagination.html @@ -0,0 +1,64 @@ +{% extends 'application/page_layout.html' %} + +{% block content %} + {{super()}} + {% include 'who/fragments/fragment_who_navtabs.html' %} + + <div class="container"> + <div class="row"> + <div class="col"> + {% if page_data.pages > 1 %} + <!-- previous page --> + <ul class="pagination"> + {% if page_data.has_prev %} + <li class="page-item"> + <a class="page-link" href="{{ url_for('who.url_who_region', + region_id=who_region.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('who.url_who_region', + region_id=who_region.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('who.url_who_region', + region_id=who_region.id , page=page_data.next_num) }}">Next</a> + </li> + {% endif %} + </ul> + {% endif %} + </div> + </div> + <div class="row"> + <div class="col"> + {% include 'who/fragments/fragment_who_table_who_country.html' %} + </div> + </div> + </div> +{% endblock %} + + +{% block footer_container %} + <div> + {% for error in errors %} + <h4>{{ error }}</h4> + {% endfor %} + </div> +{% endblock %} \ No newline at end of file diff --git a/src/covid19/blueprints/who/templates/who/region/who_region_one_table.html b/src/covid19/blueprints/who/templates/who/region/who_region_one_table.html new file mode 100644 index 00000000..c2e6a340 --- /dev/null +++ b/src/covid19/blueprints/who/templates/who/region/who_region_one_table.html @@ -0,0 +1,65 @@ +{% extends 'application/page_layout.html' %} + +{% block content %} + {{super()}} + {% include 'who/fragments/fragment_who_navtabs.html' %} + + <div class="container"> + <div class="row"> + <div class="col"> + {% if page_data.pages > 1 %} + <!-- previous page --> + <ul class="pagination"> + {% if page_data.has_prev %} + <li class="page-item"> + <a class="page-link" href="{{ url_for('who.url_who_region', + region_id=who_region.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('who.url_who_region', + region_id=who_region.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('who.url_who_region', + region_id=who_region.id , page=page_data.next_num) }}">Next</a> + </li> + {% endif %} + </ul> + {% endif %} + </div> + </div> + <div class="container"> + <div class="row"> + <div class="col"> + {% include 'who/fragments/fragment_who_table_who_country.html' %} + </div> + </div> + </div> +{% endblock %} + + +{% block footer_container %} + <div> + {% for error in errors %} + <h4>{{ error }}</h4> + {% endfor %} + </div> +{% endblock %} \ No newline at end of file diff --git a/src/covid19/blueprints/who/templates/who/who_imported.html b/src/covid19/blueprints/who/templates/who/who_imported.html index 1dad80b5..63b038b3 100644 --- a/src/covid19/blueprints/who/templates/who/who_imported.html +++ b/src/covid19/blueprints/who/templates/who/who_imported.html @@ -7,75 +7,12 @@ <div class="container"> <div class="row"> <div class="col"> - {% if page_data.pages > 1 %} - <!-- previous page --> - <ul class="pagination"> - {% if page_data.has_prev %} - <li class="page-item"> - <a class="page-link" - href="{{ url_for('who.url_who_imported', 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('who.url_who_imported', 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('who.url_who_imported', page=page_data.next_num) }}">Next</a> - </li> - {% endif %} - </ul> - {% endif %} + {% include 'who/fragments/fragment_who_imported_pagination.html' %} </div> </div> <div class="row"> <div class="col"> - <table class="table table-hover table-striped table-dark"> - <thead> - <tr> - <th scope="col">date reported</th> - <th scope="col">country</th> - <th scope="col">country code</th> - <th scope="col">who region</th> - <th scope="col">new cases</th> - <th scope="col">cumulative cases</th> - <th scope="col">new deaths</th> - <th scope="col">cumulative deaths</th> - </tr> - </thead> - <tbody> - {% for who_global_data_import in page_data.items %} - <tr> - <td>{{ who_global_data_import.date_reported }}</td> - <td>{{ who_global_data_import.country }}</td> - <td>{{ who_global_data_import.country_code }}</td> - <td>{{ who_global_data_import.who_region }}</td> - <td>{{ who_global_data_import.new_cases }}</td> - <td>{{ who_global_data_import.cumulative_cases }}</td> - <td>{{ who_global_data_import.new_deaths }}</td> - <td>{{ who_global_data_import.cumulative_deaths }}</td> - </tr> - {% endfor %} - </tbody> - </table> + {% include 'who/fragments/fragment_who_imported_table.html' %} </div> </div> </div> diff --git a/src/covid19/blueprints/who/templates/who/who_info.html b/src/covid19/blueprints/who/templates/who/who_info.html index 528e988a..20a5c92a 100644 --- a/src/covid19/blueprints/who/templates/who/who_info.html +++ b/src/covid19/blueprints/who/templates/who/who_info.html @@ -7,18 +7,36 @@ <div class="container"> <div class="row"> <div class="col"> - <h3>WHO Coronavirus Disease (COVID-19) Dashboard</h3> - <p> - <a href="https://covid19.who.int/">https://covid19.who.int</a> - </p> + <div class="card"> + <div class="card-body"> + <div class="card-title"> + Dashboard + </div> + <div class="card-text"> + WHO Coronavirus Disease (COVID-19) + </div> + <div class="card-text"> + <a class="btn btn-primary" href="https://covid19.who.int/">https://covid19.who.int</a> + </div> + </div> + </div> </div> <div class="col"> - <h3>WHO Coronavirus disease (COVID-19) pandemic</h3> - <p> - <a href="https://www.who.int/emergencies/diseases/novel-coronavirus-2019"> - https://www.who.int/emergencies/diseases/novel-coronavirus-2019 - </a> - </p> + <div class="card"> + <div class="card-body"> + <div class="card-title"> + Pandemic + </div> + <div class="card-text"> + WHO Coronavirus Disease (COVID-19) + </div> + <div class="card-text"> + <a class="btn btn-primary" href="https://www.who.int/emergencies/diseases/novel-coronavirus-2019"> + novel-coronavirus-2019 + </a> + </div> + </div> + </div> </div> </div> </div> -- GitLab