From 665cdf7c885af645ab4a4d1b737887cdf8f4e2ce Mon Sep 17 00:00:00 2001
From: thomaswoehlke <thomas.woehlke@gmail.com>
Date: Sat, 16 Jan 2021 17:02:05 +0100
Subject: [PATCH] ### 0.0.7 Release * Issue #8
 WhoServiceUpdate.update_db_short() * Issue #9 URL: /who/update/short * Issue
 #10 async who_update_short_task * Issue #11
 WhoServiceUpdate.__update_who_global_data_short() * Issue #12 better layout
 for flash messages

---
 org/woehlke/covid19/who/who_service_download.py | 3 +++
 templates/fragment_flashed_messages.html        | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/org/woehlke/covid19/who/who_service_download.py b/org/woehlke/covid19/who/who_service_download.py
index 65b866c8..570397bc 100644
--- a/org/woehlke/covid19/who/who_service_download.py
+++ b/org/woehlke/covid19/who/who_service_download.py
@@ -1,5 +1,6 @@
 import os
 import wget
+from flask import flash
 from database import app
 
 who_service_download = None
@@ -38,7 +39,9 @@ class WhoServiceDownload:
             app.logger.warning("############################################################")
             app.logger.warning(error)
             app.logger.warning("############################################################")
+            flash(message="downloaded: " + self.__who_cvsfile_name, category='error')
         finally:
             app.logger.info("------------------------------------------------------------")
             app.logger.info(" download - WHO [done] ")
+            flash("downloaded: "+self.__who_cvsfile_name)
         return self
diff --git a/templates/fragment_flashed_messages.html b/templates/fragment_flashed_messages.html
index 7a44176f..cbebc094 100644
--- a/templates/fragment_flashed_messages.html
+++ b/templates/fragment_flashed_messages.html
@@ -1,5 +1,10 @@
 <div class="fragment-flash-messages">
 {% for message in get_flashed_messages() %}
-    <div class="alert alert-success" role="alert">{{ message }}</div>
+    <div class="alert alert-success" role="alert">
+        <span>{{ message }}</span>
+        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+            <span aria-hidden="true">&times;</span>
+        </button>
+    </div>
 {% endfor %}
 </div>
\ No newline at end of file
-- 
GitLab