diff --git a/org/woehlke/covid19/europe/europe_model.py b/org/woehlke/covid19/europe/europe_model.py index c493061c52215865b43b35a9f5995b92e6b2cd85..cd49f70259644e187257a78bb0f8845bd1e461d3 100644 --- a/org/woehlke/covid19/europe/europe_model.py +++ b/org/woehlke/covid19/europe/europe_model.py @@ -96,6 +96,27 @@ class EuropeDateReported(db.Model): day_of_week = db.Column(db.Integer, nullable=False) week_of_year = db.Column(db.Integer, nullable=False) + def get_name_for_datum(self): + result = "" + if self.day_of_month < 10: + result += "0" + str(self.day_of_month) + else: + result += "" + str(self.day_of_month) + if self.month < 10: + result += ".0" + str(self.month) + else: + result += "." + str(self.month) + result += "." + str(self.year) + return result + + def get_name_for_weekday(self): + return self.get_names_for_weekday()[self.day_of_week] + + @classmethod + def get_names_for_weekday(cls): + return {1: "Montag", 2: "Dienstag", 3: "Mittwoch", 4: "Donnerstag", 5: "Freitag", 6: "Samstag", + 7: "Sonntag"} + @classmethod def create_new_object_factory(cls, my_date_rep, my_year_week): my_date_reported = my_date_rep.split('/') diff --git a/templates/europe/fragments/fragment_europe_navtabs.html b/templates/europe/fragments/fragment_europe_navtabs.html index 6d825d6fb69cfc146f0d345f6ec62985c9d66322..25be0356e95e557d76b848d11317f2197c0908b7 100644 --- a/templates/europe/fragments/fragment_europe_navtabs.html +++ b/templates/europe/fragments/fragment_europe_navtabs.html @@ -10,13 +10,13 @@ <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/all">Europe continent</a> + <a class="nav-link" href="/europe/country/germany">Europe Germany</a> </li> <li class="nav-item"> - <a class="nav-link" href="/europe/country/all">Europe country</a> + <a class="nav-link" href="/europe/continent/all">Europe continent</a> </li> <li class="nav-item"> - <a class="nav-link" href="/europe/country/germany">Europe Germany</a> + <a class="nav-link" href="/europe/country/all">Europe country</a> </li> <li class="nav-item"> <a class="nav-link" href="/europe/imported">Europe imported</a> diff --git a/templates/europe/fragments/fragment_europe_table_continent.html b/templates/europe/fragments/fragment_europe_table_continent.html index 19f52e3357dbba28c9eb2f07e320056caa6ce9ea..5e0775eacdf56fde87652015a1fed02d6f80849f 100644 --- a/templates/europe/fragments/fragment_europe_table_continent.html +++ b/templates/europe/fragments/fragment_europe_table_continent.html @@ -1,8 +1,8 @@ <table class="table table-hover table-striped table-dark"> - <thead> - <tr> - <th scope="col">continent</th> - </tr> + <thead class="table-secondary"> + <tr> + <th scope="col">continent</th> + </tr> </thead> <tbody> {% for europe_continent in page_data.items %} diff --git a/templates/europe/fragments/fragment_europe_table_country.html b/templates/europe/fragments/fragment_europe_table_country.html index dd875de2b872c136a40bd34b12fd0a826249f56a..8fdd45cfad8d6d85ac7030bef143ecb1e300e6e9 100644 --- a/templates/europe/fragments/fragment_europe_table_country.html +++ b/templates/europe/fragments/fragment_europe_table_country.html @@ -1,13 +1,13 @@ <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 class="table-secondary"> + <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 %} diff --git a/templates/europe/fragments/fragment_europe_table_data.html b/templates/europe/fragments/fragment_europe_table_data.html index 7d9dc7632a136f13f2624a0371a2e81de3a84537..bcc9355d338b608be20167c89f87feb4486148ea 100644 --- a/templates/europe/fragments/fragment_europe_table_data.html +++ b/templates/europe/fragments/fragment_europe_table_data.html @@ -5,11 +5,11 @@ <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> + <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 @@ -17,11 +17,11 @@ </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> + <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 @@ -29,11 +29,11 @@ </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> + <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 @@ -51,7 +51,7 @@ <tr> <td> <a href="/europe/date_reported/{{ europe_data.europe_date_reported.id }}"> - {{ europe_data.europe_date_reported.date_rep }} + {{ europe_data.europe_date_reported.get_name_for_datum() }} </a> </td> <td> diff --git a/templates/europe/fragments/fragment_europe_table_date_reported.html b/templates/europe/fragments/fragment_europe_table_date_reported.html index fc1f42aeec9d63a3c5be1db33614d13ea3794cf8..f842320f0e3f360376744a1e43fa50ed90266be6 100644 --- a/templates/europe/fragments/fragment_europe_table_date_reported.html +++ b/templates/europe/fragments/fragment_europe_table_date_reported.html @@ -1,16 +1,16 @@ <table class="table table-hover table-striped table-dark"> - <thead> - <tr> - <th scope="col">date reported</th> - <th scope="col">year week</th> - </tr> + <thead class="table-secondary"> + <tr> + <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 }} + {{ europe_date_reported.get_name_for_datum() }} </a> </td> <td>