{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings applications")}}

{{ctx.Locale.Tr "settings.generate_new_token"}}

{{ctx.Locale.Tr "settings.access_token.resource_all_help"}}

{{ctx.Locale.Tr "settings.access_token.resource_public_only_help"}} {{if $.IsAdmin}}{{ctx.Locale.Tr "settings.access_token.admin_disabled"}}{{end}}

{{ctx.Locale.Tr "settings.access_token.resource_specific_repo_help"}} {{if $.IsAdmin}}{{ctx.Locale.Tr "settings.access_token.admin_disabled"}}{{end}}

{{ctx.Locale.Tr "settings.access_token.available_repositories"}}
{{svg "octicon-search" 16}}
{{if eq (len .Repos) 0}} {{ctx.Locale.Tr "settings.access_token.no_repositories_found"}} {{else}}
{{range .Repos}} {{template "user/settings/repo_icon" .}}
{{.FullName}}
{{end}}
{{end}} {{/* Can't use base/paginate template include here because all the pagination links in that template are simple links. Here, we need to turn them into form buttons so that we can submit the current form. If a user just changed a value (eg. set the token name, changed a selected permission) and then clicked a pagination button, the new value that they changed needs to be submitted. base/paginate would allow preserving old values from before the change, but not new updates. Implementing here also allows the use of smaller styling. */}} {{with .Page.Paginater}}
{{end}}
{{ctx.Locale.TrPluralString (len .SelectedRepos) "settings.access_token.selected_repositories" (len .SelectedRepos)}}
{{if eq (len .SelectedRepos) 0}}
{{ctx.Locale.Tr "settings.access_token.no_repositories_selected"}}
{{else}}
{{range .SelectedRepos}} {{template "user/settings/repo_icon" .}}
{{.FullName}}
{{end}}
{{end}}

{{ctx.Locale.Tr "settings.access_token_desc" (printf "%s/api/swagger" AppSubUrl) "https://forgejo.org/docs/latest/user/token-scope/"}}

{{range .Categories}}
{{end}}
{{template "user/settings/layout_footer" .}}