glance/internal/assets/templates/reddit-vertical-cards.html

30 lines
1.3 KiB
HTML
Raw Normal View History

2024-04-27 21:10:24 +02:00
{{ template "widget-base.html" . }}
{{ define "widget-content-classes" }}widget-content-frameless{{ end }}
{{ define "widget-content" }}
<div class="cards-vertical">
{{ range .Posts }}
<div class="widget-content-frame relative">
{{ if ne "" .ThumbnailUrl }}
<div class="reddit-card-thumbnail-container">
<img class="reddit-card-thumbnail" loading="lazy" src="{{ .ThumbnailUrl }}" alt="">
</div>
{{ end }}
<div class="padding-widget relative">
{{ if ne "" .TargetUrl }}
<a class="color-highlight size-h5 text-truncate visited-indicator block" href="{{ .TargetUrl }}" target="_blank" rel="noreferrer">{{ .TargetUrlDomain }}</a>
{{ else }}
<div class="color-highlight size-h5 text-truncate">/r/{{ $.Subreddit }}</div>
{{ end }}
<a href="{{ .DiscussionUrl }}" title="{{ .Title }}" class="text-truncate-3-lines color-primary-if-not-visited margin-top-7" target="_blank" rel="noreferrer">{{ .Title }}</a>
<ul class="list-horizontal-text margin-top-7">
<li {{ dynamicRelativeTimeAttrs .TimePosted }}></li>
2024-04-27 21:10:24 +02:00
<li>{{ .Score | formatNumber }} points</li>
</ul>
</div>
</div>
{{ end }}
</div>
{{ end }}