diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 374f13af0f511..8f60d4c497e9a 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -298,8 +298,8 @@ func NewFuncMap() []template.FuncMap { } return false }, - "svg": func(icon string, size int) template.HTML { - return template.HTML(fmt.Sprintf(``, icon, size, size, icon)) + "svg": func(icon string, width int, height int) template.HTML { + return template.HTML(fmt.Sprintf(``, icon, width, height, icon)) }, }} } diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl index c1ac8fb4890c9..7e9bee502afd1 100644 --- a/templates/admin/dashboard.tmpl +++ b/templates/admin/dashboard.tmpl @@ -21,44 +21,44 @@ {{.i18n.Tr "admin.dashboard.delete_inactive_accounts"}} - + {{.i18n.Tr "admin.dashboard.delete_repo_archives"}} - + {{.i18n.Tr "admin.dashboard.delete_missing_repos"}} - + {{.i18n.Tr "admin.dashboard.git_gc_repos"}} - + {{.i18n.Tr "admin.dashboard.resync_all_sshkeys"}}
{{.i18n.Tr "admin.dashboard.resync_all_sshkeys.desc"}} - + {{.i18n.Tr "admin.dashboard.resync_all_hooks"}} - + {{.i18n.Tr "admin.dashboard.reinit_missing_repos"}} - + {{.i18n.Tr "admin.dashboard.sync_external_users"}} - + {{.i18n.Tr "admin.dashboard.repo_health_check"}} - + {{.i18n.Tr "admin.dashboard.delete_generated_repository_avatars"}} - + diff --git a/templates/admin/monitor.tmpl b/templates/admin/monitor.tmpl index 2980a2e9d8ffe..f36d1678e3458 100644 --- a/templates/admin/monitor.tmpl +++ b/templates/admin/monitor.tmpl @@ -23,7 +23,7 @@ {{range .Entries}} - + {{$.i18n.Tr (printf "admin.dashboard.%s" .Name)}} {{.Spec}} {{DateFmtLong .Next}} diff --git a/templates/admin/org/list.tmpl b/templates/admin/org/list.tmpl index fc512f2ad92b1..1a37a3b576956 100644 --- a/templates/admin/org/list.tmpl +++ b/templates/admin/org/list.tmpl @@ -32,7 +32,7 @@ {{.Name}} {{if .Visibility.IsPrivate}} - {{svg "octicon-lock" 16}} + {{svg "octicon-lock" 12 16}} {{end}} {{.NumTeams}} diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index f946b8a461b94..2562004a77dce 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -33,7 +33,7 @@ {{.Owner.Name}} {{if .Owner.Visibility.IsPrivate}} - {{svg "octicon-lock" 16}} + {{svg "octicon-lock" 12 16}} {{end}} {{.Name}} diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index b96e99702ec67..622f264d758a0 100644 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -50,7 +50,7 @@ {{.i18n.Tr "user_profile_and_more"}} {{.SignedUser.Name}} - {{svg "octicon-triangle-down" 16}} + {{svg "octicon-triangle-down" 16 16}} diff --git a/templates/home.tmpl b/templates/home.tmpl index 5daea544fe8e9..85ee197aef0ff 100644 --- a/templates/home.tmpl +++ b/templates/home.tmpl @@ -16,7 +16,7 @@

- {{svg "octicon-flame" 16}} {{.i18n.Tr "startpage.install"}} + {{svg "octicon-flame" 12 16}} {{.i18n.Tr "startpage.install"}}

{{.i18n.Tr "startpage.install_desc" | Str2html}} @@ -24,7 +24,7 @@

- {{svg "octicon-device-desktop" 16}} {{.i18n.Tr "startpage.platform"}} + {{svg "octicon-device-desktop" 16 16}} {{.i18n.Tr "startpage.platform"}}

{{.i18n.Tr "startpage.platform_desc" | Str2html}} @@ -34,7 +34,7 @@

- {{svg "octicon-rocket" 16}} {{.i18n.Tr "startpage.lightweight"}} + {{svg "octicon-rocket" 16 16}} {{.i18n.Tr "startpage.lightweight"}}

{{.i18n.Tr "startpage.lightweight_desc" | Str2html}} @@ -42,7 +42,7 @@

- {{svg "octicon-code" 16}} {{.i18n.Tr "startpage.license"}} + {{svg "octicon-code" 14 16}} {{.i18n.Tr "startpage.license"}}

{{.i18n.Tr "startpage.license_desc" | Str2html}} diff --git a/templates/org/header.tmpl b/templates/org/header.tmpl index 2dc93dbf8d1b9..6c688aa05bd37 100644 --- a/templates/org/header.tmpl +++ b/templates/org/header.tmpl @@ -9,11 +9,11 @@

diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index 7fc2a5c2de8fa..cf27fdc1b4b5c 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -7,12 +7,12 @@
{{.Org.DisplayName}} - {{if .IsOrganizationOwner}}{{svg "octicon-gear" 16}}{{end}} + {{if .IsOrganizationOwner}}{{svg "octicon-gear" 14 16}}{{end}}
{{if .Org.Description}}

{{.Org.Description}}

{{end}}
- {{if .Org.Location}}
{{svg "octicon-location" 16}} {{.Org.Location}}
{{end}} - {{if .Org.Website}}
{{svg "octicon-link" 16}} {{.Org.Website}}
{{end}} + {{if .Org.Location}}
{{svg "octicon-location" 12 16}} {{.Org.Location}}
{{end}} + {{if .Org.Website}}
{{svg "octicon-link" 16 16}} {{.Org.Website}}
{{end}}
@@ -38,7 +38,7 @@ {{.i18n.Tr "org.people"}} {{if .IsOrganizationMember}} {{end}} @@ -55,7 +55,7 @@
diff --git a/templates/org/member/members.tmpl b/templates/org/member/members.tmpl index 1a65a02278da7..34f7b19ef9413 100644 --- a/templates/org/member/members.tmpl +++ b/templates/org/member/members.tmpl @@ -34,7 +34,7 @@ {{$.i18n.Tr "org.members.member_role"}}
- {{if index $.MembersIsUserOrgOwner .ID}}{{svg "octicon-shield-lock" 16}} {{$.i18n.Tr "org.members.owner"}}{{else}}{{$.i18n.Tr "org.members.member"}}{{end}} + {{if index $.MembersIsUserOrgOwner .ID}}{{svg "octicon-shield-lock" 14 16}} {{$.i18n.Tr "org.members.owner"}}{{else}}{{$.i18n.Tr "org.members.member"}}{{end}}
@@ -44,9 +44,9 @@
{{if index $.MembersTwoFaStatus .ID}} - {{svg "octicon-check" 16}} + {{svg "octicon-check" 12 16}} {{else}} - {{svg "octicon-x" 16}} + {{svg "octicon-x" 12 16}} {{end}}
diff --git a/templates/org/settings/delete.tmpl b/templates/org/settings/delete.tmpl index 729126b7b9ca6..7c8680f2c9f48 100644 --- a/templates/org/settings/delete.tmpl +++ b/templates/org/settings/delete.tmpl @@ -11,7 +11,7 @@
-

{{svg "octicon-alert" 16}} {{.i18n.Tr "org.settings.delete_prompt" | Str2html}}

+

{{svg "octicon-alert" 16 16}} {{.i18n.Tr "org.settings.delete_prompt" | Str2html}}

