Optimize the dashboard (#32990)

before:

![image](https://github.com/user-attachments/assets/d0b432e4-a521-4540-a489-d18b9c265674)

after:

![image](https://github.com/user-attachments/assets/dbb8b387-d150-41e2-b12b-f9d8450e36d7)
-----

![image](https://github.com/user-attachments/assets/40dcd71e-344b-4043-9811-77227c71aed9)
-----

Optimize the dashboard by adding welcoming messages or quick action
entry points (such as adding a new repository or organization) to ensure
that new users are not greeted by a blank page upon logging in.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Kerwin Bryant 2025-02-11 01:24:34 +08:00 committed by GitHub
parent 72518a8dab
commit 085f273d19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 55 additions and 7 deletions

View file

@ -5,7 +5,11 @@
<div class="flex-container-main">
{{template "base/alert" .}}
{{template "user/heatmap" .}}
{{template "user/dashboard/feeds" .}}
{{if .Feeds}}
{{template "user/dashboard/feeds" .}}
{{else}}
{{template "user/dashboard/guide" .}}
{{end}}
</div>
{{template "user/dashboard/repolist" .}}
</div>

View file

@ -0,0 +1,10 @@
<div class="tw-text-center tw-p-8">
{{svg "octicon-package" 24 "tw-text-placeholder-text"}}
<h3 class="tw-my-4">{{ctx.Locale.Tr "home.guide_title"}}</h3>
<p class="tw-text-placeholder-text">{{ctx.Locale.Tr "home.guide_desc"}}</p>
<div>
<a href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "home.explore_repos"}}</a>
<span>·</span>
<a href="{{AppSubUrl}}/explore/users">{{ctx.Locale.Tr "home.explore_users"}}</a>
</div>
</div>

View file

@ -5,6 +5,10 @@ const data = {
isMirrorsEnabled: {{.MirrorsEnabled}},
isStarsEnabled: {{not .IsDisableStars}},
canCreateMigrations: {{not .DisableMigrations}},
textNoOrg: {{ctx.Locale.Tr "home.empty_org"}},
textNoRepo: {{ctx.Locale.Tr "home.empty_repo"}},
textRepository: {{ctx.Locale.Tr "repository"}},
textOrganization: {{ctx.Locale.Tr "organization"}},
textMyRepos: {{ctx.Locale.Tr "home.my_repos"}},