diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 9037af899..9e1c2fd38 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -470,7 +470,10 @@ var heightRe = regexp.MustCompile(`height="[0-9]+?"`) // SVG render icons - arguments icon name (string), size (int), class (string) func SVG(icon string, others ...interface{}) template.HTML { - var size = others[0].(int) + size := 16 + if len(others) > 0 && others[0].(int) != 0 { + size = others[0].(int) + } class := "" if len(others) > 1 && others[1].(string) != "" { diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl index 0fd87f925..99c215493 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 8dd0d939d..c3600fa99 100644 --- a/templates/admin/monitor.tmpl +++ b/templates/admin/monitor.tmpl @@ -24,7 +24,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 4f6bc5034..4a0fd1611 100644 --- a/templates/admin/org/list.tmpl +++ b/templates/admin/org/list.tmpl @@ -38,7 +38,7 @@ {{.Name}} {{if .Visibility.IsPrivate}} - {{svg "octicon-lock" 16}} + {{svg "octicon-lock"}} {{end}} {{.NumTeams}} diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index b9b886538..4c3b77dcf 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -45,7 +45,7 @@ {{.Owner.Name}} {{if .Owner.Visibility.IsPrivate}} - {{svg "octicon-lock" 16}} + {{svg "octicon-lock"}} {{end}} {{.Name}} diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index 832b8cf3c..e960f7fe1 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"}} diff --git a/templates/home.tmpl b/templates/home.tmpl index 5daea544f..721bb50db 100644 --- a/templates/home.tmpl +++ b/templates/home.tmpl @@ -16,7 +16,7 @@

- {{svg "octicon-flame" 16}} {{.i18n.Tr "startpage.install"}} + {{svg "octicon-flame"}} {{.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"}} {{.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"}} {{.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"}} {{.i18n.Tr "startpage.license"}}

{{.i18n.Tr "startpage.license_desc" | Str2html}} diff --git a/templates/org/header.tmpl b/templates/org/header.tmpl index 6593900c1..17cc58fcb 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 7fc2a5c2d..01c1fe66b 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"}}{{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"}} {{.Org.Location}}
{{end}} + {{if .Org.Website}}
{{svg "octicon-link"}} {{.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 1c33c55c5..f33f9be92 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"}} {{$.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"}} {{else}} - {{svg "octicon-x" 16}} + {{svg "octicon-x"}} {{end}}
diff --git a/templates/org/settings/delete.tmpl b/templates/org/settings/delete.tmpl index 729126b7b..a189a2f5e 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"}} {{.i18n.Tr "org.settings.delete_prompt" | Str2html}}

{{.CsrfTokenHtml}} diff --git a/templates/org/team/navbar.tmpl b/templates/org/team/navbar.tmpl index 95329a2be..18d638796 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 f6cb4f028..de39fee2e 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"}} {{else if .IsFork}} - {{svg "octicon-repo-forked" 16}} + {{svg "octicon-repo-forked"}} {{else if .IsMirror}} - {{svg "octicon-mirror" 16}} + {{svg "octicon-mirror"}} {{else}} - {{svg "octicon-repo" 16}} + {{svg "octicon-repo"}} {{end}} {{$.Org.Name}}/{{.Name}} diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl index d3bd08287..9ab6e8f4c 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 6aef18dff..e4be11ee5 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 41f6be643..fd24499fc 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"}} {{.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"}} {{.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"}} {{.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"}} {{.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"}} {{.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"}} {{.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"}} {{.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"}} {{.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"}} {{.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"}} {{.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/branch/list.tmpl b/templates/repo/branch/list.tmpl index 74025bd53..51ddf6c1e 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"}} {{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"}}{{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"}} {{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"}}{{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"}} {{$.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"}} {{$.i18n.Tr "repo.pulls.merged"}} {{else if .LatestPullRequest.Issue.IsClosed}} - {{svg "octicon-git-pull-request" 16}} {{$.i18n.Tr "repo.issues.closed_title"}} + {{svg "octicon-git-pull-request"}} {{$.i18n.Tr "repo.issues.closed_title"}} {{else}} - {{svg "octicon-git-pull-request" 16}} {{$.i18n.Tr "repo.issues.open_title"}} + {{svg "octicon-git-pull-request"}} {{$.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"}} {{else}} {{end}} diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index 28aa14abe..6a8e16c10 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -2,7 +2,7 @@