view.html.twig 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {% extends 'stdgrid.html.twig' %}
  2. {% import '/cards/note/view.html.twig' as noteView %}
  3. {% set nickname = nickname|escape %}
  4. {% block title %}{{ nickname }}{% endblock %}
  5. {% block stylesheets %}
  6. {{ parent() }}
  7. <link rel="stylesheet" href="{{ asset('assets/default_theme/css/pages/feeds.css') }}" type="text/css">
  8. {% endblock stylesheets %}
  9. {% block body %}
  10. {% if actor is defined and actor is not null %}
  11. {% block profile_view %}
  12. {% include 'cards/profile/view.html.twig' with { 'actor': actor } only %}
  13. {% endblock profile_view %}
  14. {% if notes is defined %}
  15. <article>
  16. <header class="feed-header">
  17. {% if page_title is defined %}
  18. <h1 class="heading-no-margin">{{ page_title | trans }}</h1>
  19. {% else %}
  20. <h1 class="heading-no-margin">{{ 'Notes' | trans }}</h1>
  21. {% endif %}
  22. <nav class="feed-actions">
  23. <details class="feed-actions-details">
  24. <summary>
  25. {{ icon('filter', 'icon icon-feed-actions') | raw }} {# button-container #}
  26. </summary>
  27. <div class="feed-actions-details-dropdown">
  28. <menu>
  29. {% for block in handle_event('AddFeedActions', app.request, notes is defined and notes is not empty) %}
  30. {{ block | raw }}
  31. {% endfor %}
  32. </menu>
  33. </div>
  34. </details>
  35. </nav>
  36. </header>
  37. {% if notes is not empty %}
  38. {# Backwards compatibility with hAtom 0.1 #}
  39. <section class="feed h-feed hfeed notes" tabindex="0" role="feed">
  40. {% for conversation in notes %}
  41. {% block current_note %}
  42. {% if conversation is instanceof('array') %}
  43. {{ noteView.macro_note(conversation['note'], conversation['replies']) }}
  44. {% else %}
  45. {{ noteView.macro_note(conversation) }}
  46. {% endif %}
  47. <hr tabindex="0" title="{{ 'End of note and replies.' | trans }}">
  48. {% endblock current_note %}
  49. {% endfor %}
  50. </section>
  51. {% else %}
  52. <section class="feed h-feed hfeed notes" tabindex="0" role="feed">
  53. <strong>{% trans %}No notes yet...{% endtrans %}</strong>
  54. </section>
  55. {% endif %}
  56. </article>
  57. {% endif %}
  58. {% endif %}
  59. {% endblock body %}