Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add main landmark to templates and adjust titles #22670

Merged
merged 1 commit into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions routers/web/admin/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const (
func DefaultOrSystemWebhooks(ctx *context.Context) {
var err error

ctx.Data["Title"] = ctx.Tr("admin.hooks")
ctx.Data["PageIsAdminSystemHooks"] = true
ctx.Data["PageIsAdminDefaultHooks"] = true

Expand Down
6 changes: 3 additions & 3 deletions routers/web/repo/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const (
// SettingsCtxData is a middleware that sets all the general context data for the
// settings template.
func SettingsCtxData(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.settings")
ctx.Data["Title"] = ctx.Tr("repo.settings.options")
ctx.Data["PageIsSettingsOptions"] = true
ctx.Data["ForcePrivate"] = setting.Repository.ForcePrivate
ctx.Data["MirrorsEnabled"] = setting.Mirror.Enabled
Expand Down Expand Up @@ -879,7 +879,7 @@ func handleSettingRemoteAddrError(ctx *context.Context, err error, form *forms.R

// Collaboration render a repository's collaboration page
func Collaboration(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.settings")
ctx.Data["Title"] = ctx.Tr("repo.settings.collaboration")
ctx.Data["PageIsSettingsCollaboration"] = true

users, err := repo_model.GetCollaborators(ctx, ctx.Repo.Repository.ID, db.ListOptions{})
Expand Down Expand Up @@ -1119,7 +1119,7 @@ func GitHooksEditPost(ctx *context.Context) {

// DeployKeys render the deploy keys list of a repository page
func DeployKeys(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.settings.deploy_keys")
ctx.Data["Title"] = ctx.Tr("repo.settings.deploy_keys") + " / " + ctx.Tr("secrets.secrets")
ctx.Data["PageIsSettingsKeys"] = true
ctx.Data["DisableSSH"] = setting.SSH.Disabled

Expand Down
4 changes: 2 additions & 2 deletions routers/web/repo/setting_protected_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (

// ProtectedBranchRules render the page to protect the repository
func ProtectedBranchRules(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.settings")
ctx.Data["Title"] = ctx.Tr("repo.settings.branches")
ctx.Data["PageIsSettingsBranches"] = true

rules, err := git_model.FindRepoProtectedBranchRules(ctx, ctx.Repo.Repository.ID)
Expand All @@ -46,7 +46,7 @@ func ProtectedBranchRules(ctx *context.Context) {

// SetDefaultBranchPost set default branch
func SetDefaultBranchPost(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.settings")
ctx.Data["Title"] = ctx.Tr("repo.settings.branches.update_default_branch")
ctx.Data["PageIsSettingsBranches"] = true

repo := ctx.Repo.Repository
Expand Down
2 changes: 1 addition & 1 deletion routers/web/repo/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func DeleteProtectedTagPost(ctx *context.Context) {
}

func setTagsContext(ctx *context.Context) error {
ctx.Data["Title"] = ctx.Tr("repo.settings")
ctx.Data["Title"] = ctx.Tr("repo.settings.tags")
ctx.Data["PageIsSettingsTags"] = true

protectedTags, err := git_model.GetProtectedTags(ctx, ctx.Repo.Repository.ID)
Expand Down
2 changes: 1 addition & 1 deletion routers/web/user/setting/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (

// Account renders change user's password, user's email and user suicide page
func Account(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("settings")
ctx.Data["Title"] = ctx.Tr("settings.account")
ctx.Data["PageIsSettingsAccount"] = true
ctx.Data["Email"] = ctx.Doer.Email
ctx.Data["EnableNotifyMail"] = setting.Service.EnableNotifyMail
Expand Down
2 changes: 1 addition & 1 deletion routers/web/user/setting/adopt.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

// AdoptOrDeleteRepository adopts or deletes a repository
func AdoptOrDeleteRepository(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("settings")
ctx.Data["Title"] = ctx.Tr("settings.adopt")
ctx.Data["PageIsSettingsRepos"] = true
allowAdopt := ctx.IsUserSiteAdmin() || setting.Repository.AllowAdoptionOfUnadoptedRepositories
ctx.Data["allowAdopt"] = allowAdopt
Expand Down
2 changes: 1 addition & 1 deletion routers/web/user/setting/applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const (

// Applications render manage access token page
func Applications(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("settings")
ctx.Data["Title"] = ctx.Tr("settings.applications")
ctx.Data["PageIsSettingsApplications"] = true

loadApplicationsData(ctx)
Expand Down
2 changes: 1 addition & 1 deletion routers/web/user/setting/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (

// Keys render user's SSH/GPG public keys page
func Keys(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("settings")
ctx.Data["Title"] = ctx.Tr("settings.ssh_gpg_keys")
ctx.Data["PageIsSettingsKeys"] = true
ctx.Data["DisableSSH"] = setting.SSH.Disabled
ctx.Data["BuiltinSSH"] = setting.SSH.StartBuiltinServer
Expand Down
8 changes: 4 additions & 4 deletions routers/web/user/setting/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const (

// Profile render user's profile page
func Profile(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("settings")
ctx.Data["Title"] = ctx.Tr("settings.profile")
ctx.Data["PageIsSettingsProfile"] = true
ctx.Data["AllowedUserVisibilityModes"] = setting.Service.AllowedUserVisibilityModesSlice.ToVisibleTypeSlice()

Expand Down Expand Up @@ -219,7 +219,7 @@ func DeleteAvatar(ctx *context.Context) {

// Organization render all the organization of the user
func Organization(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("settings")
ctx.Data["Title"] = ctx.Tr("settings.organization")
ctx.Data["PageIsSettingsOrganization"] = true

opts := organization.FindOrgOptions{
Expand Down Expand Up @@ -254,7 +254,7 @@ func Organization(ctx *context.Context) {

// Repos display a list of all repositories of the user
func Repos(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("settings")
ctx.Data["Title"] = ctx.Tr("settings.repos")
ctx.Data["PageIsSettingsRepos"] = true
ctx.Data["allowAdopt"] = ctx.IsUserSiteAdmin() || setting.Repository.AllowAdoptionOfUnadoptedRepositories
ctx.Data["allowDelete"] = ctx.IsUserSiteAdmin() || setting.Repository.AllowDeleteOfUnadoptedRepositories
Expand Down Expand Up @@ -360,7 +360,7 @@ func Repos(ctx *context.Context) {

// Appearance render user's appearance settings
func Appearance(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("settings")
ctx.Data["Title"] = ctx.Tr("settings.appearance")
ctx.Data["PageIsSettingsAppearance"] = true

var hiddenCommentTypes *big.Int
Expand Down
2 changes: 1 addition & 1 deletion routers/web/user/setting/security/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (

// Security render change user's password page and 2FA
func Security(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("settings")
ctx.Data["Title"] = ctx.Tr("settings.security")
ctx.Data["PageIsSettingsSecurity"] = true

if ctx.FormString("openid.return_to") != "" {
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/applications/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin config">
<div role="main" aria-label="{{.Title}}" class="page-content admin config">
{{template "admin/navbar" .}}
<div class="ui container">
<div class="twelve wide column content">
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/applications/oauth2_edit.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin config">
<div role="main" aria-label="{{.Title}}" class="page-content admin config">
{{template "admin/navbar" .}}

{{template "user/settings/applications_oauth2_edit_form" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/auth/edit.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin edit authentication">
<div role="main" aria-label="{{.Title}}" class="page-content admin edit authentication">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/auth/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin authentication">
<div role="main" aria-label="{{.Title}}" class="page-content admin authentication">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/auth/new.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin new authentication">
<div role="main" aria-label="{{.Title}}" class="page-content admin new authentication">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/config.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin config">
<div role="main" aria-label="{{.Title}}" class="page-content admin config">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/dashboard.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin dashboard">
<div role="main" aria-label="{{.Title}}" class="page-content admin dashboard">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/emails/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin user">
<div role="main" aria-label="{{.Title}}" class="page-content admin user">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/hook_new.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin settings new webhook">
<div role="main" aria-label="{{.Title}}" class="page-content admin settings new webhook">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/hooks.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin hooks">
<div role="main" aria-label="{{.Title}}" class="page-content admin hooks">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/monitor.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin monitor">
<div role="main" aria-label="{{.Title}}" class="page-content admin monitor">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/notice.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin notice">
<div role="main" aria-label="{{.Title}}" class="page-content admin notice">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/org/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin user">
<div role="main" aria-label="{{.Title}}" class="page-content admin user">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/packages/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin user">
<div role="main" aria-label="{{.Title}}" class="page-content admin user">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/queue.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin monitor">
<div role="main" aria-label="{{.Title}}" class="page-content admin monitor">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/repo/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin user">
<div role="main" aria-label="{{.Title}}" class="page-content admin user">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/repo/unadopted.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin user">
<div role="main" aria-label="{{.Title}}" class="page-content admin user">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/stacktrace.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin monitor">
<div role="main" aria-label="{{.Title}}" class="page-content admin monitor">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/user/edit.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin edit user">
<div role="main" aria-label="{{.Title}}" class="page-content admin edit user">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/user/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin user">
<div role="main" aria-label="{{.Title}}" class="page-content admin user">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/user/new.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content admin new user">
<div role="main" aria-label="{{.Title}}" class="page-content admin new user">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/explore/code.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content explore users">
<div role="main" aria-label="{{.Title}}" class="page-content explore users">
{{template "explore/navbar" .}}
<div class="ui container">
{{template "code/searchform" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/explore/organizations.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content explore users">
<div role="main" aria-label="{{.Title}}" class="page-content explore users">
{{template "explore/navbar" .}}
<div class="ui container">
{{template "explore/search" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/explore/repos.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content explore repositories">
<div role="main" aria-label="{{.Title}}" class="page-content explore repositories">
{{template "explore/navbar" .}}
<div class="ui container">
{{template "explore/repo_search" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/explore/users.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content explore users">
<div role="main" aria-label="{{.Title}}" class="page-content explore users">
{{template "explore/navbar" .}}
<div class="ui container">
{{template "explore/search" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/home.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content home">
<div role="main" aria-label="{{if .IsSigned}}{{.locale.Tr "dashboard"}}{{else}}{{.locale.Tr "home"}}{{end}}" class="page-content home">
<div class="ui stackable middle very relaxed page grid">
<div class="sixteen wide center aligned centered column">
<div>
Expand Down
2 changes: 1 addition & 1 deletion templates/install.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content install">
<div role="main" aria-label="{{.Title}}" class="page-content install">
<div class="ui middle very relaxed page grid">
<div class="sixteen wide center aligned centered column">
<h3 class="ui top attached header">
Expand Down
2 changes: 1 addition & 1 deletion templates/org/create.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content organization new org">
<div role="main" aria-label="{{.Title}}" class="page-content organization new org">
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{.Link}}" method="post">
Expand Down
2 changes: 1 addition & 1 deletion templates/org/home.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content organization profile">
<div role="main" aria-label="{{.Title}}" class="page-content organization profile">
<div class="ui container df">
{{avatar .Org 140 "org-avatar"}}
<div id="org-info">
Expand Down
2 changes: 1 addition & 1 deletion templates/org/member/members.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content organization members">
<div role="main" aria-label="{{.Title}}" class="page-content organization members">
{{template "org/header" .}}
<div class="ui container">
{{template "base/alert" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/org/projects/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content repository packages">
<div role="main" aria-label="{{.Title}}" class="page-content repository packages">
{{template "user/overview/header" .}}
{{template "projects/list" .}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/org/projects/new.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content repository packages">
<div role="main" aria-label="{{.Title}}" class="page-content repository packages">
{{template "user/overview/header" .}}
{{template "projects/new" .}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/org/projects/view.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content repository packages">
<div role="main" aria-label="{{.Title}}" class="page-content repository packages">
{{template "user/overview/header" .}}
{{template "projects/view" .}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/org/settings/applications.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content organization settings options">
<div role="main" aria-label="{{.Title}}" class="page-content organization settings options">
{{template "org/header" .}}
<div class="ui container">
<div class="ui grid">
Expand Down
2 changes: 1 addition & 1 deletion templates/org/settings/applications_oauth2_edit.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content organization settings options">
<div role="main" aria-label="{{.Title}}" class="page-content organization settings options">
{{template "org/header" .}}

{{template "user/settings/applications_oauth2_edit_form" .}}
Expand Down
2 changes: 1 addition & 1 deletion templates/org/settings/delete.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{template "base/head" .}}
<div class="page-content organization settings delete">
<div role="main" aria-label="{{.Title}}" class="page-content organization settings delete">
{{template "org/header" .}}
<div class="ui container">
<div class="ui grid">
Expand Down
Loading