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,8 +147,11 @@ def handler500(request):
|
|||||||
|
|
||||||
def login(request):
|
def login(request):
|
||||||
context = get_base_context(request)
|
context = get_base_context(request)
|
||||||
context["CAP_API_BASE"] = s.CAP_API_BASE
|
|
||||||
context["CAP_SITE_KEY"] = s.CAP_SITE_KEY
|
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":
|
if request.method == "GET":
|
||||||
context["title"] = "enviPath"
|
context["title"] = "enviPath"
|
||||||
@ -227,6 +230,11 @@ def logout(request):
|
|||||||
def register(request):
|
def register(request):
|
||||||
context = get_base_context(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":
|
if request.method == "GET":
|
||||||
# Redirect to unified login page with signup tab
|
# Redirect to unified login page with signup tab
|
||||||
next_url = request.GET.get("next", "")
|
next_url = request.GET.get("next", "")
|
||||||
|
|||||||
@ -218,9 +218,11 @@
|
|||||||
|
|
||||||
<input type="hidden" name="next" value="{{ next }}" />
|
<input type="hidden" name="next" value="{{ next }}" />
|
||||||
|
|
||||||
<cap-widget
|
{% if CAP_ENABLED %}
|
||||||
data-cap-api-endpoint="{{ CAP_API_BASE }}/{{ CAP_SITE_KEY }}/"
|
<cap-widget
|
||||||
></cap-widget>
|
data-cap-api-endpoint="{{ CAP_API_BASE }}/{{ CAP_SITE_KEY }}/"
|
||||||
|
></cap-widget>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- ToS and Academic Use Notice -->
|
<!-- ToS and Academic Use Notice -->
|
||||||
<div class="text-xs text-base-content/70 mt-2">
|
<div class="text-xs text-base-content/70 mt-2">
|
||||||
|
|||||||
@ -19,12 +19,16 @@
|
|||||||
type="text/css"
|
type="text/css"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/@cap.js/widget@0.1.41/cap.min.js"></script>
|
{% if CAP_ENABLED %}
|
||||||
<link
|
<script src="https://cdn.jsdelivr.net/npm/@cap.js/widget@0.1.41/cap.min.js"></script>
|
||||||
rel="stylesheet"
|
<link
|
||||||
href="https://cdn.jsdelivr.net/npm/@cap.js/widget@0.1.41/src/cap.min.css"
|
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>
|
</head>
|
||||||
<body class="bg-base-100">
|
<body class="bg-base-100">
|
||||||
<div class="flex h-screen">
|
<div class="flex h-screen">
|
||||||
|
|||||||
Reference in New Issue
Block a user