diff --git a/README.md b/README.md index 49ce08f7869abe3e0645f7feb8606b5fe6e304b6..a289887c028a1b53636e19623856c906a3fddff6 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,7 @@ class WhoGlobalDataImportTable(db.Model): * Issue #47 refactor Routes from app.py to org...who,europe,... * Issue #48 refactor Tasks from server_mq.py to org...who,europe,... * Issue #49 EuropeServiceUpdate.__update_data_short() +* Issue #50 remove unused requirements from requirements.txt ### 0.0.12 Release * Issue #5 Visual Graphs for Data per Countries order by Date diff --git a/app.py b/app.py index 471f8ddb4c60129be4f8b3fb79f44ef1fbcb5b0f..d425cbb7fbc802b8d6f28aa0029371fc9cea7399 100644 --- a/app.py +++ b/app.py @@ -272,9 +272,9 @@ def url_europe_data_imported(page=1): page_info=page_info) -@app.route('/europe/date_reported/page/<int:page>') -@app.route('/europe/date_reported') -def url_europe_date_reported(page=1): +@app.route('/europe/date_reported/all/page/<int:page>') +@app.route('/europe/date_reported/all') +def url_europe_date_reported_all(page=1): page_info = ApplicationPage('Europe', "date_reported") page_data = EuropeDateReported.get_all_as_page(page) return render_template( @@ -296,9 +296,9 @@ def url_europe_date_reported_one(europe_date_reported_id, page=1): page_info=page_info) -@app.route('/europe/continent/page/<int:page>') -@app.route('/europe/continent') -def url_europe_continent(page=1): +@app.route('/europe/continent/all/page/<int:page>') +@app.route('/europe/continent/all') +def url_europe_continent_all(page=1): page_info = ApplicationPage('Europe', "continent") page_data = EuropeContinent.get_all_as_page(page) return render_template( @@ -307,6 +307,20 @@ def url_europe_continent(page=1): page_info=page_info) + +@app.route('/europe/continent/<int:continent_id>/page/<int:page>') +@app.route('/europe/continent/<int:continent_id>') +def url_europe_continent_one(continent_id, page=1): + page_info = ApplicationPage('Europe', "continent") + continent = EuropeContinent.get_by_id(continent_id) + page_data = EuropeCountry.find_by_continent(continent, page) + return render_template( + 'europe/europe_continent_all.html', + continent=continent, + page_data=page_data, + page_info=page_info) + + @app.route('/europe/country/all/page/<int:page>') @app.route('/europe/country/all') def url_europe_country_all(page=1): diff --git a/org/woehlke/covid19/europe/europe_model.py b/org/woehlke/covid19/europe/europe_model.py index a77d8025515307309f2494276c251e047328e0d7..03ab1c5bda5362158ad48772e38a84318a614892 100644 --- a/org/woehlke/covid19/europe/europe_model.py +++ b/org/woehlke/covid19/europe/europe_model.py @@ -178,6 +178,10 @@ class EuropeCountry(db.Model): (cls.country_territory_code == country_territory_code) )).one() + @classmethod + def find_by_continent(cls, continent, page): + return db.session.query(cls).filter(cls.continent_id == continent.id).paginate(page, per_page=ITEMS_PER_PAGE) + class EuropeData(db.Model): __tablename__ = 'europe_data' diff --git a/requirements.txt b/requirements.txt index db3cf397a2f7c33cb47d912749f01fa34244e8a6..936553a83f97cddf11690b6b945a947a86e6d632 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,10 +6,10 @@ packaging==20.8 # Flask # Flask==1.1.2 -Flask-Admin==1.5.7 +#Flask-Admin==1.5.7 Flask-DB==0.3.0 -Flask-Migrate==2.6.0 -flask-restx==0.2.0 +#Flask-Migrate==2.6.0 +#flask-restx==0.2.0 Flask-SQLAlchemy==2.4.4 SQLAlchemy==1.3.22 SQLAlchemy-Utils==0.36.8 @@ -19,18 +19,12 @@ Werkzeug==1.0.1 # Flask extras # flask-paginate==0.8.0 -simplejson==3.17.2 -blinker==1.4 +#simplejson==3.17.2 +#blinker==1.4 python-dotenv==0.15.0 watchdog==1.0.2 flask-cors==3.0.10 # -# -# -tokenize-rt==4.0.0 -numpy==1.19.5 -pandas==1.2.1 -# # PostgreSQL # psycopg2==2.8.6 @@ -42,5 +36,11 @@ celery[redis]==5.0.5 # # Frontend # -pyecharts==1.9.0 -pyecharts-extras==0.0.5 \ No newline at end of file +#pyecharts==1.9.0 +#pyecharts-extras==0.0.5 +# +# +# +#tokenize-rt==4.0.0 +#numpy==1.19.5 +#pandas==1.2.1 \ No newline at end of file diff --git a/templates/europe/europe_continent_all.html b/templates/europe/europe_continent_all.html index c3db4ff0524e32d17fdf11eb3383296eea6d0694..a8ca95274f0f240ec5273f329e5d67db755f4b28 100644 --- a/templates/europe/europe_continent_all.html +++ b/templates/europe/europe_continent_all.html @@ -57,7 +57,7 @@ </ul> {% endif %} - <table class="table table-hover table-striped"> + <table class="table table-hover table-striped table-dark"> <thead> <tr> <th scope="col">continent</th> @@ -66,7 +66,7 @@ <tbody> {% for europe_continent in page_data.items %} <tr> - <td>{{ europe_continent.continent_exp }}</td> + <td><a href="/europe/continent/{{ europe_continent.id }}">{{ europe_continent.continent_exp }}</a></td> </tr> {% endfor %} </tbody> diff --git a/templates/europe/europe_continent_one.html b/templates/europe/europe_continent_one.html new file mode 100644 index 0000000000000000000000000000000000000000..f642f3ef47bc92ff6a6d4ab9f9837027340b950c --- /dev/null +++ b/templates/europe/europe_continent_one.html @@ -0,0 +1,71 @@ +{% extends 'page_layout.html' %} + +{% block navigation_breadcrumb %} + <nav aria-label="breadcrumb"> + <ol class="breadcrumb"> + <li class="breadcrumb-item"><a href="/">Home</a></li> + <li class="breadcrumb-item"><a href="/who/region/all">Regions</a></li> + <li class="breadcrumb-item active" aria-current="page">TBD</li> + </ol> + </nav> +{% endblock %} + +{% block navigation_navtabs %} + {% include 'fragment_navtabs_europe.html' %} +{% endblock %} + +{% block main_container %} + + {% if page_data.pages > 1 %} + <ul class="pagination"> + {% if page_data.has_prev %} + <li class="page-item"> + <a class="page-link" + href="{{ url_for( 'url_europe_continent', page=page_data.prev_num) }}"> + Previous + </a> + </li> + {% endif %} + {% 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_europe_continent', 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 %} + {% if page_data.has_next %} + <li class="page-item"> + <a class="page-link" + href="{{ url_for( 'url_europe_continent', page=page_data.next_num) }}"> + Next + </a> + </li> + {% endif %} + </ul> + {% endif %} + + {% include 'europe/fragment_europe_country_table.html' %} + +{% endblock %} + + +{% block footer_container %} + <div> + {% for error in errors %} + <h4>{{ error }}</h4> + {% endfor %} + </div> +{% endblock %} \ No newline at end of file diff --git a/templates/europe/europe_country_all.html b/templates/europe/europe_country_all.html index 7427d42a71c6308653e1cfc44501191f17424db7..7044d9b617672927c2cfe26b6485654358f0bac7 100644 --- a/templates/europe/europe_country_all.html +++ b/templates/europe/europe_country_all.html @@ -57,33 +57,7 @@ </ul> {% endif %} - <table class="table table-hover table-striped"> - <thead> - <tr> - <th scope="col">countries_and_territories</th> - <th scope="col">pop_data_2019</th> - <th scope="col">geo_id</th> - <th scope="col">country_territory_code</th> - <th scope="col">continent</th> - </tr> - </thead> - <tbody> - {% for europe_country in page_data.items %} - <tr> - <td> - <a href="/europe/country/{{ europe_country.id }}"> - {{ europe_country.countries_and_territories }}</a></td> - <td>{{ europe_country.pop_data_2019 }}</td> - <td><a href="/europe/country/{{ europe_country.id }}"> - {{ europe_country.geo_id }}</a></td> - <td><a href="/europe/country/{{ europe_country.id }}"> - {{ europe_country.country_territory_code }}</a></td> - <td><a href="/europe/continent/{{ europe_country.continent.id }}"> - {{ europe_country.continent.continent_exp }}</a></td> - </tr> - {% endfor %} - </tbody> - </table> + {% include 'europe/fragment_europe_country_table.html' %} {% endblock %} diff --git a/templates/europe/europe_country_one.html b/templates/europe/europe_country_one.html index 53aa7c4b254204fca6b1247b755a70e252864538..cb1e856fec8f6f2d77cbed9cb991c4da540d7b88 100644 --- a/templates/europe/europe_country_one.html +++ b/templates/europe/europe_country_one.html @@ -52,7 +52,7 @@ </ul> {% endif %} - {% include 'europe/europe_data_table.html' %} + {% include 'europe/fragment_europe_data_table.html' %} {% endblock %} diff --git a/templates/europe/europe_data.html b/templates/europe/europe_data.html index e2ce09c03aa8528b51b75b902af06b28bd5e4a5b..f4f195423c4a7843f5c81d8527bc849bd6b34025 100644 --- a/templates/europe/europe_data.html +++ b/templates/europe/europe_data.html @@ -57,38 +57,7 @@ </ul> {% endif %} - <table class="table table-hover table-striped"> - <thead> - <tr> - <th scope="col">date_rep</th> - <th scope="col">year_week</th> - <th scope="col">deaths_weekly</th> - <th scope="col">cases_weekly</th> - <th scope="col">notification_rate_per_100000_population_14days</th> - <th scope="col">countries_and_territories</th> - <th scope="col">pop_data_2019</th> - <th scope="col">geo_id</th> - <th scope="col">country_territory_code</th> - <th scope="col">continent</th> - </tr> - </thead> - <tbody> - {% for europe_data in page_data.items %} - <tr> - <td>{{ europe_data.europe_date_reported.date_rep }}</td> - <td>{{ europe_data.europe_date_reported.year_week }}</td> - <td>{{ europe_data.deaths_weekly }}</td> - <td>{{ europe_data.cases_weekly }}</td> - <td>{{ europe_data.notification_rate_per_100000_population_14days }}</td> - <td>{{ europe_data.europe_country.countries_and_territories }}</td> - <td>{{ europe_data.europe_country.pop_data_2019 }}</td> - <td>{{ europe_data.europe_country.geo_id }}</td> - <td>{{ europe_data.europe_country.country_territory_code }}</td> - <td>{{ europe_data.europe_country.continent.continent_exp }}</td> - </tr> - {% endfor %} - </tbody> - </table> + {% include 'europe/fragment_europe_data_table.html' %} {% endblock %} diff --git a/templates/europe/europe_date_reported_all.html b/templates/europe/europe_date_reported_all.html index 872be3cd526841d4cbedfb8c46ffd2ba3ca9fec8..e65ab6d9e5d0bfa7514b899f0cf1ce3286941f6f 100644 --- a/templates/europe/europe_date_reported_all.html +++ b/templates/europe/europe_date_reported_all.html @@ -21,7 +21,7 @@ {% if page_data.has_prev %} <li class="page-item"> <a class="page-link" - href="{{ url_for( 'url_europe_date_reported', page=page_data.prev_num) }}"> + href="{{ url_for( 'url_europe_date_reported_all', page=page_data.prev_num) }}"> Previous </a> </li> @@ -31,7 +31,7 @@ {% if page_num != page_data.page %} <li class="page-item"> <a class="page-link" - href="{{ url_for( 'url_europe_date_reported', page=page_num) }}"> + href="{{ url_for( 'url_europe_date_reported_all', page=page_num) }}"> {{ page_num }} </a> </li> @@ -49,7 +49,7 @@ {% if page_data.has_next %} <li class="page-item"> <a class="page-link" - href="{{ url_for( 'url_europe_date_reported', page=page_data.next_num) }}"> + href="{{ url_for( 'url_europe_date_reported_all', page=page_data.next_num) }}"> Next </a> </li> @@ -57,18 +57,19 @@ </ul> {% endif %} - <table class="table table-hover table-striped"> + <table class="table table-hover table-striped table-dark"> <thead> <tr> - <th scope="col">date_rep</th> - <th scope="col">year_week</th> + <th scope="col">date reported</th> + <th scope="col">year week</th> </tr> </thead> <tbody> {% for europe_date_reported in page_data.items %} <tr> - <td><a href="/europe/date_reported/{{ europe_date_reported.id }}">{{ europe_date_reported.date_rep }}</a></td> - <td>{{ europe_date_reported.year_week }}</td> + <th>{{ europe_date_reported.date_rep }}</th> + <td><a href="/europe/date_reported/{{ europe_date_reported.id }}"> + {{ europe_date_reported.year_week }}</a></td> </tr> {% endfor %} </tbody> diff --git a/templates/europe/europe_date_reported_one.html b/templates/europe/europe_date_reported_one.html index f34943d5e9cd96b8571eddedfcfca00cede96127..6c18afea5324b85b3fca308e57b397d66c736260 100644 --- a/templates/europe/europe_date_reported_one.html +++ b/templates/europe/europe_date_reported_one.html @@ -55,7 +55,7 @@ </ul> {% endif %} - {% include 'europe/europe_data_table.html' %} + {% include 'europe/fragment_europe_data_table.html' %} {% endblock %} diff --git a/templates/europe/fragment_europe_country_table.html b/templates/europe/fragment_europe_country_table.html new file mode 100644 index 0000000000000000000000000000000000000000..b21d06968c8ab67adb768995af2d873b570634a4 --- /dev/null +++ b/templates/europe/fragment_europe_country_table.html @@ -0,0 +1,35 @@ + + <table class="table table-hover table-striped table-dark"> + <thead> + <tr> + <th scope="col">countries and territories</th> + <th scope="col">population data 2019</th> + <th scope="col">geo id</th> + <th scope="col">country territory code</th> + <th scope="col">continent</th> + </tr> + </thead> + <tbody> + {% for europe_country in page_data.items %} + <tr> + <td> + <a href="/europe/country/{{ europe_country.id }}"> + {{ europe_country.countries_and_territories }}</a> + </td> + <td>{{ europe_country.pop_data_2019 }}</td> + <td> + <a href="/europe/country/{{ europe_country.id }}"> + {{ europe_country.geo_id }}</a> + </td> + <td> + <a href="/europe/country/{{ europe_country.id }}"> + {{ europe_country.country_territory_code }}</a> + </td> + <td> + <a href="/europe/continent/{{ europe_country.continent.id }}"> + {{ europe_country.continent.continent_exp }}</a> + </td> + </tr> + {% endfor %} + </tbody> + </table> \ No newline at end of file diff --git a/templates/europe/europe_data_table.html b/templates/europe/fragment_europe_data_table.html similarity index 97% rename from templates/europe/europe_data_table.html rename to templates/europe/fragment_europe_data_table.html index 1f85f333b09610777f0ae9c059ae596348acd77d..c56001e7b1ce1a3710fa0abaf878de8dbcae099f 100644 --- a/templates/europe/europe_data_table.html +++ b/templates/europe/fragment_europe_data_table.html @@ -7,7 +7,7 @@ <th scope="col">cases weekly</th> <th scope="col">notification rate per 100000 population 14days</th> <th scope="col">countries and territories</th> - <th scope="col">pop data 2019</th> + <th scope="col">population data 2019</th> <th scope="col">geo id</th> <th scope="col">country territory code</th> <th scope="col">continent</th> diff --git a/templates/fragment_navtabs_europe.html b/templates/fragment_navtabs_europe.html index 73aa49a1255c16b8d010d8fb5a3b6c0be29f61c5..46ac51034091e6e77ce5ad3966b59c49ef7d78b8 100644 --- a/templates/fragment_navtabs_europe.html +++ b/templates/fragment_navtabs_europe.html @@ -7,13 +7,13 @@ <a class="nav-link" href="/europe/info">Europe Info</a> </li> <li class="nav-item"> - <a class="nav-link" href="/europe/date_reported">Europe date_reported</a> + <a class="nav-link" href="/europe/date_reported/all">Europe date_reported</a> </li> <li class="nav-item"> - <a class="nav-link" href="/europe/continent">Europe continent</a> + <a class="nav-link" href="/europe/continent/all">Europe continent</a> </li> <li class="nav-item"> - <a class="nav-link" href="/europe/country">Europe country</a> + <a class="nav-link" href="/europe/country/all">Europe country</a> </li> <li class="nav-item"> <a class="nav-link" href="/europe/data">Europe data</a> diff --git a/templates/who/fragment_who_country_table.html b/templates/who/fragment_who_country_table.html new file mode 100644 index 0000000000000000000000000000000000000000..c59548648ca9a781ed22adab44ec5f7aa9d09811 --- /dev/null +++ b/templates/who/fragment_who_country_table.html @@ -0,0 +1,18 @@ + <table class="table table-hover table-striped table-dark"> + <thead> + <tr> + <th scope="col">country code</th> + <th scope="col">country</th> + <th scope="col">who region</th> + </tr> + </thead> + <tbody> + {% for who_country in page_data.items %} + <tr> + <td><a href="/who/country/{{ who_country.id }}">{{ who_country.country_code }}</a></td> + <td><a href="/who/country/{{ who_country.id }}">{{ who_country.country }}</a></td> + <th><a href="/who/region/{{ who_country.region.id }}">{{ who_country.region.region }}</a></th> + </tr> + {% endfor %} + </tbody> + </table> \ No newline at end of file diff --git a/templates/who/fragment_who_global_data_table.html b/templates/who/fragment_who_global_data_table.html new file mode 100644 index 0000000000000000000000000000000000000000..066a0c6373be71b194e83bf9df40ddb8543ca2f6 --- /dev/null +++ b/templates/who/fragment_who_global_data_table.html @@ -0,0 +1,44 @@ + <table class="table table-hover table-striped"> + <thead> + <tr> + <th scope="col">date reported</th> + <th scope="col">deaths new</th> + <th scope="col">cases new</th> + <th scope="col">deaths cumulative</th> + <th scope="col">cases cumulative</th> + <th scope="col">country code</th> + <th scope="col">country</th> + <th scope="col">region</th> + </tr> + </thead> + <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.date_reported }} + </a> + </th> + <td>{{ who_global_data.deaths_new }}</td> + <td>{{ who_global_data.cases_new }}</td> + <td>{{ who_global_data.deaths_cumulative }}</td> + <td>{{ who_global_data.cases_cumulative }}</td> + <td> + <a href="/who/country/{{ who_global_data.country.id }}"> + {{ who_global_data.country.country_code }} + </a> + </td> + <td> + <a href="/who/country/{{ who_global_data.country.id }}"> + {{ who_global_data.country.country }} + </a> + </td> + <th> + <a href="/who/region/{{ who_global_data.country.region.id }}"> + {{ who_global_data.country.region.region }} + </a> + </th> + </tr> + {% endfor %} + </tbody> + </table> \ No newline at end of file diff --git a/templates/who/who_country_all.html b/templates/who/who_country_all.html index 0b0b5435ba8d69f771c807802dd03763b9aea567..9cc87840d9b6b044fa8f092be292cde8d7c4642e 100644 --- a/templates/who/who_country_all.html +++ b/templates/who/who_country_all.html @@ -50,24 +50,7 @@ </ul> {% endif %} - <table class="table table-hover table-striped"> - <thead> - <tr> - <th scope="col">country_code</th> - <th scope="col">country</th> - <th scope="col">who_region</th> - </tr> - </thead> - <tbody> - {% for who_country in page_data.items %} - <tr> - <td><a href="/who/country/{{ who_country.id }}">{{ who_country.country_code }}</a></td> - <td><a href="/who/country/{{ who_country.id }}">{{ who_country.country }}</a></td> - <td><a href="/who/region/{{ who_country.region.id }}">{{ who_country.region.region }}</a></td> - </tr> - {% endfor %} - </tbody> - </table> + {% include 'who/fragment_who_country_table.html' %} {% endblock %} diff --git a/templates/who/who_country_germany.html b/templates/who/who_country_germany.html index 5cebc22436296a6ef143a30c111a0305f826f7e0..1b719585be32dd81cd5484384fe5720678656141 100644 --- a/templates/who/who_country_germany.html +++ b/templates/who/who_country_germany.html @@ -57,34 +57,7 @@ </ul> {% endif %} - <table class="table table-hover table-striped"> - <thead> - <tr> - <th scope="col">date_reported</th> - <th scope="col">deaths_new</th> - <th scope="col">cases_new</th> - <th scope="col">deaths_cumulative</th> - <th scope="col">cases_cumulative</th> - <th scope="col">country_code</th> - <th scope="col">country</th> - <th scope="col">region</th> - </tr> - </thead> - <tbody> - {% for who_global_data in page_data.items %} - <tr> - <td><a href="/who/date_reported/{{ who_global_data.date_reported.id }}">{{ who_global_data.date_reported.date_reported }}</a></td> - <td>{{ who_global_data.deaths_new }}</td> - <td>{{ who_global_data.cases_new }}</td> - <td>{{ who_global_data.deaths_cumulative }}</td> - <td>{{ who_global_data.cases_cumulative }}</td> - <td><a href="/who/country/{{ who_global_data.country.id }}">{{ who_global_data.country.country_code }}</a></td> - <td><a href="/who/country/{{ who_global_data.country.id }}">{{ who_global_data.country.country }}</a></td> - <td><a href="/who/region/{{ who_global_data.country.region.id }}">{{ who_global_data.country.region.region }}</a></td> - </tr> - {% endfor %} - </tbody> - </table> + {% include 'who/fragment_who_global_data_table.html' %} {% endblock %} diff --git a/templates/who/who_country_one.html b/templates/who/who_country_one.html index 2c37d19afbe4e5c07088dcb703bca22e281f0b26..cb7d837ba171a10479403f686c9a249500952df3 100644 --- a/templates/who/who_country_one.html +++ b/templates/who/who_country_one.html @@ -57,34 +57,7 @@ </ul> {% endif %} - <table class="table table-hover table-striped"> - <thead> - <tr> - <th scope="col">date_reported</th> - <th scope="col">deaths_new</th> - <th scope="col">cases_new</th> - <th scope="col">deaths_cumulative</th> - <th scope="col">cases_cumulative</th> - <th scope="col">country_code</th> - <th scope="col">country</th> - <th scope="col">region</th> - </tr> - </thead> - <tbody> - {% for who_global_data in page_data.items %} - <tr> - <td><a href="/who/date_reported/{{ who_global_data.date_reported.id }}">{{ who_global_data.date_reported.date_reported }}</a></td> - <td>{{ who_global_data.deaths_new }}</td> - <td>{{ who_global_data.cases_new }}</td> - <td>{{ who_global_data.deaths_cumulative }}</td> - <td>{{ who_global_data.cases_cumulative }}</td> - <td><a href="/who/country/{{ who_global_data.country.id }}">{{ who_global_data.country.country_code }}</a></td> - <td><a href="/who/country/{{ who_global_data.country.id }}">{{ who_global_data.country.country }}</a></td> - <td><a href="/who/region/{{ who_global_data.country.region.id }}">{{ who_global_data.country.region.region }}</a></td> - </tr> - {% endfor %} - </tbody> - </table> + {% include 'who/fragment_who_global_data_table.html' %} {% endblock %} diff --git a/templates/who/who_date_reported_all.html b/templates/who/who_date_reported_all.html index 2e6fc3530d6b2f506564485a565b0586ab897fd8..c768eadb5aa2b46fe67980e818066d8bf8928b67 100644 --- a/templates/who/who_date_reported_all.html +++ b/templates/who/who_date_reported_all.html @@ -59,8 +59,11 @@ <tbody> {% for who_date_reported in page_data.items %} <tr> - <td><a href="/who/date_reported/{{ who_date_reported.id }}">{{ who_date_reported.date_reported }}</a></td> - + <td> + <a href="/who/date_reported/{{ who_date_reported.id }}"> + {{ who_date_reported.date_reported }} + </a> + </td> </tr> {% endfor %} </tbody> diff --git a/templates/who/who_date_reported_one.html b/templates/who/who_date_reported_one.html index abca1cc7859c71441eb36647e86538e47afa595e..9ddad9e1175414c6aae2403fa1da507e28b67a13 100644 --- a/templates/who/who_date_reported_one.html +++ b/templates/who/who_date_reported_one.html @@ -24,7 +24,8 @@ <ul class="pagination"> {% if page_data.has_prev %} <li class="page-item"> - <a class="page-link" href="{{ url_for('url_who_date_reported', date_reported_id=who_date_reported.id, page=page_data.prev_num) }}">Previous</a> + <a class="page-link" href="{{ url_for('url_who_date_reported', + date_reported_id=who_date_reported.id, page=page_data.prev_num) }}">Previous</a> </li> {% endif %} <!-- all page numbers --> @@ -32,7 +33,8 @@ {% if page_num %} {% if page_num != page_data.page %} <li class="page-item"> - <a class="page-link" href="{{ url_for('url_who_date_reported', date_reported_id=who_date_reported.id, page=page_num) }}">{{ page_num }}</a> + <a class="page-link" href="{{ url_for('url_who_date_reported', + date_reported_id=who_date_reported.id, page=page_num) }}">{{ page_num }}</a> </li> {% else %} <li class="page-item active"> @@ -48,40 +50,14 @@ <!-- next page --> {% if page_data.has_next %} <li class="page-item"> - <a class="page-link" href="{{ url_for('url_who_date_reported', date_reported_id=who_date_reported.id, page=page_data.next_num) }}">Next</a> + <a class="page-link" href="{{ url_for('url_who_date_reported', + date_reported_id=who_date_reported.id, page=page_data.next_num) }}">Next</a> </li> {% endif %} </ul> {% endif %} - <table class="table table-hover table-striped"> - <thead> - <tr> - <th scope="col">date_reported</th> - <th scope="col">deaths_new</th> - <th scope="col">cases_new</th> - <th scope="col">deaths_cumulative</th> - <th scope="col">cases_cumulative</th> - <th scope="col">country_code</th> - <th scope="col">country</th> - <th scope="col">region</th> - </tr> - </thead> - <tbody> - {% for who_global_data in page_data.items %} - <tr> - <td><a href="/who/date_reported/{{ who_global_data.date_reported.id }}">{{ who_global_data.date_reported.date_reported }}</a></td> - <td>{{ who_global_data.deaths_new }}</td> - <td>{{ who_global_data.cases_new }}</td> - <td>{{ who_global_data.deaths_cumulative }}</td> - <td>{{ who_global_data.cases_cumulative }}</td> - <td><a href="/who/country/{{ who_global_data.country.id }}">{{ who_global_data.country.country_code }}</a></td> - <td><a href="/who/country/{{ who_global_data.country.id }}">{{ who_global_data.country.country }}</a></td> - <td><a href="/who/region/{{ who_global_data.country.region.id }}">{{ who_global_data.country.region.region }}</a></td> - </tr> - {% endfor %} - </tbody> - </table> + {% include 'who/fragment_who_global_data_table.html' %} {% endblock %} diff --git a/templates/who/who_region_one.html b/templates/who/who_region_one.html index 53f2c9be88be84864b865982d2a502c1ceaf9159..8aa93cd68380c8d7e0b36d130ffeca6ecaa366ef 100644 --- a/templates/who/who_region_one.html +++ b/templates/who/who_region_one.html @@ -51,24 +51,7 @@ </ul> {% endif %} - <table class="table table-hover table-striped"> - <thead> - <tr> - <th scope="col">country_code</th> - <th scope="col">country</th> - <th scope="col">region</th> - </tr> - </thead> - <tbody> - {% for who_country in page_data.items %} - <tr> - <td><a href="/who/country/{{ who_country.id }}">{{ who_country.country_code }}</a></td> - <td><a href="/who/country/{{ who_country.id }}">{{ who_country.country }}</a></td> - <td><a href="/who/region/{{ who_country.region.id }}">{{ who_country.region.region }}</a></td> - </tr> - {% endfor %} - </tbody> - </table> + {% include 'who/fragment_who_country_table.html' %} {% endblock %}