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