Skip to content

Commit e2a59c5

Browse files
Fix dashboard repolist alignment and repolisting (#17355)
Unfortunately #17301 broke the restriction of the dashboard repolist to the user's repos because it stopped passing in the uid for the current user. This PR restores this. There is also a weird alignment problem - not caused by that PR - where the menu items in the repolist spread over multiple lines. This PR simply reduces the padding on these items and switches the justification of the flex elements to space-evenly. Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1 parent 1f41fcc commit e2a59c5

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

routers/web/user/home.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,14 @@ func Dashboard(ctx *context.Context) {
7272
ctx.Data["PageIsDashboard"] = true
7373
ctx.Data["PageIsNews"] = true
7474

75+
var uid int64
76+
if ctxUser != nil {
77+
uid = ctxUser.ID
78+
}
79+
7580
ctx.PageData["dashboardRepoList"] = map[string]interface{}{
7681
"searchLimit": setting.UI.User.RepoPagingNum,
82+
"uid": uid,
7783
}
7884

7985
if setting.Service.EnableUserHeatmap {

templates/user/dashboard/repolist.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<repo-search
33
:search-limit="searchLimit"
44
:sub-url="subUrl"
5+
:uid="uid"
56
{{if .Team}}
67
:team-id="{{.Team.ID}}"
78
{{end}}
@@ -95,7 +96,7 @@
9596
</div>
9697
</div>
9798
</div>
98-
<div class="ui secondary tiny pointing borderless menu center aligned grid repos-filter">
99+
<div class="ui secondary tiny pointing borderless menu center grid repos-filter">
99100
<a class="item" :class="{active: reposFilter === 'all'}" @click="changeReposFilter('all')">
100101
{{.i18n.Tr "all"}}
101102
<div v-show="reposFilter === 'all'" class="ui circular mini grey label">${repoTypeCount}</div>

web_src/js/components/DashboardRepoList.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ export function initDashboardRepoList() {
362362
return {
363363
searchLimit: dashboardRepoListData.searchLimit || 0,
364364
subUrl: AppSubUrl,
365+
uid: dashboardRepoListData.uid || 0,
365366
};
366367
},
367368
});

web_src/less/_base.less

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,6 +1361,13 @@ footer {
13611361
margin-top: 0 !important;
13621362
border-bottom-width: 0 !important;
13631363
margin-bottom: 2px !important;
1364+
justify-content: space-evenly;
1365+
1366+
}
1367+
1368+
.ui.secondary.pointing.menu.repos-filter .item {
1369+
padding-left: 4.5px;
1370+
padding-right: 4.5px;
13641371
}
13651372

13661373
.repo-title {

0 commit comments

Comments
 (0)