From 723527cbb64873260d58bf07bd2efbc9fab28b94 Mon Sep 17 00:00:00 2001 From: palytoxin Date: Fri, 14 Aug 2020 17:13:56 +0800 Subject: [PATCH] fix #25 --- options/locale/locale_en-US.ini | 1 + options/locale/locale_zh-CN.ini | 1 + routers/home.go | 6 ++++++ routers/routes/routes.go | 1 + templates/base/head_navbar.tmpl | 4 ++++ 5 files changed, 13 insertions(+) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index f8ae20440..221de16b8 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -59,6 +59,7 @@ manage_org = Manage Organizations admin_panel = Site Administration account_settings = Account Settings settings = Settings +your_dashboard = Dashboard your_profile = Profile your_starred = Starred your_settings = Settings diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 5f4dbf949..2fa110795 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -59,6 +59,7 @@ manage_org=管理我的组织 admin_panel=管理后台 account_settings=帐户设置 settings=帐户设置 +your_dashboard=个人概览 your_profile=个人信息 your_starred=已点赞 your_settings=设置 diff --git a/routers/home.go b/routers/home.go index f97e3bf10..9ff860c09 100755 --- a/routers/home.go +++ b/routers/home.go @@ -37,6 +37,12 @@ const ( // Home render home page func Home(ctx *context.Context) { + ctx.Data["PageIsHome"] = true + ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled + ctx.HTML(200, tplHome) +} + +func Dashboard(ctx *context.Context) { if ctx.IsSigned { if !ctx.User.IsActive && setting.Service.RegisterEmailConfirm { ctx.Data["Title"] = ctx.Tr("auth.active_your_account") diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 8d8fa0c21..ce9ac4fbe 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -285,6 +285,7 @@ func RegisterRoutes(m *macaron.Macaron) { return "" }) m.Get("/", routers.Home) + m.Get("/dashboard", routers.Dashboard) m.Group("/explore", func() { m.Get("", func(ctx *context.Context) { ctx.Redirect(setting.AppSubURL + "/explore/repos") diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index db9e26a12..8e1055a72 100644 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -128,6 +128,10 @@
+ + {{svg "octicon-info" 16}} + {{.i18n.Tr "your_dashboard"}} + {{svg "octicon-person" 16}} {{.i18n.Tr "your_profile"}}