AnthoLume/templates/components/document-card.tmpl

51 lines
1.6 KiB
Cheetah
Raw Permalink Normal View History

2024-05-26 00:04:26 +00:00
<div class="w-full relative">
2024-06-16 21:11:03 +00:00
<div
class="flex gap-4 w-full h-full p-4 shadow-lg bg-white dark:bg-gray-700 rounded"
>
2024-05-26 00:04:26 +00:00
<div class="min-w-fit my-auto h-48 relative">
2024-06-16 21:11:03 +00:00
<a href="./documents/{{ .ID }}">
<img
class="rounded object-cover h-full"
src="./documents/{{ .ID }}/cover"
/>
2024-05-26 00:04:26 +00:00
</a>
</div>
<div class="flex flex-col justify-around dark:text-white w-full text-sm">
<div class="inline-flex shrink-0 items-center">
<div>
<p class="text-gray-400">Title</p>
<p class="font-medium">{{ or .Title "Unknown" }}</p>
</div>
</div>
<div class="inline-flex shrink-0 items-center">
<div>
<p class="text-gray-400">Author</p>
<p class="font-medium">{{ or .Author "Unknown" }}</p>
</div>
</div>
<div class="inline-flex shrink-0 items-center">
<div>
<p class="text-gray-400">Progress</p>
<p class="font-medium">{{ .Percentage }}%</p>
</div>
</div>
<div class="inline-flex shrink-0 items-center">
<div>
<p class="text-gray-400">Time Read</p>
<p class="font-medium">{{ niceSeconds .TotalTimeSeconds }}</p>
</div>
</div>
</div>
2024-06-16 21:11:03 +00:00
<div
class="absolute flex flex-col gap-2 right-4 bottom-4 text-gray-500 dark:text-gray-400"
>
2024-05-26 00:04:26 +00:00
<a href="./activity?document={{ .ID }}">{{ template "svg/activity" }}</a>
{{ if .Filepath }}
2024-06-16 21:11:03 +00:00
<a href="./documents/{{ .ID }}/file">{{ template "svg/download" }}</a>
{{ else }}
{{ template "svg/download" (dict "Disabled" true) }}
2024-05-26 00:04:26 +00:00
{{ end }}
</div>
</div>
</div>