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:
@@ -13,18 +13,6 @@
|
||||
|
||||
{{template "base/footer_content" .}}
|
||||
|
||||
<!-- Third-party libraries -->
|
||||
{{if .EnableCaptcha}}
|
||||
{{if eq .CaptchaType "recaptcha"}}
|
||||
<script src='{{URLJoin .RecaptchaURL "api.js"}}'></script>
|
||||
{{end}}
|
||||
{{if eq .CaptchaType "hcaptcha"}}
|
||||
<script src='https://hcaptcha.com/1/api.js'></script>
|
||||
{{end}}
|
||||
{{if eq .CaptchaType "cfturnstile"}}
|
||||
<script src='https://challenges.cloudflare.com/turnstile/v0/api.js'></script>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<script src="{{AssetUrlPrefix}}/js/index.js?v={{AssetVersion}}" onerror="alert('Failed to load asset files from ' + this.src + '. Please make sure the asset files can be accessed.')"></script>
|
||||
|
||||
{{template "custom/footer" .}}
|
||||
|
Reference in New Issue
Block a user