From 524f1ddd122cc22b748bd11e02a842b268a3c261 Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 5 Jul 2022 04:36:15 +0200 Subject: [PATCH 1/5] Fix dashboard switching on Mobile - This is a regression of improving mobile experience on Gitea, currently organization dashboard aren't readable and the popup won't show up when you want to switch between users/organization(as we saw in - This patch fixes that, by allowing the popup to allocate the required pixels(for some absurd reason, z-index doesn't work on the popup, so it's not able to render over the existing elements, we can investigate later of why this is). And also remove the additional dropdown menu for the pages link, so it's one unified list which then can be displayed as rows. --- templates/user/dashboard/navbar.tmpl | 44 +++++++++++++--------------- web_src/less/_base.less | 2 +- web_src/less/_dashboard.less | 6 ++++ 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/templates/user/dashboard/navbar.tmpl b/templates/user/dashboard/navbar.tmpl index 685c1a58e267b..2116d1f5fb9ba 100644 --- a/templates/user/dashboard/navbar.tmpl +++ b/templates/user/dashboard/navbar.tmpl @@ -75,30 +75,28 @@ {{end}} {{if .ContextUser.IsOrganization}} - diff --git a/web_src/less/_base.less b/web_src/less/_base.less index 78f32956efce1..6c6f6ac2f0519 100644 --- a/web_src/less/_base.less +++ b/web_src/less/_base.less @@ -2194,7 +2194,7 @@ table th[data-sortt-desc] { .ui.stackable.menu:not(.no-vertical-tabs) { overflow-y: hidden; overflow-x: auto; - flex-direction: row; + flex-direction: row !important; flex-wrap: nowrap !important; .item { diff --git a/web_src/less/_dashboard.less b/web_src/less/_dashboard.less index 54cb74b6ee105..1a50f7e9dbc79 100644 --- a/web_src/less/_dashboard.less +++ b/web_src/less/_dashboard.less @@ -81,6 +81,12 @@ .ui.dropdown { max-width: 100%; + + @media @mediaSm { + > .menu:not(.hidden) { + position: inherit; + } + } } } } From ff1fe0d055be66e8ffc70b88615ffe5f344de413 Mon Sep 17 00:00:00 2001 From: Gusted Date: Thu, 7 Jul 2022 01:16:55 +0200 Subject: [PATCH 2/5] Remove uncessary `!important`. --- web_src/less/_base.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/less/_base.less b/web_src/less/_base.less index 6c6f6ac2f0519..78f32956efce1 100644 --- a/web_src/less/_base.less +++ b/web_src/less/_base.less @@ -2194,7 +2194,7 @@ table th[data-sortt-desc] { .ui.stackable.menu:not(.no-vertical-tabs) { overflow-y: hidden; overflow-x: auto; - flex-direction: row !important; + flex-direction: row; flex-wrap: nowrap !important; .item { From 02589de6c56e5ad8669efbbd6524088842349187 Mon Sep 17 00:00:00 2001 From: Gusted Date: Thu, 28 Jul 2022 12:50:48 +0200 Subject: [PATCH 3/5] Use dirty CSS --- templates/user/dashboard/navbar.tmpl | 44 +++++++++++++++------------- web_src/less/_base.less | 4 +++ web_src/less/_dashboard.less | 2 +- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/templates/user/dashboard/navbar.tmpl b/templates/user/dashboard/navbar.tmpl index 2116d1f5fb9ba..26ee6aa5c0867 100644 --- a/templates/user/dashboard/navbar.tmpl +++ b/templates/user/dashboard/navbar.tmpl @@ -75,28 +75,30 @@ {{end}} {{if .ContextUser.IsOrganization}} - - {{svg "octicon-rss"}} {{.locale.Tr "activities"}} - - {{if not .UnitIssuesGlobalDisabled}} - - {{svg "octicon-issue-opened"}} {{.locale.Tr "issues"}} - - {{end}} - {{if not .UnitPullsGlobalDisabled}} - - {{svg "octicon-git-pull-request"}} {{.locale.Tr "pull_requests"}} - - {{end}} - {{if and .ShowMilestonesDashboardPage (not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled))}} - - {{svg "octicon-milestone"}} {{.locale.Tr "milestones"}} - - {{end}} - diff --git a/web_src/less/_base.less b/web_src/less/_base.less index eb55ca8da8d66..0bf46497e3a9a 100644 --- a/web_src/less/_base.less +++ b/web_src/less/_base.less @@ -2206,6 +2206,10 @@ table th[data-sortt-desc] { > .dropdown.item { position: initial; } + + .menu { + flex-direction: row; + } } } diff --git a/web_src/less/_dashboard.less b/web_src/less/_dashboard.less index b990690502f0a..6f0ff0af82551 100644 --- a/web_src/less/_dashboard.less +++ b/web_src/less/_dashboard.less @@ -61,7 +61,7 @@ } } - .right.stackable.menu > .item.active { + .right.menu > .item.active { color: var(--color-red); } } From 07f5952212c9573b099483b21935e7956c001fd0 Mon Sep 17 00:00:00 2001 From: Gusted Date: Thu, 28 Jul 2022 12:58:38 +0200 Subject: [PATCH 4/5] Fix HTML + revert CSS modification --- templates/user/dashboard/navbar.tmpl | 12 ++++++------ web_src/less/_dashboard.less | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/user/dashboard/navbar.tmpl b/templates/user/dashboard/navbar.tmpl index 26ee6aa5c0867..685c1a58e267b 100644 --- a/templates/user/dashboard/navbar.tmpl +++ b/templates/user/dashboard/navbar.tmpl @@ -80,14 +80,14 @@ {{svg "octicon-rss"}} {{.locale.Tr "activities"}} {{if not .UnitIssuesGlobalDisabled}} - - {{svg "octicon-issue-opened"}} {{.locale.Tr "issues"}} - + + {{svg "octicon-issue-opened"}} {{.locale.Tr "issues"}} + {{end}} {{if not .UnitPullsGlobalDisabled}} - - {{svg "octicon-git-pull-request"}} {{.locale.Tr "pull_requests"}} - + + {{svg "octicon-git-pull-request"}} {{.locale.Tr "pull_requests"}} + {{end}} {{if and .ShowMilestonesDashboardPage (not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled))}} diff --git a/web_src/less/_dashboard.less b/web_src/less/_dashboard.less index 6f0ff0af82551..b990690502f0a 100644 --- a/web_src/less/_dashboard.less +++ b/web_src/less/_dashboard.less @@ -61,7 +61,7 @@ } } - .right.menu > .item.active { + .right.stackable.menu > .item.active { color: var(--color-red); } } From 0fdfce51f8b4abbe07b8bd53b1c396a3fcd41a27 Mon Sep 17 00:00:00 2001 From: Gusted Date: Thu, 28 Jul 2022 14:40:04 +0200 Subject: [PATCH 5/5] Tidy up css --- web_src/less/_dashboard.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_src/less/_dashboard.less b/web_src/less/_dashboard.less index b990690502f0a..d37d9ab161025 100644 --- a/web_src/less/_dashboard.less +++ b/web_src/less/_dashboard.less @@ -83,8 +83,8 @@ max-width: 100%; @media @mediaSm { - > .menu:not(.hidden) { - position: inherit; + > .menu { + position: static; } } }