Skip to content

Add "Special Functions" and update contact list #129

Merged
merged 8 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
126 changes: 53 additions & 73 deletions locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-15 14:56+0100\n"
"POT-Creation-Date: 2025-02-06 17:08+0100\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"
Expand Down Expand Up @@ -57,7 +56,7 @@ msgid "content"
msgstr "Inhalt"

#: mpicms/base/blocks.py:56 mpicms/base/blocks.py:59 mpicms/base/models.py:74
#: mpicms/templates/personal/list.html:39
#: mpicms/templates/personal/list.html:92
#: venv0/lib/python3.7/site-packages/wagtailvideos/templates/wagtailvideos/videos/usage.html:16
msgid "Title"
msgstr "Titel"
Expand All @@ -84,7 +83,7 @@ msgstr "Generiere Inhaltsverzeichnis"
msgid "Page not available in %s"
msgstr "Seite auf %s nicht vorhanden"

#: mpicms/base/mixins.py:94 mpicms/personal/wagtail_hooks.py:97
#: mpicms/base/mixins.py:94 mpicms/personal/wagtail_hooks.py:99
msgid "Contacts"
msgstr "Kontakte"

Expand Down Expand Up @@ -191,7 +190,7 @@ msgstr "Anfangszeit"
msgid "end time"
msgstr "Endzeit"

#: mpicms/events/models.py:22 mpicms/templates/personal/list.html:44
#: mpicms/events/models.py:22 mpicms/templates/personal/list.html:97
msgid "Room"
msgstr "Raum"

Expand Down Expand Up @@ -240,20 +239,16 @@ msgid "groups"
msgstr "Gruppen"

#: mpicms/personal/models.py:31
#, fuzzy
#| msgid "groups"
msgid "group"
msgstr "Gruppen"
msgstr "Gruppe"

#: mpicms/personal/models.py:44
msgid "positions"
msgstr "Positionen"

#: mpicms/personal/models.py:50
#, fuzzy
#| msgid "positions"
msgid "position"
msgstr "Positionen"
msgstr "Position"

#: mpicms/personal/models.py:83
msgid "status"
Expand Down Expand Up @@ -324,16 +319,24 @@ msgid "Persons"
msgstr "Personen"

#: mpicms/personal/wagtail_hooks.py:52 mpicms/personal/wagtail_hooks.py:69
#: mpicms/templates/personal/list.html:46
#: mpicms/templates/personal/list.html:98
#: mpicms/templates/wagtailusers/users/list.html:28
msgid "Groups"
msgstr "Gruppen"

#: mpicms/personal/wagtail_hooks.py:57 mpicms/personal/wagtail_hooks.py:76
#: mpicms/templates/personal/list.html:45
#: mpicms/templates/personal/list.html:99
msgid "Positions"
msgstr "Positionen"

#: mpicms/personal/wagtail_hooks.py:88 mpicms/templates/personal/list.html:100
msgid "Special Functions"
msgstr "Sonderfunktionen"

#: mpicms/personal/wagtail_hooks.py:94
msgid "Written Consents"
msgstr "Einwilligungen"

#: mpicms/publications/models.py:28
msgid "authors"
msgstr "Autoren"
Expand Down Expand Up @@ -445,27 +448,37 @@ msgstr "Telefonliste"
msgid "Search contacts"
msgstr "Telefonliste durchsuchen"

#: mpicms/templates/personal/list.html:11
msgid "Filter by group"
msgstr "Gruppen"
#: mpicms/templates/personal/list.html:13
msgid "Group"
msgstr "Gruppe"

#: mpicms/templates/personal/list.html:20
#: mpicms/templates/personal/list.html:22
#: mpicms/templates/personal/list.html:48
#: mpicms/templates/personal/list.html:74
msgid "Reset filter"
msgstr "Filter zurücksetzen"

#: mpicms/templates/personal/list.html:40
#: mpicms/templates/personal/list.html:39
msgid "Position"
msgstr "Position"

#: mpicms/templates/personal/list.html:65
msgid "Special Function"
msgstr "Sonderfunktion"

#: mpicms/templates/personal/list.html:93
msgid "First Name"
msgstr "Vorname"

#: mpicms/templates/personal/list.html:41
#: mpicms/templates/personal/list.html:94
msgid "Last Name"
msgstr "Nachname"

#: mpicms/templates/personal/list.html:42
#: mpicms/templates/personal/list.html:95
msgid "Email"
msgstr "Email-Adresse"

#: mpicms/templates/personal/list.html:43
#: mpicms/templates/personal/list.html:96
msgid "Phone"
msgstr "Telefon"

Expand Down Expand Up @@ -507,17 +520,13 @@ msgstr ""

#: mpicms/templates/wagtailusers/users/list.html:8
#: mpicms/templates/wagtailusers/users/list.html:12
#, fuzzy
#| msgid "Last Name"
msgid "Name"
msgstr "Nachname"

