aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-07-27 22:36:20 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-07-27 22:36:20 +0200
commit1606b2a13efd78f69acd359bd6ff1024a75f4a8a (patch)
tree239529820b03a4ed44799add2129ef2444972882
parentRevert change for search result table. (diff)
downloadmu4web-1606b2a13efd78f69acd359bd6ff1024a75f4a8a.tar.gz
mu4web-1606b2a13efd78f69acd359bd6ff1024a75f4a8a.tar.xz
Add hover text in search result view.
Hovering a field now shows its text. Adding title for empty elements isn't the best (when data is empty, usualy due to someone not filling in the subject field), but having empty <a> tags is just as bad.
-rw-r--r--mu4web/main.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mu4web/main.py b/mu4web/main.py
index 776f655..3cc39dc 100644
--- a/mu4web/main.py
+++ b/mu4web/main.py
@@ -418,7 +418,9 @@ def search_result(q: str, by: Optional[str], direction: str) -> HTML:
if data and key == 'date':
dt = datetime.fromtimestamp(int(data))
data = dt.strftime('%Y-%m-%d %H:%M')
- rowdata.append(('td', ('a', {'href': '/?id=' + row['msgid']}, data)))
+ rowdata.append(('td', ('a', {'href': '/?id=' + row['msgid'],
+ 'title': data or ''
+ }, data)))
body.append(('tr', rowdata))
if len(rows) == 0: