From 3ae6c21bae167d54c90104d81177fd696db6541c Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 16 Mar 2025 10:12:23 +0100 Subject: [PATCH 1/5] Replace text-align classes with tailwind --- templates/admin/dashboard.tmpl | 26 +++++++++---------- templates/org/team/teams.tmpl | 2 +- templates/repo/commit_page.tmpl | 4 +-- templates/repo/commits_list.tmpl | 6 ++--- templates/repo/diff/box.tmpl | 2 +- templates/repo/issue/milestone_issues.tmpl | 2 +- templates/repo/issue/new_form.tmpl | 2 +- .../repo/issue/sidebar/issue_management.tmpl | 2 +- .../repo/issue/sidebar/reviewer_list.tmpl | 2 +- templates/repo/issue/view_content.tmpl | 4 +-- .../view_content/reference_issue_dialog.tmpl | 2 +- templates/repo/migrate/migrating.tmpl | 2 +- templates/repo/settings/options.tmpl | 10 +++---- templates/repo/wiki/new.tmpl | 2 +- templates/repo/wiki/pages.tmpl | 2 +- templates/repo/wiki/revision.tmpl | 2 +- templates/shared/user/block_user_dialog.tmpl | 2 +- templates/shared/user/blocked_users.tmpl | 2 +- web_src/css/base.css | 8 ------ 19 files changed, 38 insertions(+), 46 deletions(-) diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl index af2349d28892e..2426a43b154d9 100644 --- a/templates/admin/dashboard.tmpl +++ b/templates/admin/dashboard.tmpl @@ -15,57 +15,57 @@ {{ctx.Locale.Tr "admin.dashboard.delete_inactive_accounts"}} - + {{ctx.Locale.Tr "admin.dashboard.delete_repo_archives"}} - + {{ctx.Locale.Tr "admin.dashboard.delete_missing_repos"}} - + {{ctx.Locale.Tr "admin.dashboard.git_gc_repos"}} - + {{if and (not .SSH.Disabled) (not .SSH.StartBuiltinServer)}} {{ctx.Locale.Tr "admin.dashboard.resync_all_sshkeys"}} - + {{ctx.Locale.Tr "admin.dashboard.resync_all_sshprincipals"}} - + {{end}} {{ctx.Locale.Tr "admin.dashboard.resync_all_hooks"}} - + {{ctx.Locale.Tr "admin.dashboard.reinit_missing_repos"}} - + {{ctx.Locale.Tr "admin.dashboard.sync_external_users"}} - + {{ctx.Locale.Tr "admin.dashboard.repo_health_check"}} - + {{ctx.Locale.Tr "admin.dashboard.delete_generated_repository_avatars"}} - + {{ctx.Locale.Tr "admin.dashboard.sync_repo_branches"}} - + {{ctx.Locale.Tr "admin.dashboard.sync_repo_tags"}} - + diff --git a/templates/org/team/teams.tmpl b/templates/org/team/teams.tmpl index 53c909ee9c81a..4e3e388cb618e 100644 --- a/templates/org/team/teams.tmpl +++ b/templates/org/team/teams.tmpl @@ -4,7 +4,7 @@
{{template "base/alert" .}} {{if .IsOrganizationOwner}} -
+
diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index 2e3ddeb228938..50d12de241bde 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -83,7 +83,7 @@
-
+
@@ -108,7 +108,7 @@
-
+
diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index dc800d99119b0..169c9f32607fb 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -61,11 +61,11 @@ {{end}} {{if .Committer}} - {{DateUtils.TimeSince .Committer.When}} + {{DateUtils.TimeSince .Committer.When}} {{else}} - {{DateUtils.TimeSince .Author.When}} + {{DateUtils.TimeSince .Author.When}} {{end}} - + {{/* at the moment, wiki doesn't support these "view" links like "view at history point" */}} {{if not $.PageIsWiki}} diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 0770e287fbce0..19f2efecb7774 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -235,7 +235,7 @@ {{template "repo/upload" .}}
{{end}} -
+
diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl index ac5d7f16ddd8e..85068102e6133 100644 --- a/templates/repo/issue/milestone_issues.tmpl +++ b/templates/repo/issue/milestone_issues.tmpl @@ -6,7 +6,7 @@

