blob: a015860a1ec9cdb39bc09303a2e2c675245ea9ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
<div id="user-post-preview">
{{ if .HasProjects }}
{{ $isSelf := .IsSelf }}
{{ range $article := .Projects }}
<div class="post-preview">
<div class="post-meta">
<a href="/users/{{ $article.User.Username }}"
hx-push-url="/users/{{ $article.User.Username }}"
hx-get="/htmx/users/{{ $article.User.Username }}"
hx-target="#app-body"
>
<img src="{{ $article.User.Image }}" />
</a>
<div class="info">
<a href="/users/{{ $article.User.Username }}"
hx-push-url="/users/{{ $article.User.Username }}"
hx-get="/htmx/users/{{ $article.User.Username }}"
hx-target="#app-body"
class="author"
>
{{ $article.User.Name }}
</a>
<span class="date">{{ $article.GetFormattedCreatedAt }}</span>
</div>
{{ template "users/partials/article-favorite-button" Dict "Project" $article "IsSelf" $isSelf }}
</div>
<a href="/articles/{{ $article.Slug }}"
hx-push-url="/articles/{{ $article.Slug }}"
hx-get="/htmx/articles/{{ $article.Slug }}"
hx-target="#app-body"
class="preview-link"
>
<h1>{{ $article.Title }}</h1>
<p>{{ $article.Description }}</p>
<div class="m-t-1">
<span>Read more...</span>
<ul class="tag-list">
{{ range $tag := $article.Tags }}
<li class="tag-default tag-pill tag-outline">{{ $tag.Name }}</li>
{{ end }}
</ul>
</div>
</a>
</div>
{{ end }}
{{ end }}
{{ if not .HasProjects }}
<div class="post-preview">
<div class="alert alert-warning" role="alert">
No articles are here... yet.
</div>
</div>
{{ end }}
</div>
|