0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-02-21 21:57:30 +01:00
gitea/templates/user/dashboard/repolist.tmpl
Kerwin Bryant 085f273d19
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>
2025-02-11 01:24:34 +08:00

64 lines
2.4 KiB
Handlebars

<script type="module">
const data = {
...window.config.pageData.dashboardRepoList, // it only contains searchLimit and uid
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"}},
textNewRepo: {{ctx.Locale.Tr "new_repo"}},
textSearchRepos: {{ctx.Locale.Tr "search.repo_kind"}},
textFilter: {{ctx.Locale.Tr "home.filter"}},
textShowArchived: {{ctx.Locale.Tr "home.show_archived"}},
textShowPrivate: {{ctx.Locale.Tr "home.show_private"}},
textShowBothArchivedUnarchived: {{ctx.Locale.Tr "home.show_both_archived_unarchived"}},
textShowOnlyUnarchived: {{ctx.Locale.Tr "home.show_only_unarchived"}},
textShowOnlyArchived: {{ctx.Locale.Tr "home.show_only_archived"}},
textShowBothPrivatePublic: {{ctx.Locale.Tr "home.show_both_private_public"}},
textShowOnlyPublic: {{ctx.Locale.Tr "home.show_only_public"}},
textShowOnlyPrivate: {{ctx.Locale.Tr "home.show_only_private"}},
textAll: {{ctx.Locale.Tr "all"}},
textSources: {{ctx.Locale.Tr "sources"}},
textForks: {{ctx.Locale.Tr "forks"}},
textMirrors: {{ctx.Locale.Tr "mirrors"}},
textCollaborative: {{ctx.Locale.Tr "collaborative"}},
textFirstPage: {{ctx.Locale.Tr "admin.first_page"}},
textPreviousPage: {{ctx.Locale.Tr "repo.issues.previous"}},
textNextPage: {{ctx.Locale.Tr "repo.issues.next"}},
textLastPage: {{ctx.Locale.Tr "admin.last_page"}},
textMyOrgs: {{ctx.Locale.Tr "home.my_orgs"}},
textNewOrg: {{ctx.Locale.Tr "new_org"}},
textOrgVisibilityLimited: {{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}},
textOrgVisibilityPrivate: {{ctx.Locale.Tr "org.settings.visibility.private_shortname"}},
};
{{if .Team}}
data.teamId = {{.Team.ID}};
{{end}}
{{if not .ContextUser.IsOrganization}}
data.organizations = [{{range .Orgs}}{'name': {{.Name}}, 'full_name': {{.FullName}}, 'num_repos': {{.NumRepos}}, 'org_visibility': {{.Visibility}}},{{end}}];
data.isOrganization = false;
data.organizationsTotalCount = {{.UserOrgsCount}};
data.canCreateOrganization = {{.SignedUser.CanCreateOrganization}};
{{else}}
data.organizationId = {{.ContextUser.ID}};
{{end}}
window.config.pageData.dashboardRepoList = data;
</script>
<div id="dashboard-repo-list" class="flex-container-sidebar"></div>