Skip to content

Commit a748447

Browse files
silverwindAbdulrhmnGhanem
authored andcommitted
Rename StaticUrlPrefix to AssetUrlPrefix (go-gitea#15779)
Use a new name for this template/frontend variable to make it distinct from the server variable StaticURLPrefix.
1 parent 40a56d5 commit a748447

File tree

21 files changed

+71
-71
lines changed

21 files changed

+71
-71
lines changed

modules/templates/helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func NewFuncMap() []template.FuncMap {
6060
"AppSubUrl": func() string {
6161
return setting.AppSubURL
6262
},
63-
"StaticUrlPrefix": func() string {
63+
"AssetUrlPrefix": func() string {
6464
return setting.StaticURLPrefix + "/assets"
6565
},
6666
"AppUrl": func() string {

templates/admin/hook_new.tmpl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@
1515
{{end}}
1616
<div class="ui right">
1717
{{if eq .HookType "gitea"}}
18-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gitea.svg">
18+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gitea.svg">
1919
{{else if eq .HookType "gogs"}}
20-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gogs.ico">
20+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gogs.ico">
2121
{{else if eq .HookType "slack"}}
22-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/slack.png">
22+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/slack.png">
2323
{{else if eq .HookType "discord"}}
24-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/discord.png">
24+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/discord.png">
2525
{{else if eq .HookType "dingtalk"}}
26-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/dingtalk.ico">
26+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/dingtalk.ico">
2727
{{else if eq .HookType "telegram"}}
28-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/telegram.png">
28+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/telegram.png">
2929
{{else if eq .HookType "msteams"}}
30-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/msteams.png">
30+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/msteams.png">
3131
{{else if eq .HookType "feishu"}}
32-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/feishu.png">
32+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/feishu.png">
3333
{{else if eq .HookType "matrix"}}
34-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/matrix.svg">
34+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/matrix.svg">
3535
{{end}}
3636
</div>
3737
</h4>

templates/base/footer.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212

1313
{{template "base/footer_content" .}}
1414
{{if .RequireSimpleMDE}}
15-
<script src="{{StaticUrlPrefix}}/js/easymde.js?v={{MD5 AppVer}}"></script>
16-
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js"></script>
17-
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js"></script>
15+
<script src="{{AssetUrlPrefix}}/js/easymde.js?v={{MD5 AppVer}}"></script>
16+
<script src="{{AssetUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js"></script>
17+
<script src="{{AssetUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js"></script>
1818
<script>
19-
CodeMirror.modeURL = '{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/%N/%N.js';
19+
CodeMirror.modeURL = '{{AssetUrlPrefix}}/vendor/plugins/codemirror/mode/%N/%N.js';
2020
</script>
2121
{{end}}
2222

2323
<!-- Third-party libraries -->
2424
{{if .RequireU2F}}
25-
<script src="{{StaticUrlPrefix}}/vendor/plugins/u2f/index.js"></script>
25+
<script src="{{AssetUrlPrefix}}/vendor/plugins/u2f/index.js"></script>
2626
{{end}}
2727
{{if .EnableCaptcha}}
2828
{{if eq .CaptchaType "recaptcha"}}
@@ -32,7 +32,7 @@
3232
<script src='https://hcaptcha.com/1/api.js' async></script>
3333
{{end}}
3434
{{end}}
35-
<script src="{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}"></script>
35+
<script src="{{AssetUrlPrefix}}/js/index.js?v={{MD5 AppVer}}"></script>
3636
{{template "custom/footer" .}}
3737
</body>
3838
</html>

templates/base/footer_content.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{{end}}
1717
</div>
1818
</div>
19-
<a href="{{StaticUrlPrefix}}/js/licenses.txt">{{.i18n.Tr "licenses"}}</a>
19+
<a href="{{AssetUrlPrefix}}/js/licenses.txt">{{.i18n.Tr "licenses"}}</a>
2020
{{if .EnableSwagger}}<a href="{{AppSubUrl}}/api/swagger">API</a>{{end}}
2121
<a target="_blank" rel="noopener noreferrer" href="https://gitea.io">{{.i18n.Tr "website"}}</a>
2222
{{template "custom/extra_links_footer" .}}

templates/base/head.tmpl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
window.config = {
3030
AppVer: '{{AppVer}}',
3131
AppSubUrl: '{{AppSubUrl}}',
32-
StaticUrlPrefix: '{{StaticUrlPrefix}}',
32+
AssetUrlPrefix: '{{AssetUrlPrefix}}',
3333
UseServiceWorker: {{UseServiceWorker}},
3434
csrf: '{{.CsrfToken}}',
3535
HighlightJS: {{if .RequireHighlightJS}}true{{else}}false{{end}},
@@ -61,12 +61,12 @@
6161
{{end}}
6262
};
6363
</script>
64-
<link rel="icon" href="{{StaticUrlPrefix}}/img/logo.svg" type="image/svg+xml">
65-
<link rel="alternate icon" href="{{StaticUrlPrefix}}/img/favicon.png" type="image/png">
64+
<link rel="icon" href="{{AssetUrlPrefix}}/img/logo.svg" type="image/svg+xml">
65+
<link rel="alternate icon" href="{{AssetUrlPrefix}}/img/favicon.png" type="image/png">
6666
{{if .RequireSimpleMDE}}
67-
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/easymde.css?v={{MD5 AppVer}}">
67+
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/easymde.css?v={{MD5 AppVer}}">
6868
{{end}}
69-
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/index.css?v={{MD5 AppVer}}">
69+
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/index.css?v={{MD5 AppVer}}">
7070
<noscript>
7171
<style>
7272
.dropdown:hover > .menu { display: block; }
@@ -105,17 +105,17 @@
105105
{{else}}
106106
<meta property="og:title" content="{{AppName}}">
107107
<meta property="og:type" content="website" />
108-
<meta property="og:image" content="{{StaticUrlPrefix}}/img/logo.png" />
108+
<meta property="og:image" content="{{AssetUrlPrefix}}/img/logo.png" />
109109
<meta property="og:url" content="{{AppUrl}}" />
110110
<meta property="og:description" content="{{MetaDescription}}">
111111
{{end}}
112112
<meta property="og:site_name" content="{{AppName}}" />
113113
{{if .IsSigned }}
114114
{{ if ne .SignedUser.Theme "gitea" }}
115-
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/theme-{{.SignedUser.Theme}}.css?v={{MD5 AppVer}}">
115+
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{.SignedUser.Theme}}.css?v={{MD5 AppVer}}">
116116
{{end}}
117117
{{else if ne DefaultTheme "gitea"}}
118-
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/theme-{{DefaultTheme}}.css?v={{MD5 AppVer}}">
118+
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{DefaultTheme}}.css?v={{MD5 AppVer}}">
119119
{{end}}
120120
{{template "custom/header" .}}
121121
</head>

templates/base/head_navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="ui container" id="navbar">
22
<div class="item brand" style="justify-content: space-between;">
33
<a href="{{AppSubUrl}}/">
4-
<img class="ui mini image" with="30" height="30" src="{{StaticUrlPrefix}}/img/logo.svg">
4+
<img class="ui mini image" with="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg">
55
</a>
66
<div class="ui basic icon button mobile-only" id="navbar-expand-toggle">
77
<i class="sidebar icon"></i>

templates/home.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="ui stackable middle very relaxed page grid">
44
<div class="sixteen wide center aligned centered column">
55
<div>
6-
<img class="logo" width="220" height="220" src="{{StaticUrlPrefix}}/img/logo.svg"/>
6+
<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg"/>
77
</div>
88
<div class="hero">
99
<h1 class="ui icon header title">

templates/install.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,5 +321,5 @@
321321
</div>
322322
</div>
323323
</div>
324-
<img style="display: none" src="{{StaticUrlPrefix}}/img/loading.png"/>
324+
<img style="display: none" src="{{AssetUrlPrefix}}/img/loading.png"/>
325325
{{template "base/footer" .}}

templates/org/settings/hook_new.tmpl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@
1010
{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}
1111
<div class="ui right">
1212
{{if eq .HookType "gitea"}}
13-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gitea.svg">
13+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gitea.svg">
1414
{{else if eq .HookType "gogs"}}
15-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gogs.ico">
15+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gogs.ico">
1616
{{else if eq .HookType "slack"}}
17-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/slack.png">
17+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/slack.png">
1818
{{else if eq .HookType "discord"}}
19-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/discord.png">
19+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/discord.png">
2020
{{else if eq .HookType "dingtalk"}}
21-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/dingtalk.ico">
21+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/dingtalk.ico">
2222
{{else if eq .HookType "telegram"}}
23-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/telegram.png">
23+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/telegram.png">
2424
{{else if eq .HookType "msteams"}}
25-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/msteams.png">
25+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/msteams.png">
2626
{{else if eq .HookType "feishu"}}
27-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/feishu.png">
27+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/feishu.png">
2828
{{else if eq .HookType "matrix"}}
29-
<img width="26" height="26" src="{{StaticUrlPrefix}}/img/matrix.svg">
29+
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/matrix.svg">
3030
{{end}}
3131
</div>
3232
</h4>

templates/post-install.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="ui stackable middle very relaxed page grid">
88
<div id="repo_migrating" class="sixteen wide center aligned centered column">
99
<div>
10-
<img src="{{StaticUrlPrefix}}/img/loading.png"/>
10+
<img src="{{AssetUrlPrefix}}/img/loading.png"/>
1111
</div>
1212
</div>
1313
</div>

0 commit comments

Comments
 (0)