mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 11:28:24 +00:00 
			
		
		
		
	Rename StaticUrlPrefix to AssetUrlPrefix (#15779)
Use a new name for this template/frontend variable to make it distinct from the server variable StaticURLPrefix.
This commit is contained in:
		| @@ -60,7 +60,7 @@ func NewFuncMap() []template.FuncMap { | |||||||
| 		"AppSubUrl": func() string { | 		"AppSubUrl": func() string { | ||||||
| 			return setting.AppSubURL | 			return setting.AppSubURL | ||||||
| 		}, | 		}, | ||||||
| 		"StaticUrlPrefix": func() string { | 		"AssetUrlPrefix": func() string { | ||||||
| 			return setting.StaticURLPrefix + "/assets" | 			return setting.StaticURLPrefix + "/assets" | ||||||
| 		}, | 		}, | ||||||
| 		"AppUrl": func() string { | 		"AppUrl": func() string { | ||||||
|   | |||||||
| @@ -15,23 +15,23 @@ | |||||||
| 			{{end}} | 			{{end}} | ||||||
| 			<div class="ui right"> | 			<div class="ui right"> | ||||||
| 				{{if eq .HookType "gitea"}} | 				{{if eq .HookType "gitea"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gitea.svg"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gitea.svg"> | ||||||
| 				{{else if eq .HookType "gogs"}} | 				{{else if eq .HookType "gogs"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gogs.ico"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gogs.ico"> | ||||||
| 				{{else if eq .HookType "slack"}} | 				{{else if eq .HookType "slack"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/slack.png"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/slack.png"> | ||||||
| 				{{else if eq .HookType "discord"}} | 				{{else if eq .HookType "discord"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/discord.png"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/discord.png"> | ||||||
| 				{{else if eq .HookType "dingtalk"}} | 				{{else if eq .HookType "dingtalk"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/dingtalk.ico"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/dingtalk.ico"> | ||||||
| 				{{else if eq .HookType "telegram"}} | 				{{else if eq .HookType "telegram"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/telegram.png"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/telegram.png"> | ||||||
| 				{{else if eq .HookType "msteams"}} | 				{{else if eq .HookType "msteams"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/msteams.png"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/msteams.png"> | ||||||
| 				{{else if eq .HookType "feishu"}} | 				{{else if eq .HookType "feishu"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/feishu.png"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/feishu.png"> | ||||||
| 				{{else if eq .HookType "matrix"}} | 				{{else if eq .HookType "matrix"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/matrix.svg"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/matrix.svg"> | ||||||
| 				{{end}} | 				{{end}} | ||||||
| 			</div> | 			</div> | ||||||
| 		</h4> | 		</h4> | ||||||
|   | |||||||
| @@ -12,17 +12,17 @@ | |||||||
|  |  | ||||||
| 	{{template "base/footer_content" .}} | 	{{template "base/footer_content" .}} | ||||||
| {{if .RequireSimpleMDE}} | {{if .RequireSimpleMDE}} | ||||||
| 	<script src="{{StaticUrlPrefix}}/js/easymde.js?v={{MD5 AppVer}}"></script> | 	<script src="{{AssetUrlPrefix}}/js/easymde.js?v={{MD5 AppVer}}"></script> | ||||||
| 	<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js"></script> | 	<script src="{{AssetUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js"></script> | ||||||
| 	<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js"></script> | 	<script src="{{AssetUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js"></script> | ||||||
| 	<script> | 	<script> | ||||||
| 		CodeMirror.modeURL = '{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/%N/%N.js'; | 		CodeMirror.modeURL = '{{AssetUrlPrefix}}/vendor/plugins/codemirror/mode/%N/%N.js'; | ||||||
| 	</script> | 	</script> | ||||||
| {{end}} | {{end}} | ||||||
|  |  | ||||||
| <!-- Third-party libraries --> | <!-- Third-party libraries --> | ||||||
| {{if .RequireU2F}} | {{if .RequireU2F}} | ||||||
| 	<script src="{{StaticUrlPrefix}}/vendor/plugins/u2f/index.js"></script> | 	<script src="{{AssetUrlPrefix}}/vendor/plugins/u2f/index.js"></script> | ||||||
| {{end}} | {{end}} | ||||||
| {{if .EnableCaptcha}} | {{if .EnableCaptcha}} | ||||||
| 	{{if eq .CaptchaType "recaptcha"}} | 	{{if eq .CaptchaType "recaptcha"}} | ||||||
| @@ -32,7 +32,7 @@ | |||||||
| 		<script src='https://hcaptcha.com/1/api.js' async></script> | 		<script src='https://hcaptcha.com/1/api.js' async></script> | ||||||
| 	{{end}} | 	{{end}} | ||||||
| {{end}} | {{end}} | ||||||
| 	<script src="{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}"></script> | 	<script src="{{AssetUrlPrefix}}/js/index.js?v={{MD5 AppVer}}"></script> | ||||||
| {{template "custom/footer" .}} | {{template "custom/footer" .}} | ||||||
| </body> | </body> | ||||||
| </html> | </html> | ||||||
|   | |||||||
| @@ -16,7 +16,7 @@ | |||||||
| 					{{end}} | 					{{end}} | ||||||
| 				</div> | 				</div> | ||||||
| 			</div> | 			</div> | ||||||
| 			<a href="{{StaticUrlPrefix}}/js/licenses.txt">{{.i18n.Tr "licenses"}}</a> | 			<a href="{{AssetUrlPrefix}}/js/licenses.txt">{{.i18n.Tr "licenses"}}</a> | ||||||
| 			{{if .EnableSwagger}}<a href="{{AppSubUrl}}/api/swagger">API</a>{{end}} | 			{{if .EnableSwagger}}<a href="{{AppSubUrl}}/api/swagger">API</a>{{end}} | ||||||
| 			<a target="_blank" rel="noopener noreferrer" href="https://gitea.io">{{.i18n.Tr "website"}}</a> | 			<a target="_blank" rel="noopener noreferrer" href="https://gitea.io">{{.i18n.Tr "website"}}</a> | ||||||
| 			{{template "custom/extra_links_footer" .}} | 			{{template "custom/extra_links_footer" .}} | ||||||
|   | |||||||
| @@ -29,7 +29,7 @@ | |||||||
| 		window.config = { | 		window.config = { | ||||||
| 			AppVer: '{{AppVer}}', | 			AppVer: '{{AppVer}}', | ||||||
| 			AppSubUrl: '{{AppSubUrl}}', | 			AppSubUrl: '{{AppSubUrl}}', | ||||||
| 			StaticUrlPrefix: '{{StaticUrlPrefix}}', | 			AssetUrlPrefix: '{{AssetUrlPrefix}}', | ||||||
| 			UseServiceWorker: {{UseServiceWorker}}, | 			UseServiceWorker: {{UseServiceWorker}}, | ||||||
| 			csrf: '{{.CsrfToken}}', | 			csrf: '{{.CsrfToken}}', | ||||||
| 			HighlightJS: {{if .RequireHighlightJS}}true{{else}}false{{end}}, | 			HighlightJS: {{if .RequireHighlightJS}}true{{else}}false{{end}}, | ||||||
| @@ -61,12 +61,12 @@ | |||||||
| 			{{end}} | 			{{end}} | ||||||
| 		}; | 		}; | ||||||
| 	</script> | 	</script> | ||||||
| 	<link rel="icon" href="{{StaticUrlPrefix}}/img/logo.svg" type="image/svg+xml"> | 	<link rel="icon" href="{{AssetUrlPrefix}}/img/logo.svg" type="image/svg+xml"> | ||||||
| 	<link rel="alternate icon" href="{{StaticUrlPrefix}}/img/favicon.png" type="image/png"> | 	<link rel="alternate icon" href="{{AssetUrlPrefix}}/img/favicon.png" type="image/png"> | ||||||
| {{if .RequireSimpleMDE}} | {{if .RequireSimpleMDE}} | ||||||
| 	<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/easymde.css?v={{MD5 AppVer}}"> | 	<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/easymde.css?v={{MD5 AppVer}}"> | ||||||
| {{end}} | {{end}} | ||||||
| 	<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/index.css?v={{MD5 AppVer}}"> | 	<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/index.css?v={{MD5 AppVer}}"> | ||||||
| 	<noscript> | 	<noscript> | ||||||
| 		<style> | 		<style> | ||||||
| 			.dropdown:hover > .menu { display: block; } | 			.dropdown:hover > .menu { display: block; } | ||||||
| @@ -105,17 +105,17 @@ | |||||||
| {{else}} | {{else}} | ||||||
| 	<meta property="og:title" content="{{AppName}}"> | 	<meta property="og:title" content="{{AppName}}"> | ||||||
| 	<meta property="og:type" content="website" /> | 	<meta property="og:type" content="website" /> | ||||||
| 	<meta property="og:image" content="{{StaticUrlPrefix}}/img/logo.png" /> | 	<meta property="og:image" content="{{AssetUrlPrefix}}/img/logo.png" /> | ||||||
| 	<meta property="og:url" content="{{AppUrl}}" /> | 	<meta property="og:url" content="{{AppUrl}}" /> | ||||||
| 	<meta property="og:description" content="{{MetaDescription}}"> | 	<meta property="og:description" content="{{MetaDescription}}"> | ||||||
| {{end}} | {{end}} | ||||||
| <meta property="og:site_name" content="{{AppName}}" /> | <meta property="og:site_name" content="{{AppName}}" /> | ||||||
| {{if .IsSigned }} | {{if .IsSigned }} | ||||||
| 	{{ if ne .SignedUser.Theme "gitea" }} | 	{{ if ne .SignedUser.Theme "gitea" }} | ||||||
| 		<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/theme-{{.SignedUser.Theme}}.css?v={{MD5 AppVer}}"> | 		<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{.SignedUser.Theme}}.css?v={{MD5 AppVer}}"> | ||||||
| 	{{end}} | 	{{end}} | ||||||
| {{else if ne DefaultTheme "gitea"}} | {{else if ne DefaultTheme "gitea"}} | ||||||
| 	<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/theme-{{DefaultTheme}}.css?v={{MD5 AppVer}}"> | 	<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{DefaultTheme}}.css?v={{MD5 AppVer}}"> | ||||||
| {{end}} | {{end}} | ||||||
| {{template "custom/header" .}} | {{template "custom/header" .}} | ||||||
| </head> | </head> | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| <div class="ui container" id="navbar"> | <div class="ui container" id="navbar"> | ||||||
| 	<div class="item brand" style="justify-content: space-between;"> | 	<div class="item brand" style="justify-content: space-between;"> | ||||||
| 		<a href="{{AppSubUrl}}/"> | 		<a href="{{AppSubUrl}}/"> | ||||||
| 			<img class="ui mini image" with="30" height="30" src="{{StaticUrlPrefix}}/img/logo.svg"> | 			<img class="ui mini image" with="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg"> | ||||||
| 		</a> | 		</a> | ||||||
| 		<div class="ui basic icon button mobile-only" id="navbar-expand-toggle"> | 		<div class="ui basic icon button mobile-only" id="navbar-expand-toggle"> | ||||||
| 			<i class="sidebar icon"></i> | 			<i class="sidebar icon"></i> | ||||||
|   | |||||||
| @@ -3,7 +3,7 @@ | |||||||
| 	<div class="ui stackable middle very relaxed page grid"> | 	<div class="ui stackable middle very relaxed page grid"> | ||||||
| 		<div class="sixteen wide center aligned centered column"> | 		<div class="sixteen wide center aligned centered column"> | ||||||
| 			<div> | 			<div> | ||||||
| 				<img class="logo" width="220" height="220" src="{{StaticUrlPrefix}}/img/logo.svg"/> | 				<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg"/> | ||||||
| 			</div> | 			</div> | ||||||
| 			<div class="hero"> | 			<div class="hero"> | ||||||
| 				<h1 class="ui icon header title"> | 				<h1 class="ui icon header title"> | ||||||
|   | |||||||
| @@ -321,5 +321,5 @@ | |||||||
| 		</div> | 		</div> | ||||||
| 	</div> | 	</div> | ||||||
| </div> | </div> | ||||||
| <img style="display: none" src="{{StaticUrlPrefix}}/img/loading.png"/> | <img style="display: none" src="{{AssetUrlPrefix}}/img/loading.png"/> | ||||||
| {{template "base/footer" .}} | {{template "base/footer" .}} | ||||||
|   | |||||||
| @@ -10,23 +10,23 @@ | |||||||
| 					{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}} | 					{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}} | ||||||
| 					<div class="ui right"> | 					<div class="ui right"> | ||||||
| 						{{if eq .HookType "gitea"}} | 						{{if eq .HookType "gitea"}} | ||||||
| 							<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gitea.svg"> | 							<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gitea.svg"> | ||||||
| 						{{else if eq .HookType "gogs"}} | 						{{else if eq .HookType "gogs"}} | ||||||
| 							<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gogs.ico"> | 							<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gogs.ico"> | ||||||
| 						{{else if eq .HookType "slack"}} | 						{{else if eq .HookType "slack"}} | ||||||
| 							<img width="26" height="26" src="{{StaticUrlPrefix}}/img/slack.png"> | 							<img width="26" height="26" src="{{AssetUrlPrefix}}/img/slack.png"> | ||||||
| 						{{else if eq .HookType "discord"}} | 						{{else if eq .HookType "discord"}} | ||||||
| 							<img width="26" height="26" src="{{StaticUrlPrefix}}/img/discord.png"> | 							<img width="26" height="26" src="{{AssetUrlPrefix}}/img/discord.png"> | ||||||
| 						{{else if eq .HookType "dingtalk"}} | 						{{else if eq .HookType "dingtalk"}} | ||||||
| 							<img width="26" height="26" src="{{StaticUrlPrefix}}/img/dingtalk.ico"> | 							<img width="26" height="26" src="{{AssetUrlPrefix}}/img/dingtalk.ico"> | ||||||
| 						{{else if eq .HookType "telegram"}} | 						{{else if eq .HookType "telegram"}} | ||||||
| 							<img width="26" height="26" src="{{StaticUrlPrefix}}/img/telegram.png"> | 							<img width="26" height="26" src="{{AssetUrlPrefix}}/img/telegram.png"> | ||||||
| 						{{else if eq .HookType "msteams"}} | 						{{else if eq .HookType "msteams"}} | ||||||
| 							<img width="26" height="26" src="{{StaticUrlPrefix}}/img/msteams.png"> | 							<img width="26" height="26" src="{{AssetUrlPrefix}}/img/msteams.png"> | ||||||
| 						{{else if eq .HookType "feishu"}} | 						{{else if eq .HookType "feishu"}} | ||||||
| 							<img width="26" height="26" src="{{StaticUrlPrefix}}/img/feishu.png"> | 							<img width="26" height="26" src="{{AssetUrlPrefix}}/img/feishu.png"> | ||||||
| 						{{else if eq .HookType "matrix"}} | 						{{else if eq .HookType "matrix"}} | ||||||
| 							<img width="26" height="26" src="{{StaticUrlPrefix}}/img/matrix.svg"> | 							<img width="26" height="26" src="{{AssetUrlPrefix}}/img/matrix.svg"> | ||||||
| 						{{end}} | 						{{end}} | ||||||
| 					</div> | 					</div> | ||||||
| 				</h4> | 				</h4> | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ | |||||||
| 					<div class="ui stackable middle very relaxed page grid"> | 					<div class="ui stackable middle very relaxed page grid"> | ||||||
| 						<div id="repo_migrating" class="sixteen wide center aligned centered column"> | 						<div id="repo_migrating" class="sixteen wide center aligned centered column"> | ||||||
| 							<div> | 							<div> | ||||||
| 								<img src="{{StaticUrlPrefix}}/img/loading.png"/> | 								<img src="{{AssetUrlPrefix}}/img/loading.png"/> | ||||||
| 							</div> | 							</div> | ||||||
| 						</div> | 						</div> | ||||||
| 					</div> | 					</div> | ||||||
|   | |||||||
| @@ -9,12 +9,12 @@ | |||||||
| 					<div class="ui stackable middle very relaxed page grid"> | 					<div class="ui stackable middle very relaxed page grid"> | ||||||
| 						<div id="repo_migrating" class="sixteen wide center aligned centered column" task="{{.MigrateTask.ID}}"> | 						<div id="repo_migrating" class="sixteen wide center aligned centered column" task="{{.MigrateTask.ID}}"> | ||||||
| 							<div> | 							<div> | ||||||
| 								<img src="{{StaticUrlPrefix}}/img/loading.png"/> | 								<img src="{{AssetUrlPrefix}}/img/loading.png"/> | ||||||
| 							</div> | 							</div> | ||||||
| 						</div> | 						</div> | ||||||
| 						<div id="repo_migrating_failed_image" class="sixteen wide center aligned centered column" style="display: none;"> | 						<div id="repo_migrating_failed_image" class="sixteen wide center aligned centered column" style="display: none;"> | ||||||
| 							<div> | 							<div> | ||||||
| 								<img src="{{StaticUrlPrefix}}/img/failed.png"/> | 								<img src="{{AssetUrlPrefix}}/img/failed.png"/> | ||||||
| 							</div> | 							</div> | ||||||
| 						</div> | 						</div> | ||||||
| 					</div> | 					</div> | ||||||
|   | |||||||
| @@ -5,31 +5,31 @@ | |||||||
| 			<div class="ui blue tiny button">{{.i18n.Tr "repo.settings.add_webhook"}}</div> | 			<div class="ui blue tiny button">{{.i18n.Tr "repo.settings.add_webhook"}}</div> | ||||||
| 			<div class="menu"> | 			<div class="menu"> | ||||||
| 				<a class="item" href="{{.BaseLinkNew}}/gitea/new"> | 				<a class="item" href="{{.BaseLinkNew}}/gitea/new"> | ||||||
| 					<img width="20" height="20" src="{{StaticUrlPrefix}}/img/gitea.svg">Gitea | 					<img width="20" height="20" src="{{AssetUrlPrefix}}/img/gitea.svg">Gitea | ||||||
| 				</a> | 				</a> | ||||||
| 				<a class="item" href="{{.BaseLinkNew}}/gogs/new"> | 				<a class="item" href="{{.BaseLinkNew}}/gogs/new"> | ||||||
| 					<img width="20" height="20" src="{{StaticUrlPrefix}}/img/gogs.ico">Gogs | 					<img width="20" height="20" src="{{AssetUrlPrefix}}/img/gogs.ico">Gogs | ||||||
| 				</a> | 				</a> | ||||||
| 				<a class="item" href="{{.BaseLinkNew}}/slack/new"> | 				<a class="item" href="{{.BaseLinkNew}}/slack/new"> | ||||||
| 					<img width="20" height="20" src="{{StaticUrlPrefix}}/img/slack.png">Slack | 					<img width="20" height="20" src="{{AssetUrlPrefix}}/img/slack.png">Slack | ||||||
| 				</a> | 				</a> | ||||||
| 				<a class="item" href="{{.BaseLinkNew}}/discord/new"> | 				<a class="item" href="{{.BaseLinkNew}}/discord/new"> | ||||||
| 					<img width="20" height="20" src="{{StaticUrlPrefix}}/img/discord.png">Discord | 					<img width="20" height="20" src="{{AssetUrlPrefix}}/img/discord.png">Discord | ||||||
| 				</a> | 				</a> | ||||||
| 				<a class="item" href="{{.BaseLinkNew}}/dingtalk/new"> | 				<a class="item" href="{{.BaseLinkNew}}/dingtalk/new"> | ||||||
| 					<img width="20" height="20" src="{{StaticUrlPrefix}}/img/dingtalk.ico">Dingtalk | 					<img width="20" height="20" src="{{AssetUrlPrefix}}/img/dingtalk.ico">Dingtalk | ||||||
| 				</a> | 				</a> | ||||||
| 				<a class="item" href="{{.BaseLinkNew}}/telegram/new"> | 				<a class="item" href="{{.BaseLinkNew}}/telegram/new"> | ||||||
| 					<img width="20" height="20" src="{{StaticUrlPrefix}}/img/telegram.png">Telegram | 					<img width="20" height="20" src="{{AssetUrlPrefix}}/img/telegram.png">Telegram | ||||||
| 				</a> | 				</a> | ||||||
| 				<a class="item" href="{{.BaseLinkNew}}/msteams/new"> | 				<a class="item" href="{{.BaseLinkNew}}/msteams/new"> | ||||||
| 					<img width="20" height="20" src="{{StaticUrlPrefix}}/img/msteams.png">Microsoft Teams | 					<img width="20" height="20" src="{{AssetUrlPrefix}}/img/msteams.png">Microsoft Teams | ||||||
| 				</a> | 				</a> | ||||||
| 				<a class="item" href="{{.BaseLinkNew}}/feishu/new"> | 				<a class="item" href="{{.BaseLinkNew}}/feishu/new"> | ||||||
| 					<img width="20" height="20" src="{{StaticUrlPrefix}}/img/feishu.png">Feishu | 					<img width="20" height="20" src="{{AssetUrlPrefix}}/img/feishu.png">Feishu | ||||||
| 				</a> | 				</a> | ||||||
| 				<a class="item" href="{{.BaseLinkNew}}/matrix/new"> | 				<a class="item" href="{{.BaseLinkNew}}/matrix/new"> | ||||||
| 					<img width="20" height="20" src="{{StaticUrlPrefix}}/img/matrix.svg">Matrix | 					<img width="20" height="20" src="{{AssetUrlPrefix}}/img/matrix.svg">Matrix | ||||||
| 				</a> | 				</a> | ||||||
| 			</div> | 			</div> | ||||||
| 		</div> | 		</div> | ||||||
|   | |||||||
| @@ -8,23 +8,23 @@ | |||||||
| 			{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}} | 			{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}} | ||||||
| 			<div class="ui right"> | 			<div class="ui right"> | ||||||
| 				{{if eq .HookType "gitea"}} | 				{{if eq .HookType "gitea"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gitea.svg"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gitea.svg"> | ||||||
| 				{{else if eq .HookType "gogs"}} | 				{{else if eq .HookType "gogs"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/gogs.ico"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/gogs.ico"> | ||||||
| 				{{else if eq .HookType "slack"}} | 				{{else if eq .HookType "slack"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/slack.png"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/slack.png"> | ||||||
| 				{{else if eq .HookType "discord"}} | 				{{else if eq .HookType "discord"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/discord.png"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/discord.png"> | ||||||
| 				{{else if eq .HookType "dingtalk"}} | 				{{else if eq .HookType "dingtalk"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/dingtalk.ico"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/dingtalk.ico"> | ||||||
| 				{{else if eq .HookType "telegram"}} | 				{{else if eq .HookType "telegram"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/telegram.png"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/telegram.png"> | ||||||
| 				{{else if eq .HookType "msteams"}} | 				{{else if eq .HookType "msteams"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/msteams.png"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/msteams.png"> | ||||||
| 				{{else if eq .HookType "feishu"}} | 				{{else if eq .HookType "feishu"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/feishu.png"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/feishu.png"> | ||||||
| 				{{else if eq .HookType "matrix"}} | 				{{else if eq .HookType "matrix"}} | ||||||
| 					<img width="26" height="26" src="{{StaticUrlPrefix}}/img/matrix.svg"> | 					<img width="26" height="26" src="{{AssetUrlPrefix}}/img/matrix.svg"> | ||||||
| 				{{end}} | 				{{end}} | ||||||
| 			</div> | 			</div> | ||||||
| 		</h4> | 		</h4> | ||||||
|   | |||||||
| @@ -82,7 +82,7 @@ | |||||||
| 							<strong>{{.i18n.Tr "repo.audio_not_supported_in_browser"}}</strong> | 							<strong>{{.i18n.Tr "repo.audio_not_supported_in_browser"}}</strong> | ||||||
| 						</audio> | 						</audio> | ||||||
| 					{{else if .IsPDFFile}} | 					{{else if .IsPDFFile}} | ||||||
| 						<iframe width="100%" height="600px" src="{{StaticUrlPrefix}}/vendor/plugins/pdfjs/web/viewer.html?file={{EscapePound $.RawFileLink}}"></iframe> | 						<iframe width="100%" height="600px" src="{{AssetUrlPrefix}}/vendor/plugins/pdfjs/web/viewer.html?file={{EscapePound $.RawFileLink}}"></iframe> | ||||||
| 					{{else}} | 					{{else}} | ||||||
| 						<a href="{{EscapePound $.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a> | 						<a href="{{EscapePound $.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a> | ||||||
| 					{{end}} | 					{{end}} | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
| <div class="page-content ui container center full-screen-width {{if .IsRepo}}repository{{end}}"> | <div class="page-content ui container center full-screen-width {{if .IsRepo}}repository{{end}}"> | ||||||
| 	{{if .IsRepo}}{{template "repo/header" .}}{{end}} | 	{{if .IsRepo}}{{template "repo/header" .}}{{end}} | ||||||
| 	<div class="ui container center"> | 	<div class="ui container center"> | ||||||
| 		<p style="margin-top: 100px"><img class="ui centered image" src="{{StaticUrlPrefix}}/img/404.png" alt="404"/></p> | 		<p style="margin-top: 100px"><img class="ui centered image" src="{{AssetUrlPrefix}}/img/404.png" alt="404"/></p> | ||||||
| 		<div class="ui divider"></div> | 		<div class="ui divider"></div> | ||||||
| 		<br> | 		<br> | ||||||
| 		<p>{{.i18n.Tr "error404" | Safe}} | 		<p>{{.i18n.Tr "error404" | Safe}} | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| {{template "base/head" .}} | {{template "base/head" .}} | ||||||
| <div class="page-content ui container full-screen-width center"> | <div class="page-content ui container full-screen-width center"> | ||||||
| 	<p style="margin-top: 100px"><img class="ui centered image" src="{{StaticUrlPrefix}}/img/500.png" alt="500"/></p> | 	<p style="margin-top: 100px"><img class="ui centered image" src="{{AssetUrlPrefix}}/img/500.png" alt="500"/></p> | ||||||
| 	<div class="ui divider"></div> | 	<div class="ui divider"></div> | ||||||
| 	<br> | 	<br> | ||||||
| 	{{if .ErrorMsg}}<p>{{.i18n.Tr "error.occurred"}}:</p> | 	{{if .ErrorMsg}}<p>{{.i18n.Tr "error.occurred"}}:</p> | ||||||
|   | |||||||
| @@ -3,11 +3,11 @@ | |||||||
| 	<head> | 	<head> | ||||||
| 		<meta charset="UTF-8"> | 		<meta charset="UTF-8"> | ||||||
| 		<title>Gitea API</title> | 		<title>Gitea API</title> | ||||||
| 		<link href="{{StaticUrlPrefix}}/css/swagger.css?v={{MD5 AppVer}}" rel="stylesheet"> | 		<link href="{{AssetUrlPrefix}}/css/swagger.css?v={{MD5 AppVer}}" rel="stylesheet"> | ||||||
| 	</head> | 	</head> | ||||||
| 	<body> | 	<body> | ||||||
| 		<a class="swagger-back-link" href="{{AppUrl}}">{{svg "octicon-reply"}}{{.i18n.Tr "return_to_gitea"}}</a> | 		<a class="swagger-back-link" href="{{AppUrl}}">{{svg "octicon-reply"}}{{.i18n.Tr "return_to_gitea"}}</a> | ||||||
| 		<div id="swagger-ui" data-source="{{AppUrl}}swagger.{{.APIJSONVersion}}.json"></div> | 		<div id="swagger-ui" data-source="{{AppUrl}}swagger.{{.APIJSONVersion}}.json"></div> | ||||||
| 		<script src="{{StaticUrlPrefix}}/js/swagger.js?v={{MD5 AppVer}}"></script> | 		<script src="{{AssetUrlPrefix}}/js/swagger.js?v={{MD5 AppVer}}"></script> | ||||||
| 	</body> | 	</body> | ||||||
| </html> | </html> | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| import emojis from '../../../assets/emoji.json'; | import emojis from '../../../assets/emoji.json'; | ||||||
|  |  | ||||||
| const {StaticUrlPrefix} = window.config; | const {AssetUrlPrefix} = window.config; | ||||||
|  |  | ||||||
| const tempMap = {gitea: ':gitea:'}; | const tempMap = {gitea: ':gitea:'}; | ||||||
| for (const {emoji, aliases} of emojis) { | for (const {emoji, aliases} of emojis) { | ||||||
| @@ -24,7 +24,7 @@ for (const key of emojiKeys) { | |||||||
| export function emojiHTML(name) { | export function emojiHTML(name) { | ||||||
|   let inner; |   let inner; | ||||||
|   if (name === 'gitea') { |   if (name === 'gitea') { | ||||||
|     inner = `<img alt=":${name}:" src="${StaticUrlPrefix}/img/emoji/gitea.png">`; |     inner = `<img alt=":${name}:" src="${AssetUrlPrefix}/img/emoji/gitea.png">`; | ||||||
|   } else { |   } else { | ||||||
|     inner = emojiString(name); |     inner = emojiString(name); | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -31,7 +31,7 @@ export default async function initServiceWorker() { | |||||||
|  |  | ||||||
|   if (UseServiceWorker) { |   if (UseServiceWorker) { | ||||||
|     try { |     try { | ||||||
|       // normally we'd serve the service worker as a static asset from StaticUrlPrefix but |       // normally we'd serve the service worker as a static asset from AssetUrlPrefix but | ||||||
|       // the spec strictly requires it to be same-origin so it has to be AppSubUrl to work |       // the spec strictly requires it to be same-origin so it has to be AppSubUrl to work | ||||||
|       await Promise.all([ |       await Promise.all([ | ||||||
|         checkCacheValidity(), |         checkCacheValidity(), | ||||||
|   | |||||||
| @@ -25,7 +25,7 @@ import {renderMarkupContent} from './markup/content.js'; | |||||||
| import {stripTags, mqBinarySearch} from './utils.js'; | import {stripTags, mqBinarySearch} from './utils.js'; | ||||||
| import {svg, svgs} from './svg.js'; | import {svg, svgs} from './svg.js'; | ||||||
|  |  | ||||||
| const {AppSubUrl, StaticUrlPrefix, csrf} = window.config; | const {AppSubUrl, AssetUrlPrefix, csrf} = window.config; | ||||||
|  |  | ||||||
| let previewFileModes; | let previewFileModes; | ||||||
| const commentMDEditors = {}; | const commentMDEditors = {}; | ||||||
| @@ -3138,7 +3138,7 @@ function initVueComponents() { | |||||||
|         finalPage: 1, |         finalPage: 1, | ||||||
|         searchQuery, |         searchQuery, | ||||||
|         isLoading: false, |         isLoading: false, | ||||||
|         staticPrefix: StaticUrlPrefix, |         staticPrefix: AssetUrlPrefix, | ||||||
|         counts: {}, |         counts: {}, | ||||||
|         repoTypes: { |         repoTypes: { | ||||||
|           all: { |           all: { | ||||||
|   | |||||||
| @@ -1,9 +1,9 @@ | |||||||
| // This sets up the URL prefix used in webpack's chunk loading. | // This sets up the URL prefix used in webpack's chunk loading. | ||||||
| // This file must be imported before any lazy-loading is being attempted. | // This file must be imported before any lazy-loading is being attempted. | ||||||
| const {StaticUrlPrefix} = window.config; | const {AssetUrlPrefix} = window.config; | ||||||
|  |  | ||||||
| if (StaticUrlPrefix) { | if (AssetUrlPrefix) { | ||||||
|   __webpack_public_path__ = StaticUrlPrefix.endsWith('/') ? StaticUrlPrefix : `${StaticUrlPrefix}/`; |   __webpack_public_path__ = AssetUrlPrefix.endsWith('/') ? AssetUrlPrefix : `${AssetUrlPrefix}/`; | ||||||
| } else { | } else { | ||||||
|   const url = new URL(document.currentScript.src); |   const url = new URL(document.currentScript.src); | ||||||
|   __webpack_public_path__ = url.pathname.replace(/\/[^/]*?\/[^/]*?$/, '/'); |   __webpack_public_path__ = url.pathname.replace(/\/[^/]*?\/[^/]*?$/, '/'); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user