diff --git a/messages.pot b/messages.pot index 2741ace..35d4ffa 100644 --- a/messages.pot +++ b/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2022-01-17 09:16+0100\n" +"POT-Creation-Date: 2022-08-24 14:28+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -363,47 +363,65 @@ msgstr "" msgid "Logo" msgstr "" -#: project/forms/admin_unit.py:65 +#: project/forms/admin_unit.py:55 +msgid "Allow verification requests" +msgstr "" + +#: project/forms/admin_unit.py:56 +msgid "If set, unverified organizations may ask you for verification." +msgstr "" + +#: project/forms/admin_unit.py:62 +msgid "Verification requests information" +msgstr "" + +#: project/forms/admin_unit.py:64 +msgid "" +"This text is shown to unverified organizations to help them decide " +"whether they ask you for verification." +msgstr "" + +#: project/forms/admin_unit.py:80 msgid "Verify new organization" msgstr "" -#: project/forms/admin_unit.py:66 +#: project/forms/admin_unit.py:81 msgid "If set, events of the new organization are publicly visible." msgstr "" -#: project/forms/admin_unit.py:72 project/forms/reference_request.py:86 +#: project/forms/admin_unit.py:87 project/forms/reference_request.py:86 msgid "Verify reference requests automatically" msgstr "" -#: project/forms/admin_unit.py:73 +#: project/forms/admin_unit.py:88 msgid "" "If set, all upcoming reference requests of the new organization are " "verified automatically." msgstr "" -#: project/forms/admin_unit.py:84 project/templates/admin_unit/create.html:5 +#: project/forms/admin_unit.py:99 project/templates/admin_unit/create.html:5 #: project/templates/admin_unit/create.html:22 #: project/templates/manage/admin_units.html:27 msgid "Create organization" msgstr "" -#: project/forms/admin_unit.py:92 project/forms/admin_unit.py:115 +#: project/forms/admin_unit.py:107 project/forms/admin_unit.py:130 msgid "Update settings" msgstr "" -#: project/forms/admin_unit.py:96 +#: project/forms/admin_unit.py:111 msgid "Font" msgstr "" -#: project/forms/admin_unit.py:98 +#: project/forms/admin_unit.py:113 msgid "Background Color" msgstr "" -#: project/forms/admin_unit.py:104 +#: project/forms/admin_unit.py:119 msgid "Primary Color" msgstr "" -#: project/forms/admin_unit.py:110 +#: project/forms/admin_unit.py:125 msgid "Link Color" msgstr "" @@ -1288,7 +1306,7 @@ msgstr "" msgid "Edit event" msgstr "" -#: project/templates/_macros.html:1226 project/templates/manage/events.html:65 +#: project/templates/_macros.html:1226 project/templates/manage/events.html:66 msgid "More" msgstr "" @@ -1354,7 +1372,7 @@ msgstr "" #: project/templates/layout.html:175 project/templates/layout.html:220 #: project/templates/manage/events.html:6 -#: project/templates/manage/events.html:41 +#: project/templates/manage/events.html:42 #: project/templates/manage/events_vue.html:4 msgid "Events" msgstr "" @@ -1397,7 +1415,7 @@ msgstr "" #: project/templates/event/create.html:5 #: project/templates/event/create.html:221 project/templates/layout.html:227 -#: project/templates/manage/events.html:44 +#: project/templates/manage/events.html:45 #: project/templates/manage/organizers.html:21 msgid "Create event" msgstr "" @@ -1517,7 +1535,7 @@ msgstr "" #: project/templates/admin/admin_units.html:27 #: project/templates/admin/users.html:27 -#: project/templates/manage/events.html:59 +#: project/templates/manage/events.html:60 #: project/templates/manage/members.html:35 #: project/templates/manage/organizers.html:22 #: project/templates/manage/places.html:27 @@ -1548,6 +1566,12 @@ msgstr "" msgid "Invite user" msgstr "" +#: project/templates/admin_unit/update.html:72 +#: project/templates/manage/verification_requests_outgoing.html:6 +#: project/templates/manage/verification_requests_outgoing.html:10 +msgid "Verification requests" +msgstr "" + #: project/templates/email/event_report_notice.html:4 msgid "There is a new event report." msgstr "" @@ -1657,7 +1681,7 @@ msgid "Reference this event on your organization's calendar." msgstr "" #: project/templates/event/actions.html:44 -#: project/templates/manage/events.html:63 +#: project/templates/manage/events.html:64 msgid "Add to list" msgstr "" @@ -1680,7 +1704,7 @@ msgid "List all events of %(admin_unit_name)s" msgstr "" #: project/templates/event/actions.html:74 -#: project/templates/manage/events.html:78 +#: project/templates/manage/events.html:79 msgid "Add event to list" msgstr "" @@ -1797,13 +1821,17 @@ msgid "" "visible." msgstr "" -#: project/templates/manage/events.html:58 +#: project/templates/manage/events.html:38 +msgid "Verify organization" +msgstr "" + +#: project/templates/manage/events.html:59 #: project/templates/manage/references_incoming.html:19 #: project/templates/manage/references_outgoing.html:19 msgid "View" msgstr "" -#: project/templates/manage/events.html:60 +#: project/templates/manage/events.html:61 #: project/templates/manage/members.html:21 #: project/templates/manage/members.html:36 #: project/templates/manage/organizers.html:23 @@ -1813,7 +1841,7 @@ msgstr "" msgid "Delete" msgstr "" -#: project/templates/manage/events.html:61 +#: project/templates/manage/events.html:62 msgid "Duplicate" msgstr "" @@ -1844,6 +1872,10 @@ msgstr "" msgid "Reviews" msgstr "" +#: project/templates/manage/verification_requests_outgoing.html:11 +msgid "Here you can find organizations that can verify other organizations." +msgstr "" + #: project/templates/manage/widgets.html:87 msgid "Link, um Veranstaltungen vorzuschlagen" msgstr "" @@ -1967,7 +1999,7 @@ msgstr "" msgid "Organization successfully updated" msgstr "" -#: project/views/admin.py:68 project/views/manage.py:360 +#: project/views/admin.py:68 project/views/manage.py:361 msgid "Settings successfully updated" msgstr "" diff --git a/migrations/versions/ec7a6b157860_.py b/migrations/versions/ec7a6b157860_.py new file mode 100644 index 0000000..db162ab --- /dev/null +++ b/migrations/versions/ec7a6b157860_.py @@ -0,0 +1,41 @@ +"""empty message + +Revision ID: ec7a6b157860 +Revises: 40873357f372 +Create Date: 2022-08-23 15:09:34.578596 + +""" +import sqlalchemy as sa +import sqlalchemy_utils +from alembic import op + +from project import dbtypes + +# revision identifiers, used by Alembic. +revision = "ec7a6b157860" +down_revision = "40873357f372" +branch_labels = None +depends_on = None + + +def upgrade(): + op.add_column( + "adminunit", + sa.Column( + "incoming_verification_requests_allowed", + sa.Boolean(), + server_default="0", + nullable=False, + ), + ) + op.add_column( + "adminunit", + sa.Column( + "incoming_verification_requests_text", sa.UnicodeText(), nullable=True + ), + ) + + +def downgrade(): + op.drop_column("adminunit", "incoming_verification_requests_text") + op.drop_column("adminunit", "incoming_verification_requests_allowed") diff --git a/project/forms/admin_unit.py b/project/forms/admin_unit.py index 7e91548..3fd687d 100644 --- a/project/forms/admin_unit.py +++ b/project/forms/admin_unit.py @@ -1,6 +1,6 @@ from flask_babelex import lazy_gettext from flask_wtf import FlaskForm -from wtforms import DecimalField, FormField, StringField, SubmitField +from wtforms import DecimalField, FormField, StringField, SubmitField, TextAreaField from wtforms.fields.core import BooleanField from wtforms.fields.html5 import EmailField, TelField, URLField from wtforms.validators import DataRequired, Length, Optional, Regexp @@ -51,9 +51,24 @@ class BaseAdminUnitForm(FlaskForm): logo = FormField(Base64ImageForm, lazy_gettext("Logo"), default=lambda: Image()) location = FormField(AdminUnitLocationForm, default=lambda: Location()) + incoming_verification_requests_allowed = BooleanField( + lazy_gettext("Allow verification requests"), + description=lazy_gettext( + "If set, unverified organizations may ask you for verification." + ), + validators=[Optional()], + ) + incoming_verification_requests_text = TextAreaField( + lazy_gettext("Verification requests information"), + validators=[Optional()], + description=lazy_gettext( + "This text is shown to unverified organizations to help them decide whether they ask you for verification." + ), + ) + def populate_obj(self, obj): for name, field in self._fields.items(): - if name == "location" and not obj.location: + if name == "location" and not obj.location: # pragma: no cover obj.location = Location() elif name == "logo" and not obj.logo: obj.logo = Image() diff --git a/project/models.py b/project/models.py index 49a1a98..de6149b 100644 --- a/project/models.py +++ b/project/models.py @@ -495,6 +495,15 @@ class AdminUnit(db.Model, TrackableMixin): server_default="0", ) ) + incoming_verification_requests_allowed = deferred( + Column( + Boolean(), + nullable=False, + default=False, + server_default="0", + ) + ) + incoming_verification_requests_text = Column(UnicodeText()) can_invite_other = deferred( Column( Boolean(), diff --git a/project/services/admin_unit.py b/project/services/admin_unit.py index 2eb0f17..012951e 100644 --- a/project/services/admin_unit.py +++ b/project/services/admin_unit.py @@ -169,12 +169,22 @@ def get_admin_unit_member(id): return AdminUnitMember.query.filter_by(id=id).first() -def get_admin_unit_query(keyword=None, include_unverified=False): +def get_admin_unit_query( + keyword=None, + include_unverified=False, + only_verifier=False, +): query = AdminUnit.query if not include_unverified: query = query.filter(AdminUnit.is_verified) + if only_verifier: + only_verifier_filter = and_( + AdminUnit.can_verify_other, AdminUnit.incoming_verification_requests_allowed + ) + query = query.filter(only_verifier_filter) + if keyword: like_keyword = "%" + keyword + "%" keyword_filter = or_( diff --git a/project/templates/admin_unit/update.html b/project/templates/admin_unit/update.html index 65f9bac..ff53f5b 100644 --- a/project/templates/admin_unit/update.html +++ b/project/templates/admin_unit/update.html @@ -66,6 +66,18 @@ + {% if admin_unit.can_verify_other %} +
+
+ {{ _('Verification requests') }} +
+
+ {{ render_field_with_errors(form.incoming_verification_requests_allowed, ri="checkbox") }} + {{ render_field_with_errors(form.incoming_verification_requests_text) }} +
+
+ {% endif %} + {{ render_field(form.submit) }} diff --git a/project/templates/manage/events.html b/project/templates/manage/events.html index e4027d1..509098c 100644 --- a/project/templates/manage/events.html +++ b/project/templates/manage/events.html @@ -35,6 +35,7 @@ var vue_app_data = { eventId: 0 }; {% if not admin_unit.is_verified %} {% endif %} diff --git a/project/templates/manage/verification_requests_outgoing.html b/project/templates/manage/verification_requests_outgoing.html new file mode 100644 index 0000000..6a3325c --- /dev/null +++ b/project/templates/manage/verification_requests_outgoing.html @@ -0,0 +1,41 @@ +{% extends "layout.html" %} +{% set active_id = "verification_requests_outgoing" %} +{% from "_macros.html" import render_logo, render_location_prop, render_fax_prop, render_phone_prop, render_email_prop, +render_link_prop, render_admin_unit_badges, render_pagination %} +{%- block title -%} +{{ _('Verification requests') }} +{%- endblock -%} +{% block content %} + +

