diff --git a/backend/donations/views/account_management.py b/backend/donations/views/account_management.py index 6ace015f..c693fbc0 100644 --- a/backend/donations/views/account_management.py +++ b/backend/donations/views/account_management.py @@ -8,7 +8,6 @@ from django.shortcuts import redirect, render from django.urls import reverse from django.utils import timezone -from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ from redirectioneaza.common.messaging import send_email @@ -92,12 +91,13 @@ def get(self, request, *args, **kwargs): context = self.get_context_data(**kwargs) - signup_text: str = _("sign up") - signup_link: str = request.build_absolute_uri(reverse("signup")) - signup_url: str = f'{signup_text}' - - # noinspection DjangoSafeString - context.update({"signup_url": mark_safe(signup_url)}) + context.update( + { + "account_button": _("Go to account"), + "section_title": _("Login through NGO Hub"), + "form_action": reverse("amazon_cognito_login"), + } + ) return render(request, self.template_name, context) @@ -189,6 +189,15 @@ def get(self, request, *args, **kwargs): context = self.get_context_data(**kwargs) + context.update( + { + "account_button": _("Register new account"), + "account_button_is_external": True, + "section_title": _("Register through NGO Hub"), + "form_action": settings.NGOHUB_APP_BASE, + } + ) + return render(request, self.template_name, context) def post(self, request, *args, **kwargs): diff --git a/backend/locale/en/LC_MESSAGES/django.po b/backend/locale/en/LC_MESSAGES/django.po index 92ab108b..79b019ad 100644 --- a/backend/locale/en/LC_MESSAGES/django.po +++ b/backend/locale/en/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-08 13:01+0200\n" +"POT-Creation-Date: 2024-12-12 15:48+0200\n" "PO-Revision-Date: 2024-02-28 15:45+0000\n" "Last-Translator: Tudor Amariei \n" "Language-Team: English \n" "Language-Team: Romanian %(account_button)s button " @@ -918,7 +925,7 @@ msgstr "" "vei putea intra pe platformă folosind datele tale de autentificare din NGO " "Hub." -#: templates/v2/account/snippets/third-party.html:33 +#: templates/v2/account/snippets/third-party.html:39 msgid "After authentication, you will be redirected to your account." msgstr "După autentificare, vei fi redirecționat către contul tău." @@ -997,6 +1004,9 @@ msgstr "parolă veche" msgid "Group" msgstr "Grup" +#~ msgid "sign up" +#~ msgstr "înregistrare" + #~ msgid "" #~ "Click the \"Go to account\" button and you will be redirected to the page " #~ "where you need to authenticate using your NGO Hub credentials." @@ -1059,9 +1069,6 @@ msgstr "Grup" #~ msgid "Sign In Error" #~ msgstr "Eroare la autentificare" -#~ msgid "Create an account" -#~ msgstr "Creează un cont" - #~ msgid "logo url" #~ msgstr "url logo" diff --git a/backend/templates/v2/account/errors/login/app_missing.html b/backend/templates/v2/account/errors/login/app_missing.html index 38611cd3..d109ac59 100644 --- a/backend/templates/v2/account/errors/login/app_missing.html +++ b/backend/templates/v2/account/errors/login/app_missing.html @@ -1,10 +1,18 @@ -{% extends 'account/errors/login/base_login.html' %} +{% extends "account/errors/login/base_login.html" %} {% load i18n %} {% block title %} - {% trans 'Application not activated' %} + {% trans "Application not activated" %} {% endblock %} {% block message %} - {% trans 'The application is not activated for this user/organization.' %} +

+ {% trans "The application is not activated for this user/organization." %} +

+ +

+ {% trans "If you are the owner of the organization, please activate it in NGO Hub." %} +

+ + {% endblock %} diff --git a/backend/templates/v2/account/snippets/third-party.html b/backend/templates/v2/account/snippets/third-party.html index 7be3f0ef..b8bd8315 100644 --- a/backend/templates/v2/account/snippets/third-party.html +++ b/backend/templates/v2/account/snippets/third-party.html @@ -1,17 +1,23 @@ {% load i18n allauth socialaccount %} -{% trans "Go to account" as account_button %} +{% if not account_button %} + {% trans "Go to account" as account_button %} +{% endif %} +{% if not section_title %} + {% trans "Access your account through NGO Hub" as section_title %} +{% endif %} +{% if not form_action %} + {% if SOCIALACCOUNT_ENABLED %} + {% url 'amazon_cognito_login' as form_action %} + {% else %} + {% url 'login' as form_action %} + {% endif %} +{% endif %}

- {% if page_type == "login" %} - {% trans "Login through NGO Hub" %} - {% elif page_type == "register" %} - {% trans "Register through NGO Hub" %} - {% else %} - {% trans "Access your account through NGO Hub" %} - {% endif %} + {{ section_title }}

{% if SOCIALACCOUNT_ONLY %} @@ -34,9 +40,13 @@