mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
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
This commit is contained in:
@@ -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}}
|
||||
|
Reference in New Issue
Block a user