From c7bdf3081634716c525cbc46bdfeaf4364d07edd Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Mon, 18 Oct 2021 20:05:43 +0100 Subject: [PATCH] Fix dashboard repolist alignment and repolisting 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 --- routers/web/user/home.go | 6 ++++++ templates/user/dashboard/repolist.tmpl | 3 ++- web_src/js/components/DashboardRepoList.js | 1 + web_src/less/_base.less | 7 +++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/routers/web/user/home.go b/routers/web/user/home.go index 959b1aa1e9859..af5750e616057 100644 --- a/routers/web/user/home.go +++ b/routers/web/user/home.go @@ -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 { diff --git a/templates/user/dashboard/repolist.tmpl b/templates/user/dashboard/repolist.tmpl index e2cfa76e88328..c02cdecd49dc3 100644 --- a/templates/user/dashboard/repolist.tmpl +++ b/templates/user/dashboard/repolist.tmpl @@ -2,6 +2,7 @@ -