#: mpicms/templates/wagtailusers/users/list.html:19
#: mpicms/templates/wagtailusers/users/list.html:23
#, fuzzy
#| msgid "name"
msgid "Username"
msgstr "Name"
msgstr "Benutzername"

#: mpicms/templates/wagtailusers/users/list.html:27
msgid "Level"
Expand All @@ -529,26 +538,20 @@ msgid "Status"
msgstr ""

#: mpicms/templates/wagtailusers/users/list.html:30
#, fuzzy
#| msgid "Login"
msgid "Last Login"
msgstr "Einloggen"
msgstr "Letzter Login"

#: mpicms/templates/wagtailusers/users/list.html:46
msgid "Admin"
msgstr ""

#: mpicms/templates/wagtailusers/users/list.html:48
#, fuzzy
#| msgid "is active"
msgid "Active"
msgstr "ist aktiv"
msgstr "Aktiv"

#: mpicms/templates/wagtailusers/users/list.html:48
#, fuzzy
#| msgid "is active"
msgid "Inactive"
msgstr "ist aktiv"
msgstr "Inaktiv"

#: mpicms/templates/wagtailusers/users/list.html:49
#, python-format
Expand All @@ -563,10 +566,8 @@ msgstr ""
#: mpicms/users/views.py:34
#: venv0/lib/python3.7/site-packages/wagtailvideos/forms.py:80
#: venv0/lib/python3.7/site-packages/wagtailvideos/views/videos.py:177
#, fuzzy
#| msgid "Editor"
msgid "Edit"
msgstr "Editor"
msgstr "Editeren"

#: mpicms/users/views.py:42
msgid "The user could not be saved due to errors."
Expand Down Expand Up @@ -1828,17 +1829,13 @@ msgid "This slug is already in use"
msgstr ""

#: venv0/lib/python3.7/site-packages/wagtail_modeltranslation/patch_wagtailadmin_forms.py:44
#, fuzzy
#| msgid "title"
msgid "New title"
msgstr "Titel"
msgstr "Neuer Titel"

#: venv0/lib/python3.7/site-packages/wagtail_modeltranslation/patch_wagtailadmin_forms.py:50
#: venv0/lib/python3.7/site-packages/wagtail_modeltranslation/patch_wagtailadmin_forms.py:53
#, fuzzy
#| msgid "slug"
msgid "New slug"
msgstr "Kürzel"
msgstr "Neues Kürzel"

#: venv0/lib/python3.7/site-packages/wagtail_modeltranslation/patch_wagtailadmin_forms.py:59
msgid "New parent page"
Expand All @@ -1849,10 +1846,8 @@ msgid "This copy will be a child of this given parent page."
msgstr ""

#: venv0/lib/python3.7/site-packages/wagtail_modeltranslation/patch_wagtailadmin_forms.py:66
#, fuzzy
#| msgid "root pages"
msgid "Copy subpages"
msgstr "Grundseiten"
msgstr "Kopiere Unterseiten"

#: venv0/lib/python3.7/site-packages/wagtail_modeltranslation/patch_wagtailadmin_forms.py:68
#, python-format
Expand All @@ -1870,8 +1865,6 @@ msgid "This page is live. Would you like to publish its copy as well?"
msgstr ""

#: venv0/lib/python3.7/site-packages/wagtail_modeltranslation/patch_wagtailadmin_forms.py:80
#, fuzzy
#| msgid "Publications"
msgid "Publish copies"
msgstr "Publikationen"

Expand Down Expand Up @@ -1911,10 +1904,8 @@ msgid "Copy"
msgstr ""

#: venv0/lib/python3.7/site-packages/wagtail_modeltranslation/templates/modeltranslation_copy.html:19
#, fuzzy
#| msgid "root page"
msgid "Copy this page"
msgstr "Grundseite"
msgstr "Kopiere diese Seite"

#: venv0/lib/python3.7/site-packages/wagtail_modeltranslation/wagtail_hooks.py:77
msgid "View / edit fields for"
Expand Down Expand Up @@ -2052,10 +2043,8 @@ msgid "Video updated."
msgstr ""

#: venv0/lib/python3.7/site-packages/wagtailvideos/templates/wagtailvideos/multiple/edit_form.html:13
#, fuzzy
#| msgid "date"
msgid "Update"
msgstr "Datum"
msgstr "Aktualisieren"

#: venv0/lib/python3.7/site-packages/wagtailvideos/templates/wagtailvideos/permissions/includes/video_permissions_formset.html:4
msgid "Video permissions"
Expand Down Expand Up @@ -2084,10 +2073,8 @@ msgstr ""

#: venv0/lib/python3.7/site-packages/wagtailvideos/templates/wagtailvideos/videos/confirm_delete.html:4
#: venv0/lib/python3.7/site-packages/wagtailvideos/templates/wagtailvideos/videos/confirm_delete.html:7
#, fuzzy
#| msgid "featured image"
msgid "Delete image"
msgstr "Titelbild"
msgstr "Lösche Bild"

