Skip to content

Commit

Permalink
Merge 37a045d into 0b6ccec
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Dec 21, 2023
2 parents 0b6ccec + 37a045d commit 907ccdc
Show file tree
Hide file tree
Showing 38 changed files with 376 additions and 180 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [RDMO 2.1.1](https://github.com/rdmorganiser/rdmo/compare/2.1.0...2.1.1) (Dec 21, 2023)

* Fix translations
* Fix bugs with the new progress bar
* Fix issues with option set provider plugins
* Fix issues with import and export in management
* Fix management when BASE_URL is set

## [RDMO 2.1.0](https://github.com/rdmorganiser/rdmo/compare/2.0.2...2.1.0) (Dec 11, 2023)

* Refactor progress bar and overview
Expand Down
2 changes: 1 addition & 1 deletion rdmo/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.1.0"
__version__ = "2.1.1.dev1"
8 changes: 8 additions & 0 deletions rdmo/conditions/tests/test_viewset_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ def test_export(db, client, username, password, export_format):
assert child.tag in ['condition']


def test_export_search(db, client):
client.login(username='editor', password='editor')

url = reverse(urlnames['export']) + 'xml/?search=bar'
response = client.get(url)
assert response.status_code == status_map['list']['editor'], response.content


@pytest.mark.parametrize('username,password', users)
def test_detail(db, client, username, password):
client.login(username=username, password=password)
Expand Down
2 changes: 1 addition & 1 deletion rdmo/conditions/viewsets.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from rest_framework.decorators import action
from rest_framework.filters import SearchFilter
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet

from django_filters.rest_framework import DjangoFilterBackend

from rdmo.core.exports import XMLResponse
from rdmo.core.filters import SearchFilter
from rdmo.core.permissions import HasModelPermission, HasObjectPermission
from rdmo.core.utils import is_truthy, render_to_format
from rdmo.core.views import ChoicesViewSet
Expand Down
30 changes: 30 additions & 0 deletions rdmo/core/filters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from django.db.models import Q
from django.utils.translation import get_language

from rest_framework.filters import BaseFilterBackend

from rdmo.core.utils import get_languages


class SearchFilter(BaseFilterBackend):

def filter_queryset(self, request, queryset, view):
if view.detail:
return queryset

search = request.GET.get('search')
if search:
q = Q()

if 'uri' in view.search_fields:
q |= Q(uri__contains=search)

for lang_code, lang_string, lang_field in get_languages():
if lang_code == get_language():
for search_field in ['title', 'text']:
if search_field in view.search_fields:
q |= Q(**{f'{search_field}_{lang_field}__contains': search})

queryset = queryset.filter(q)

return queryset
8 changes: 8 additions & 0 deletions rdmo/domain/tests/test_viewset_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ def test_export(db, client, username, password, export_format):
assert child.tag in ['attribute']


def test_export_search(db, client):
client.login(username='editor', password='editor')

url = reverse(urlnames['export']) + 'xml/?search=bar'
response = client.get(url)
assert response.status_code == status_map['list']['editor'], response.content


@pytest.mark.parametrize('username,password', users)
def test_detail(db, client, username, password):
client.login(username=username, password=password)
Expand Down
2 changes: 1 addition & 1 deletion rdmo/domain/viewsets.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from django.db import models

from rest_framework.decorators import action
from rest_framework.filters import SearchFilter
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet

from django_filters.rest_framework import DjangoFilterBackend

from rdmo.core.exports import XMLResponse
from rdmo.core.filters import SearchFilter
from rdmo.core.permissions import HasModelPermission, HasObjectPermission
from rdmo.core.utils import render_to_csv, render_to_format

Expand Down
Binary file modified rdmo/locale/de/LC_MESSAGES/django.mo
Binary file not shown.
77 changes: 41 additions & 36 deletions rdmo/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ msgid ""
msgstr ""
"Project-Id-Version: RDMO\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-12-08 17:11+0100\n"
"PO-Revision-Date: 2023-12-08 19:08+0100\n"
"POT-Creation-Date: 2023-12-15 11:37+0100\n"
"PO-Revision-Date: 2023-12-15 11:37+0100\n"
"Last-Translator: Jochen Klar <jklar@aip.de>\n"
"Language-Team: RDMO <rdmo-team@listserv.dfn.de>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.4\n"
"X-Generator: Poedit 2.4.2\n"

#: accounts/apps.py:7
msgid "Accounts"
Expand Down Expand Up @@ -359,11 +359,11 @@ msgstr "Bestätigen"
#: accounts/templates/account/email_confirm.html:29
#, python-format
msgid ""
"This e-mail confirmation link expired or is invalid. Please <a "
"href=\"%(email_url)s\">issue a new e-mail confirmation request</a>."
"This e-mail confirmation link expired or is invalid. Please <a href="
"\"%(email_url)s\">issue a new e-mail confirmation request</a>."
msgstr ""
"Dieser Bestätigungs-Link ist abgelaufen oder ungültig. Bitte <a "
"href=\"%(email_url)s\">fordern sie eine neue Betätigungs-E-Mail an</a>."
"Dieser Bestätigungs-Link ist abgelaufen oder ungültig. Bitte <a href="
"\"%(email_url)s\">fordern sie eine neue Betätigungs-E-Mail an</a>."

#: accounts/templates/account/login.html:6
#: accounts/templates/account/login_form.html:23
Expand All @@ -380,17 +380,17 @@ msgstr "Mit Shibboleth einloggen"
#: accounts/templates/account/login_form_account.html:7
#, python-format
msgid ""
"If you have not created an account yet, then please <a "
"href=\"%(signup_url)s\">sign up</a> first."
"If you have not created an account yet, then please <a href=\"%(signup_url)s"
"\">sign up</a> first."
msgstr ""
"Falls Sie noch kein Benutzerkonto haben, <a "
"href=\"%(signup_url)s\">registrieren</a> Sie sich bitte zunächst."
"Falls Sie noch kein Benutzerkonto haben, <a href=\"%(signup_url)s"
"\">registrieren</a> Sie sich bitte zunächst."

#: accounts/templates/account/login_form_account.html:14
#, python-format
msgid ""
"If you forgot your password and want to reset it, click <a "
"href=\"%(reset_url)s\">here</a>."
"If you forgot your password and want to reset it, click <a href="
"\"%(reset_url)s\">here</a>."
msgstr ""
"Falls Sie Ihr Passwort vergessen haben und es zurücksetzen wollen, klicken "
"Sie bitte <a href=\"%(reset_url)s\">hier</a>."
Expand Down Expand Up @@ -520,8 +520,8 @@ msgstr "Neues Benutzerkonto erstellen"
msgid ""
"Already have an account? Then please <a href=\"%(login_url)s\">sign in</a>."
msgstr ""
"Falls Sie schon eine Benutzerkonto haben können Sie sich <a "
"href=\"%(login_url)s\">hier</a> anmelden."
"Falls Sie schon eine Benutzerkonto haben können Sie sich <a href="
"\"%(login_url)s\">hier</a> anmelden."

#: accounts/templates/account/signup.html:34
#: accounts/templates/socialaccount/signup.html:33
Expand Down Expand Up @@ -601,8 +601,8 @@ msgid ""
"<strong>Note:</strong> you can still <a href=\"%(email_url)s\">change your e-"
"mail address</a>."
msgstr ""
"<strong>Hinweis:</strong> Sie können immer noch Ihre <a "
"href=\"%(email_url)s\">E-Mail Adresse ändern</a>."
"<strong>Hinweis:</strong> Sie können immer noch Ihre <a href=\"%(email_url)s"
"\">E-Mail Adresse ändern</a>."

#: accounts/templates/profile/profile_remove_closed.html:6
#: accounts/templates/profile/profile_remove_failed.html:6
Expand Down Expand Up @@ -759,12 +759,12 @@ msgstr "Anmeldung abgebrochen"
#, python-format
msgid ""
"You decided to cancel logging in to our site using one of your existing "
"accounts. If this was a mistake, please proceed to <a "
"href=\"%(login_url)s\">sign in</a>."
"accounts. If this was a mistake, please proceed to <a href=\"%(login_url)s"
"\">sign in</a>."
msgstr ""
"Sie haben sich entschieden, die Anmeldung mit einem externen Konto "
"abzubrechen. Falls dies versehentlich geschehen ist, könne Sie <a "
"href=\"%(login_url)s\">hier</a> fortsetzen."
"abzubrechen. Falls dies versehentlich geschehen ist, könne Sie <a href="
"\"%(login_url)s\">hier</a> fortsetzen."

#: accounts/templates/socialaccount/signup.html:9
#, python-format
Expand Down Expand Up @@ -2417,11 +2417,11 @@ msgstr "Sehr geehrte Damen und Herren,"
#: projects/templates/projects/issue_send_message.txt:3
#, python-format
msgid ""
"The following task was identified in the project \"%(project_title)s\" "
"<%(project_url)s>:"
"The following task was identified in the project \"%(project_title)s\" <"
"%(project_url)s>:"
msgstr ""
"Die folgende Aufgabe wurde im Projekt \"%(project_title)s\" "
"<%(project_url)s> identifiziert:"
"Die folgende Aufgabe wurde im Projekt \"%(project_title)s\" <"
"%(project_url)s> identifiziert:"

#: projects/templates/projects/issue_send_message.txt:13
#, python-format
Expand All @@ -2446,8 +2446,8 @@ msgid ""
"You are about to remove the user <strong>%(user)s</strong> from the project "
"<strong>%(title)s</strong>."
msgstr ""
"Sie sind dabei den User <strong>%(user)s</strong> aus dem Projekt "
"<strong>%(title)s</strong> zu entfernen."
"Sie sind dabei den User <strong>%(user)s</strong> aus dem Projekt <strong>"
"%(title)s</strong> zu entfernen."

#: projects/templates/projects/membership_form.html:9
#: projects/templates/projects/membership_form.html:11
Expand Down Expand Up @@ -3003,6 +3003,11 @@ msgstr "Entfernen"
msgid "Please give the tab a meaningful name."
msgstr "Bitte geben Sie dem Tab einen aus­sa­ge­kräf­tigen Namen."

#: projects/templates/projects/project_questions_navigation.html:23
#, python-format
msgid "(%(page_count)s of %(page_total)s)"
msgstr "(%(page_count)s von %(page_total)s)"

#: projects/templates/projects/project_questions_navigation_help.html:5
msgid "Using the navigation will save your input."
msgstr "Wenn Sie die Navigation verwenden, wird Ihre Eingabe gespeichert."
Expand Down Expand Up @@ -3046,9 +3051,9 @@ msgid ""
msgstr ""
"Warnung: In der Datenbank sind mehrere Antworten vorhanden. Dies kann "
"aufgrund eines technischen Problems in der Vergangenheit geschehen. Sie "
"können unerwünschte Antworten über das Feld \"Eintrag entfernen\" (<i "
"class=\"fa fa-times\"></i>) entfernen. Bitte kontaktieren Sie den Support, "
"wenn das Problem weiterhin besteht."
"können unerwünschte Antworten über das Feld \"Eintrag entfernen\" (<i class="
"\"fa fa-times\"></i>) entfernen. Bitte kontaktieren Sie den Support, wenn "
"das Problem weiterhin besteht."

#: projects/templates/projects/project_questions_questionset_head.html:33
msgid "Edit tab"
Expand Down Expand Up @@ -3225,15 +3230,15 @@ msgstr "(%(progress)s Fortschritt)"
msgid "A newer version of this value was found."
msgstr "Eine neuere Version dieses Wertes wurde gefunden."

#: projects/validators.py:39
#: projects/validators.py:44
msgid ""
"An existing value for this attribute/set_prefix/set_index/collection_index "
"was found."
msgstr ""
"Es wurde ein vorhandener Wert für dieses Attribut/set_prefix/set_index/"
"collection_index gefunden."

#: projects/validators.py:54
#: projects/validators.py:57
msgid "The file quota for this project has been reached."
msgstr "Sie haben die Quota für dieses Projekt erreicht."

Expand Down Expand Up @@ -4307,11 +4312,11 @@ msgstr "Set"
#~ msgstr "Sets"

#~ msgid ""
#~ "Entries with <i class=\"fa fa-question-circle-o small\" aria-"
#~ "hidden=\"true\"></i> might be skipped based on your input."
#~ "Entries with <i class=\"fa fa-question-circle-o small\" aria-hidden=\"true"
#~ "\"></i> might be skipped based on your input."
#~ msgstr ""
#~ "Einträge mit <i class=\"fa fa-question-circle-o small\" aria-"
#~ "hidden=\"true\"></i> können aufgrund Ihrer Eingabe übersprungen werden."
#~ "Einträge mit <i class=\"fa fa-question-circle-o small\" aria-hidden=\"true"
#~ "\"></i> können aufgrund Ihrer Eingabe übersprungen werden."

#~ msgid "Plural name (primary)"
#~ msgstr "Name (Plural, erste Sprache)"
Expand Down
Binary file modified rdmo/locale/es/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit 907ccdc

Please sign in to comment.