aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2025-03-28 20:37:27 +0800
committerGitHub <noreply@github.com>2025-03-28 12:37:27 +0000
commit5d81f6d73f2382e829ed0cb24e6b37f4bd5bdb3d (patch)
tree265fb3d03b7a7fb195c9a46ebc6a34655c2c62ef
parenteee4a752a55a5b0021f14420c60948223ebe8fd2 (diff)
downloadgitea-5d81f6d73f2382e829ed0cb24e6b37f4bd5bdb3d.tar.gz
gitea-5d81f6d73f2382e829ed0cb24e6b37f4bd5bdb3d.zip
Adjust the layout of the toolbar on the Issues/Projects page (#33667) (#34047)
And fix layout for mobile Backport #33667 Fix #33880 --------- Co-authored-by: Kerwin Bryant <kerwin612@qq.com>
-rw-r--r--templates/projects/view.tmpl9
-rw-r--r--templates/repo/issue/list.tmpl5
-rw-r--r--templates/repo/projects/view.tmpl5
-rw-r--r--web_src/css/base.css5
-rw-r--r--web_src/css/features/projects.css12
5 files changed, 15 insertions, 21 deletions
diff --git a/templates/projects/view.tmpl b/templates/projects/view.tmpl
index 82d744bbc2..217ffe6355 100644
--- a/templates/projects/view.tmpl
+++ b/templates/projects/view.tmpl
@@ -1,10 +1,10 @@
{{$canWriteProject := and .CanWriteProjects (or (not .Repository) (not .Repository.IsArchived))}}
<div class="ui container tw-max-w-full">
- <div class="tw-flex tw-justify-between tw-items-center tw-mb-4 tw-gap-3">
- <h2 class="tw-mb-0 tw-flex-1 tw-break-anywhere">{{.Project.Title}}</h2>
- <div class="project-toolbar-right">
- <div class="ui secondary filter menu labels">
+ <div class="flex-text-block tw-flex-wrap tw-mb-4">
+ <h2 class="tw-mb-0">{{.Project.Title}}</h2>
+ <div class="tw-flex-1"></div>
+ <div class="ui secondary menu tw-m-0">
{{$queryLink := QueryBuild "?" "labels" .SelectLabels "assignee" $.AssigneeID "archived_labels" (Iif $.ShowArchivedLabels "true")}}
{{template "repo/issue/filter_item_label" dict "Labels" .Labels "QueryLink" $queryLink "SupportArchivedLabel" true}}
@@ -19,7 +19,6 @@
"TextNegativeOne" (ctx.Locale.Tr "repo.issues.filter_assginee_no_assignee")
}}
</div>
- </div>
{{if $canWriteProject}}
<div class="ui compact mini menu">
<a class="item" href="{{.Link}}/edit?redirect=project">
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl
index 01b610b39d..ee783b420a 100644
--- a/templates/repo/issue/list.tmpl
+++ b/templates/repo/issue/list.tmpl
@@ -14,9 +14,10 @@
</div>
{{end}}
- <div class="list-header">
- {{template "repo/issue/navbar" .}}
+ <div class="list-header flex-text-block">
{{template "repo/issue/search" .}}
+ <a class="ui small button" href="{{.RepoLink}}/labels">{{ctx.Locale.Tr "repo.labels"}}</a>
+ <a class="ui small button" href="{{.RepoLink}}/milestones">{{ctx.Locale.Tr "repo.milestones"}}</a>
{{if not .Repository.IsArchived}}
{{if .PageIsIssueList}}
<a class="ui small primary button issue-list-new" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{ctx.Locale.Tr "repo.issues.new"}}</a>
diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl
index 05ad7264bf..7267a99b1d 100644
--- a/templates/repo/projects/view.tmpl
+++ b/templates/repo/projects/view.tmpl
@@ -2,8 +2,9 @@
<div role="main" aria-label="{{.Title}}" class="page-content repository projects view-project">
{{template "repo/header" .}}
<div class="ui container padded">
- <div class="tw-flex tw-justify-between tw-items-center tw-mb-4">
- {{template "repo/issue/navbar" .}}
+ <div class="flex-text-block tw-justify-end tw-mb-4">
+ <a class="ui small button" href="{{.RepoLink}}/labels">{{ctx.Locale.Tr "repo.labels"}}</a>
+ <a class="ui small button" href="{{.RepoLink}}/milestones">{{ctx.Locale.Tr "repo.milestones"}}</a>
<a class="ui small primary button" href="{{.RepoLink}}/issues/new/choose?project={{.Project.ID}}">{{ctx.Locale.Tr "repo.issues.new"}}</a>
</div>
</div>
diff --git a/web_src/css/base.css b/web_src/css/base.css
index 01eff4ac07..28bb6ce7ad 100644
--- a/web_src/css/base.css
+++ b/web_src/css/base.css
@@ -1384,6 +1384,11 @@ table th[data-sortt-desc] .svg {
min-width: 0;
}
+.flex-text-block > .ui.button,
+.flex-text-inline > .ui.button {
+ margin: 0; /* fomantic buttons have default margin, when we use them in a flex container with gap, we do not need these margins */
+}
+
/* to override Fomantic's default display: block for ".menu .item", and use a slightly larger gap for menu item content
the "!important" is necessary to override Fomantic UI menu item styles, meanwhile we should keep the "hidden" items still hidden */
.ui.dropdown .menu.flex-items-menu > .item:not(.hidden, .filtered, .tw-hidden) {
diff --git a/web_src/css/features/projects.css b/web_src/css/features/projects.css
index 9d462c4c4a..ef3b036217 100644
--- a/web_src/css/features/projects.css
+++ b/web_src/css/features/projects.css
@@ -8,18 +8,6 @@
margin: 0 0.5em;
}
-.project-toolbar-right .filter.menu {
- flex-direction: row;
- flex-wrap: wrap;
-}
-
-@media (max-width: 767.98px) {
- .project-toolbar-right .dropdown .menu {
- left: auto !important;
- right: auto !important;
- }
-}
-
.project-column {
background-color: var(--color-project-column-bg) !important;
border: 1px solid var(--color-secondary) !important;