c4f2e5f41f6d4f706a1e7224fc40cd15da12845a
[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}}" target="main">
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                 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}}" target="main">
18                                 <img class="status-profile-img" src="{{.Account.AvatarStatic}}" alt="avatar" />
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}}"  target="main">
25                                         <span class="status-uname"> {{.Account.Acct}} </span>
26                                 </a>
27                                 <div class="more-container">
28                                         <div class="remote-link">
29                                                 {{.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">
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">
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">
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}}" target="main"> 
59                                                  reply to {{.Pleroma.InReplyToAccountAcct}} 
60                                         </a>
61                                 </div>
62                                 {{if index .ReplyMap .ID}} <span class="status-reply-info-divider"> - </span> {{end}}
63                                 {{end}}
64                                 {{if .ShowReplies}}
65                                 {{if index .ReplyMap .ID}} <span class="status-reply-text"> replies: </span> {{end}}
66                                 {{range index .ReplyMap .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                                 {{if eq .Type "image"}}
79                                 <a class="img-link" href="{{.URL}}" target="_blank">
80                                         <img class="status-image" src="{{.URL}}" alt="status-image" />
81                                         {{if (and $.Ctx.MaskNSFW $s.Sensitive)}}
82                                         <div class="status-nsfw-overlay"></div>
83                                         {{end}}
84                                 </a>
85                                 {{else if eq .Type "audio"}}
86                                 <audio class="status-audio" controls preload="none">
87                                         <source src="{{.URL}}">
88                                         <p> Your browser doesn't support HTML5 audio </p>
89                                 </audio>
90                                 {{else if eq .Type "video"}}
91                                 <div class="status-video-container">
92                                         <video class="status-video" controls preload="none">
93                                                 <source src="{{.URL}}">
94                                                 <p> Your browser doesn't support HTML5 video </p>
95                                         </video>
96                                         {{if (and $.Ctx.MaskNSFW $s.Sensitive)}}
97                                         <div class="status-nsfw-overlay"></div>
98                                         {{end}}
99                                 </div>
100                                 {{else}}
101                                 <a href="{{.URL}}" target="_blank"> attachment </a>
102                                 {{end}}
103                                 {{end}}
104                         </div>
105                         {{if .Poll}}
106                         <form class="poll-form" action="/vote/{{.Poll.ID}}" method="POST">
107                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
108                                 <input type="hidden" name="status_id" value="{{$s.ID}}">
109                                 {{range $i, $o := .Poll.Options}}
110                                 <div class="poll-option">
111                                         {{if (or $s.Poll.Expired $s.Poll.Voted)}}
112                                         <div> {{$o.Title}} - {{$o.VotesCount}} votes </div>
113                                         {{else}}
114                                         <input type="{{if $s.Poll.Multiple}}checkbox{{else}}radio{{end}}" name="choices" 
115                                                 id="poll-{{$s.ID}}-{{$i}}" value="{{$i}}">
116                                         <label for="poll-{{$s.ID}}-{{$i}}"> 
117                                                 {{$o.Title}} 
118                                         </label>
119                                         {{end}}
120                                 </div>
121                                 {{end}}
122                                 {{if not (or .Poll.Expired .Poll.Voted)}}
123                                 <button type="submit"> Vote </button>
124                                 {{end}}
125                                 <div class="poll-info">
126                                         <span>{{.Poll.VotesCount}} votes</span>
127                                         {{if .Poll.Expired}}
128                                         <span> - poll expired </span>
129                                         {{else}}
130                                         <span>
131                                                 - poll ends in
132                                                 <time datetime="{{FormatTimeRFC3339 .Poll.ExpiresAt}}" title="{{FormatTimeRFC822 .Poll.ExpiresAt}}"> 
133                                                         {{TimeUntil .Poll.ExpiresAt}} 
134                                                 </time> 
135                                         </span>
136                                         {{end}}
137                                 </div>
138                         </form>
139                         {{end}}
140                         <div class="status-action-container"> 
141                                 <div class="status-action">
142                                         <a href="/thread/{{.ID}}?reply=true#status-{{.ID}}" target="main"> 
143                                                 reply
144                                         </a>
145                                         <a class="status-reply-count" href="/thread/{{.ID}}#status-{{.ID}}" target="{{if $.Ctx.ThreadInNewTab}}_blank{{else}}main{{end}}">
146                                                 {{if .RepliesCount}} ({{DisplayInteractionCount .RepliesCount}}) {{end}}
147                                         </a>
148                                 </div>
149                                 <div class="status-action">
150                                         {{if or (eq .Visibility "private") (eq .Visibility "direct")}}
151                                         <a class="status-retweet" href="" title="this status cannot be retweeted" target="main"> 
152                                                 retweet
153                                         </a>
154                                         {{else}}
155                                         {{if .Reblogged}}
156                                         <form class="status-retweet" data-action="unretweet" action="/unretweet/{{.ID}}" method="post">
157                                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
158                                                 <input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
159                                                 <input type="submit" value="unretweet" class="btn-link">
160                                         </form>
161                                         {{else}}
162                                         <form class="status-retweet" data-action="retweet" action="/retweet/{{.ID}}" method="post">
163                                                 <input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
164                                                 <input type="hidden" name="retweeted_by_id" value="{{.RetweetedByID}}">
165                                                 <input type="submit" value="retweet" class="btn-link">
166                                         </form>
167                                         {{end}}
168                                         {{end}}
169                                         <a class="status-retweet-count" href="/retweetedby/{{.ID}}" title="click to see the the list" target="main"> 
170                                                 {{if .ReblogsCount}} ({{DisplayInteractionCount .ReblogsCount}}) {{end}}
171                                         </a>
172                                 </div>
173                                 <div class="status-action">
174                                         {{if .Favourited}}
175                                         <form class="status-like" data-action="unlike" action="/unlike/{{.ID}}" method="post">
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="unlike" class="btn-link">
179                                         </form>
180                                         {{else}}
181                                         <form class="status-like" data-action="like" action="/like/{{.ID}}" method="post">
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="like" class="btn-link">
185                                         </form>
186                                         {{end}}
187                                         <a class="status-like-count" href="/likedby/{{.ID}}" title="click to see the the list" target="main"> 
188                                                 {{if .FavouritesCount}} ({{DisplayInteractionCount .FavouritesCount}}) {{end}}
189                                         </a>
190                                 </div>
191                                 <div class="status-action">
192                                         <a class="status-time" href="{{if not .ShowReplies}}/thread/{{.ID}}{{end}}#status-{{.ID}}" 
193                                                 target="{{if $.Ctx.ThreadInNewTab}}_blank{{else}}main{{end}}"> 
194                                                 <time datetime="{{FormatTimeRFC3339 .CreatedAt}}" title="{{FormatTimeRFC822 .CreatedAt}}"> 
195                                                         {{TimeSince .CreatedAt}}
196                                                 </time> 
197                                         </a>
198                                 </div>
199                         </div>
200                 </div>
201         </div>
202         {{end}}
203         {{end}}
204         {{end}}
205 </div>
206 {{end}}