diff options
author | Daniel Schadt <kingdread@gmx.de> | 2022-08-02 12:04:02 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2022-08-02 12:04:02 +0200 |
commit | a33ab1a4ce916bda028362ffb29af89437262ae9 (patch) | |
tree | 31123b4e42de2e5bb18244767cd7524112b36339 | |
parent | 10bd43b2948fa1d837ee8878e69c46d9f3e74792 (diff) | |
download | fietsboek-a33ab1a4ce916bda028362ffb29af89437262ae9.tar.gz fietsboek-a33ab1a4ce916bda028362ffb29af89437262ae9.tar.bz2 fietsboek-a33ab1a4ce916bda028362ffb29af89437262ae9.zip |
use different error when filters return no tracks
-rw-r--r-- | fietsboek/locale/de/LC_MESSAGES/messages.mo | bin | 11111 -> 11214 bytes | |||
-rw-r--r-- | fietsboek/locale/de/LC_MESSAGES/messages.po | 7 | ||||
-rw-r--r-- | fietsboek/locale/en/LC_MESSAGES/messages.mo | bin | 10466 -> 10549 bytes | |||
-rw-r--r-- | fietsboek/locale/en/LC_MESSAGES/messages.po | 6 | ||||
-rw-r--r-- | fietsboek/locale/fietslog.pot | 6 | ||||
-rw-r--r-- | fietsboek/templates/browse.jinja2 | 2 | ||||
-rw-r--r-- | fietsboek/views/browse.py | 4 |
7 files changed, 22 insertions, 3 deletions
diff --git a/fietsboek/locale/de/LC_MESSAGES/messages.mo b/fietsboek/locale/de/LC_MESSAGES/messages.mo Binary files differindex a4cc5dc..97ee495 100644 --- a/fietsboek/locale/de/LC_MESSAGES/messages.mo +++ b/fietsboek/locale/de/LC_MESSAGES/messages.mo diff --git a/fietsboek/locale/de/LC_MESSAGES/messages.po b/fietsboek/locale/de/LC_MESSAGES/messages.po index dcc860d..9c93bb4 100644 --- a/fietsboek/locale/de/LC_MESSAGES/messages.po +++ b/fietsboek/locale/de/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2022-07-30 22:48+0200\n" +"POT-Creation-Date: 2022-08-02 11:57+0200\n" "PO-Revision-Date: 2022-07-02 17:35+0200\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language: de\n" @@ -183,6 +183,11 @@ msgid "page.browse.download_multiple" msgstr "ausgewählte Herunterladen" #: fietsboek/templates/browse.jinja2:158 +msgid "page.browse.no_results" +msgstr "" +"Es wurden keine Strecken gefunden, die den Filtern entsprechen." + +#: fietsboek/templates/browse.jinja2:160 msgid "page.browse.no_tracks" msgstr "" "Es wurden keine Strecken gefunden, auf die Du Zugriff hast. Versuche, " diff --git a/fietsboek/locale/en/LC_MESSAGES/messages.mo b/fietsboek/locale/en/LC_MESSAGES/messages.mo Binary files differindex 0d228d8..8887d3d 100644 --- a/fietsboek/locale/en/LC_MESSAGES/messages.mo +++ b/fietsboek/locale/en/LC_MESSAGES/messages.mo diff --git a/fietsboek/locale/en/LC_MESSAGES/messages.po b/fietsboek/locale/en/LC_MESSAGES/messages.po index 542a6f9..2ac9f98 100644 --- a/fietsboek/locale/en/LC_MESSAGES/messages.po +++ b/fietsboek/locale/en/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2022-07-30 22:48+0200\n" +"POT-Creation-Date: 2022-08-02 11:57+0200\n" "PO-Revision-Date: 2022-06-28 13:11+0200\n" "Last-Translator: \n" "Language: en\n" @@ -183,6 +183,10 @@ msgid "page.browse.download_multiple" msgstr "Download selected" #: fietsboek/templates/browse.jinja2:158 +msgid "page.browse.no_results" +msgstr "No results matching the filters were found." + +#: fietsboek/templates/browse.jinja2:160 msgid "page.browse.no_tracks" msgstr "You currently do not have access to any tracks. Try logging in." diff --git a/fietsboek/locale/fietslog.pot b/fietsboek/locale/fietslog.pot index 47d3c6e..2c25251 100644 --- a/fietsboek/locale/fietslog.pot +++ b/fietsboek/locale/fietslog.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2022-07-30 22:48+0200\n" +"POT-Creation-Date: 2022-08-02 11:57+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -182,6 +182,10 @@ msgid "page.browse.download_multiple" msgstr "" #: fietsboek/templates/browse.jinja2:158 +msgid "page.browse.no_results" +msgstr "" + +#: fietsboek/templates/browse.jinja2:160 msgid "page.browse.no_tracks" msgstr "" diff --git a/fietsboek/templates/browse.jinja2 b/fietsboek/templates/browse.jinja2 index 169309b..0f98192 100644 --- a/fietsboek/templates/browse.jinja2 +++ b/fietsboek/templates/browse.jinja2 @@ -154,6 +154,8 @@ </div> {% endfor %} <button type="button" class="btn btn-primary" id="archiveDownloadButton" disabled><i class="bi bi-file-earmark-zip"></i> {{ _("page.browse.download_multiple") }}</button> + {% elif used_filters %} + <p>{{ _("page.browse.no_results") }}</p> {% else %} <p>{{ _("page.browse.no_tracks") }}</p> {% endif %} diff --git a/fietsboek/views/browse.py b/fietsboek/views/browse.py index e62ca0b..7120b0d 100644 --- a/fietsboek/views/browse.py +++ b/fietsboek/views/browse.py @@ -55,6 +55,9 @@ class TrackFilters: def __init__(self, filters): self._filters = filters + def __bool__(self): + return bool(self._filters) + def apply(self, track): """Apply the filters to the track. @@ -173,6 +176,7 @@ def browse(request): return { 'tracks': tracks, 'mps_to_kph': util.mps_to_kph, + 'used_filters': bool(filters), } |