{{ _('Verification requests') }}

+

{{ _('Here you can find organizations that can verify other organizations.') }}

+ +{% for other_admin_unit in admin_units %} +
+
+

+ {{ + other_admin_unit.name }} + {{ render_admin_unit_badges(other_admin_unit) }} +

+

{{ other_admin_unit.incoming_verification_requests_text }}

+
+ {% if other_admin_unit.logo_id %} +
{{ render_logo(other_admin_unit.logo) }}
+ {% endif %} + +
+ {{ render_link_prop(other_admin_unit.url) }} + {{ render_email_prop(other_admin_unit.email) }} + {{ render_phone_prop(other_admin_unit.phone) }} + {{ render_fax_prop(other_admin_unit.fax) }} + {{ render_location_prop(other_admin_unit.location) }} +
+
+
+
+{% endfor %} + +
{{ render_pagination(pagination) }}
+ +{% endblock %} \ No newline at end of file diff --git a/project/translations/de/LC_MESSAGES/messages.mo b/project/translations/de/LC_MESSAGES/messages.mo index 7e72f64..6acfb36 100644 Binary files a/project/translations/de/LC_MESSAGES/messages.mo and b/project/translations/de/LC_MESSAGES/messages.mo differ diff --git a/project/translations/de/LC_MESSAGES/messages.po b/project/translations/de/LC_MESSAGES/messages.po index 7a1ac07..d9d6420 100644 --- a/project/translations/de/LC_MESSAGES/messages.po +++ b/project/translations/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-01-17 09:16+0100\n" +"POT-Creation-Date: 2022-08-24 14:28+0200\n" "PO-Revision-Date: 2020-06-07 18:51+0200\n" "Last-Translator: FULL NAME \n" "Language: de\n" @@ -375,21 +375,39 @@ msgstr "Fax" msgid "Logo" msgstr "Logo" -#: project/forms/admin_unit.py:65 +#: project/forms/admin_unit.py:55 +msgid "Allow verification requests" +msgstr "Verifizierungsanfragen erlauben" + +#: project/forms/admin_unit.py:56 +msgid "If set, unverified organizations may ask you for verification." +msgstr "Wenn gesetzt, können nicht verifizierte Organisationen um eine Verifizierung bitten." + +#: project/forms/admin_unit.py:62 +msgid "Verification requests information" +msgstr "Text für Verifizierungsanfragen" + +#: project/forms/admin_unit.py:64 +msgid "" +"This text is shown to unverified organizations to help them decide " +"whether they ask you for verification." +msgstr "Dieser Text wird nicht verifizierten Organisationen angezeigt, um ihnen bei der Entscheidung zu helfen, ob sie um eine Verifizierung bitten." + +#: project/forms/admin_unit.py:80 msgid "Verify new organization" msgstr "Neue Organisation verifizieren" -#: project/forms/admin_unit.py:66 +#: project/forms/admin_unit.py:81 msgid "If set, events of the new organization are publicly visible." msgstr "" "Wenn gesetzt, sind Veranstaltungen der neuen Organisation öffentlich " "sichtbar." -#: project/forms/admin_unit.py:72 project/forms/reference_request.py:86 +#: project/forms/admin_unit.py:87 project/forms/reference_request.py:86 msgid "Verify reference requests automatically" msgstr "Empfehlungsanfragen automatisch verifizieren" -#: project/forms/admin_unit.py:73 +#: project/forms/admin_unit.py:88 msgid "" "If set, all upcoming reference requests of the new organization are " "verified automatically." @@ -397,29 +415,29 @@ msgstr "" "Wenn gesetzt, werden alle zukünftigen Empfehlungsanfragen der neuen " "Organisation automatisch verifiziert." -#: project/forms/admin_unit.py:84 project/templates/admin_unit/create.html:5 +#: project/forms/admin_unit.py:99 project/templates/admin_unit/create.html:5 #: project/templates/admin_unit/create.html:22 #: project/templates/manage/admin_units.html:27 msgid "Create organization" msgstr "Organisation erstellen" -#: project/forms/admin_unit.py:92 project/forms/admin_unit.py:115 +#: project/forms/admin_unit.py:107 project/forms/admin_unit.py:130 msgid "Update settings" msgstr "Einstellungen speichern" -#: project/forms/admin_unit.py:96 +#: project/forms/admin_unit.py:111 msgid "Font" msgstr "Schriftart" -#: project/forms/admin_unit.py:98 +#: project/forms/admin_unit.py:113 msgid "Background Color" msgstr "Hintergrundfarbe" -#: project/forms/admin_unit.py:104 +#: project/forms/admin_unit.py:119 msgid "Primary Color" msgstr "Hauptfarbe" -#: project/forms/admin_unit.py:110 +#: project/forms/admin_unit.py:125 msgid "Link Color" msgstr "Linkfarbe" @@ -1334,7 +1352,7 @@ msgstr "Bild-Datei auswählen" msgid "Edit event" msgstr "Veranstaltung bearbeiten" -#: project/templates/_macros.html:1226 project/templates/manage/events.html:65 +#: project/templates/_macros.html:1226 project/templates/manage/events.html:66 msgid "More" msgstr "Mehr" @@ -1400,7 +1418,7 @@ msgstr "Kostenlos registrieren" #: project/templates/layout.html:175 project/templates/layout.html:220 #: project/templates/manage/events.html:6 -#: project/templates/manage/events.html:41 +#: project/templates/manage/events.html:42 #: project/templates/manage/events_vue.html:4 msgid "Events" msgstr "Veranstaltungen" @@ -1443,7 +1461,7 @@ msgstr "Veranstaltungen anzeigen" #: project/templates/event/create.html:5 #: project/templates/event/create.html:221 project/templates/layout.html:227 -#: project/templates/manage/events.html:44 +#: project/templates/manage/events.html:45 #: project/templates/manage/organizers.html:21 msgid "Create event" msgstr "Veranstaltung erstellen" @@ -1563,7 +1581,7 @@ msgstr "Benutzer" #: project/templates/admin/admin_units.html:27 #: project/templates/admin/users.html:27 -#: project/templates/manage/events.html:59 +#: project/templates/manage/events.html:60 #: project/templates/manage/members.html:35 #: project/templates/manage/organizers.html:22 #: project/templates/manage/places.html:27 @@ -1594,6 +1612,12 @@ msgstr "Beziehung zu %(admin_unit_name)s" msgid "Invite user" msgstr "Nutzer:in einladen" +#: project/templates/admin_unit/update.html:72 +#: project/templates/manage/verification_requests_outgoing.html:6 +#: project/templates/manage/verification_requests_outgoing.html:10 +msgid "Verification requests" +msgstr "Verifizierungsanfragen" + #: project/templates/email/event_report_notice.html:4 msgid "There is a new event report." msgstr "Es gibt eine neue Meldung zu einer Veranstaltung." @@ -1707,7 +1731,7 @@ msgid "Reference this event on your organization's calendar." msgstr "Empfehle diese Veranstaltung im Kalender deiner Organisation." #: project/templates/event/actions.html:44 -#: project/templates/manage/events.html:63 +#: project/templates/manage/events.html:64 msgid "Add to list" msgstr "Zu Liste hinzufügen" @@ -1730,7 +1754,7 @@ msgid "List all events of %(admin_unit_name)s" msgstr "Zeige alle Veranstaltungen von %(admin_unit_name)s" #: project/templates/event/actions.html:74 -#: project/templates/manage/events.html:78 +#: project/templates/manage/events.html:79 msgid "Add event to list" msgstr "Veranstaltung zu Liste hinzufügen" @@ -1852,13 +1876,17 @@ msgstr "" "Die Organisation ist nicht verifiziert. Veranstaltungen sind daher nicht " "öffentlich sichtbar." -#: project/templates/manage/events.html:58 +#: project/templates/manage/events.html:38 +msgid "Verify organization" +msgstr "Organisation verifizieren" + +#: project/templates/manage/events.html:59 #: project/templates/manage/references_incoming.html:19 #: project/templates/manage/references_outgoing.html:19 msgid "View" msgstr "Anzeigen" -#: project/templates/manage/events.html:60 +#: project/templates/manage/events.html:61 #: project/templates/manage/members.html:21 #: project/templates/manage/members.html:36 #: project/templates/manage/organizers.html:23 @@ -1868,7 +1896,7 @@ msgstr "Anzeigen" msgid "Delete" msgstr "Löschen" -#: project/templates/manage/events.html:61 +#: project/templates/manage/events.html:62 msgid "Duplicate" msgstr "Duplizieren" @@ -1899,6 +1927,10 @@ msgstr "Prüfungsstatus anzeigen" msgid "Reviews" msgstr "Prüfungen" +#: project/templates/manage/verification_requests_outgoing.html:11 +msgid "Here you can find organizations that can verify other organizations." +msgstr "Hier findest du Organisationen, die deine Organisationen verifizieren können." + #: project/templates/manage/widgets.html:87 msgid "Link, um Veranstaltungen vorzuschlagen" msgstr "Link, um Veranstaltungen vorzuschlagen" @@ -2022,7 +2054,7 @@ msgstr "Vorschau" msgid "Organization successfully updated" msgstr "Organisation erfolgreich aktualisiert" -#: project/views/admin.py:68 project/views/manage.py:360 +#: project/views/admin.py:68 project/views/manage.py:361 msgid "Settings successfully updated" msgstr "Einstellungen erfolgreich aktualisiert" diff --git a/project/translations/en/LC_MESSAGES/messages.mo b/project/translations/en/LC_MESSAGES/messages.mo index 89de756..226c766 100644 Binary files a/project/translations/en/LC_MESSAGES/messages.mo and b/project/translations/en/LC_MESSAGES/messages.mo differ diff --git a/project/translations/en/LC_MESSAGES/messages.po b/project/translations/en/LC_MESSAGES/messages.po index 48bc6bc..6484083 100644 --- a/project/translations/en/LC_MESSAGES/messages.po +++ b/project/translations/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-01-17 09:16+0100\n" +"POT-Creation-Date: 2022-08-24 14:28+0200\n" "PO-Revision-Date: 2021-04-30 15:04+0200\n" "Last-Translator: FULL NAME \n" "Language: en\n" @@ -364,47 +364,65 @@ msgstr "" msgid "Logo" msgstr "" -#: project/forms/admin_unit.py:65 +#: project/forms/admin_unit.py:55 +msgid "Allow verification requests" +msgstr "" + +#: project/forms/admin_unit.py:56 +msgid "If set, unverified organizations may ask you for verification." +msgstr "" + +#: project/forms/admin_unit.py:62 +msgid "Verification requests information" +msgstr "" + +#: project/forms/admin_unit.py:64 +msgid "" +"This text is shown to unverified organizations to help them decide " +"whether they ask you for verification." +msgstr "" + +#: project/forms/admin_unit.py:80 msgid "Verify new organization" msgstr "" -#: project/forms/admin_unit.py:66 +#: project/forms/admin_unit.py:81 msgid "If set, events of the new organization are publicly visible." msgstr "" -#: project/forms/admin_unit.py:72 project/forms/reference_request.py:86 +#: project/forms/admin_unit.py:87 project/forms/reference_request.py:86 msgid "Verify reference requests automatically" msgstr "" -#: project/forms/admin_unit.py:73 +#: project/forms/admin_unit.py:88 msgid "" "If set, all upcoming reference requests of the new organization are " "verified automatically." msgstr "" -#: project/forms/admin_unit.py:84 project/templates/admin_unit/create.html:5 +#: project/forms/admin_unit.py:99 project/templates/admin_unit/create.html:5 #: project/templates/admin_unit/create.html:22 #: project/templates/manage/admin_units.html:27 msgid "Create organization" msgstr "" -#: project/forms/admin_unit.py:92 project/forms/admin_unit.py:115 +#: project/forms/admin_unit.py:107 project/forms/admin_unit.py:130 msgid "Update settings" msgstr "" -#: project/forms/admin_unit.py:96 +#: project/forms/admin_unit.py:111 msgid "Font" msgstr "" -#: project/forms/admin_unit.py:98 +#: project/forms/admin_unit.py:113 msgid "Background Color" msgstr "" -#: project/forms/admin_unit.py:104 +#: project/forms/admin_unit.py:119 msgid "Primary Color" msgstr "" -#: project/forms/admin_unit.py:110 +#: project/forms/admin_unit.py:125 msgid "Link Color" msgstr "" @@ -1289,7 +1307,7 @@ msgstr "" msgid "Edit event" msgstr "" -#: project/templates/_macros.html:1226 project/templates/manage/events.html:65 +#: project/templates/_macros.html:1226 project/templates/manage/events.html:66 msgid "More" msgstr "" @@ -1355,7 +1373,7 @@ msgstr "" #: project/templates/layout.html:175 project/templates/layout.html:220 #: project/templates/manage/events.html:6 -#: project/templates/manage/events.html:41 +#: project/templates/manage/events.html:42 #: project/templates/manage/events_vue.html:4 msgid "Events" msgstr "" @@ -1398,7 +1416,7 @@ msgstr "" #: project/templates/event/create.html:5 #: project/templates/event/create.html:221 project/templates/layout.html:227 -#: project/templates/manage/events.html:44 +#: project/templates/manage/events.html:45 #: project/templates/manage/organizers.html:21 msgid "Create event" msgstr "" @@ -1518,7 +1536,7 @@ msgstr "" #: project/templates/admin/admin_units.html:27 #: project/templates/admin/users.html:27 -#: project/templates/manage/events.html:59 +#: project/templates/manage/events.html:60 #: project/templates/manage/members.html:35 #: project/templates/manage/organizers.html:22 #: project/templates/manage/places.html:27 @@ -1549,6 +1567,12 @@ msgstr "" msgid "Invite user" msgstr "" +#: project/templates/admin_unit/update.html:72 +#: project/templates/manage/verification_requests_outgoing.html:6 +#: project/templates/manage/verification_requests_outgoing.html:10 +msgid "Verification requests" +msgstr "" + #: project/templates/email/event_report_notice.html:4 msgid "There is a new event report." msgstr "" @@ -1658,7 +1682,7 @@ msgid "Reference this event on your organization's calendar." msgstr "" #: project/templates/event/actions.html:44 -#: project/templates/manage/events.html:63 +#: project/templates/manage/events.html:64 msgid "Add to list" msgstr "" @@ -1681,7 +1705,7 @@ msgid "List all events of %(admin_unit_name)s" msgstr "" #: project/templates/event/actions.html:74 -#: project/templates/manage/events.html:78 +#: project/templates/manage/events.html:79 msgid "Add event to list" msgstr "" @@ -1798,13 +1822,17 @@ msgid "" "visible." msgstr "" -#: project/templates/manage/events.html:58 +#: project/templates/manage/events.html:38 +msgid "Verify organization" +msgstr "" + +#: project/templates/manage/events.html:59 #: project/templates/manage/references_incoming.html:19 #: project/templates/manage/references_outgoing.html:19 msgid "View" msgstr "" -#: project/templates/manage/events.html:60 +#: project/templates/manage/events.html:61 #: project/templates/manage/members.html:21 #: project/templates/manage/members.html:36 #: project/templates/manage/organizers.html:23 @@ -1814,7 +1842,7 @@ msgstr "" msgid "Delete" msgstr "" -#: project/templates/manage/events.html:61 +#: project/templates/manage/events.html:62 msgid "Duplicate" msgstr "" @@ -1845,6 +1873,10 @@ msgstr "" msgid "Reviews" msgstr "" +#: project/templates/manage/verification_requests_outgoing.html:11 +msgid "Here you can find organizations that can verify other organizations." +msgstr "" + #: project/templates/manage/widgets.html:87 msgid "Link, um Veranstaltungen vorzuschlagen" msgstr "" @@ -1968,7 +2000,7 @@ msgstr "" msgid "Organization successfully updated" msgstr "" -#: project/views/admin.py:68 project/views/manage.py:360 +#: project/views/admin.py:68 project/views/manage.py:361 msgid "Settings successfully updated" msgstr "" diff --git a/project/views/manage.py b/project/views/manage.py index e83e33b..8388f6c 100644 --- a/project/views/manage.py +++ b/project/views/manage.py @@ -26,6 +26,7 @@ from project.models import ( from project.services.admin_unit import ( get_admin_unit_member_invitations, get_admin_unit_organization_invitations, + get_admin_unit_query, ) from project.services.event import get_events_query from project.services.event_search import EventSearchParams @@ -366,3 +367,17 @@ def manage_admin_unit_widgets(id): flash_errors(form) return render_template("manage/widgets.html", form=form, admin_unit=admin_unit) + + +@app.route("/manage/admin_unit//verification_requests/outgoing") +@auth_required() +def manage_admin_unit_verification_requests_outgoing(id): + admin_unit = get_admin_unit_for_manage_or_404(id) + admin_units = get_admin_unit_query(only_verifier=True).paginate() + + return render_template( + "manage/verification_requests_outgoing.html", + admin_unit=admin_unit, + admin_units=admin_units.items, + pagination=get_pagination_urls(admin_units, id=id), + ) diff --git a/tests/seeder.py b/tests/seeder.py index 71e1240..35fe0c3 100644 --- a/tests/seeder.py +++ b/tests/seeder.py @@ -11,10 +11,11 @@ class Seeder(object): admin_unit_verified=True, email="test@test.de", name="Meine Crew", + password="MeinPasswortIstDasBeste", ): user_id = self.create_user(email=email, admin=admin) if log_in: - self._utils.login() + self._utils.login(email, password) admin_unit_id = self.create_admin_unit( user_id, name=name, verified=admin_unit_verified ) @@ -62,8 +63,9 @@ class Seeder(object): can_verify_other=False, verified=False, can_invite_other=True, + **kwargs ): - from project.models import AdminUnit + from project.models import AdminUnit, Location from project.services.admin_unit import insert_admin_unit_for_user from project.services.user import get_user @@ -77,6 +79,13 @@ class Seeder(object): admin_unit.can_create_other = can_create_other admin_unit.can_verify_other = can_verify_other admin_unit.can_invite_other = can_invite_other + + location = Location() + location.postalCode = "12345" + location.city = "City" + admin_unit.location = location + + admin_unit.__dict__.update(kwargs) insert_admin_unit_for_user(admin_unit, user) self._db.session.commit() admin_unit_id = admin_unit.id @@ -647,6 +656,9 @@ class Seeder(object): marketing_admin_unit_id = self.create_admin_unit( user_id, "Stadtmarketing", + can_verify_other=True, + incoming_verification_requests_allowed=True, + incoming_verification_requests_text="Please give us a call", ) self.create_admin_unit_relation( oveda_admin_unit_id, diff --git a/tests/views/test_manage.py b/tests/views/test_manage.py index bb7930e..70d9f18 100644 --- a/tests/views/test_manage.py +++ b/tests/views/test_manage.py @@ -216,3 +216,25 @@ def test_admin_unit_events_import(client, seeder, utils): url = utils.get_url("manage_admin_unit_events_import", id=admin_unit_id) utils.get_ok(url) + + +def test_verification_requests_outgoing(client, seeder, utils): + user_id = seeder.create_user() + seeder.create_admin_unit( + user_id, + "Stadtmarketing", + verified=True, + can_verify_other=True, + incoming_verification_requests_allowed=True, + incoming_verification_requests_text="Please give us a call", + ) + + _, other_admin_unit_id = seeder.setup_base( + admin_unit_verified=False, email="mitglied@verein.de", name="Verein" + ) + + response = utils.get_endpoint_ok( + "manage_admin_unit_verification_requests_outgoing", id=other_admin_unit_id + ) + utils.assert_response_contains(response, "Stadtmarketing") + utils.assert_response_contains(response, "Please give us a call")