Skip to content

Commit

Permalink
Filter obsolete entries from the start
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Jul 4, 2024
1 parent f7a2bfe commit 546cfae
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 40 deletions.
56 changes: 22 additions & 34 deletions conf/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-04 15:06+0200\n"
"POT-Creation-Date: 2024-07-04 20:30+0200\n"
"PO-Revision-Date: 2024-07-04 15:06+0200\n"
"Last-Translator: Anonymous User <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -50,23 +50,6 @@ msgstr "Diese Seite wurde nicht gefunden"
msgid "404: Sorry, we could not find the page you requested."
msgstr "404: Leider haben wir die gewünschte Seite nicht gefunden."

#: app/templates/404.html
msgid "Try the following links:"
msgstr "Versuchen Sie es mit folgenden Links:"

#: app/templates/404.html
msgid "go to Homepage"
msgstr "zur Startseite"

#: app/templates/404.html
msgid "Homepage"
msgstr "Startseite"

#: app/templates/404.html
#, python-format
msgid "go to page %(title)s"
msgstr "zur Seite %(title)s"

#: app/templates/projects/catalog.html
msgid "Apply"
msgstr "Anwenden"
Expand Down Expand Up @@ -151,14 +134,8 @@ msgid "Change password"
msgstr "Passwort ändern"

#: app/templates/registration/login.html
#: app/templates/registration/password_change_done.html
#: app/templates/registration/password_change_form.html
#: app/templates/registration/password_reset_complete.html
#: app/templates/registration/password_reset_confirm.html
#: app/templates/registration/password_reset_done.html
#: app/templates/registration/password_reset_form.html
msgid "Dashboard"
msgstr "Dashboard"
msgid "Login"
msgstr "Anmelden"

#: app/templates/registration/login.html
#: app/templates/registration/password_reset_complete.html
Expand All @@ -168,14 +145,6 @@ msgstr "Dashboard"
msgid "Reset password"
msgstr "Passwort zurücksetzen"

#: app/templates/registration/login.html
msgid "Login"
msgstr "Anmelden"

#: app/templates/registration/login.html
msgid "scroll to content"
msgstr "Forum der Zukunft"

#: app/templates/registration/password_change_done.html
msgid "Your password was changed."
msgstr "Ihr Passwort wurde geändert."
Expand Down Expand Up @@ -289,6 +258,25 @@ msgstr "Vorschlagen"
msgid "With {count} items"
msgstr "Mit {count} Elementen"

#~ msgid "Try the following links:"
#~ msgstr "Versuchen Sie es mit folgenden Links:"

#~ msgid "go to Homepage"
#~ msgstr "zur Startseite"

#~ msgid "Homepage"
#~ msgstr "Startseite"

#, python-format
#~ msgid "go to page %(title)s"
#~ msgstr "zur Seite %(title)s"

#~ msgid "Dashboard"
#~ msgstr "Dashboard"

#~ msgid "scroll to content"
#~ msgstr "Forum der Zukunft"

#~ msgid "Flags"
#~ msgstr "Flags"

Expand Down
8 changes: 2 additions & 6 deletions projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,14 @@ def catalog(request, project, language_code, domain):
domain=domain,
)

entries = list(catalog.po)
entries = [entry for entry in catalog.po if not entry.obsolete]
total = len(entries)

filter_form = FilterForm(request.GET)
if filter_form.is_valid():
data = filter_form.cleaned_data
if data.get("pending"):
entries = [
entry
for entry in entries
if not entry.translated() and not entry.obsolete
]
entries = [entry for entry in entries if not entry.translated()]
total = len(entries)
if query := data.get("query", "").casefold():
entries = [entry for entry in entries if query in str(entry).casefold()]
Expand Down

0 comments on commit 546cfae

Please sign in to comment.