{* SPDX-FileCopyrightText: © 2021 Olivier Meunier SPDX-License-Identifier: AGPL-3.0-only *} {{- import "/_libs/common" -}} {{- import "./card_blocks" -}} {{- import "./common" -}} {{- textArch := .IsArchived ? gettext("Remove from archive") : gettext("Move to archive") -}} {{- textFav := .IsMarked ? gettext("Remove from favorites") : gettext("Add to favorites") -}} {{- _url := urlFor(`/bookmarks`, .ID) }} {{- yield card(isDeleted=.IsDeleted, isLoading=!.Loaded) content -}} {{- if !.Loaded -}}
{{- yield card_image(src=urlFor(`/assets/rnd`, checksum(.URL)) + ".svg", width=256, height=160) -}}
{{- yield spinner() -}}

{{ pgettext("bookmark", "Loading") }} {{ .Site }}…

{{- else -}} {{- if .DocumentType == "photo" -}} {{- yield icon(name="o-photo") -}} {{- else if .DocumentType == "video" -}} {{- yield icon(name="o-video") -}} {{- end -}} {{ if isset(.Resources.thumbnail) -}} {{- yield card_image(src=.Resources.thumbnail.Src, width=.Resources.thumbnail.Width, height=.Resources.thumbnail.Height) -}} {{- else -}} {{- yield card_image(src=urlFor(`/assets/rnd`, checksum(.URL)) + ".svg", width=256, height=144) -}} {{- end }} {{- if .ReadProgress > 0 -}}
{{- yield progress_circle(value=.ReadProgress) -}}
{{- end -}}
{{- if isset(.Resources.icon) -}} {{- else -}} {{- yield icon(name="o-circle", class="svgicon text-gray-600") -}} {{- end -}}
{{ shortText(.SiteName, 50) }} {{- if .ReadingTime > 0 -}} • {{npgettext("abbr", "%d min", "%d min", .ReadingTime, .ReadingTime)}} {{- end -}}
{{ if len(.Labels) -}}
    {{- range .Labels -}}
  • {{ . }}
  • {{- end -}}
{{- end }} {{ end -}} {{- if .IsDeleted -}}
{{ gettext("This bookmark will be removed in a few seconds.") }}
{{- else -}}
{{- if .Loaded -}} {{- end -}} {{ yield icon(name="o-link-ext") }}
{{- end -}} {{- end -}}