status.tmpl 8.8 KB

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