From 3ac20e36008c51f957424e9546ae4e73d069191b Mon Sep 17 00:00:00 2001 From: thomaswoehlke <thomas.woehlke@gmail.com> Date: Sat, 30 Jan 2021 22:16:33 +0100 Subject: [PATCH] ### 0.0.13 Release * Fixed #49 EuropeServiceUpdate.__update_data_short() (wontfix) * Fixed #52 download vaccination timeline data file * Fixed #53 import vaccination timeline data file into db * Fixed #54 /vaccination/imported * Fixed #57 frontend: use npm for handling 3rdParty css and javascript modules like jQuery, Bootstrap * Fixed #58 frontend: remove jumbotron from all pageheader, put jumbotron as main content on home page * Fixed #47 major refactoring: Routes from app.py to org...who,europe,... (Doublette von #65) * Fixed #48 major refactoring: Tasks from server_mq.py to org...who,europe,... (Doublette von #65) * Fixed #64 major refactoring: create two packages: for web app and for celery worker * Issue #65 major refactoring: add flask-blueprints for admin, common, europe, rki, vaccination, who ### 0.0.14 Release * Issue #66 frontend: migrate to Bootstrap Theme sb-admin-angular * Issue #67 implement Flask-Login ### 0.0.15 Release * Issue #5 Visual Graphs for Data per Countries order by Date * Issue #59 frontend: add correct breadcrumb to every page * Issue #60 frontend: better design for tables * Issue #61 frontend: better design for navtabs * Issue #62 frontend: better design for pages * Issue #63 frontend: add footer design ### 0.0.16 Release * Issue #28 /admin/database/import * Issue #39 SQLalchemy instead of SQL: AllModelClasses.remove_all() * Issue #40 SQLalchemy instead of SQL: EuropeDataImportTable.get_date_rep() * Issue #41 SQLalchemy instead of SQL: EuropeDataImportTable.get_countries_of_continent() * Issue #42 SQLalchemy instead of SQL: WhoGlobalDataImportTable.get_new_dates_as_array() --- covid19/blueprints/europe/europe_model.py | 15 ++++++- .../fragment_europe_table_date_reported.html | 41 +++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/covid19/blueprints/europe/europe_model.py b/covid19/blueprints/europe/europe_model.py index 89e8bd33..c7c61fdd 100644 --- a/covid19/blueprints/europe/europe_model.py +++ b/covid19/blueprints/europe/europe_model.py @@ -16,7 +16,7 @@ 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): + def __str__(self): result = "" if self.day_of_month < 10: result += "0" + str(self.day_of_month) @@ -37,6 +37,19 @@ class EuropeDateReported(db.Model): return {1: "Montag", 2: "Dienstag", 3: "Mittwoch", 4: "Donnerstag", 5: "Freitag", 6: "Samstag", 7: "Sonntag"} + 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 + @classmethod def create_new_object_factory(cls, my_date_rep, my_year_week): my_date_reported = my_date_rep.split('/') diff --git a/covid19/blueprints/europe/templates/europe/fragments/fragment_europe_table_date_reported.html b/covid19/blueprints/europe/templates/europe/fragments/fragment_europe_table_date_reported.html index f842320f..365eeb38 100644 --- a/covid19/blueprints/europe/templates/europe/fragments/fragment_europe_table_date_reported.html +++ b/covid19/blueprints/europe/templates/europe/fragments/fragment_europe_table_date_reported.html @@ -1,3 +1,4 @@ + <!-- <table class="table table-hover table-striped table-dark"> <thead class="table-secondary"> <tr> @@ -21,4 +22,44 @@ </tr> {% endfor %} </tbody> + </table> + --> + + <table class="table table-hover table-striped table-dark"> + <thead class="table-secondary"> + <tr> + <th scope="col" class="text-right">day of week</th> + <th scope="col" class="text-left">date reported</th> + <th scope="col" class="text-right">week of year</th> + <th scope="col" class="text-left">year</th> + </tr> + </thead> + <tbody> + {% for europe_date_reported in page_data.items %} + <tr> + <td class="text-right"> + {{ europe_date_reported.get_name_for_weekday() }} + </td> + <td class="text-left"> + <a href="/europe/date_reported/{{ europe_date_reported.id }}"> + {{ europe_date_reported }} + </a> + </td> + <td class="text-right"> + {{ europe_date_reported.week_of_year }} + </td> + <td class="text-left"> + {{ europe_date_reported.year }} + </td> + </tr> + {% endfor %} + </tbody> + <tfoot class="table-secondary"> + <tr> + <th scope="col" class="text-right">day of week</th> + <th scope="col" class="text-left">date reported</th> + <th scope="col" class="text-right">week of year</th> + <th scope="col" class="text-left">year</th> + </tr> + </tfoot> </table> \ No newline at end of file -- GitLab