forked from enviPath/enviPy
[Fix] Add Captcha vars to Template (#359)
Co-authored-by: Tim Lorsbach <tim@lorsba.ch> Reviewed-on: enviPath/enviPy#359
This commit is contained in:
@ -147,6 +147,9 @@ def handler500(request):
|
||||
|
||||
def login(request):
|
||||
context = get_base_context(request)
|
||||
|
||||
if s.CAP_ENABLED:
|
||||
context["CAP_ENABLED"] = s.CAP_ENABLED
|
||||
context["CAP_API_BASE"] = s.CAP_API_BASE
|
||||
context["CAP_SITE_KEY"] = s.CAP_SITE_KEY
|
||||
|
||||
@ -227,6 +230,11 @@ def logout(request):
|
||||
def register(request):
|
||||
context = get_base_context(request)
|
||||
|
||||
if s.CAP_ENABLED:
|
||||
context["CAP_ENABLED"] = s.CAP_ENABLED
|
||||
context["CAP_API_BASE"] = s.CAP_API_BASE
|
||||
context["CAP_SITE_KEY"] = s.CAP_SITE_KEY
|
||||
|
||||
if request.method == "GET":
|
||||
# Redirect to unified login page with signup tab
|
||||
next_url = request.GET.get("next", "")
|
||||
|
||||
@ -218,9 +218,11 @@
|
||||
|
||||
<input type="hidden" name="next" value="{{ next }}" />
|
||||
|
||||
{% if CAP_ENABLED %}
|
||||
<cap-widget
|
||||
data-cap-api-endpoint="{{ CAP_API_BASE }}/{{ CAP_SITE_KEY }}/"
|
||||
></cap-widget>
|
||||
{% endif %}
|
||||
|
||||
<!-- ToS and Academic Use Notice -->
|
||||
<div class="text-xs text-base-content/70 mt-2">
|
||||
|
||||
@ -19,12 +19,16 @@
|
||||
type="text/css"
|
||||
/>
|
||||
|
||||
{% if CAP_ENABLED %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/@cap.js/widget@0.1.41/cap.min.js"></script>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/@cap.js/widget@0.1.41/src/cap.min.css"
|
||||
/>
|
||||
{% block extra_styles %}{% endblock %}
|
||||
{% endif %}
|
||||
|
||||
{% block extra_styles %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body class="bg-base-100">
|
||||
<div class="flex h-screen">
|
||||
|
||||
Reference in New Issue
Block a user