From 892fc82a2036374518052e985c07db4555944630 Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Thu, 28 Mar 2024 18:23:57 +0500 Subject: [PATCH] Fix New issue button consistency Fixes https://codeberg.org/forgejo/forgejo/issues/2613 Based on https://codeberg.org/forgejo/forgejo/issues/2613#issuecomment-1654709 - add new class `list-header-issues`; - add rules that fix button position; - use variable to keep the vertical offset constant; - fix gap for edit button. Co-authored-by: Gusted --- templates/repo/issue/list.tmpl | 2 +- templates/repo/issue/view_title.tmpl | 2 +- web_src/css/base.css | 1 + web_src/css/repo.css | 8 ++++++-- web_src/css/repo/issue-list.css | 8 ++++++++ 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index 30edf825f1..1654cd2c90 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -14,7 +14,7 @@ {{end}} -
+
{{template "repo/issue/navbar" .}} {{template "repo/issue/search" .}} {{if not .Repository.IsArchived}} diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index 5c95018cdb..3a5ba0f4a3 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -14,7 +14,7 @@
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}} - + {{end}} {{if not .Issue.IsPull}} {{ctx.Locale.Tr "repo.issues.new"}} diff --git a/web_src/css/base.css b/web_src/css/base.css index a63a3ddde5..05ab0255e8 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -21,6 +21,7 @@ --border-radius-circle: 50%; --opacity-disabled: 0.55; --height-loading: 16rem; + --repo-header-issue-min-height: 41px; --min-height-textarea: 132px; /* padding + 6 lines + border = calc(1.57142em + 6lh + 2px), but lh is not fully supported */ --tab-size: 4; } diff --git a/web_src/css/repo.css b/web_src/css/repo.css index d28dc4b96d..3d867fcf14 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -569,6 +569,10 @@ display: flex; } +.issue-title-buttons { + gap: 0.5rem; +} + @media (max-width: 767.98px) { .repository.view.issue .issue-title { flex-direction: column; @@ -611,7 +615,7 @@ line-height: 40px; margin: 0; padding-right: 0.25rem; - min-height: 41px; /* avoid layout shift on edit */ + min-height: var(--repo-header-issue-min-height); } .repository.view.issue .issue-title h1 .ui.input { @@ -2180,7 +2184,7 @@ margin: 0 !important; position: relative; color: var(--color-text); - min-height: 41px; + min-height: var(--repo-header-issue-min-height); background-color: var(--color-box-header); display: flex; justify-content: space-between; diff --git a/web_src/css/repo/issue-list.css b/web_src/css/repo/issue-list.css index 6c3755fa49..e46ffeb4f0 100644 --- a/web_src/css/repo/issue-list.css +++ b/web_src/css/repo/issue-list.css @@ -16,6 +16,14 @@ flex-wrap: wrap; } +.issue-list-new.button { + margin-right: 0; +} + +.list-header-issues { + min-height: var(--repo-header-issue-min-height); +} + @media (max-width: 767.98px) { .issue-list-navbar { order: 0;