logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

show.html.eex (2484B)


  1. <div>
  2. <div class="p-author h-card">
  3. <a class="u-url" rel="author noopener" href="<%= @author.ap_id %>">
  4. <div class="avatar">
  5. <img src="<%= User.avatar_url(@author) |> MediaProxy.url %>" width="48" height="48" alt="">
  6. </div>
  7. <span class="display-name" style="padding-left: 0.5em;">
  8. <bdi><%= raw (@author.name |> Formatter.emojify(@author.emoji)) %></bdi>
  9. <span class="nickname">@<%= full_nickname(@author) %></span>
  10. </span>
  11. </a>
  12. </div>
  13. <div class="activity-content" >
  14. <%= if status_title(@activity) != "" do %>
  15. <details <%= if open_content?() do %>open<% end %>>
  16. <summary><%= raw status_title(@activity) %></summary>
  17. <div><%= activity_content(@activity) %></div>
  18. </details>
  19. <% else %>
  20. <div><%= activity_content(@activity) %></div>
  21. <% end %>
  22. <%= for %{"name" => name, "url" => [url | _]} <- attachments(@activity) do %>
  23. <div class="attachment">
  24. <%= if sensitive?(@activity) do %>
  25. <details class="nsfw">
  26. <summary onClick="updateHeight()"><%= Gettext.gettext("sensitive media") %></summary>
  27. <div class="nsfw-content">
  28. <%= render("_attachment.html", %{name: name, url: url["href"],
  29. mediaType: fetch_media_type(url)}) %>
  30. </div>
  31. </details>
  32. <% else %>
  33. <%= render("_attachment.html", %{name: name, url: url["href"],
  34. mediaType: fetch_media_type(url)}) %>
  35. <% end %>
  36. </div>
  37. <% end %>
  38. </div>
  39. <dl class="counts pull-right">
  40. <dt><%= Gettext.gettext("replies") %></dt><dd><%= @counts.replies %></dd>
  41. <dt><%= Gettext.gettext("announces") %></dt><dd><%= @counts.announces %></dd>
  42. <dt><%= Gettext.gettext("likes") %></dt><dd><%= @counts.likes %></dd>
  43. </dl>
  44. <p class="date pull-left">
  45. <%= link published(@activity), to: activity_url(@author, @activity) %>
  46. </p>
  47. </div>
  48. <script>
  49. function updateHeight() {
  50. window.requestAnimationFrame(function(){
  51. var height = document.getElementsByTagName('html')[0].scrollHeight;
  52. window.parent.postMessage({
  53. type: 'setHeightPleromaEmbed',
  54. id: window.parentId,
  55. height: height,
  56. }, '*');
  57. })
  58. }
  59. window.addEventListener('message', function(e){
  60. var data = e.data || {};
  61. if (!window.parent || data.type !== 'setHeightPleromaEmbed') {
  62. return;
  63. }
  64. window.parentId = data.id
  65. updateHeight()
  66. });
  67. </script>