mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Move the captcha script loader to the template which really needs it (#28718)
It improves the maintainability for the templates. Now `base/footer.tmpl` doesn't need to depend on "captcha" feature.
This commit is contained in:
@@ -11,10 +11,12 @@
|
||||
<div class="inline field required">
|
||||
<div id="captcha" data-captcha-type="g-recaptcha" class="g-recaptcha-style" data-sitekey="{{.RecaptchaSitekey}}"></div>
|
||||
</div>
|
||||
<script src='{{URLJoin .RecaptchaURL "api.js"}}'></script>
|
||||
{{else if eq .CaptchaType "hcaptcha"}}
|
||||
<div class="inline field required">
|
||||
<div id="captcha" data-captcha-type="h-captcha" class="h-captcha-style" data-sitekey="{{.HcaptchaSitekey}}"></div>
|
||||
</div>
|
||||
<script src='https://hcaptcha.com/1/api.js'></script>
|
||||
{{else if eq .CaptchaType "mcaptcha"}}
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
@@ -25,4 +27,5 @@
|
||||
<div class="inline field gt-text-center">
|
||||
<div id="captcha" data-captcha-type="cf-turnstile" data-sitekey="{{.CfTurnstileSitekey}}"></div>
|
||||
</div>
|
||||
<script src='https://challenges.cloudflare.com/turnstile/v0/api.js'></script>
|
||||
{{end}}{{end}}
|
||||
|
Reference in New Issue
Block a user