diff --git a/core/auth/mixins.py b/core/auth/mixins.py index 54bdc481..dfba3f11 100644 --- a/core/auth/mixins.py +++ b/core/auth/mixins.py @@ -227,6 +227,19 @@ class FormerSubscriberMixin(AccessMixin): return super().dispatch(request, *args, **kwargs) +class IsSubscriberMixin(AccessMixin): + """Check if the user is a subscriber. + + Raises: + PermissionDenied: if the user isn't subscribed. + """ + + def dispatch(self, request, *args, **kwargs): + if not request.user.is_subscribed: + raise PermissionDenied + return super().dispatch(request, *args, **kwargs) + + class PermissionOrAuthorRequiredMixin(PermissionRequiredMixin): """Require that the user has the required perm or is the object author. diff --git a/eboutic/templates/eboutic/eboutic_main.jinja b/eboutic/templates/eboutic/eboutic_main.jinja index 1e070b95..71757436 100644 --- a/eboutic/templates/eboutic/eboutic_main.jinja +++ b/eboutic/templates/eboutic/eboutic_main.jinja @@ -95,23 +95,36 @@

{% trans %}Eurockéennes 2025 partnership{% endtrans %}

{% if user.is_subscribed %} - - Billetterie Weezevent - - +
+

+ {% trans trimmed %} + Our partner uses Weezevent to sell tickets. + Weezevent may collect user info according to + it's own privacy policy. + By clicking the accept button you consent to + their terms of services. + {% endtrans %} +

+ + {% trans %}Privacy policy{% endtrans %} + + +
{% else %}

{%- trans trimmed %} diff --git a/eboutic/templates/eboutic/eurok_fragment.jinja b/eboutic/templates/eboutic/eurok_fragment.jinja new file mode 100644 index 00000000..c2791d8b --- /dev/null +++ b/eboutic/templates/eboutic/eurok_fragment.jinja @@ -0,0 +1,17 @@ + + Billetterie Weezevent + + diff --git a/eboutic/urls.py b/eboutic/urls.py index a8029b1c..2286b6fd 100644 --- a/eboutic/urls.py +++ b/eboutic/urls.py @@ -29,6 +29,7 @@ from eboutic.views import ( BillingInfoFormFragment, EbouticCommand, EtransactionAutoAnswer, + EurokPartnerFragment, eboutic_main, pay_with_sith, payment_result, @@ -43,6 +44,7 @@ urlpatterns = [ path("billing-infos/", BillingInfoFormFragment.as_view(), name="billing_infos"), path("pay/sith/", pay_with_sith, name="pay_with_sith"), path("pay//", payment_result, name="payment_result"), + path("eurok/", EurokPartnerFragment.as_view(), name="eurok"), path( "et_autoanswer", EtransactionAutoAnswer.as_view(), diff --git a/eboutic/views.py b/eboutic/views.py index 608d57fe..b5328719 100644 --- a/eboutic/views.py +++ b/eboutic/views.py @@ -45,6 +45,7 @@ from django.views.decorators.http import require_GET, require_POST from django.views.generic import TemplateView, UpdateView, View from django_countries.fields import Country +from core.auth.mixins import IsSubscriberMixin from core.views.mixins import FragmentMixin, UseFragmentsMixin from counter.forms import BillingInfoForm from counter.models import BillingInfo, Counter, Customer, Product @@ -99,6 +100,10 @@ def payment_result(request, result: str) -> HttpResponse: return render(request, "eboutic/eboutic_payment_result.jinja", context) +class EurokPartnerFragment(IsSubscriberMixin, TemplateView): + template_name = "eboutic/eurok_fragment.jinja" + + class BillingInfoFormFragment( LoginRequiredMixin, FragmentMixin, SuccessMessageMixin, UpdateView ): diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index cdb22051..15d0a99d 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-13 00:18+0200\n" +"POT-Creation-Date: 2025-04-14 01:16+0200\n" "PO-Revision-Date: 2016-07-18\n" "Last-Translator: Maréchal \n" @@ -3812,6 +3812,25 @@ msgstr "cette page" msgid "Eurockéennes 2025 partnership" msgstr "Partenariat Eurockéennes 2025" +#: eboutic/templates/eboutic/eboutic_main.jinja +msgid "" +"Our partner uses Weezevent to sell tickets. Weezevent may collect user info " +"according to it's own privacy policy. By clicking the accept button you " +"consent to their terms of services." +msgstr "" +"Notre partenaire utilises Wezevent pour vendre ses billets. Weezevent peut collecter des informatinos utilisateur " +"conformément à sa propre politique de confidentialité. En cliquant sur le bouton d'acceptation vous " +"consentez à leurs termes de service." + +#: eboutic/templates/eboutic/eboutic_main.jinja +msgid "Privacy policy" +msgstr "Politique de confidentialité" + +#: eboutic/templates/eboutic/eboutic_main.jinja +#: trombi/templates/trombi/comment_moderation.jinja +msgid "Accept" +msgstr "Accepter" + #: eboutic/templates/eboutic/eboutic_main.jinja msgid "" "You must be subscribed to benefit from the partnership with the Eurockéennes." @@ -5386,10 +5405,6 @@ msgstr "fin" msgid "Moderate Trombi comments" msgstr "Modérer les commentaires du Trombi" -#: trombi/templates/trombi/comment_moderation.jinja -msgid "Accept" -msgstr "Accepter" - #: trombi/templates/trombi/comment_moderation.jinja msgid "Reject" msgstr "Refuser"