Compare commits

5 Commits

Author SHA1 Message Date
e64cc4bd5f Merge branch 'develop'
# Conflicts:
#	src/locale/en/LC_MESSAGES/django.po
2025-11-09 17:55:11 +01:00
a498971d66 feat: create directory in one go, don't use cache dir and use more standard entrypoint.sh 2025-11-09 17:36:48 +01:00
527ab07b6f trans: fis various 2025-11-08 00:33:35 +01:00
e2e236d650 feat: add button to download all logs 2025-11-08 00:00:54 +01:00
c4100a9ade trans: fix various 2025-11-07 18:17:53 +01:00
6 changed files with 39 additions and 26 deletions

View File

@@ -9,15 +9,14 @@ RUN apt install gettext -y
RUN apt install libpq-dev gcc -y RUN apt install libpq-dev gcc -y
COPY . /app COPY . /app
WORKDIR /app WORKDIR /app
RUN mkdir /app/data RUN mkdir /app/data/static -p
RUN mkdir /app/data/static
RUN mkdir /app/data/media RUN mkdir /app/data/media
RUN pip install -e . # Without the -e the library static folder will not be copied by collectstatic! RUN pip install --no-cache-dir -e . # Without the -e the library static folder will not be copied by collectstatic!
RUN nf collectstatic --noinput RUN nf collectstatic --noinput
RUN nf compilemessages --ignore venv RUN nf compilemessages --ignore venv
COPY docker/notfellchen.bash /bin/notfellchen COPY docker/entrypoint.sh /bin/notfellchen
EXPOSE 7345 EXPOSE 7345
CMD ["notfellchen"] CMD ["notfellchen"]

View File

@@ -41,6 +41,7 @@ dependencies = [
"django-super-deduper", "django-super-deduper",
"django-allauth[mfa]", "django-allauth[mfa]",
"django_debug_toolbar", "django_debug_toolbar",
"django-admin-extra-buttons"
] ]
dynamic = ["version", "readme"] dynamic = ["version", "readme"]

View File

@@ -7,6 +7,8 @@ from django.utils.html import format_html
from django.urls import reverse from django.urls import reverse
from django.utils.http import urlencode from django.utils.http import urlencode
from admin_extra_buttons.api import ExtraButtonsMixin, button, link
from .models import Language, Text, ReportComment, ReportAdoptionNotice, Log, Timestamp, SearchSubscription, \ from .models import Language, Text, ReportComment, ReportAdoptionNotice, Log, Timestamp, SearchSubscription, \
SpeciesSpecificURL, ImportantLocation, SocialMediaPost SpeciesSpecificURL, ImportantLocation, SocialMediaPost
@@ -170,18 +172,26 @@ class SocialMediaPostAdmin(admin.ModelAdmin):
@admin.register(Log) @admin.register(Log)
class LogAdmin(admin.ModelAdmin): class LogAdmin(ExtraButtonsMixin, admin.ModelAdmin):
ordering = ["-created_at"] ordering = ["-created_at"]
list_filter = ("action",) list_filter = ("action",)
list_display = ("action", "user", "created_at") list_display = ("action", "user", "created_at")
actions = ("export_as_csv",) actions = ("export_as_csv",)
@admin.action(description=_("Ausgewählte Logs exportieren"))
def export_as_csv(self, request, queryset): def export_as_csv(self, request, queryset):
response = export_to_csv_generic(Log, queryset) response = export_to_csv_generic(Log, queryset)
return response return response
export_as_csv.short_description = _("Ausgewählte Logs exportieren") @button()
def export_all_as_csv(self, request):
actual_queryset = Log.objects.all()
response = export_to_csv_generic(Log, actual_queryset)
return response
@link(href="https://www.google.com/", visible=lambda btn: True)
def invisible(self, button):
button.visible = False
admin.site.register(Animal) admin.site.register(Animal)
admin.site.register(Species) admin.site.register(Species)

View File

