a6b28fa70395b8fcfeb655d444565c5a2a27f4c1
[bloat] / templates / status.tmpl
1 {{with .Data}}
2 <div id="status-{{.ID}}" class="status-container-container">
3         {{if .Reblog}}
4         <div class="retweet-info">
5                 <a class="img-link" href="/user/{{.Account.ID}}">
6                         <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="avatar" />
7                 </a>
8                 <span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>  
9                 <img class="icon" src="{{GetIcon "retweeted" $.Ctx.DarkMode}}" alt="retweeted" />
10                 retweeted
11         </div>
12         {{template "status" (WithContext .Reblog $.Ctx)}}
13         {{else}}
14         {{block "status" (WithContext . $.Ctx)}}
15         {{with $s := .Data}}
16         <div class="status-container status-{{.ID}}" data-id="{{.ID}}">
17                 <div class="status-profile-img-container">
18                         <a class="img-link" href="/user/{{.Account.ID}}">
19                                 <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="avatar" />
20                         </a>
21                 </div>
22                 <div class="status"> 
23                         <div class="status-name">
24                                 <span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span> 
25                                 <a href="/user/{{.Account.ID}}" >
26                                         <span class="status-uname"> {{.Account.Acct}} </span>
27                                 </a>
28                                 <a class="status-visibility">
29                                         {{if eq .Visibility "public"}}
30                                         <img class="icon" src="{{GetIcon "globe" $.Ctx.DarkMode}}" alt="Public" title="Public" />
31                                         {{else if eq .Visibility "unlisted"}}
32                                         <img class="icon" src="{{GetIcon "unlock-alt" $.Ctx.DarkMode}}" alt="Unlisted" title="Unlisted" />
33                                         {{else if eq .Visibility "private"}}
34                                         <img class="icon" src="{{GetIcon "lock" $.Ctx.DarkMode}}" alt="Private" title="Private" />
35                                         {{else if eq .Visibility "direct"}}
36                                         <img class="icon" src="{{GetIcon "envelope" $.Ctx.DarkMode}}" alt="Direct" title="Direct" />
37                                         {{end}}
38                                 </a>
39                                 <a class="remote-link" href="{{.URL}}" target="_blank" title="source">
40                                         <img class="icon" src="{{GetIcon "link" $.Ctx.DarkMode}}" alt="source" />
41                                 </a>
42                         </div>
43                         <div class="status-reply-container">
44                                 {{if .InReplyToID}}
45                                 <div class="status-reply-to">
46                                         <a class="status-reply-to-link" href="{{if not .ShowReplies}}/thread/{{.InReplyToID}}{{end}}#status-{{.InReplyToID}}"> 
47                                                 <img class="icon" src="{{GetIcon "mail-forward" $.Ctx.DarkMode}}" alt="reply to" /> reply to {{.Pleroma.InReplyToAccountAcct}} 
48                                         </a>
49                                 </div>
50                                 {{if index .ReplyMap .ID}} <span class="status-reply-info-divider"> - </span> {{end}}
51                                 {{end}}
52                                 {{if .ShowReplies}}
53                                 {{if index .ReplyMap .ID}} <span class="status-reply-text"> replies: </span> {{end}}
54                                 {{range index .ReplyMap .ID}}
55                                 <div class="status-reply">
56                                         <a class="status-reply-link" href="#status-{{.ID}}">#{{.Number}}</a>
57                                 </div>
58                                 {{end}}
59                                 {{end}}
60                         </div>
61                         <div class="status-content"> {{StatusContentFilter .SpoilerText .Content .Emojis .Mentions}} </div>
62                         <div class="status-media-container">
63                         {{range .MediaAttachments}}
64                         {{if eq .Type "image"}}
65                         <a class="img-link" href="{{.URL}}" target="_blank">
66                                 <img class="status-image" src="{{.URL}}" alt="status-image" />
67                                 {{if (and $.Ctx.MaskNSFW $s.Sensitive)}}
68                                 <div class="status-nsfw-overlay"></div>
69                                 {{end}}
70                         </a>
71                         {{else if eq .Type "audio"}}
72                         <audio class="status-audio" controls preload="none">
73                                 <source src="{{.URL}}">
74                                 <p> Your browser doesn't support HTML5 audio </p>
75                         </audio>
76                         {{else if eq .Type "video"}}
77                         <div class="status-video-container">
78                                 <video class="status-video" controls preload="none">
79                                         <source src="{{.URL}}">
80                                         <p> Your browser doesn't support HTML5 video </p>
81                                 </video>
82                                 {{if (and $.Ctx.MaskNSFW $s.Sensitive)}}
83                                 <div class="status-nsfw-overlay"></div>
84                                 {{end}}
85                         </div>
86                         {{else}}
87                         <a href="{{.URL}}" target="_blank"> attachment </a>
88                         {{end}}
89                         {{end}}
90                         </div>
91                         <div class="status-action-container"> 
92                                 <div class="status-action">
93                                         <a class="status-you" href="/thread/{{.ID}}?reply=true#status-{{.ID}}" title="reply"> 
94                                                 <img class="icon" src="{{GetIcon "reply" $.Ctx.DarkMode}}" alt="reply" />
95                                         </a>
96                                         <a class="status-reply-count" href="/thread/{{.ID}}#status-{{.ID}}" {{if $.Ctx.ThreadInNewTab}}target="_blank"{{end}}>
97                                                 {{DisplayInteractionCount .RepliesCount}}
98                                         </a>
99                                 </div>
100                                 <div class="status-action">
101                                         {{if or (eq .Visibility "private") (eq .Visibility "direct")}}
102                                         <a class="status-retweet" title="this status cannot be retweeted"> 
103                                                 <img class="icon" src="{{GetIcon "retweet" $.Ctx.DarkMode}}" alt="retweet" />
104                                         </a>
105                                         {{else}}
106                                         {{if .Reblogged}}
107                                         <form class="status-retweet" data-action="unretweet" action="/unretweet/{{.ID}}" method="post">
108                                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
109                                                 <input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
110                                                 <input type="image" src="{{GetIcon "retweeted" $.Ctx.DarkMode}}" alt="undo retweet" class="icon" title="undo retweet">
111                                         </form>
112                                         {{else}}
113                                         <form class="status-retweet" data-action="retweet" action="/retweet/{{.ID}}" method="post">
114                                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
115                                                 <input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
116                                                 <input type="image" src="{{GetIcon "retweet" $.Ctx.DarkMode}}" alt="retweet" class="icon" title="retweet">
117                                         </form>
118                                         {{end}}
119                                         {{end}}
120                                         <a class="status-retweet-count" href="/retweetedby/{{.ID}}" title="click to see the the list"> 
121                                                 {{DisplayInteractionCount .ReblogsCount}}
122                                         </a>
123                                 </div>
124                                 <div class="status-action">
125                                         {{if .Favourited}}
126                                         <form class="status-like" data-action="unlike" action="/unlike/{{.ID}}" method="post">
127                                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
128                                                 <input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
129                                                 <input type="image" src="{{GetIcon "liked" $.Ctx.DarkMode}}" alt="unlike" class="icon" title="unlike">
130                                         </form>
131                                         {{else}}
132                                         <form class="status-like" data-action="like" action="/like/{{.ID}}" method="post">
133                                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
134                                                 <input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
135                                                 <input type="image" src="{{GetIcon "star-o" $.Ctx.DarkMode}}" alt="like" class="icon" title="like">
136                                         </form>
137                                         {{end}}
138                                         <a class="status-like-count" href="/likedby/{{.ID}}" title="click to see the the list"> 
139                                                 {{DisplayInteractionCount .FavouritesCount}}
140                                         </a>
141                                 </div>
142                                 <div class="status-action">
143                                         <a class="status-time" href="{{if not .ShowReplies}}/thread/{{.ID}}{{end}}#status-{{.ID}}" {{if $.Ctx.ThreadInNewTab}}target="_blank"{{end}}> 
144                                                 <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}"> {{TimeSince .CreatedAt}} </time> 
145                                         </a>
146                                 </div>
147                         </div>
148                 </div>
149         </div>
150         {{end}}
151         {{end}}
152         {{end}}
153 </div>
154 {{end}}