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