{{.CsrfTokenHtml}} diff --git a/templates/org/team/navbar.tmpl b/templates/org/team/navbar.tmpl index 95329a2be3328..7341f499b9aac 100644 --- a/templates/org/team/navbar.tmpl +++ b/templates/org/team/navbar.tmpl @@ -1,4 +1,4 @@ diff --git a/templates/org/team/repositories.tmpl b/templates/org/team/repositories.tmpl index e3c52e161503c..24161ef8b7120 100644 --- a/templates/org/team/repositories.tmpl +++ b/templates/org/team/repositories.tmpl @@ -42,13 +42,13 @@ {{end}} {{if .IsPrivate}} - {{svg "octicon-lock" 16}} + {{svg "octicon-lock" 12 16}} {{else if .IsFork}} - {{svg "octicon-repo-forked" 16}} + {{svg "octicon-repo-forked" 10 16}} {{else if .IsMirror}} - {{svg "octicon-repo-clone" 16}} + {{svg "octicon-repo-clone" 16 16}} {{else}} - {{svg "octicon-repo" 16}} + {{svg "octicon-repo" 12 16}} {{end}} {{$.Org.Name}}/{{.Name}} diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl index d3bd0828758a9..e0feef4ee535e 100644 --- a/templates/org/team/sidebar.tmpl +++ b/templates/org/team/sidebar.tmpl @@ -55,7 +55,7 @@
{{if .IsOrganizationOwner}} {{end}}
diff --git a/templates/org/team/teams.tmpl b/templates/org/team/teams.tmpl index 6aef18dfffea8..61cd8fbfaf9ee 100644 --- a/templates/org/team/teams.tmpl +++ b/templates/org/team/teams.tmpl @@ -5,7 +5,7 @@ {{template "base/alert" .}} {{if .IsOrganizationOwner}}
{{end}} diff --git a/templates/repo/activity.tmpl b/templates/repo/activity.tmpl index 41f6be64309e0..04332c6cb5124 100644 --- a/templates/repo/activity.tmpl +++ b/templates/repo/activity.tmpl @@ -63,21 +63,21 @@
{{if .Permission.CanRead $.UnitTypePullRequests}} - {{svg "octicon-git-pull-request" 16}} {{.Activity.MergedPRCount}}
+ {{svg "octicon-git-pull-request" 12 16}} {{.Activity.MergedPRCount}}
{{.i18n.Tr (TrN .i18n.Lang .Activity.MergedPRCount "repo.activity.merged_prs_count_1" "repo.activity.merged_prs_count_n") }}
- {{svg "octicon-git-branch" 16}} {{.Activity.OpenedPRCount}}
+ {{svg "octicon-git-branch" 10 16}} {{.Activity.OpenedPRCount}}
{{.i18n.Tr (TrN .i18n.Lang .Activity.OpenedPRCount "repo.activity.opened_prs_count_1" "repo.activity.opened_prs_count_n") }}
{{end}} {{if .Permission.CanRead $.UnitTypeIssues}} - {{svg "octicon-issue-closed" 16}} {{.Activity.ClosedIssueCount}}
+ {{svg "octicon-issue-closed" 16 16}} {{.Activity.ClosedIssueCount}}
{{.i18n.Tr (TrN .i18n.Lang .Activity.ClosedIssueCount "repo.activity.closed_issues_count_1" "repo.activity.closed_issues_count_n") }}
- {{svg "octicon-issue-opened" 16}} {{.Activity.OpenedIssueCount}}
+ {{svg "octicon-issue-opened" 14 16}} {{.Activity.OpenedIssueCount}}
{{.i18n.Tr (TrN .i18n.Lang .Activity.OpenedIssueCount "repo.activity.new_issues_count_1" "repo.activity.new_issues_count_n") }}
{{end}} @@ -120,7 +120,7 @@ {{if gt .Activity.PublishedReleaseCount 0}}

