You are here

group--hero.html.twig in Open Social 8.7

Default theme implementation for profiles.

Available variables:

  • content: Items for the content of the profile. Use 'content' to print them all, or print a subset such as 'content.title'. Use the following code to exclude the printing of a given child element:

  {{ content|without('title') }}
  
  • attributes: HTML attributes for the wrapper.
  • profile: The profile object.
  • url: The profile URL.

File

themes/socialbase/templates/group/group--hero.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. *
  5. * Default theme implementation for profiles.
  6. *
  7. * Available variables:
  8. * - content: Items for the content of the profile.
  9. * Use 'content' to print them all, or print a subset such as
  10. * 'content.title'. Use the following code to exclude the
  11. * printing of a given child element:
  12. * @code
  13. * {{ content|without('title') }}
  14. * @endcode
  15. * - attributes: HTML attributes for the wrapper.
  16. * - profile: The profile object.
  17. * - url: The profile URL.
  18. *
  19. * @ingroup themeable
  20. */
  21. #}
  22. {{ attach_library('socialbase/hero')}}
  23. {%
  24. set cover_classes = [
  25. 'cover',
  26. group_hero_styled_image_url ? 'cover-img cover-img-gradient',
  27. ]
  28. %}
  29. {%
  30. set cover_wrap_classes = group_hero_small ? 'cover-wrap small' : 'cover-wrap'
  31. %}
  32. <div{{ attributes.addClass(cover_classes) }} {% if group_hero_styled_image_url %} style="background-image: url('{{ group_hero_styled_image_url }}');" {% endif %}>
  33. <div class="hero__bgimage-overlay"></div>
  34. {% if group_edit_url %}
  35. <div class="hero-action-button">
  36. <a href="{{ group_edit_url }}" title="{% trans %}Edit group{% endtrans %}" class="btn btn-default btn-floating">
  37. <svg class="icon-gray icon-medium">
  38. <use xlink:href="#icon-edit"></use>
  39. </svg>
  40. </a>
  41. </div>
  42. {% endif %}
  43. <div class="{{ cover_wrap_classes }}">
  44. <header class="page-title">
  45. <h1>
  46. {% if closed_group_lock %}
  47. <svg class="icon-white icon-medium">
  48. <use xlink:href="#icon-lock"></use>
  49. </svg>
  50. {% elseif secret_group_shield %}
  51. <svg class="icon-white icon-medium">
  52. <use xlink:href="#icon-shield"></use>
  53. </svg>
  54. {% endif %}
  55. <span>{{ title }}</span></h1>
  56. {% if group_type %}
  57. <span>{{ group_type }}</span>
  58. {% endif %}
  59. {% if group_settings_help %}
  60. <span>
  61. {{ group_settings_help }}
  62. </span>
  63. {% endif %}
  64. &bullet;
  65. <span>
  66. {% trans %}1 member {% plural group_members %} @count members{% endtrans %}
  67. </span>
  68. </header>
  69. <footer class="hero-footer">
  70. <div class="hero-footer__text">
  71. {% if content.field_group_location|render is not empty and content.field_group_address|render is not empty %}
  72. <svg class="hero-footer-icon">
  73. <use xlink:href="#icon-location"></use>
  74. </svg>
  75. {% endif %}
  76. <span class="inline-center">
  77. {{ content.field_group_location }}
  78. {% if content.field_group_location|render is not empty and content.field_group_address|render is not empty %} &bullet;{% endif %}
  79. {{ content.field_group_address }} </span>
  80. </div>
  81. {% if group_operations_url %}
  82. <div class="hero-footer__cta">
  83. <div class="btn-group">
  84. {% if joined %}
  85. <button type="button" autocomplete="off" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="btn btn-accent btn-lg btn-raised dropdown-toggle">{% trans with {'context': 'Is a member'} %}Joined{% endtrans %}<span class="caret"></span></button>
  86. <ul class="dropdown-menu dropdown-menu-right">
  87. <li><a href="{{ group_operations_url }}">{% trans %}Leave group{% endtrans %}</a></li>
  88. </ul>
  89. {% elseif closed_group %}
  90. <a href="{{ group_operations_url }}" class="btn btn-accent btn-lg btn-raised dropdown-toggle disabled" title="{{ cta }}">{{ cta }}</a>
  91. {% else %}
  92. <a href="{{ group_operations_url }}" class="btn btn-accent btn-lg btn-raised dropdown-toggle" title="{% trans %}Join{% endtrans %}">{% trans %}Join{% endtrans %}</a>
  93. {% endif %}
  94. </div>
  95. </div>
  96. {% endif %}
  97. </footer>
  98. </div> {# cover-wrap #}
  99. </div> {# cover #}