view.html.twig 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <div class="note">
  2. <div class="note-info">
  3. {% set nickname = note.getActorNickname() %}
  4. <a href="{{ path('settings_avatar') }}">
  5. <img src="{{ note.getAvatarUrl() }}" alt="{{ nickname }}'s avatar">
  6. </a>
  7. <b>{{ nickname }}</b>
  8. {% set reply_to = note.getReplyToNickname() %}
  9. {% if reply_to is not null and not skip_reply_to is defined %}
  10. {% trans with {'%name%': reply_to}%} in reply to %name% {% endtrans %}
  11. {% endif %}
  12. </div>
  13. <div class="note-content">
  14. {{ note.getContent() }}
  15. <div class="note-attachments">
  16. {% for attachment in note.getAttachments() %}
  17. {% if attachment.mimetype starts with 'image/' %}
  18. <div>
  19. <img src="{{ path('attachment_inline', {'id': attachment.getId()}) }}" alt="{{ attachment.getTitle() }}">
  20. <i> {{ attachment.getTitle() }} </i>
  21. </img>
  22. </div>
  23. {% elseif attachment.mimetype starts with 'video/' %}
  24. <div>
  25. <video src="{{ path('attachment_inline', {'id': attachment.getId()}) }}">
  26. <i> {{ attachment.getTitle() }} </i>
  27. </video>
  28. </div>
  29. {% else %}
  30. <div>
  31. <i> {{ attachment.getTitle() }} </i>
  32. </div>
  33. {% endif %}
  34. {% endfor %}
  35. </div>
  36. </div>
  37. <div class="note-actions">
  38. {% if have_user %}
  39. {% for act in get_note_actions(note) %}
  40. {{ form(act) }}
  41. {% endfor %}
  42. {% endif %}
  43. </div>
  44. <div class="replies">
  45. {% for reply in note.getReplies() %}
  46. {% include '/note/view.html.twig' with {'note': reply, 'skip_reply_to': true, 'have_user': have_user} only %}
  47. {% endfor %}
  48. </div>
  49. </div>