- {{svg "octicon-tag" 16}} + {{svg "octicon-tag" 16 16}} {{.i18n.Tr "repo.activity.title.releases_published_by" (.i18n.Tr (TrN .i18n.Lang .Activity.PublishedReleaseCount "repo.activity.title.releases_1" "repo.activity.title.releases_n") .Activity.PublishedReleaseCount) (.i18n.Tr (TrN .i18n.Lang .Activity.PublishedReleaseAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n") .Activity.PublishedReleaseAuthorCount) }}

@@ -139,7 +139,7 @@ {{if gt .Activity.MergedPRCount 0}}

- {{svg "octicon-git-pull-request" 16}} + {{svg "octicon-git-pull-request" 12 16}} {{.i18n.Tr "repo.activity.title.prs_merged_by" (.i18n.Tr (TrN .i18n.Lang .Activity.MergedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n") .Activity.MergedPRCount) (.i18n.Tr (TrN .i18n.Lang .Activity.MergedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n") .Activity.MergedPRAuthorCount) }}

@@ -155,7 +155,7 @@ {{if gt .Activity.OpenedPRCount 0}}

- {{svg "octicon-git-branch" 16}} + {{svg "octicon-git-branch" 10 16}} {{.i18n.Tr "repo.activity.title.prs_opened_by" (.i18n.Tr (TrN .i18n.Lang .Activity.OpenedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n") .Activity.OpenedPRCount) (.i18n.Tr (TrN .i18n.Lang .Activity.OpenedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n") .Activity.OpenedPRAuthorCount) }}

@@ -171,7 +171,7 @@ {{if gt .Activity.ClosedIssueCount 0}}

- {{svg "octicon-issue-closed" 16}} + {{svg "octicon-issue-closed" 16 16}} {{.i18n.Tr "repo.activity.title.issues_closed_by" (.i18n.Tr (TrN .i18n.Lang .Activity.ClosedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n") .Activity.ClosedIssueCount) (.i18n.Tr (TrN .i18n.Lang .Activity.ClosedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n") .Activity.ClosedIssueAuthorCount) }}

@@ -187,7 +187,7 @@ {{if gt .Activity.OpenedIssueCount 0}}

- {{svg "octicon-issue-opened" 16}} + {{svg "octicon-issue-opened" 14 16}} {{.i18n.Tr "repo.activity.title.issues_created_by" (.i18n.Tr (TrN .i18n.Lang .Activity.OpenedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n") .Activity.OpenedIssueCount) (.i18n.Tr (TrN .i18n.Lang .Activity.OpenedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n") .Activity.OpenedIssueAuthorCount) }}

@@ -203,7 +203,7 @@ {{if gt .Activity.UnresolvedIssueCount 0}}

- {{svg "octicon-comment-discussion" 16}} + {{svg "octicon-comment-discussion" 16 16}} {{.i18n.Tr (TrN .i18n.Lang .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n") .Activity.UnresolvedIssueCount }}

diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl index c2410e8c1d0d7..2ff48d1aa225a 100644 --- a/templates/repo/blame.tmpl +++ b/templates/repo/blame.tmpl @@ -18,14 +18,14 @@
{{if .Repository.CanEnableEditor}} {{if .CanEditFile}} - {{svg "octicon-pencil" 16}} + {{svg "octicon-pencil" 16 16}} {{else}} - {{svg "octicon-pencil" 16}} + {{svg "octicon-pencil" 16 16}} {{end}} {{if .CanDeleteFile}} - {{svg "octicon-trashcan" 16}} + {{svg "octicon-trashcan" 16 16}} {{else}} - {{svg "octicon-trashcan" 16}} + {{svg "octicon-trashcan" 16 16}} {{end}} {{end}}
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index d2eedef49c94e..5a7eec21f32aa 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -16,10 +16,10 @@ {{range .Branches}} {{if eq .Name $.DefaultBranch}} {{if .IsProtected}} - {{svg "octicon-shield-lock" 16}} + {{svg "octicon-shield-lock" 14 16}} {{end}} {{$.DefaultBranch}} -

{{svg "octicon-git-commit" 16}}{{ShortSha .Commit.ID.String}} · {{RenderCommitMessage .Commit.CommitMessage $.RepoLink $.Repository.ComposeMetas}} · {{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}

+

{{svg "octicon-git-commit" 16 16}}{{ShortSha .Commit.ID.String}} · {{RenderCommitMessage .Commit.CommitMessage $.RepoLink $.Repository.ComposeMetas}} · {{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}

{{end}} {{end}} @@ -27,8 +27,8 @@ @@ -53,10 +53,10 @@

{{$.i18n.Tr "repo.branch.deleted_by" .DeletedBranch.DeletedBy.Name}} {{TimeSinceUnix .DeletedBranch.DeletedUnix $.i18n.Lang}}

{{else}} {{if .IsProtected}} - {{svg "octicon-shield-lock" 16}} + {{svg "octicon-shield-lock" 14 16}} {{end}} {{.Name}} -

{{svg "octicon-git-commit" 16}}{{ShortSha .Commit.ID.String}} · {{RenderCommitMessage .Commit.CommitMessage $.RepoLink $.Repository.ComposeMetas}} · {{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}

+

{{svg "octicon-git-commit" 16 16}}{{ShortSha .Commit.ID.String}} · {{RenderCommitMessage .Commit.CommitMessage $.RepoLink $.Repository.ComposeMetas}} · {{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}

{{end}} @@ -77,7 +77,7 @@ {{if not .LatestPullRequest}} {{if .IsIncluded}} - {{svg "octicon-git-pull-request" 16}} {{$.i18n.Tr "repo.branch.included"}} + {{svg "octicon-git-pull-request" 12 16}} {{$.i18n.Tr "repo.branch.included"}} {{else if and (not .IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}} @@ -93,11 +93,11 @@ {{else}} {{if not .LatestPullRequest.IsSameRepo}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}} {{if .LatestPullRequest.HasMerged}} - {{svg "octicon-git-merge" 16}} {{$.i18n.Tr "repo.pulls.merged"}} + {{svg "octicon-git-merge" 16 16}} {{$.i18n.Tr "repo.pulls.merged"}} {{else if .LatestPullRequest.Issue.IsClosed}} - {{svg "octicon-issue-closed" 16}} {{$.i18n.Tr "repo.issues.closed_title"}} + {{svg "octicon-issue-closed" 16 16}} {{$.i18n.Tr "repo.issues.closed_title"}} {{else}} - {{svg "octicon-issue-opened" 16}} {{$.i18n.Tr "repo.issues.open_title"}} + {{svg "octicon-issue-opened" 14 16}} {{$.i18n.Tr "repo.issues.open_title"}} {{end}} {{end}} @@ -106,14 +106,14 @@ {{end}} {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}} {{if .IsDeleted}} - {{svg "octicon-reply" 16}} + {{svg "octicon-reply" 16 16}} {{else}} {{end}} diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index 28aa14abea034..b3430b38a1dc9 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -2,7 +2,7 @@