diff --git a/src/covid19/blueprints/rki_vaccination/rki_vaccination_views.py b/src/covid19/blueprints/rki_vaccination/rki_vaccination_views.py index 5c3f050bddceb0df87b53ad583dd797da7aa9bf3..8c2b477b88ebe9747137de417306a38477bd5e60 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 0000000000000000000000000000000000000000..fc3c7babc55ea45da6958c025102b030b6b20142 --- /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 0000000000000000000000000000000000000000..619b498d8e9b2f88b978818932f38a330f64483d --- /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 0000000000000000000000000000000000000000..3489edc477177d16f33c365e3b268eeadb5d7554 --- /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 65a3dd380ec791cba4497f7259c56e4c11c8c631..b85894a63fc9aa3c2d10e8ac2ddab14f8b0f4d57 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 8775bbe8566a2b186999fd1b276f98b202d501c0..0000000000000000000000000000000000000000 --- 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 ec93246f8b5b25ed7b14c0757522c80a467f3d65..ebe60202b2972c08258b4a791746de161b4b3dd1 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 ec93246f8b5b25ed7b14c0757522c80a467f3d65..b3cdb57704956da03ec77c3906a29bd9da3914e0 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 0000000000000000000000000000000000000000..d0d56482bb784e9352439d0d1b38a76d3bfd4bd0 --- /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 0000000000000000000000000000000000000000..941f320b750d00038bc84af70bef5e4c5db83d5f --- /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 b6b96d3531748e5045863ee33fbee2ddeff70d92..29c2c8c55568d72950e35a1232b81e050172ec6f 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 0000000000000000000000000000000000000000..3c231fdfc2175b9f9c0aac53438dee9080707354 --- /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 0000000000000000000000000000000000000000..c2e6a340bbb6e05ff371539fad60b03b0dd18d19 --- /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 1dad80b543d76345ea5fd62a3b32c327e22f8df5..63b038b3a2f3c271406c45a4543cdc65a0efdba4 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 528e988a468e6e43ebd0c56beae5c13f2292f32c..20a5c92a4dddf932af5c9dcd30dd491aa80aec59 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>