@@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: Notfellchen\n" "Project-Id-Version: Notfellchen\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-11-07 14:28+0000\n" "POT-Creation-Date: 2025-11-07 14:28+0000\n"
"PO-Revision-Date: 2025-11-07 18:11+0100\n" "PO-Revision-Date: 2025-11-08 00:33+0100\n"
"Last-Translator: Julian-Samuel <Gebühr>\n" "Last-Translator: Julian-Samuel <Gebühr>\n"
"Language-Team: English\n" "Language-Team: English\n"
"Language: en\n" "Language: en\n"
@@ -1455,14 +1455,18 @@ msgid ""
"\n" "\n"
" Folgende Nachricht wurde zur Meldung hinzugefügt:\n" " Folgende Nachricht wurde zur Meldung hinzugefügt:\n"
" " " "
msgstr "The following message was added to the report" msgstr ""
"\n"
"The following message was added to the report:"
#: src/fellchensammlung/templates/fellchensammlung/mail/notifications/report.html:28 #: src/fellchensammlung/templates/fellchensammlung/mail/notifications/report.html:28
msgid "" msgid ""
"\n" "\n"
" Bitte bearbeite die Meldung möglichst bald.\n" " Bitte bearbeite die Meldung möglichst bald.\n"
" " " "
msgstr "Please check the report soon." msgstr ""
"\n"
"Please check the report soon."
#: src/fellchensammlung/templates/fellchensammlung/mail/notifications/report.html:33 #: src/fellchensammlung/templates/fellchensammlung/mail/notifications/report.html:33
msgid "Report bearbeiten" msgid "Report bearbeiten"
@@ -1512,7 +1516,7 @@ msgstr "Adoption Notice deactivated"
#: src/fellchensammlung/templates/fellchensammlung/misc/deactivate-an.html:10 #: src/fellchensammlung/templates/fellchensammlung/misc/deactivate-an.html:10
msgid "Warum schließt du die Vermittlung?" msgid "Warum schließt du die Vermittlung?"
msgstr "Why are you closing the adoption notice" msgstr "Why are you closing the adoption notice?"
#: src/fellchensammlung/templates/fellchensammlung/misc/deactivate-an.html:14 #: src/fellchensammlung/templates/fellchensammlung/misc/deactivate-an.html:14
msgid "Vermittelt mit Hilfe von Notfellchen" msgid "Vermittelt mit Hilfe von Notfellchen"
@@ -1562,9 +1566,9 @@ msgid ""
"href=%(post_url)s>%(post_url)s</a>\n" "href=%(post_url)s>%(post_url)s</a>\n"
" " " "
msgstr "" msgstr ""
"\r\n" "\n"
" Link to Post: <a " " Link to Post: <a "
"href=%(post_url)s>%(post_url)s</a>\r\n" "href=%(post_url)s>%(post_url)s</a>\n"
" " " "
#: src/fellchensammlung/templates/fellchensammlung/mod-tool-overview.html:39 #: src/fellchensammlung/templates/fellchensammlung/mod-tool-overview.html:39
@@ -1666,9 +1670,9 @@ msgid ""
" Die Vermittlung <strong>%(adoption_notice_title)s</strong> wurde " " Die Vermittlung <strong>%(adoption_notice_title)s</strong> wurde "
"deaktiviert.\n" "deaktiviert.\n"
msgstr "" msgstr ""
"\r\n" "\n"
" The adoption notice <strong>%(adoption_notice_title)s</strong> was " " The adoption notice <strong>%(adoption_notice_title)s</strong> was "
"deactivated.\r\n" "deactivated.\n"
#: src/fellchensammlung/templates/fellchensammlung/partials/notifications/body-an-for-search.html:2 #: src/fellchensammlung/templates/fellchensammlung/partials/notifications/body-an-for-search.html:2
msgid "" msgid ""
@@ -1676,8 +1680,8 @@ msgid ""
" Es wurde eine neue Vermittlung gefunden, die deinen Kriterien " " Es wurde eine neue Vermittlung gefunden, die deinen Kriterien "
"entspricht:\n" "entspricht:\n"
msgstr "" msgstr ""
"\r\n" "\n"
" There is a new adoption notice that fits your search criteria:\r\n" " There is a new adoption notice that fits your search criteria:\n"
#: src/fellchensammlung/templates/fellchensammlung/partials/notifications/body-an-to-be-checked.html:2 #: src/fellchensammlung/templates/fellchensammlung/partials/notifications/body-an-to-be-checked.html:2
#, python-format #, python-format
@@ -1686,9 +1690,9 @@ msgid ""
" Die Vermittlung <strong>%(adoption_notice_title)s</strong> muss " " Die Vermittlung <strong>%(adoption_notice_title)s</strong> muss "
"überprüft werden.\n" "überprüft werden.\n"
msgstr "" msgstr ""
"\r\n" "\n"
" The adoption notice <strong>%(adoption_notice_title)s</strong> must be " " The adoption notice <strong>%(adoption_notice_title)s</strong> must be "
"checked.\r\n" "checked.\n"
#: src/fellchensammlung/templates/fellchensammlung/partials/notifications/body-new-comment.html:4 #: src/fellchensammlung/templates/fellchensammlung/partials/notifications/body-new-comment.html:4
#, python-format #, python-format
@@ -1698,9 +1702,9 @@ msgid ""
"<strong>%(adoption_notice_title)s</strong> hinzugefügt:\n" "<strong>%(adoption_notice_title)s</strong> hinzugefügt:\n"
" " " "
msgstr "" msgstr ""
"\r\n" "\n"
" There is a new comment on the adoption notice " " There is a new comment on the adoption notice "
"<strong>%(adoption_notice_title)s</strong>.\r\n" "<strong>%(adoption_notice_title)s</strong>.\n"
" " " "
#: src/fellchensammlung/templates/fellchensammlung/partials/notifications/body-new-report.html:3 #: src/fellchensammlung/templates/fellchensammlung/partials/notifications/body-new-report.html:3
@@ -1709,8 +1713,8 @@ msgid ""
" Es gibt eine neue Meldung. Folgende Nachricht wurde zur Meldung " " Es gibt eine neue Meldung. Folgende Nachricht wurde zur Meldung "
"hinzugefügt:\n" "hinzugefügt:\n"
msgstr "" msgstr ""
"\r\n" "\n"
" There is a new report. The following message was added to it:\r\n" " There is a new report. The following message was added to it:\n"
#: src/fellchensammlung/templates/fellchensammlung/partials/notifications/body-new-report.html:13 #: src/fellchensammlung/templates/fellchensammlung/partials/notifications/body-new-report.html:13
msgid "Meldung anzeigen" msgid "Meldung anzeigen"
@@ -1893,8 +1897,8 @@ msgid ""
" %(number_of_adoption_notices)s\n" " %(number_of_adoption_notices)s\n"
" Vermittlungen gefunden" " Vermittlungen gefunden"
msgstr "" msgstr ""
"\r\n" "\n"
" %(number_of_adoption_notices)s\r\n" " %(number_of_adoption_notices)s\n"
" adoption notices found" " adoption notices found"
#: src/fellchensammlung/templates/fellchensammlung/search.html:58 #: src/fellchensammlung/templates/fellchensammlung/search.html:58