{{.Milestone.Name}}

{{if not .Repository.IsArchived}} -
+
{{if or .CanWriteIssues .CanWritePulls}} {{if .Milestone.IsClosed}} {{ctx.Locale.Tr "repo.milestones.open"}} diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index 5a923a1602c7e..73cf8c6324ae2 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -33,7 +33,7 @@ {{else}} {{template "repo/issue/comment_tab" .}} {{end}} -
+
{{end}} -
+
-
+
diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 50a41654f3fcc..1a7c0716bc450 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -83,7 +83,7 @@ {{template "repo/issue/comment_tab" .}} {{.CsrfTokenHtml}}
-
+
{{template "repo/clone_panel" .}}
diff --git a/templates/shared/user/block_user_dialog.tmpl b/templates/shared/user/block_user_dialog.tmpl index c6db4ca1e46bb..22d835f55ffe4 100644 --- a/templates/shared/user/block_user_dialog.tmpl +++ b/templates/shared/user/block_user_dialog.tmpl @@ -14,7 +14,7 @@

{{ctx.Locale.Tr "user.block.note.info"}}

-
+
diff --git a/templates/shared/user/blocked_users.tmpl b/templates/shared/user/blocked_users.tmpl index e83a039ef57db..6490044b8a550 100644 --- a/templates/shared/user/blocked_users.tmpl +++ b/templates/shared/user/blocked_users.tmpl @@ -74,7 +74,7 @@

{{ctx.Locale.Tr "user.block.note.info"}}

