7d510e2b50bbf97bb9f7598fcce91ce0dcf794b8
[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}}" title="{{.Account.Acct}}" alt="avatar" height="24" />
7                 </a>
8                 <span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span>  
9                 retweeted
10         </div>
11         {{template "status" (WithContext .Reblog $.Ctx)}}
12         {{else}}
13         {{block "status" (WithContext . $.Ctx)}}
14         {{with $s := .Data}}
15         <div class="status-container status-{{.ID}}" data-id="{{.ID}}">
16                 <div class="status-profile-img-container">
17                         <a class="img-link" href="/user/{{.Account.ID}}">
18                                 <img class="status-profile-img" src="{{.Account.AvatarStatic}}" title="{{.Account.Acct}}" alt="avatar" height="48" />
19                         </a>
20                 </div>
21                 <div class="status"> 
22                         <div class="status-name">
23                                 <span class="status-dname"> {{EmojiFilter .Account.DisplayName .Account.Emojis}} </span> 
24                                 <a href="/user/{{.Account.ID}}">
25                                         <span class="status-uname"> {{.Account.Acct}} </span>
26                                 </a>
27                                 <div class="more-container">
28                                         <div class="remote-link">
29                                                 {{if .IDNumbers}}#{{index .IDNumbers .ID}}{{end}} {{.Visibility}}
30                                         </div>
31                                         <div class="more-content">
32                                                 <a class="more-link" href="{{.URL}}" target="_blank">
33                                                         source
34                                                 </a>
35                                                 {{if .Muted}}
36                                                 <form action="/unmuteconv/{{.ID}}" method="post" target="_self">
37                                                         <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
38                                                         <input type="submit" value="unmute" class="btn-link more-link">
39                                                 </form>
40                                                 {{else}}
41                                                 <form action="/muteconv/{{.ID}}" method="post" target="_self">
42                                                         <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
43                                                         <input type="submit" value="mute" class="btn-link more-link">
44                                                 </form>
45                                                 {{end}}
46                                                 {{if eq $.Ctx.UserID .Account.ID}}
47                                                 <form action="/delete/{{.ID}}" method="post" target="_self">
48                                                         <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
49                                                         <input type="submit" value="delete" class="btn-link more-link">
50                                                 </form>
51                                                 {{end}}
52                                         </div>
53                                 </div>
54                         </div>
55                         <div class="status-reply-container">
56                                 {{if .InReplyToID}}
57                                 <div class="status-reply-to">
58                                         <a class="status-reply-to-link" href="{{if not .ShowReplies}}/thread/{{.InReplyToID}}{{end}}#status-{{.InReplyToID}}"> 
59                                                  in reply to {{if .IDNumbers}}#{{index .IDNumbers .InReplyToID}}{{end}} {{if .Pleroma.InReplyToAccountAcct}}{{.Pleroma.InReplyToAccountAcct}}{{else if not .IDNumbers}}{{.InReplyToID}}{{end}}
60                                         </a>
61                                 </div>
62                                 {{if index .IDReplies .ID}} <span class="status-reply-info-divider"> - </span> {{end}}
63                                 {{end}}
64                                 {{if .ShowReplies}}
65                                 {{if index .IDReplies .ID}} <span class="status-reply-text"> replies: </span> {{end}}
66                                 {{range index .IDReplies .ID}}
67                                 <div class="status-reply">
68                                         <a class="status-reply-link" href="#status-{{.ID}}">#{{.Number}}</a>
69                                 </div>
70                                 {{end}}
71                                 {{end}}
72                         </div>
73                         {{if .Content}}
74                         <div class="status-content"> {{StatusContentFilter .SpoilerText .Content .Emojis .Mentions}} </div>
75                         {{end}}
76                         <div class="status-media-container">
77                                 {{range .MediaAttachments}}
78
79                                 {{if eq .Type "image"}}
80                                 {{if $.Ctx.HideAttachments}}
81                                 <a href="{{.URL}}" target="_blank" title="{{.Description}}"> [image] </a>
82                                 {{else}}
83                                 <a class="img-link" href="{{.URL}}" target="_blank" title="{{.Description}}">
84                                         <img class="status-image" src="{{.URL}}" alt="status-image" height="240" />
85                                         {{if (and $.Ctx.MaskNSFW $s.Sensitive)}}
86                                         <div class="status-nsfw-overlay"></div>
87                                         {{end}}
88                                 </a>
89                                 {{end}}
90
91                                 {{else if eq .Type "audio"}}
92                                 {{if $.Ctx.HideAttachments}}
93                                 <a href="{{.URL}}" target="_blank" title="{{.Description}}"> [audio] </a>
94                                 {{else}}
95                                 <audio class="status-audio" controls title="{{.Description}}">
96                                         <source src="{{.URL}}">
97                                         <a href="{{.URL}}" target="_blank"> [audio] </a>
98                                 </audio>
99                                 {{end}}
100
101                                 {{else if eq .Type "video"}}
102                                 {{if $.Ctx.HideAttachments}}
103                                 <a href="{{.URL}}" target="_blank" title="{{.Description}}"> [video] </a>
104                                 {{else}}
105                                 <div class="status-video-container" title="{{.Description}}">
106                                         <video class="status-video" controls height="240">
107                                                 <source src="{{.URL}}">
108                                                 <a href="{{.URL}}" target="_blank"> [video] </a>
109                                         </video>
110                                         {{if (and $.Ctx.MaskNSFW $s.Sensitive)}}
111                                         <div class="status-nsfw-overlay"></div>
112                                         {{end}}
113                                 </div>
114                                 {{end}}
115
116                                 {{else}}
117                                 <a href="{{.URL}}" target="_blank" title="{{.Description}}"> [attachment] </a>
118                                 {{end}}
119
120                                 {{end}}
121                         </div>
122                         {{if .Poll}}
123                         <form class="poll-form" action="/vote/{{.Poll.ID}}" method="POST" target="_self">
124                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
125                                 <input type="hidden" name="status_id" value="{{$s.ID}}">
126                                 {{range $i, $o := .Poll.Options}}
127                                 <div class="poll-option">
128                                         {{if (or $s.Poll.Expired $s.Poll.Voted)}}
129                                         <div> {{$o.Title}} - {{$o.VotesCount}} votes </div>
130                                         {{else}}
131                                         <input type="{{if $s.Poll.Multiple}}checkbox{{else}}radio{{end}}" name="choices" 
132                                                 id="poll-{{$s.ID}}-{{$i}}" value="{{$i}}">
133                                         <label for="poll-{{$s.ID}}-{{$i}}"> 
134                                                 {{$o.Title}} 
135                                         </label>
136                                         {{end}}
137                                 </div>
138                                 {{end}}
139                                 {{if not (or .Poll.Expired .Poll.Voted)}}
140                                 <button type="submit"> Vote </button>
141                                 {{end}}
142                                 <div class="poll-info">
143                                         <span>{{.Poll.VotesCount}} votes</span>
144                                         {{if .Poll.Expired}}
145                                         <span> - poll expired </span>
146                                         {{else if .Poll.ExpiresAt}}
147                                         <span>
148                                                 - poll ends in
149                                                 <time datetime="{{FormatTimeRFC3339 .Poll.ExpiresAt}}" title="{{FormatTimeRFC822 .Poll.ExpiresAt}}"> 
150                                                         {{TimeUntil .Poll.ExpiresAt}} 
151                                                 </time> 
152                                         </span>
153                                         {{end}}
154                                 </div>
155                         </form>
156                         {{end}}
157                         <div class="status-action-container"> 
158                                 <div class="status-action">
159                                         <a href="/thread/{{.ID}}?reply=true#status-{{.ID}}"> 
160                                                 reply
161                                         </a>
162                                         <a class="status-reply-count" href="/thread/{{.ID}}#status-{{.ID}}" {{if $.Ctx.ThreadInNewTab}}target="_blank"{{end}}>
163                                                 {{if and (not $.Ctx.AntiDopamineMode) .RepliesCount}}
164                                                         ({{DisplayInteractionCount .RepliesCount}})
165                                                 {{end}}
166                                         </a>
167                                 </div>
168                                 <div class="status-action">
169                                         {{if or (eq .Visibility "private") (eq .Visibility "direct")}}
170                                         <a class="status-retweet" href="" title="this status cannot be retweeted"> 
171                                                 retweet
172                                         </a>
173                                         {{else}}
174                                         {{if .Reblogged}}
175                                         <form class="status-retweet" data-action="unretweet" action="/unretweet/{{.ID}}" method="post" target="_self">
176                                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
177                                                 <input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
178                                                 <input type="submit" value="unretweet" class="btn-link">
179                                         </form>
180                                         {{else}}
181                                         <form class="status-retweet" data-action="retweet" action="/retweet/{{.ID}}" method="post" target="_self">
182                                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
183                                                 <input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
184                                                 <input type="submit" value="retweet" class="btn-link">
185                                         </form>
186                                         {{end}}
187                                         {{end}}
188                                         <a class="status-retweet-count" href="/retweetedby/{{.ID}}" title="click to see the the list"> 
189                                                 {{if and (not $.Ctx.AntiDopamineMode) .ReblogsCount}}
190                                                         ({{DisplayInteractionCount .ReblogsCount}})
191                                                 {{end}}
192                                         </a>
193                                 </div>
194                                 <div class="status-action">
195                                         {{if .Favourited}}
196                                         <form class="status-like" data-action="unlike" action="/unlike/{{.ID}}" method="post" target="_self">
197                                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
198                                                 <input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
199                                                 <input type="submit" value="unlike" class="btn-link">
200                                         </form>
201                                         {{else}}
202                                         <form class="status-like" data-action="like" action="/like/{{.ID}}" method="post" target="_self">
203                                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
204                                                 <input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
205                                                 <input type="submit" value="like" class="btn-link">
206                                         </form>
207                                         {{end}}
208                                         <a class="status-like-count" href="/likedby/{{.ID}}" title="click to see the the list"> 
209                                                 {{if and (not $.Ctx.AntiDopamineMode) .FavouritesCount}}
210                                                         ({{DisplayInteractionCount .FavouritesCount}})
211                                                 {{end}}
212                                         </a>
213                                 </div>
214                                 <div class="status-action status-action-last">
215                                         <a class="status-time" href="{{if not .ShowReplies}}/thread/{{.ID}}{{end}}#status-{{.ID}}"
216                                                 {{if $.Ctx.ThreadInNewTab}}target="_blank"{{end}}> 
217                                                 <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}"> 
218                                                         {{TimeSince .CreatedAt}}
219                                                 </time> 
220                                         </a>
221                                 </div>
222                         </div>
223                 </div>
224         </div>
225         {{end}}
226         {{end}}
227         {{end}}
228 </div>
229 {{end}}