#: venv0/lib/python3.7/site-packages/wagtailvideos/templates/wagtailvideos/videos/confirm_delete.html:15
msgid "Are you sure you want to delete this video?"
Expand All @@ -2103,20 +2090,16 @@ msgid "Editing video %(title)s"
msgstr ""

#: venv0/lib/python3.7/site-packages/wagtailvideos/templates/wagtailvideos/videos/edit.html:20
#, fuzzy
#| msgid "Editor"
msgid "Editing"
msgstr "Editor"
msgstr "Editieren"

#: venv0/lib/python3.7/site-packages/wagtailvideos/templates/wagtailvideos/videos/edit.html:41
msgid "Delete video"
msgstr ""

#: venv0/lib/python3.7/site-packages/wagtailvideos/templates/wagtailvideos/videos/edit.html:47
#, fuzzy
#| msgid "This is a preview"
msgid "Video preview"
msgstr "Dies ist eine Vorschau"
msgstr "Videovorschau"

#: venv0/lib/python3.7/site-packages/wagtailvideos/templates/wagtailvideos/videos/edit.html:85
msgid "Thumbnail"
Expand All @@ -2127,10 +2110,8 @@ msgid "Filesize"
msgstr ""

#: venv0/lib/python3.7/site-packages/wagtailvideos/templates/wagtailvideos/videos/edit.html:89
#, fuzzy
#| msgid "No events found"
msgid "File not found"
msgstr "Keine Veranstaltungen gefunden"
msgstr "Datei nicht gefunden"

#: venv0/lib/python3.7/site-packages/wagtailvideos/templates/wagtailvideos/videos/edit.html:95
msgid "Usage"
Expand Down Expand Up @@ -2190,17 +2171,13 @@ msgid "Type"
msgstr ""

#: venv0/lib/python3.7/site-packages/wagtailvideos/templates/wagtailvideos/videos/usage.html:26
#, fuzzy
#| msgid "root page"
msgid "Edit this page"
msgstr "Grundseite"
msgstr "Diese Seite editieren"

#: venv0/lib/python3.7/site-packages/wagtailvideos/views/videos.py:39
#: venv0/lib/python3.7/site-packages/wagtailvideos/views/videos.py:45
#, fuzzy
#| msgid "Search contacts"
msgid "Search videos"
msgstr "Telefonliste durchsuchen"
msgstr "Videos durchsuchen"

#: venv0/lib/python3.7/site-packages/wagtailvideos/views/videos.py:106
#, python-brace-format
Expand Down Expand Up @@ -2242,3 +2219,6 @@ msgstr ""
#: venv0/lib/python3.7/site-packages/wagtailvideos/widgets.py:13
msgid "Edit this video"
msgstr ""

#~ msgid "Filter by group"
#~ msgstr "Gruppen"
39 changes: 32 additions & 7 deletions mpicms/personal/views.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,50 @@
from django.views.generic.list import ListView
from django.shortcuts import get_object_or_404

from .models import Contact, Group
from .models import Contact, Group, Position, SpecialFunction


class ContactListView(ListView):
model = Contact

def get_queryset(self):
group_pk = self.request.GET.get('group')
if group_pk:
members = Group.objects.get(pk=group_pk).members
return super().get_queryset().filter(pk__in=[member.pk for member in members])
return super().get_queryset()
position_pk = self.request.GET.get('position')
special_function_pk = self.request.GET.get('special_function')
qs = super().get_queryset();
if group_pk is not None and group_pk != "":
qs = qs.filter(groups__group_id=group_pk)

if position_pk is not None and position_pk != "":
qs = qs.filter(positions__position_id=position_pk)

if special_function_pk is not None and special_function_pk != "":
qs = qs.filter(special_functions=special_function_pk)

return qs


def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['groups'] = Group.objects.all().order_by("name")
context['positions'] = Position.objects.all().order_by("title")
context['special_functions'] = SpecialFunction.objects.all().order_by("title")

group_pk = self.request.GET.get('group')
context['selected_group_pk'] = group_pk
context['selected_group'] = get_object_or_404(Group, pk=group_pk) if group_pk else ""
if group_pk is not None and group_pk != "":
context['selected_group_pk'] = group_pk
context['selected_group'] = get_object_or_404(Group, pk=group_pk) if group_pk else ""

position_pk = self.request.GET.get('position')
if position_pk is not None and position_pk != "":
context['selected_position_pk'] = position_pk
context['selected_position'] = get_object_or_404(Position, pk=position_pk) if position_pk else ""

special_function_pk = self.request.GET.get('special_function')
if special_function_pk is not None and special_function_pk != "":
context['selected_special_function_pk'] = special_function_pk
context['selected_special_function'] = get_object_or_404(SpecialFunction, pk=special_function_pk) if special_function_pk else ""

return context


Expand Down