-
+
diff --git a/web_src/css/base.css b/web_src/css/base.css index 68015e4031daa..47b4f44a66f58 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -580,14 +580,6 @@ img.ui.avatar, box-shadow: 0 6px 18px var(--color-shadow) !important; } -.ui .text.left { - text-align: left !important; -} - -.ui .text.right { - text-align: right !important; -} - .ui .text.truncate { overflow-x: hidden; text-overflow: ellipsis; From 2e5246592cb2689856d6ce070cf8597c2b5358dc Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 16 Mar 2025 11:27:19 +0100 Subject: [PATCH 2/5] remove all left/center/right aligned --- templates/install.tmpl | 2 +- templates/org/team/new.tmpl | 12 ++++---- templates/repo/branch/list.tmpl | 6 ++-- templates/repo/commits_list.tmpl | 8 ++--- templates/repo/issue/choose.tmpl | 12 ++++---- templates/repo/migrate/migrating.tmpl | 6 ++-- templates/repo/pulse.tmpl | 2 +- templates/repo/settings/branches.tmpl | 2 +- templates/repo/settings/lfs.tmpl | 2 +- templates/repo/settings/lfs_locks.tmpl | 2 +- templates/repo/settings/options.tmpl | 4 +-- templates/repo/settings/tags.tmpl | 4 +-- templates/shared/actions/runner_list.tmpl | 2 +- templates/user/auth/grant.tmpl | 2 +- templates/user/auth/grant_error.tmpl | 2 +- templates/user/auth/webauthn.tmpl | 2 +- .../notification_subscriptions.tmpl | 2 +- web_src/css/modules/container.css | 4 --- web_src/css/modules/grid.css | 30 ------------------- web_src/css/modules/segment.css | 7 ----- web_src/css/modules/table.css | 15 ---------- 21 files changed, 36 insertions(+), 92 deletions(-) diff --git a/templates/install.tmpl b/templates/install.tmpl index 6c4cc7df01b0f..058822a6f6b5e 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -1,7 +1,7 @@ {{template "base/head" .}}
-
+

{{ctx.Locale.Tr "install.title"}}

diff --git a/templates/org/team/new.tmpl b/templates/org/team/new.tmpl index 410a3c4b62fb7..b67c18dd7d24b 100644 --- a/templates/org/team/new.tmpl +++ b/templates/org/team/new.tmpl @@ -77,11 +77,11 @@ {{ctx.Locale.Tr "units.unit"}} - {{ctx.Locale.Tr "org.teams.none_access"}} + {{ctx.Locale.Tr "org.teams.none_access"}} {{svg "octicon-question" 16 "tw-ml-1"}} - {{ctx.Locale.Tr "org.teams.read_access"}} + {{ctx.Locale.Tr "org.teams.read_access"}} {{svg "octicon-question" 16 "tw-ml-1"}} - {{ctx.Locale.Tr "org.teams.write_access"}} + {{ctx.Locale.Tr "org.teams.write_access"}} {{svg "octicon-question" 16 "tw-ml-1"}} @@ -97,17 +97,17 @@
- +
- +
- +
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 5d6a8ddf016d5..f4f3c2e5c5af9 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -30,7 +30,7 @@

{{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{ctx.RenderUtils.RenderCommitMessage .DefaultBranchBranch.DBBranch.CommitMessage (.Repository.ComposeMetas ctx)}} · {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DefaultBranchBranch.DBBranch.CommitTime}}{{if .DefaultBranchBranch.DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}

{{/* FIXME: here and below, the tw-overflow-visible is not quite right but it is still needed the moment: to show the important buttons when the width is narrow */}} - + {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} {{/* at the moment, wiki doesn't support these "view" links like "view at history point" */}} {{if not $.PageIsWiki}} diff --git a/templates/repo/issue/choose.tmpl b/templates/repo/issue/choose.tmpl index 38cf9e485f5d0..e3314f4260723 100644 --- a/templates/repo/issue/choose.tmpl +++ b/templates/repo/issue/choose.tmpl @@ -10,11 +10,11 @@ {{range .IssueTemplates}}
-
+
{{.Name}}
{{.About}}
- @@ -23,11 +23,11 @@ {{range .IssueConfig.ContactLinks}}
-
+
{{.Name}}
{{.About}}
- @@ -36,11 +36,11 @@ {{if .IssueConfig.BlankIssuesEnabled}}
-
+
{{ctx.Locale.Tr "repo.issues.choose.blank"}}
{{ctx.Locale.Tr "repo.issues.choose.blank_about"}}
- diff --git a/templates/repo/migrate/migrating.tmpl b/templates/repo/migrate/migrating.tmpl index cbb13cb2e04c3..32146c60d65a2 100644 --- a/templates/repo/migrate/migrating.tmpl +++ b/templates/repo/migrate/migrating.tmpl @@ -7,19 +7,19 @@ {{template "base/alert" .}}
-
+
-
+
-
+

{{ctx.Locale.Tr "repo.migrate.migrating" .CloneAddr}}

diff --git a/templates/repo/pulse.tmpl b/templates/repo/pulse.tmpl index 6a42a0ba48897..12fbb85410e78 100644 --- a/templates/repo/pulse.tmpl +++ b/templates/repo/pulse.tmpl @@ -82,7 +82,7 @@ {{if .Permission.CanRead ctx.Consts.RepoUnitTypeCode}} {{if eq .Activity.Code.CommitCountInAllBranches 0}} -
+

{{ctx.Locale.Tr "repo.activity.no_git_activity"}}

{{end}} diff --git a/templates/repo/settings/branches.tmpl b/templates/repo/settings/branches.tmpl index 57d9f2c5a831c..ef4732540b3f8 100644 --- a/templates/repo/settings/branches.tmpl +++ b/templates/repo/settings/branches.tmpl @@ -56,7 +56,7 @@
{{else}} -
+
{{ctx.Locale.Tr "repo.settings.no_protected_branch"}}
{{end}} diff --git a/templates/repo/settings/lfs.tmpl b/templates/repo/settings/lfs.tmpl index a95bd51c4f1ea..4b46aeed9547a 100644 --- a/templates/repo/settings/lfs.tmpl +++ b/templates/repo/settings/lfs.tmpl @@ -18,7 +18,7 @@ {{FileSize .Size}} {{DateUtils.TimeSince .CreatedUnix}} - + {{ctx.Locale.Tr "repo.settings.lfs_findcommits"}} diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index ea976a4f134e4..064a3b56b1b74 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -117,7 +117,7 @@ {{.PullMirror.RemoteAddress}} {{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}} {{DateUtils.FullTime .PullMirror.UpdatedUnix}} - + {{.CsrfTokenHtml}} @@ -214,7 +214,7 @@ {{if .LastError}}{{ctx.Locale.Tr "error"}}{{end}} - +
diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index 50d12de241bde..ff3dccd5348b9 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -83,7 +83,7 @@
-
+
@@ -108,7 +108,7 @@
-
+
diff --git a/templates/repo/issue/sidebar/issue_management.tmpl b/templates/repo/issue/sidebar/issue_management.tmpl index 5de7543979d1b..b4922ed04ba4e 100644 --- a/templates/repo/issue/sidebar/issue_management.tmpl +++ b/templates/repo/issue/sidebar/issue_management.tmpl @@ -76,7 +76,7 @@
{{end}} -
+
-
+
diff --git a/templates/repo/migrate/migrating.tmpl b/templates/repo/migrate/migrating.tmpl index 32146c60d65a2..8b83816b9b040 100644 --- a/templates/repo/migrate/migrating.tmpl +++ b/templates/repo/migrate/migrating.tmpl @@ -77,7 +77,7 @@
-
+
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index 064a3b56b1b74..aade734a1d790 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -936,7 +936,7 @@
-
+
@@ -967,7 +967,7 @@
-
+
@@ -1004,7 +1004,7 @@
-
+
@@ -1038,7 +1038,7 @@
-
+
@@ -1098,7 +1098,7 @@
-
+
diff --git a/templates/shared/user/block_user_dialog.tmpl b/templates/shared/user/block_user_dialog.tmpl index 22d835f55ffe4..e1fa93994568b 100644 --- a/templates/shared/user/block_user_dialog.tmpl +++ b/templates/shared/user/block_user_dialog.tmpl @@ -14,7 +14,7 @@

{{ctx.Locale.Tr "user.block.note.info"}}

-
+
diff --git a/templates/shared/user/blocked_users.tmpl b/templates/shared/user/blocked_users.tmpl index 6490044b8a550..a4c74c46acb85 100644 --- a/templates/shared/user/blocked_users.tmpl +++ b/templates/shared/user/blocked_users.tmpl @@ -74,7 +74,7 @@

{{ctx.Locale.Tr "user.block.note.info"}}

-
+
From b90fcd3f62777b1e6e03a5b350d7f227d63195fc Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 16 Mar 2025 11:33:30 +0100 Subject: [PATCH 4/5] fix modal actions --- web_src/css/modules/modal.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web_src/css/modules/modal.css b/web_src/css/modules/modal.css index 427d2529c8a7b..ebeaada3fa3b5 100644 --- a/web_src/css/modules/modal.css +++ b/web_src/css/modules/modal.css @@ -63,7 +63,6 @@ These inconsistent layouts should be refactored to simple ones. background: var(--color-secondary-bg); border-color: var(--color-secondary); padding: 1rem; - text-align: right; border-radius: 0 0 var(--border-radius) var(--border-radius); } @@ -72,6 +71,10 @@ These inconsistent layouts should be refactored to simple ones. text-align: right; } +.ui.modal .actions { + text-align: right; +} + /* positive/negative action buttons */ .ui.modal .actions > .ui.button { display: inline-flex; From 6b9c0c0dd42440629daca28eaba0a57b9458f092 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sun, 16 Mar 2025 18:49:26 +0800 Subject: [PATCH 5/5] fix modal align --- templates/devtest/fomantic-modal.tmpl | 10 ++++++++++ web_src/css/modules/modal.css | 6 ++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/templates/devtest/fomantic-modal.tmpl b/templates/devtest/fomantic-modal.tmpl index 2fbe2bd97dcfa..838c6893a4358 100644 --- a/templates/devtest/fomantic-modal.tmpl +++ b/templates/devtest/fomantic-modal.tmpl @@ -49,6 +49,16 @@
+ +