diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 2842ad16e7d..bce64a81a3d 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -385,6 +385,13 @@ show_only_public = Showing only public issues.in_your_repos = In your repositories +guide_title = No Activity +guide_desc = You are currently not following any repositories or users, so there is no content to display. You can explore repositories or users of interest from the links below. +explore_repos = Explore repositories +explore_users = Explore users +empty_org = There are no organizations yet. +empty_repo = There are no repositories yet. + [explore] repos = Repositories users = Users diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl index 5dc46dc0a5d..3ce3c1eb733 100644 --- a/templates/user/dashboard/dashboard.tmpl +++ b/templates/user/dashboard/dashboard.tmpl @@ -5,7 +5,11 @@
{{template "base/alert" .}} {{template "user/heatmap" .}} - {{template "user/dashboard/feeds" .}} + {{if .Feeds}} + {{template "user/dashboard/feeds" .}} + {{else}} + {{template "user/dashboard/guide" .}} + {{end}}
{{template "user/dashboard/repolist" .}} diff --git a/templates/user/dashboard/guide.tmpl b/templates/user/dashboard/guide.tmpl new file mode 100644 index 00000000000..bdbe81ece00 --- /dev/null +++ b/templates/user/dashboard/guide.tmpl @@ -0,0 +1,10 @@ +
+ {{svg "octicon-package" 24 "tw-text-placeholder-text"}} +

{{ctx.Locale.Tr "home.guide_title"}}

+

{{ctx.Locale.Tr "home.guide_desc"}}

+
+ {{ctx.Locale.Tr "home.explore_repos"}} + ยท + {{ctx.Locale.Tr "home.explore_users"}} +
+
diff --git a/templates/user/dashboard/repolist.tmpl b/templates/user/dashboard/repolist.tmpl index a2764ba6084..8b0fcbb401c 100644 --- a/templates/user/dashboard/repolist.tmpl +++ b/templates/user/dashboard/repolist.tmpl @@ -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"}}, diff --git a/web_src/js/components/DashboardRepoList.vue b/web_src/js/components/DashboardRepoList.vue index 14b7f0dec85..1840e89144a 100644 --- a/web_src/js/components/DashboardRepoList.vue +++ b/web_src/js/components/DashboardRepoList.vue @@ -113,7 +113,7 @@ export default defineComponent({ this.changeReposFilter(this.reposFilter); fomanticQuery(el.querySelector('.ui.dropdown')).dropdown(); nextTick(() => { - this.$refs.search.focus(); + this.$refs.search?.focus(); }); this.textArchivedFilterTitles = { @@ -243,7 +243,7 @@ export default defineComponent({ if (!this.reposTotalCount) { const totalCountSearchURL = `${this.subUrl}/repo/search?count_only=1&uid=${this.uid}&team_id=${this.teamId}&q=&page=1&mode=`; response = await GET(totalCountSearchURL); - this.reposTotalCount = response.headers.get('X-Total-Count') ?? '?'; + this.reposTotalCount = parseInt(response.headers.get('X-Total-Count') ?? '0'); } response = await GET(searchedURL); @@ -336,7 +336,6 @@ export default defineComponent({ }, }, }); -