summaryrefslogtreecommitdiffstats
path: root/templates/shared
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-02-18 17:52:02 +0800
committerGitHub <noreply@github.com>2024-02-18 10:52:02 +0100
commit31bb9f3247388b993c61a10190cfd512408ce57e (patch)
tree6a4c777d5507b8e92cebd1786750c6a4db9367c8 /templates/shared
parenta784ed3d6c6946fd9bf95f2e910f52f549326fe2 (diff)
downloadgitea-31bb9f3247388b993c61a10190cfd512408ce57e.tar.gz
gitea-31bb9f3247388b993c61a10190cfd512408ce57e.zip
Refactor more code in templates (#29236)
Follow #29165. * Introduce JSONTemplate to help to render JSON templates * Introduce JSEscapeSafe for templates. Now only use `{{ ... | JSEscape}}` instead of `{{ ... | JSEscape | Safe}}` * Simplify "UserLocationMapURL" useage
Diffstat (limited to 'templates/shared')
-rw-r--r--templates/shared/user/profile_big_avatar.tmpl5
1 files changed, 2 insertions, 3 deletions
diff --git a/templates/shared/user/profile_big_avatar.tmpl b/templates/shared/user/profile_big_avatar.tmpl
index 4fbc43f541..9ea8334881 100644
--- a/templates/shared/user/profile_big_avatar.tmpl
+++ b/templates/shared/user/profile_big_avatar.tmpl
@@ -31,9 +31,8 @@
<li>
{{svg "octicon-location"}}
<span class="gt-f1">{{.ContextUser.Location}}</span>
- {{if .UserLocationMapURL}}
- {{/* We presume that the UserLocationMapURL is safe, as it is provided by the site administrator. */}}
- <a href="{{.UserLocationMapURL | Safe}}{{.ContextUser.Location | QueryEscape}}" rel="nofollow noreferrer" data-tooltip-content="{{ctx.Locale.Tr "user.show_on_map"}}">
+ {{if .ContextUserLocationMapURL}}
+ <a href="{{.ContextUserLocationMapURL}}" rel="nofollow noreferrer" data-tooltip-content="{{ctx.Locale.Tr "user.show_on_map"}}">
{{svg "octicon-link-external"}}
</a>
{{end}}