View File

@@ -88,7 +88,6 @@ if config.getboolean('django', 'cache', fallback=False):
} }
} }
""" DATABASE """ """ DATABASE """
DB_BACKEND = config.get("database", "backend", fallback="sqlite3") DB_BACKEND = config.get("database", "backend", fallback="sqlite3")
DB_NAME = config.get("database", "name", fallback="notfellchen.sqlite3") DB_NAME = config.get("database", "name", fallback="notfellchen.sqlite3")
@@ -100,7 +99,6 @@ DB_HOST = config.get("database", "host", fallback='')
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
LOCALE_PATHS = [os.path.join(BASE_DIR, 'locale')] LOCALE_PATHS = [os.path.join(BASE_DIR, 'locale')]
""" CELERY + KEYDB """ """ CELERY + KEYDB """
CELERY_BROKER_URL = config.get("celery", "broker", fallback="redis://localhost:6379/0") CELERY_BROKER_URL = config.get("celery", "broker", fallback="redis://localhost:6379/0")
CELERY_RESULT_BACKEND = config.get("celery", "backend", fallback="redis://localhost:6379/0") CELERY_RESULT_BACKEND = config.get("celery", "backend", fallback="redis://localhost:6379/0")
@@ -246,6 +244,7 @@ INSTALLED_APPS = [
'drf_spectacular_sidecar', # required for Django collectstatic discovery 'drf_spectacular_sidecar', # required for Django collectstatic discovery
'widget_tweaks', 'widget_tweaks',
"debug_toolbar", "debug_toolbar",
'admin_extra_buttons',
] ]
MIDDLEWARE = [ MIDDLEWARE = [