mirror of
https://github.com/go-gitea/gitea.git
synced 2025-11-13 17:11:46 +01:00
fix
This commit is contained in:
parent
c3ecaed954
commit
309307afba
@ -22,6 +22,8 @@ func GetContextData(c context.Context) reqctx.ContextData {
|
||||
|
||||
func CommonTemplateContextData() reqctx.ContextData {
|
||||
return reqctx.ContextData{
|
||||
"PageTitleCommon": setting.AppName,
|
||||
|
||||
"IsLandingPageOrganizations": setting.LandingPageURL == setting.LandingPageOrganizations,
|
||||
|
||||
"ShowRegistrationButton": setting.Service.ShowRegistrationButton,
|
||||
|
||||
@ -537,6 +537,7 @@ func RepoAssignment(ctx *Context) {
|
||||
}
|
||||
|
||||
ctx.Data["Title"] = repo.Owner.Name + "/" + repo.Name
|
||||
ctx.Data["PageTitleCommon"] = repo.Name + " - " + setting.AppName
|
||||
ctx.Data["Repository"] = repo
|
||||
ctx.Data["Owner"] = ctx.Repo.Repository.Owner
|
||||
ctx.Data["CanWriteCode"] = ctx.Repo.CanWrite(unit_model.TypeCode)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<html lang="{{ctx.Locale.Lang}}" data-theme="{{UserThemeName .SignedUser}}">
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{if .Title}}{{.Title}} - {{end}}{{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}}</title>
|
||||
<title>{{if .Title}}{{.Title}} - {{end}}{{.PageTitleCommon}}</title>
|
||||
{{if .ManifestData}}<link rel="manifest" href="data:{{.ManifestData}}">{{end}}
|
||||
<meta name="author" content="{{if .Repository}}{{.Owner.Name}}{{else}}{{MetaAuthor}}{{end}}">
|
||||
<meta name="description" content="{{if .Repository}}{{.Repository.Name}}{{if .Repository.Description}} - {{.Repository.Description}}{{end}}{{else}}{{MetaDescription}}{{end}}">
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{{$isTreePathRoot := not .TreeNames}}
|
||||
|
||||
<div class="repo-view-content-data tw-hidden" data-document-title="{{ctx.RootData.Title}}"></div>
|
||||
<div class="repo-view-content-data tw-hidden" data-document-title="{{ctx.RootData.Title}}" data-document-title-common="{{ctx.RootData.PageTitleCommon}}"></div>
|
||||
{{template "repo/sub_menu" .}}
|
||||
<div class="repo-button-row">
|
||||
<div class="repo-button-row-left">
|
||||
|
||||
@ -30,7 +30,9 @@ export function createViewFileTreeStore(props: {repoLink: string, treePath: stri
|
||||
const response = await GET(u.href);
|
||||
const elViewContent = document.querySelector('.repo-view-content');
|
||||
elViewContent.innerHTML = await response.text();
|
||||
document.title = elViewContent.querySelector('.repo-view-content-data').getAttribute('data-document-title');
|
||||
const t1 = elViewContent.querySelector('.repo-view-content-data').getAttribute('data-document-title');
|
||||
const t2 = elViewContent.querySelector('.repo-view-content-data').getAttribute('data-document-title-common');
|
||||
document.title = `${t1} - ${t2}`; // follow the format in head.tmpl: <head><title>...</title></head>
|
||||
},
|
||||
|
||||
async navigateTreeView(treePath: string) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user