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