use relative url paths for samesite links #7

Merged
dalahast merged 3 commits from use-relative-url-paths-without-a-specific-domain-for-samesite-links into master 2020-12-01 14:29:26 +01:00
3 changed files with 31 additions and 31 deletions

@ -16,8 +16,8 @@
{{end}} {{end}}
</div> </div>
</div> </div>
<a href="{{StaticUrlPrefix}}/js/licenses.txt">{{.i18n.Tr "licenses"}}</a> <a href="/js/licenses.txt">{{.i18n.Tr "licenses"}}</a>
{{if .EnableSwagger}}<a href="{{AppSubUrl}}/api/swagger">API</a>{{end}} {{if .EnableSwagger}}<a href="/api/swagger">API</a>{{end}}
{{template "custom/extra_links_footer" .}} {{template "custom/extra_links_footer" .}}
{{if (or .ShowFooterVersion .PageIsAdmin)}}<span class="version">{{GoVer}}</span>{{end}} {{if (or .ShowFooterVersion .PageIsAdmin)}}<span class="version">{{GoVer}}</span>{{end}}
</div> </div>

@ -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="/">
<img class="ui mini image" src="{{StaticUrlPrefix}}/img/git.dotya.ml.svg" alt="git.dotya.ml icon"> <img class="ui mini image" src="/img/git.dotya.ml.svg" alt="git.dotya.ml icon">
</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>
@ -10,24 +10,24 @@
{{if and .IsSigned .MustChangePassword}} {{if and .IsSigned .MustChangePassword}}
{{/* No links */}} {{/* No links */}}
{{else if .IsSigned}} {{else if .IsSigned}}
<a class="item {{if .PageIsDashboard}}active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "dashboard"}}</a> <a class="item {{if .PageIsDashboard}}active{{end}}" href="/">{{.i18n.Tr "dashboard"}}</a>
{{if not .UnitIssuesGlobalDisabled}} {{if not .UnitIssuesGlobalDisabled}}
<a class="item {{if .PageIsIssues}}active{{end}}" href="{{AppSubUrl}}/issues">{{.i18n.Tr "issues"}}</a> <a class="item {{if .PageIsIssues}}active{{end}}" href="/issues">{{.i18n.Tr "issues"}}</a>
{{end}} {{end}}
{{if not .UnitPullsGlobalDisabled}} {{if not .UnitPullsGlobalDisabled}}
<a class="item {{if .PageIsPulls}}active{{end}}" href="{{AppSubUrl}}/pulls">{{.i18n.Tr "pull_requests"}}</a> <a class="item {{if .PageIsPulls}}active{{end}}" href="/pulls">{{.i18n.Tr "pull_requests"}}</a>
{{end}} {{end}}
{{if not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled)}} {{if not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled)}}
{{if .ShowMilestonesDashboardPage}}<a class="item {{if .PageIsMilestonesDashboard}}active{{end}}" href="{{AppSubUrl}}/milestones">{{.i18n.Tr "milestones"}}</a>{{end}} {{if .ShowMilestonesDashboardPage}}<a class="item {{if .PageIsMilestonesDashboard}}active{{end}}" href="/milestones">{{.i18n.Tr "milestones"}}</a>{{end}}
{{end}} {{end}}
<a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "explore"}}</a> <a class="item {{if .PageIsExplore}}active{{end}}" href="/explore/repos">{{.i18n.Tr "explore"}}</a>
{{else if .IsLandingPageHome}} {{else if .IsLandingPageHome}}
<a class="item {{if .PageIsHome}}active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "home"}}</a> <a class="item {{if .PageIsHome}}active{{end}}" href="/">{{.i18n.Tr "home"}}</a>
<a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "explore"}}</a> <a class="item {{if .PageIsExplore}}active{{end}}" href="/explore/repos">{{.i18n.Tr "explore"}}</a>
{{else if .IsLandingPageExplore}} {{else if .IsLandingPageExplore}}
<a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "home"}}</a> <a class="item {{if .PageIsExplore}}active{{end}}" href="/explore/repos">{{.i18n.Tr "home"}}</a>
{{else if .IsLandingPageOrganizations}} {{else if .IsLandingPageOrganizations}}
<a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{.i18n.Tr "home"}}</a> <a class="item {{if .PageIsExplore}}active{{end}}" href="/explore/organizations">{{.i18n.Tr "home"}}</a>
{{end}} {{end}}
{{template "custom/extra_links" .}} {{template "custom/extra_links" .}}
{{/* {{/*
@ -52,7 +52,7 @@
{{.i18n.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong> {{.i18n.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
</div> </div>
<div class="divider"></div> <div class="divider"></div>
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout" data-redirect="{{AppSubUrl}}/"> <a class="item link-action" href data-url="/user/logout" data-redirect="/">
{{svg "octicon-sign-out" 16}} {{svg "octicon-sign-out" 16}}
{{.i18n.Tr "sign_out"}}<!-- Sign Out --> {{.i18n.Tr "sign_out"}}<!-- Sign Out -->
</a> </a>
@ -61,7 +61,7 @@
</div> </div>
{{else if .IsSigned}} {{else if .IsSigned}}
<div class="right stackable menu"> <div class="right stackable menu">
<a href="{{AppSubUrl}}/notifications" class="item poping up" data-content='{{.i18n.Tr "notifications"}}' data-variation="tiny inverted"> <a href="/notifications" class="item poping up" data-content='{{.i18n.Tr "notifications"}}' data-variation="tiny inverted">
<span class="text"> <span class="text">
<span class="fitted">{{svg "octicon-bell" 16}}</span> <span class="fitted">{{svg "octicon-bell" 16}}</span>
<span class="sr-mobile-only">{{.i18n.Tr "notifications"}}</span> <span class="sr-mobile-only">{{.i18n.Tr "notifications"}}</span>
@ -79,14 +79,14 @@
<span class="fitted not-mobile">{{svg "octicon-triangle-down" 16}}</span> <span class="fitted not-mobile">{{svg "octicon-triangle-down" 16}}</span>
</span> </span>
<div class="menu"> <div class="menu">
<a class="item" href="{{AppSubUrl}}/repo/create"> <a class="item" href="/repo/create">
<span class="fitted">{{svg "octicon-plus" 16}}</span> {{.i18n.Tr "new_repo"}} <span class="fitted">{{svg "octicon-plus" 16}}</span> {{.i18n.Tr "new_repo"}}
</a> </a>
<a class="item" href="{{AppSubUrl}}/repo/migrate"> <a class="item" href="/repo/migrate">
<span class="fitted">{{svg "octicon-repo-push" 16}}</span> {{.i18n.Tr "new_migrate"}} <span class="fitted">{{svg "octicon-repo-push" 16}}</span> {{.i18n.Tr "new_migrate"}}
</a> </a>
{{if .SignedUser.CanCreateOrganization}} {{if .SignedUser.CanCreateOrganization}}
<a class="item" href="{{AppSubUrl}}/org/create"> <a class="item" href="/org/create">
<span class="fitted">{{svg "octicon-organization" 16}}</span> {{.i18n.Tr "new_org"}} <span class="fitted">{{svg "octicon-organization" 16}}</span> {{.i18n.Tr "new_org"}}
</a> </a>
{{end}} {{end}}
@ -104,15 +104,15 @@
{{.i18n.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong> {{.i18n.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
</div> </div>
<div class="divider"></div> <div class="divider"></div>
<a class="item" href="{{AppSubUrl}}/{{.SignedUser.Name}}"> <a class="item" href="/{{.SignedUser.Name}}">
{{svg "octicon-person" 16}} {{svg "octicon-person" 16}}
{{.i18n.Tr "your_profile"}}<!-- Your profile --> {{.i18n.Tr "your_profile"}}<!-- Your profile -->
</a> </a>
<a class="item" href="{{AppSubUrl}}/{{.SignedUser.Name}}?tab=stars"> <a class="item" href="/{{.SignedUser.Name}}?tab=stars">
{{svg "octicon-star" 16}} {{svg "octicon-star" 16}}
{{.i18n.Tr "your_starred"}} {{.i18n.Tr "your_starred"}}
</a> </a>
<a class="{{if .PageIsUserSettings}}active{{end}} item" href="{{AppSubUrl}}/user/settings"> <a class="{{if .PageIsUserSettings}}active{{end}} item" href="/user/settings">
{{svg "octicon-tools" 16}} {{svg "octicon-tools" 16}}
{{.i18n.Tr "your_settings"}}<!-- Your settings --> {{.i18n.Tr "your_settings"}}<!-- Your settings -->
</a> </a>
@ -122,13 +122,13 @@
</a> </a>
{{if .IsAdmin}} {{if .IsAdmin}}
<div class="divider"></div> <div class="divider"></div>
<a class="{{if .PageIsAdmin}}active{{end}} item" href="{{AppSubUrl}}/admin"> <a class="{{if .PageIsAdmin}}active{{end}} item" href="/admin">
<i class="icon settings"></i> <i class="icon settings"></i>
{{.i18n.Tr "admin_panel"}}<!-- Admin Panel --> {{.i18n.Tr "admin_panel"}}<!-- Admin Panel -->
</a> </a>
{{end}} {{end}}
<div class="divider"></div> <div class="divider"></div>
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout" data-redirect="{{AppSubUrl}}/"> <a class="item link-action" href data-url="/user/logout" data-redirect="/">
{{svg "octicon-sign-out" 16}} {{svg "octicon-sign-out" 16}}
{{.i18n.Tr "sign_out"}}<!-- Sign Out --> {{.i18n.Tr "sign_out"}}<!-- Sign Out -->
</a> </a>
@ -139,11 +139,11 @@
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">{{.i18n.Tr "help"}}</a> <a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">{{.i18n.Tr "help"}}</a>
<div class="right stackable menu"> <div class="right stackable menu">
{{if .ShowRegistrationButton}} {{if .ShowRegistrationButton}}
<a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up"> <a class="item{{if .PageIsSignUp}} active{{end}}" href="/user/sign_up">
{{svg "octicon-person" 16}} {{.i18n.Tr "register"}} {{svg "octicon-person" 16}} {{.i18n.Tr "register"}}
</a> </a>
{{end}} {{end}}
<a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login?redirect_to={{.CurrentURL}}"> <a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="/user/login?redirect_to={{.CurrentURL}}">
{{svg "octicon-sign-in" 16}} {{.i18n.Tr "sign_in"}} {{svg "octicon-sign-in" 16}} {{.i18n.Tr "sign_in"}}
</a> </a>
</div><!-- end anonymous right menu --> </div><!-- end anonymous right menu -->

@ -3,28 +3,28 @@
"name": "git.dotya.ml", "name": "git.dotya.ml",
"icons": [ "icons": [
{ {
"src": "{{StaticUrlPrefix}}/img/gitea-lg.png", "src": "/img/gitea-lg.png",
"type": "image/png", "type": "image/png",
"sizes": "880x880" "sizes": "880x880"
}, },
{ {
"src": "{{StaticUrlPrefix}}/img/gitea-sm.png", "src": "/img/gitea-sm.png",
"type": "image/png", "type": "image/png",
"sizes": "120x120" "sizes": "120x120"
}, },
{ {
"src": "{{StaticUrlPrefix}}/img/gitea-512.png", "src": "/img/gitea-512.png",
"type": "image/png", "type": "image/png",
"sizes": "512x512" "sizes": "512x512"
}, },
{ {
"src": "{{StaticUrlPrefix}}/img/gitea-192.png", "src": "/img/gitea-192.png",
"type": "image/png", "type": "image/png",
"sizes": "192x192" "sizes": "192x192"
} }
], ],
"start_url": "{{AppSubUrl}}/", "start_url": "/",
"scope": "{{AppSubUrl}}/", "scope": "/",
"background_color": "#FAFAFA", "background_color": "#FAFAFA",
"display": "standalone", "display": "standalone",
"theme_color": "{{ThemeColorMetaTag}}" "theme_color": "{{ThemeColorMetaTag}}"