gitea源码

repolist.tmpl 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <script type="module">
  2. const data = {
  3. ...window.config.pageData.dashboardRepoList, // it only contains searchLimit and uid
  4. isMirrorsEnabled: {{.MirrorsEnabled}},
  5. isStarsEnabled: {{not .IsDisableStars}},
  6. canCreateMigrations: {{not .DisableMigrations}},
  7. textNoOrg: {{ctx.Locale.Tr "home.empty_org"}},
  8. textNoRepo: {{ctx.Locale.Tr "home.empty_repo"}},
  9. textRepository: {{ctx.Locale.Tr "repository"}},
  10. textOrganization: {{ctx.Locale.Tr "organization"}},
  11. textMyRepos: {{ctx.Locale.Tr "home.my_repos"}},
  12. textNewRepo: {{ctx.Locale.Tr "new_repo"}},
  13. textSearchRepos: {{ctx.Locale.Tr "search.repo_kind"}},
  14. textFilter: {{ctx.Locale.Tr "home.filter"}},
  15. textShowArchived: {{ctx.Locale.Tr "home.show_archived"}},
  16. textShowPrivate: {{ctx.Locale.Tr "home.show_private"}},
  17. textShowBothArchivedUnarchived: {{ctx.Locale.Tr "home.show_both_archived_unarchived"}},
  18. textShowOnlyUnarchived: {{ctx.Locale.Tr "home.show_only_unarchived"}},
  19. textShowOnlyArchived: {{ctx.Locale.Tr "home.show_only_archived"}},
  20. textShowBothPrivatePublic: {{ctx.Locale.Tr "home.show_both_private_public"}},
  21. textShowOnlyPublic: {{ctx.Locale.Tr "home.show_only_public"}},
  22. textShowOnlyPrivate: {{ctx.Locale.Tr "home.show_only_private"}},
  23. textAll: {{ctx.Locale.Tr "all"}},
  24. textSources: {{ctx.Locale.Tr "sources"}},
  25. textForks: {{ctx.Locale.Tr "forks"}},
  26. textMirrors: {{ctx.Locale.Tr "mirrors"}},
  27. textCollaborative: {{ctx.Locale.Tr "collaborative"}},
  28. textFirstPage: {{ctx.Locale.Tr "admin.first_page"}},
  29. textPreviousPage: {{ctx.Locale.Tr "repo.issues.previous"}},
  30. textNextPage: {{ctx.Locale.Tr "repo.issues.next"}},
  31. textLastPage: {{ctx.Locale.Tr "admin.last_page"}},
  32. textMyOrgs: {{ctx.Locale.Tr "home.my_orgs"}},
  33. textNewOrg: {{ctx.Locale.Tr "new_org"}},
  34. textOrgVisibilityLimited: {{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}},
  35. textOrgVisibilityPrivate: {{ctx.Locale.Tr "org.settings.visibility.private_shortname"}},
  36. };
  37. {{if .Team}}
  38. data.teamId = {{.Team.ID}};
  39. {{end}}
  40. {{if not .ContextUser.IsOrganization}}
  41. data.organizations = [{{range .Orgs}}{'name': {{.Name}}, 'full_name': {{.FullName}}, 'num_repos': {{.NumRepos}}, 'org_visibility': {{.Visibility}}},{{end}}];
  42. data.isOrganization = false;
  43. data.organizationsTotalCount = {{.UserOrgsCount}};
  44. data.canCreateOrganization = {{.SignedUser.CanCreateOrganization}};
  45. {{else}}
  46. data.organizationId = {{.ContextUser.ID}};
  47. {{end}}
  48. window.config.pageData.dashboardRepoList = data;
  49. </script>
  50. <div id="dashboard-repo-list" class="flex-container-sidebar"></div>