{* SPDX-FileCopyrightText: © 2021 Olivier Meunier SPDX-License-Identifier: AGPL-3.0-only *} {{ extends "./base" }} {{ import "/_libs/forms" }} {{ import "/_libs/list"}} {{ block title() }}{{ gettext("My API Tokens") }}{{ end }} {{ block mainContent() }}

{{ yield title() }}

{{ gettext(`An API Token is a key that grants you access to the Readeck API.`) }}

{{ gettext(`Please read the API Documentation if you plan to use it.`, urlFor("/docs/api"))|raw }}

{{ if len(.Tokens) > 0 }} {{ include "/_libs/pagination" .Pagination }} {{ yield list() content }} {{ range .Tokens }} {{ yield list_item(class="flex gap-2 items-center hfw:bg-gray-100 max-md:block") content }} {{- if .IsEnabled -}} {{ yield icon(name="o-check-on", class="svgicon text-green-700") }} {{- else -}} {{ yield icon(name="o-cross", class="svgicon text-red-700") }} {{- end }} {{ .ID }} · {{ .Application }} {{ gettext("Created on: %s", date(.Created, pgettext("datetime", "%e %B %Y"))) }} {{- if .Expires -}}
{{ gettext("Expires on: %s", date(.Expires, pgettext("datetime", "%e %B %Y"))) }} {{- if .IsExpired() }} · expired{{- end -}} {{- end -}} {{- if .LastUsed -}}
{{ gettext("Last used on: %s", date(.LastUsed, "%c")) }} {{- end -}}
{{- if .IsDeleted -}}
{{ gettext("This token will be removed in a few seconds.") }}
{{- end -}} {{ end }} {{ end }} {{ end }}
{{ include "/_libs/pagination" .Pagination }} {{ end }} {{ end }}