Skip to content

Commit 88a4a4e

Browse files
author
Gusted
committed
Fix dashboard switching on Mobile (go-gitea#20238)
- Backport go-gitea#20238 - 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 go-gitea#19978). - 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. - See original PR for screenshots.
1 parent 35fd55c commit 88a4a4e

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

templates/user/dashboard/navbar.tmpl

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -75,32 +75,30 @@
7575
{{end}}
7676

7777
{{if .ContextUser.IsOrganization}}
78-
<div class="right stackable menu">
79-
<a class="{{if .PageIsNews}}active{{end}} item" style="margin-left: auto" href="{{.ContextUser.DashboardLink}}{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
80-
{{svg "octicon-rss"}}&nbsp;{{.i18n.Tr "activities"}}
81-
</a>
82-
{{if not .UnitIssuesGlobalDisabled}}
83-
<a class="{{if .PageIsIssues}}active{{end}} item" href="{{.ContextUser.OrganisationLink}}/issues{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
84-
{{svg "octicon-issue-opened"}}&nbsp;{{.i18n.Tr "issues"}}
85-
</a>
86-
{{end}}
78+
<a class="{{if .PageIsNews}}active{{end}} item" style="margin-left: auto" href="{{.ContextUser.DashboardLink}}{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
79+
{{svg "octicon-rss"}}&nbsp;{{.i18n.Tr "activities"}}
80+
</a>
81+
{{if not .UnitIssuesGlobalDisabled}}
82+
<a class="{{if .PageIsIssues}}active{{end}} item" href="{{.ContextUser.OrganisationLink}}/issues{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
83+
{{svg "octicon-issue-opened"}}&nbsp;{{.i18n.Tr "issues"}}
84+
</a>
85+
{{end}}
8786
{{if not .UnitPullsGlobalDisabled}}
88-
<a class="{{if .PageIsPulls}}active{{end}} item" href="{{.ContextUser.OrganisationLink}}/pulls{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
89-
{{svg "octicon-git-pull-request"}}&nbsp;{{.i18n.Tr "pull_requests"}}
90-
</a>
91-
{{end}}
92-
{{if and .ShowMilestonesDashboardPage (not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled))}}
93-
<a class="{{if .PageIsMilestonesDashboard}}active{{end}} item" href="{{.ContextUser.OrganisationLink}}/milestones{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
94-
{{svg "octicon-milestone"}}&nbsp;{{.i18n.Tr "milestones"}}
87+
<a class="{{if .PageIsPulls}}active{{end}} item" href="{{.ContextUser.OrganisationLink}}/pulls{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
88+
{{svg "octicon-git-pull-request"}}&nbsp;{{.i18n.Tr "pull_requests"}}
89+
</a>
90+
{{end}}
91+
{{if and .ShowMilestonesDashboardPage (not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled))}}
92+
<a class="{{if .PageIsMilestonesDashboard}}active{{end}} item" href="{{.ContextUser.OrganisationLink}}/milestones{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
93+
{{svg "octicon-milestone"}}&nbsp;{{.i18n.Tr "milestones"}}
94+
</a>
95+
{{end}}
96+
<div class="item">
97+
<a class="ui primary basic button" href="{{.ContextUser.HomeLink}}" title='{{.i18n.Tr "home.view_home" .ContextUser.Name}}'>
98+
{{.i18n.Tr "home.view_home" (.ContextUser.ShortName 40)}}
9599
</a>
96-
{{end}}
97-
<div class="item">
98-
<a class="ui primary basic button" href="{{.ContextUser.HomeLink}}" title='{{.i18n.Tr "home.view_home" .ContextUser.Name}}'>
99-
{{.i18n.Tr "home.view_home" (.ContextUser.ShortName 40)}}
100-
</a>
101100
</div>
102-
</div>
103-
{{end}}
101+
{{end}}
104102
</div>
105103
</div>
106104
<div class="ui divider"></div>

web_src/less/_base.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2194,7 +2194,7 @@ table th[data-sortt-desc] {
21942194
.ui.stackable.menu:not(.no-vertical-tabs) {
21952195
overflow-y: hidden;
21962196
overflow-x: auto;
2197-
flex-direction: row;
2197+
flex-direction: row !important;
21982198
flex-wrap: nowrap !important;
21992199

22002200
.item {

web_src/less/_dashboard.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@
8181

8282
.ui.dropdown {
8383
max-width: 100%;
84+
85+
@media @mediaSm {
86+
> .menu:not(.hidden) {
87+
position: inherit;
88+
}
89+
}
8490
}
8591
}
8692
}

0 commit comments

Comments
 (0)