From c85bb6263503ebd335863f413214a775973a1fac Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 9 Dec 2020 20:03:19 +0100 Subject: [PATCH] Replace more icons with SVG, repo search tweaks (#13860) * Replace more icons with SVG - Replace remaining icons on admin page with SVG - Fix vertical menu background on arc-green - Minor improvments to frontpage repo search - More icon replacements here and there * fix integration * whitespace tweak * add comment Co-authored-by: techknowlogick --- integrations/auth_ldap_test.go | 8 +-- public/img/svg/gitea-double-chevron-left.svg | 1 + public/img/svg/gitea-double-chevron-right.svg | 1 + templates/admin/auth/list.tmpl | 4 +- templates/admin/config.tmpl | 64 +++++++++---------- templates/admin/emails/list.tmpl | 6 +- templates/admin/monitor.tmpl | 4 +- templates/admin/notice.tmpl | 4 +- templates/admin/org/list.tmpl | 2 +- templates/admin/queue.tmpl | 6 +- templates/admin/repo/list.tmpl | 4 +- templates/admin/repo/unadopted.tmpl | 12 ++-- templates/admin/user/list.tmpl | 10 +-- templates/base/paginate.tmpl | 16 +++-- templates/repo/branch/list.tmpl | 4 +- templates/repo/branch_dropdown.tmpl | 4 +- templates/repo/diff/new_review.tmpl | 8 +-- .../repo/issue/branch_selector_field.tmpl | 4 +- templates/repo/projects/list.tmpl | 4 +- templates/repo/settings/lfs_pointers.tmpl | 6 +- templates/repo/settings/webhook/list.tmpl | 9 +-- templates/user/dashboard/repolist.tmpl | 44 +++++++++---- templates/user/settings/applications.tmpl | 1 + .../user/settings/applications_oauth2.tmpl | 5 +- templates/user/settings/grants_oauth2.tmpl | 4 +- templates/user/settings/repos.tmpl | 4 +- web_src/js/index.js | 9 ++- web_src/less/_base.less | 24 ++++++- web_src/svg/gitea-double-chevron-left.svg | 1 + web_src/svg/gitea-double-chevron-right.svg | 1 + 30 files changed, 166 insertions(+), 108 deletions(-) create mode 100644 public/img/svg/gitea-double-chevron-left.svg create mode 100644 public/img/svg/gitea-double-chevron-right.svg create mode 100644 web_src/svg/gitea-double-chevron-left.svg create mode 100644 web_src/svg/gitea-double-chevron-right.svg diff --git a/integrations/auth_ldap_test.go b/integrations/auth_ldap_test.go index 156945841..a3ed172ba 100644 --- a/integrations/auth_ldap_test.go +++ b/integrations/auth_ldap_test.go @@ -172,14 +172,14 @@ func TestLDAPUserSync(t *testing.T) { assert.Equal(t, u.UserName, strings.TrimSpace(tds.Find("td:nth-child(2) a").Text())) assert.Equal(t, u.Email, strings.TrimSpace(tds.Find("td:nth-child(3) span").Text())) if u.IsAdmin { - assert.True(t, tds.Find("td:nth-child(5) i").HasClass("fa-check-square-o")) + assert.True(t, tds.Find("td:nth-child(5) svg").HasClass("octicon-check")) } else { - assert.True(t, tds.Find("td:nth-child(5) i").HasClass("fa-square-o")) + assert.True(t, tds.Find("td:nth-child(5) svg").HasClass("octicon-x")) } if u.IsRestricted { - assert.True(t, tds.Find("td:nth-child(6) i").HasClass("fa-check-square-o")) + assert.True(t, tds.Find("td:nth-child(6) svg").HasClass("octicon-check")) } else { - assert.True(t, tds.Find("td:nth-child(6) i").HasClass("fa-square-o")) + assert.True(t, tds.Find("td:nth-child(6) svg").HasClass("octicon-x")) } } diff --git a/public/img/svg/gitea-double-chevron-left.svg b/public/img/svg/gitea-double-chevron-left.svg new file mode 100644 index 000000000..68d2d9978 --- /dev/null +++ b/public/img/svg/gitea-double-chevron-left.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/img/svg/gitea-double-chevron-right.svg b/public/img/svg/gitea-double-chevron-right.svg new file mode 100644 index 000000000..06ff40fd5 --- /dev/null +++ b/public/img/svg/gitea-double-chevron-right.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/templates/admin/auth/list.tmpl b/templates/admin/auth/list.tmpl index 851254c09..d5d8aadb5 100644 --- a/templates/admin/auth/list.tmpl +++ b/templates/admin/auth/list.tmpl @@ -28,10 +28,10 @@ {{.ID}} {{.Name}} {{.TypeName}} - + {{if .IsActived}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} {{.UpdatedUnix.FormatShort}} {{.CreatedUnix.FormatShort}} - + {{svg "octicon-pencil"}} {{end}} diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index 00ad7a9a0..3fbb80caf 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -19,9 +19,9 @@
{{.i18n.Tr "admin.config.domain"}}
{{.Domain}}
{{.i18n.Tr "admin.config.offline_mode"}}
-
+
{{if .OfflineMode}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.disable_router_log"}}
-
+
{{if .DisableRouterLog}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
@@ -67,10 +67,10 @@
{{.i18n.Tr "admin.config.ssh_enabled"}}
-
+
{{if not .SSH.Disabled}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{if not .SSH.Disabled}}
{{.i18n.Tr "admin.config.ssh_start_builtin_server"}}
-
+
{{if not .SSH.StartBuiltinServer}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.ssh_domain"}}
{{.SSH.Domain}}
{{.i18n.Tr "admin.config.ssh_port"}}
@@ -86,7 +86,7 @@
{{.i18n.Tr "admin.config.ssh_keygen_path"}}
{{.SSH.KeygenPath}}
{{.i18n.Tr "admin.config.ssh_minimum_key_size_check"}}
-
+
{{if .SSH.MinimumKeySizeCheck}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{if .SSH.MinimumKeySizeCheck}}
{{.i18n.Tr "admin.config.ssh_minimum_key_sizes"}}
{{.SSH.MinimumKeySizes}}
@@ -102,7 +102,7 @@
{{.i18n.Tr "admin.config.lfs_enabled"}}
-
+
{{if .LFS.StartServer}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{if .LFS.StartServer}}
{{.i18n.Tr "admin.config.lfs_content_path"}}
{{.LFS.Path}}
@@ -146,36 +146,36 @@
{{.i18n.Tr "admin.config.register_email_confirm"}}
-
+
{{if .Service.RegisterEmailConfirm}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.disable_register"}}
-
+
{{if .Service.DisableRegistration}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.allow_only_external_registration"}}
-
+
{{if .Service.AllowOnlyExternalRegistration}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.show_registration_button"}}
-
+
{{if .Service.ShowRegistrationButton}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.enable_openid_signup"}}
-
+
{{if .Service.EnableOpenIDSignUp}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.enable_openid_signin"}}
-
+
{{if .Service.EnableOpenIDSignIn}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.require_sign_in_view"}}
-
+
{{if .Service.RequireSignInView}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.mail_notify"}}
-
- {{/*
{{.i18n.Tr "admin.config.disable_key_size_check"}}
-
*/}} +
{{if .Service.EnableNotifyMail}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
+
{{.i18n.Tr "admin.config.disable_key_size_check"}}
+
{{if .SSH.MinimumKeySizeCheck}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.enable_captcha"}}
-
+
{{if .Service.EnableCaptcha}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.default_keep_email_private"}}
-
+
{{if .Service.DefaultKeepEmailPrivate}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.default_allow_create_organization"}}
-
+
{{if .Service.DefaultAllowCreateOrganization}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.enable_timetracking"}}
-
+
{{if .Service.EnableTimetracking}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{if .Service.EnableTimetracking}}
{{.i18n.Tr "admin.config.default_enable_timetracking"}}
-
+
{{if .Service.DefaultEnableTimetracking}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.default_allow_only_contributors_to_track_time"}}
-
+
{{if .Service.DefaultAllowOnlyContributorsToTrackTime}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{end}}
{{.i18n.Tr "admin.config.default_visibility_organization"}}
{{.Service.DefaultOrgVisibility}}
@@ -183,7 +183,7 @@
{{.i18n.Tr "admin.config.no_reply_address"}}
{{if .Service.NoReplyAddress}}{{.Service.NoReplyAddress}}{{else}}-{{end}}
{{.i18n.Tr "admin.config.default_enable_dependencies"}}
-
+
{{if .Service.DefaultEnableDependencies}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.active_code_lives"}}
{{.Service.ActiveCodeLives}} {{.i18n.Tr "tool.raw_minutes"}}
@@ -202,7 +202,7 @@
{{.i18n.Tr "admin.config.deliver_timeout"}}
{{.Webhook.DeliverTimeout}} {{.i18n.Tr "tool.raw_seconds"}}
{{.i18n.Tr "admin.config.skip_tls_verify"}}
-
+
{{if .Webhook.SkipTLSVerify}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
@@ -212,18 +212,18 @@
{{.i18n.Tr "admin.config.mailer_enabled"}}
-
+
{{if .MailerEnabled}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{if .MailerEnabled}}
{{.i18n.Tr "admin.config.mailer_name"}}
{{.Mailer.Name}}
{{if eq .Mailer.MailerType "smtp"}}
{{.i18n.Tr "admin.config.mailer_disable_helo"}}
-
+
{{if .DisableHelo}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.mailer_host"}}
{{.Mailer.Host}}
{{else if eq .Mailer.MailerType "sendmail"}}
{{.i18n.Tr "admin.config.mailer_use_sendmail"}}
-
+
{{svg "octicon-check"}}
{{.i18n.Tr "admin.config.mailer_sendmail_path"}}
{{.Mailer.SendmailPath}}
{{.i18n.Tr "admin.config.mailer_sendmail_args"}}
@@ -282,7 +282,7 @@
{{.i18n.Tr "admin.config.session_life_time"}}
{{.SessionConfig.Maxlifetime}} {{.i18n.Tr "tool.raw_seconds"}}
{{.i18n.Tr "admin.config.https_only"}}
-
+
{{if .SessionConfig.Secure}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
@@ -292,10 +292,10 @@
{{.i18n.Tr "admin.config.disable_gravatar"}}
-
+
{{if .DisableGravatar}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.enable_federated_avatar"}}
-
+
{{if .EnableFederatedAvatar}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
@@ -305,7 +305,7 @@
{{.i18n.Tr "admin.config.git_disable_diff_highlight"}}
-
+
{{if .Git.DisableDiffHighlight}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{.i18n.Tr "admin.config.git_max_diff_lines"}}
{{.Git.MaxGitDiffLines}}
{{.i18n.Tr "admin.config.git_max_diff_line_characters"}}
@@ -411,7 +411,7 @@
{{$.i18n.Tr "admin.config.routes_to_default_logger"}}
{{end}}
{{$.i18n.Tr "admin.config.xorm_log_sql"}}
-
+
{{if $.LogSQL}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}
{{else}}
{{$.i18n.Tr "admin.config.disabled_logger"}}
{{end}} diff --git a/templates/admin/emails/list.tmpl b/templates/admin/emails/list.tmpl index 752c01044..87421d258 100644 --- a/templates/admin/emails/list.tmpl +++ b/templates/admin/emails/list.tmpl @@ -52,17 +52,17 @@ {{.Name}} {{.FullName}} - + {{if .IsPrimary}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}< {{if .CanChange}} - + {{if .IsActivated}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} {{else}} - + {{if .IsActivated}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}} {{end}} diff --git a/templates/admin/monitor.tmpl b/templates/admin/monitor.tmpl index 5a38b92ee..272ebff6c 100644 --- a/templates/admin/monitor.tmpl +++ b/templates/admin/monitor.tmpl @@ -86,7 +86,7 @@ {{.Description}} {{DateFmtLong .Start}} {{TimeSince .Start $.Lang}} - + {{svg "octicon-trashcan" 16 "text-red"}} {{end}} @@ -96,7 +96,7 @@