You are here

activity.html.twig in Open Social 8.6

activity.html.twig Default theme implementation to present Activity data.

This template is used when viewing Activity pages.

Available variables:

  • content: A list of content items. Use 'content' to print all content, or
  • attributes: HTML attributes for the container element.

File

themes/socialbase/templates/activity/activity.html.twig
View source
  1. {#
  2. /**
  3. * @file activity.html.twig
  4. * Default theme implementation to present Activity data.
  5. *
  6. * This template is used when viewing Activity pages.
  7. *
  8. *
  9. * Available variables:
  10. * - content: A list of content items. Use 'content' to print all content, or
  11. * - attributes: HTML attributes for the container element.
  12. *
  13. * @see template_preprocess_activity()
  14. *
  15. * @ingroup themeable
  16. */
  17. #}
  18. {{ attach_library('socialbase/stream') }}
  19. {%
  20. set classes = [
  21. 'media',
  22. post and not published ? 'post-unpublished',
  23. ]
  24. %}
  25. <li class="stream-item">
  26. <i class="stream-icon"></i>
  27. <div class="card card--stream">
  28. <div class="card__block">
  29. <div class="media-wrapper">
  30. <div {{ attributes.addClass(classes) }}>
  31. <div class="media-left avatar">
  32. {% if actor %}
  33. {{- actor -}}
  34. {% endif %}
  35. </div>
  36. <div class="media-body">
  37. <div class="media-heading text-m">
  38. {% if content.field_activity_output_text %}
  39. {{- content.field_activity_output_text -}}
  40. {% endif %}
  41. <div class="post-date">
  42. {{ date }}
  43. {% if visibility_icon and visibility_label %}
  44. <svg class="margin-left-s icon-visibility">
  45. <use xlink:href="#icon-{{ visibility_icon }}"></use>
  46. </svg>
  47. <strong>{{ visibility_label }}</strong>
  48. {% endif %}
  49. {% if post and not published %}
  50. <span class="badge badge-default badge--pill">
  51. {% trans %} unpublished {% endtrans %}
  52. </span>
  53. {% endif %}
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. {% if content.field_activity_entity %}
  59. {{ content.field_activity_entity }}
  60. {% endif %}
  61. </div>
  62. </div>
  63. </div>
  64. </li>