diff --git a/README.md b/README.md index 1590740d438933ff71265c6c2ef19d3dac06b0dc..783a455f4e8952845150e4f6771be890f6b19810 100644 --- a/README.md +++ b/README.md @@ -219,8 +219,8 @@ class WhoGlobalDataImportTable(db.Model): ### 0.0.11 Release * Fixed #26 /admin/database/dump * Fixed #43 /europe/date_reported -* Issue #44 /europe/continent -* Issue #45 /europe/country +* Fixed #44 /europe/continent +* Fixed #45 /europe/country * Issue #46 /europe/country/germany * Issue #39 SQLalchemy instead of SQL: AllModelClasses.remove_all() * Issue #40 SQLalchemy instead of SQL: EuropeDataImportTable.get_date_rep() diff --git a/app.py b/app.py index 961056b170a3ab5c6be96a4b1602fd7414aa94c3..54f4703e391a523c4b1da0ea35097d5309cab1ae 100644 --- a/app.py +++ b/app.py @@ -342,7 +342,7 @@ def url_europe_continent_one(continent_id, page=1): continent = EuropeContinent.get_by_id(continent_id) page_data = EuropeCountry.find_by_continent(continent, page) return render_template( - 'europe/europe_continent_all.html', + 'europe/europe_continent_one.html', continent=continent, page_data=page_data, page_info=page_info) diff --git a/org/woehlke/covid19/europe/europe_model.py b/org/woehlke/covid19/europe/europe_model.py index 9a11d4c7b95d19d86b248b3185725e8b549fb4c7..7c004871ec8a1dd3871f399fd0b5ee8222d237ac 100644 --- a/org/woehlke/covid19/europe/europe_model.py +++ b/org/woehlke/covid19/europe/europe_model.py @@ -181,7 +181,9 @@ class EuropeCountry(db.Model): @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) + return db.session.query(cls)\ + .filter(cls.continent_id == continent.id)\ + .paginate(page, per_page=ITEMS_PER_PAGE) @classmethod def get_germany(cls): diff --git a/templates/europe/europe_continent_one.html b/templates/europe/europe_continent_one.html index 96fa27bc1d50fd102daad600415241dd2c364e5c..057a4696f82a6103a0d26e5eb4c8a864b5b73562 100644 --- a/templates/europe/europe_continent_one.html +++ b/templates/europe/europe_continent_one.html @@ -21,7 +21,7 @@ {% if page_data.has_prev %} <li class="page-item"> <a class="page-link" - href="{{ url_for( 'url_europe_continent_one', page=page_data.prev_num) }}"> + href="{{ url_for( 'url_europe_continent_one', continent_id=continent.id, 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_continent_one', page=page_num) }}"> + href="{{ url_for( 'url_europe_continent_one', continent_id=continent.id, 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_continent_one', page=page_data.next_num) }}"> + href="{{ url_for( 'url_europe_continent_one', continent_id=continent.id, page=page_data.next_num) }}"> Next </a> </li> diff --git a/templates/europe/fragment_europe_data_table.html b/templates/europe/fragment_europe_data_table.html index 4519fc4e66c408b2c9bfd5f548e5567ffd4fb41b..f55ed3c5bb4fef04c62aa92eaf2f985a622761c9 100644 --- a/templates/europe/fragment_europe_data_table.html +++ b/templates/europe/fragment_europe_data_table.html @@ -4,25 +4,40 @@ <th scope="col">date rep</th> <th scope="col">year_week</th> <th scope="col"> + {% if europe_date_reported %} <a href="{{ url_for( 'url_europe_date_reported_one_deaths_weekly', europe_date_reported_id=europe_date_reported.id, page=page_data.page) }}"> deaths weekly </a> + {% endif %} + {% if europe_country %} + deaths weekly + {% endif %} </th> <th scope="col"> + {% if europe_date_reported %} <a href="{{ url_for( 'url_europe_date_reported_one_cases_weekly', europe_date_reported_id=europe_date_reported.id, page=page_data.page) }}"> cases weekly </a> + {% endif %} + {% if europe_country %} + cases weekly + {% endif %} </th> <th scope="col"> + {% if europe_date_reported %} <a href="{{ url_for( 'url_europe_date_reported_one_notification_rate', europe_date_reported_id=europe_date_reported.id, page=page_data.page) }}"> notification rate per 100000 population 14days </a> + {% endif %} + {% if europe_country %} + notification rate per 100000 population 14days + {% endif %} </th> <th scope="col">countries and territories</th> <th scope="col">population data 2019</th>