mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 19:38:23 +00:00 
			
		
		
		
	Fix incorrect subpath in links (#29535)
* `$referenceUrl`: it is constructed by "Issue.Link", which already has the "AppSubURL" * `window.location.href`: AppSubURL could be empty string, so it needs the trailing slash
This commit is contained in:
		| @@ -33,7 +33,7 @@ | |||||||
| 			<div class="comment-header-right actions gt-df gt-ac"> | 			<div class="comment-header-right actions gt-df gt-ac"> | ||||||
| 				{{if .Invalidated}} | 				{{if .Invalidated}} | ||||||
| 					{{$referenceUrl := printf "%s#%s" $.root.Issue.Link .HashTag}} | 					{{$referenceUrl := printf "%s#%s" $.root.Issue.Link .HashTag}} | ||||||
| 					<a href="{{AppSubUrl}}{{$referenceUrl}}" class="ui label basic small" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}"> | 					<a href="{{$referenceUrl}}" class="ui label basic small" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}"> | ||||||
| 						{{ctx.Locale.Tr "repo.issues.review.outdated"}} | 						{{ctx.Locale.Tr "repo.issues.review.outdated"}} | ||||||
| 					</a> | 					</a> | ||||||
| 				{{end}} | 				{{end}} | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ | |||||||
| 					We only handle the case $resolved=true and $invalid=true in this template because if the comment is not resolved it has the outdated label in the comments area (not the header above). | 					We only handle the case $resolved=true and $invalid=true in this template because if the comment is not resolved it has the outdated label in the comments area (not the header above). | ||||||
| 					The case $resolved=false and $invalid=true is handled in repo/diff/comments.tmpl | 					The case $resolved=false and $invalid=true is handled in repo/diff/comments.tmpl | ||||||
| 					--> | 					--> | ||||||
| 					<a href="{{AppSubUrl}}{{$referenceUrl}}" class="ui label basic small gt-ml-3" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}"> | 					<a href="{{$referenceUrl}}" class="ui label basic small gt-ml-3" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}"> | ||||||
| 						{{ctx.Locale.Tr "repo.issues.review.outdated"}} | 						{{ctx.Locale.Tr "repo.issues.review.outdated"}} | ||||||
| 					</a> | 					</a> | ||||||
| 				{{end}} | 				{{end}} | ||||||
|   | |||||||
| @@ -112,7 +112,7 @@ export function initNotificationCount() { | |||||||
|           type: 'close', |           type: 'close', | ||||||
|         }); |         }); | ||||||
|         worker.port.close(); |         worker.port.close(); | ||||||
|         window.location.href = appSubUrl; |         window.location.href = `${appSubUrl}/`; | ||||||
|       } else if (event.data.type === 'close') { |       } else if (event.data.type === 'close') { | ||||||
|         worker.port.postMessage({ |         worker.port.postMessage({ | ||||||
|           type: 'close', |           type: 'close', | ||||||
|   | |||||||
| @@ -75,7 +75,7 @@ export function initStopwatch() { | |||||||
|           type: 'close', |           type: 'close', | ||||||
|         }); |         }); | ||||||
|         worker.port.close(); |         worker.port.close(); | ||||||
|         window.location.href = appSubUrl; |         window.location.href = `${appSubUrl}/`; | ||||||
|       } else if (event.data.type === 'close') { |       } else if (event.data.type === 'close') { | ||||||
|         worker.port.postMessage({ |         worker.port.postMessage({ | ||||||
|           type: 'close', |           type: 'close', | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user