view.html.twig 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <div class="h-entry hentry note">
  2. <div class="note-info">
  3. {% set nickname = note.getActorNickname() %}
  4. {# TODO: this should link to the note's user profile? #}
  5. <a class="u-url" href="#">
  6. {# Microformat's h-card properties indicates a face icon is a "u-logo" #}
  7. <img class="u-logo avatar" src="{{ note.getAvatarUrl() }}" alt="{{ nickname }}'s avatar">
  8. <b class="p-nickname">{{ nickname }}</b>
  9. </a>
  10. {% set reply_to = note.getReplyToNickname() %}
  11. {% if reply_to is not null and not skip_reply_to is defined %}
  12. {% trans with {'%name%': reply_to} %} in reply to %name% {% endtrans %}
  13. {% endif %}
  14. <div class="note-actions">
  15. {% if have_user %}
  16. {% for current_action in get_note_actions(note) %}
  17. {{ form_start(current_action) }}
  18. {% if current_action.submit_fav is defined %}
  19. <span title="Favourite this note." class="favourite-button-container">
  20. {{ form_widget(current_action.submit_fav) }}
  21. </span>
  22. {% endif %}
  23. {{ form_end(current_action) }}
  24. {% endfor %}
  25. {% endif %}
  26. </div>
  27. </div>
  28. <div class="e-content entry-content note-content">
  29. {% block markdown %}
  30. {% apply markdown_to_html %}
  31. {{ note.getContent() }}
  32. {% endapply %}
  33. {% endblock %}
  34. {# <div class="note-other-content"> #}
  35. {# {% for other in get_note_other_content(note) %} #}
  36. {# {% include '/'~ other.name ~ '/view.html.twig' with {'vars': other.vars} only %} #}
  37. {# {% endfor %} #}
  38. {# </div> #}
  39. {% if hide_attachments is not defined %}
  40. <div class="note-attachments">
  41. {% for attachment in note.getAttachments() %}
  42. {% include '/attachments/view.html.twig' with {'attachment': attachment, 'note': note} only%}
  43. {% endfor %}
  44. </div>
  45. {% endif %}
  46. <div class="note-links">
  47. {% for link in note.getLinks() %}
  48. {% for block in handle_event('ViewLink', {'link': link, 'note': note}) %}
  49. {{ block | raw }}
  50. {% endfor %}
  51. {% endfor %}
  52. </div>
  53. </div>
  54. {% if replies is defined %}
  55. <div class="u-in-reply-to replies">
  56. {% for conversation in replies %}
  57. {% include '/note/view.html.twig' with {'note': conversation['note'], 'skip_reply_to': true, 'have_user': have_user, 'replies': conversation['replies']} only %}
  58. {% endfor %}
  59. </div>
  60. {% endif %}
  61. </div>
  62. <hr>