aboutsummaryrefslogtreecommitdiff
path: root/templates/status.tmpl
blob: 24f9a540d23a3c1015f7ca40ca7fd54f308f505b (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<div id="status-{{if .Reblog}}{{.Reblog.ID}}{{else}}{{.ID}}{{end}}" class="status-container-container">
	{{if .Reblog}}
	<div class="retweet-info">
		<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" />
		<span class="status-dname"> {{WithEmojis .Account.DisplayName .Account.Emojis}} </span>  
		<span class="icon dripicons-retweet retweeted"></span> 
		retweeted
	</div>
	{{template "status" .Reblog}}
	{{else}}
	{{block "status" .}}
	<div class="status-container">
		<div>
			<img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="profile-avatar" />
		</div>
		<div class="status"> 
			<div class="status-name">
				<span class="status-dname"> {{WithEmojis .Account.DisplayName .Account.Emojis}} </span> 
				<span class="status-uname"> {{.Account.Acct}} </span>
			</div>
			<div class="status-content"> {{WithEmojis .Content .Emojis}} </div>
			<div class="status-media-container">
			{{range .MediaAttachments}}
			{{if eq .Type "image"}}
			<a href="{{.URL}}" target="_blank">
				<img class="status-image" src="{{.URL}}" alt="status-image" />
			</a>
			{{else if eq .Type "audio"}}
			<audio class="status-audio" controls preload="none">
				<source src="{{.URL}}">
				<p> Your browser doesn't support HTML5 audio </p>
			</audio>
			{{else if eq .Type "video"}}
			<video class="status-video" controls preload="none">
				<source src="{{.URL}}">
				<p> Your browser doesn't support HTML5 video </p>
			</video>
			{{else}}
			<a href="{{.URL}}" target="_blank"> attachment </a>
			{{end}}
			{{end}}
			</div>
			<div class="status-action"> 
				<a class="status-you" href="/thread/{{.ID}}?reply=true#status-{{.ID}}" title="reply"> 
					<span class="icon dripicons-reply"></span> 
					<span> {{DisplayInteractionCount .RepliesCount}} </span>
				</a>
				{{if .Reblogged}}
				<a class="status-retweet" href="/unretweet/{{.ID}}" title="undo repost"> 
					<span class="icon dripicons-retweet retweeted"></span> 
					<span> {{DisplayInteractionCount .ReblogsCount}} </span>
				</a>
				{{else}}
				<a class="status-retweet" href="/retweet/{{.ID}}" title="repost"> 
					<span class="icon dripicons-retweet"></span> 
					<span> {{DisplayInteractionCount .ReblogsCount}} </span>
				</a>
				{{end}}
				{{if .Favourited}}
				<a class="status-like" href="/unlike/{{.ID}}" title="unlike"> 
					<span class="icon dripicons-star liked"></span> 
					<span> {{DisplayInteractionCount .FavouritesCount}} </span>
				</a>
				{{else}}
				<a class="status-like" href="/like/{{.ID}}" title="like"> 
					<span class="icon dripicons-star"></span> 
					<span> {{DisplayInteractionCount .FavouritesCount}} </span>
				</a>
				{{end}}
				<a class="status-time" href="/thread/{{.ID}}#status-{{.ID}}"> 
					<time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{.CreatedAt}}"> {{TimeSince .CreatedAt}} </time> 
				</a>
			</div>
		</div>
	</div>
	{{end}}
	{{end}}
</div>