summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2024-12-08 17:03:57 +0100
committerJannis M. Hoffmann <jannis@fehcom.de>2024-12-08 17:03:57 +0100
commit7435cf9882fe577c8754fe8ac2df6f7007c546fa (patch)
tree884868c47b58657fc5f61dc823fdca379d65e506
parent2f086f24d782144b304091e72c66ca75c006a98a (diff)
add fixes for search and sort
-rw-r--r--src/jwebmail/__init__.py2
-rw-r--r--src/jwebmail/model/read_mails.py2
-rw-r--r--src/jwebmail/templates/_bot_nav.html4
-rw-r--r--src/jwebmail/templates/_top_nav.html10
4 files changed, 12 insertions, 6 deletions
diff --git a/src/jwebmail/__init__.py b/src/jwebmail/__init__.py
index 86febf4..b54d0e2 100644
--- a/src/jwebmail/__init__.py
+++ b/src/jwebmail/__init__.py
@@ -36,7 +36,7 @@ else:
toml_read_file = dict(load=toml_load, text=True)
-__version__ = "2.8.1.dev0"
+__version__ = "2.8.1.dev1"
csrf = CSRFProtect()
diff --git a/src/jwebmail/model/read_mails.py b/src/jwebmail/model/read_mails.py
index b2e1191..fc89c8e 100644
--- a/src/jwebmail/model/read_mails.py
+++ b/src/jwebmail/model/read_mails.py
@@ -36,7 +36,7 @@ class QMailAuthuser:
sort_val["direction"] = "asc"
match sort:
- case "date" | "subject" | "size":
+ case "date" | "sender" | "size":
sort_val["parameter"] = sort
case _:
raise ValueError(f"invalid sort parameter {sort!r}")
diff --git a/src/jwebmail/templates/_bot_nav.html b/src/jwebmail/templates/_bot_nav.html
index d92d467..03cb939 100644
--- a/src/jwebmail/templates/_bot_nav.html
+++ b/src/jwebmail/templates/_bot_nav.html
@@ -43,7 +43,7 @@
<div class="column">
{% if mail_folders|length > 1 %}
- <form action="{{ url_for('move', folder=folder) }}" id="move-mail" class=is-pulled-left method=POST>
+ <form action="{{ url_for('move', folder=request.view_args.folder) }}" id="move-mail" class=is-pulled-left method=POST>
<input type=hidden name=csrf_token value="{{ csrf_token() }}">
{% for k, v in request.args.items() if v %}
<input type=hidden name="{{ k }}" value="{{ v }}">
@@ -67,7 +67,7 @@
</form>
{% endif %}
- <form action="{{ url_for('remove', folder=folder) }}" id="remove-mail"
+ <form action="{{ url_for('remove', folder=request.view_args.folder) }}" id="remove-mail"
method=POST class="is-pulled-left ml-2">
<input type=hidden name=csrf_token value="{{ csrf_token() }}">
diff --git a/src/jwebmail/templates/_top_nav.html b/src/jwebmail/templates/_top_nav.html
index a9d385b..4c8bdb7 100644
--- a/src/jwebmail/templates/_top_nav.html
+++ b/src/jwebmail/templates/_top_nav.html
@@ -1,9 +1,15 @@
<div class="columns">
- <form class=column>
+ <form class=column method=GET
+ action="{{ url_for(
+ 'displayheaders',
+ folder=request.view_args.folder,
+ per_page=request.args.get('per_page')
+ ) }}">
+
<div class=field>
<div class=control>
- <input type=search id=search size=8 class=input placeholder="{{ gettext('Search') }}" />
+ <input type=search name=search size=8 class=input placeholder="{{ gettext('Search') }}" />
</div>
</div>
</form>