mirror of
https://github.com/go-gitea/gitea
synced 2025-07-24 11:18:36 +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}}
|
||||
|
8
templates/swagger/v1_json.tmpl
generated
8
templates/swagger/v1_json.tmpl
generated
@@ -8,8 +8,8 @@
|
||||
"text/html"
|
||||
],
|
||||
"schemes": [
|
||||
"http",
|
||||
"https"
|
||||
"https",
|
||||
"http"
|
||||
],
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
@@ -19,9 +19,9 @@
|
||||
"name": "MIT",
|
||||
"url": "http://opensource.org/licenses/MIT"
|
||||
},
|
||||
"version": "{{AppVer | JSEscape | Safe}}"
|
||||
"version": "{{AppVer | JSEscape}}"
|
||||
},
|
||||
"basePath": "{{AppSubUrl | JSEscape | Safe}}/api/v1",
|
||||
"basePath": "{{AppSubUrl | JSEscape}}/api/v1",
|
||||
"paths": {
|
||||
"/activitypub/user-id/{user-id}": {
|
||||
"get": {
|
||||
|
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"issuer": "{{AppUrl | JSEscape | Safe}}",
|
||||
"authorization_endpoint": "{{AppUrl | JSEscape | Safe}}login/oauth/authorize",
|
||||
"token_endpoint": "{{AppUrl | JSEscape | Safe}}login/oauth/access_token",
|
||||
"jwks_uri": "{{AppUrl | JSEscape | Safe}}login/oauth/keys",
|
||||
"userinfo_endpoint": "{{AppUrl | JSEscape | Safe}}login/oauth/userinfo",
|
||||
"introspection_endpoint": "{{AppUrl | JSEscape | Safe}}login/oauth/introspect",
|
||||
"issuer": "{{AppUrl | JSEscape}}",
|
||||
"authorization_endpoint": "{{AppUrl | JSEscape}}login/oauth/authorize",
|
||||
"token_endpoint": "{{AppUrl | JSEscape}}login/oauth/access_token",
|
||||
"jwks_uri": "{{AppUrl | JSEscape}}login/oauth/keys",
|
||||
"userinfo_endpoint": "{{AppUrl | JSEscape}}login/oauth/userinfo",
|
||||
"introspection_endpoint": "{{AppUrl | JSEscape}}login/oauth/introspect",
|
||||
"response_types_supported": [
|
||||
"code",
|
||||
"id_token"
|
||||
],
|
||||
"id_token_signing_alg_values_supported": [
|
||||
"{{.SigningKey.SigningMethod.Alg | JSEscape | Safe}}"
|
||||
"{{.SigningKey.SigningMethod.Alg | JSEscape}}"
|
||||
],
|
||||
"subject_types_supported": [
|
||||
"public"
|
||||
|
Reference in New Issue
Block a user