Skip to content

Commit

Permalink
Fix dashboard repolist alignment and repolisting (go-gitea#17355)
Browse files Browse the repository at this point in the history
Unfortunately go-gitea#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 <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
  • Loading branch information
2 people authored and Stelios Malathouras committed Mar 28, 2022
1 parent be7bc37 commit 7c0ffdd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions routers/web/user/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,14 @@ func Dashboard(ctx *context.Context) {
ctx.Data["PageIsDashboard"] = true
ctx.Data["PageIsNews"] = true

var uid int64
if ctxUser != nil {
uid = ctxUser.ID
}

ctx.PageData["dashboardRepoList"] = map[string]interface{}{
"searchLimit": setting.UI.User.RepoPagingNum,
"uid": uid,
}

if setting.Service.EnableUserHeatmap {
Expand Down
3 changes: 2 additions & 1 deletion templates/user/dashboard/repolist.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<repo-search
:search-limit="searchLimit"
:sub-url="subUrl"
:uid="uid"
{{if .Team}}
:team-id="{{.Team.ID}}"
{{end}}
Expand Down Expand Up @@ -95,7 +96,7 @@
</div>
</div>
</div>
<div class="ui secondary tiny pointing borderless menu center aligned grid repos-filter">
<div class="ui secondary tiny pointing borderless menu center grid repos-filter">
<a class="item" :class="{active: reposFilter === 'all'}" @click="changeReposFilter('all')">
{{.i18n.Tr "all"}}
<div v-show="reposFilter === 'all'" class="ui circular mini grey label">${repoTypeCount}</div>
Expand Down
1 change: 1 addition & 0 deletions web_src/js/components/DashboardRepoList.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ export function initDashboardRepoList() {
return {
searchLimit: dashboardRepoListData.searchLimit || 0,
subUrl: AppSubUrl,
uid: dashboardRepoListData.uid || 0,
};
},
});
Expand Down
7 changes: 7 additions & 0 deletions web_src/less/_base.less
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,13 @@ footer {
margin-top: 0 !important;
border-bottom-width: 0 !important;
margin-bottom: 2px !important;
justify-content: space-evenly;

}

.ui.secondary.pointing.menu.repos-filter .item {
padding-left: 4.5px;
padding-right: 4.5px;
}

.repo-title {
Expand Down

0 comments on commit 7c0ffdd

Please sign in to comment.