You are here

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

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. <title>{% trans %}Edit group{% endtrans %}</title>
  39. <use xlink:href="#icon-edit"></use>
  40. </svg>
  41. </a>
  42. </div>
  43. {% endif %}
  44. <div class="{{ cover_wrap_classes }}">
  45. <header class="page-title">
  46. <h1>
  47. {% if closed_group_lock %}
  48. <svg class="icon-white icon-medium">
  49. <use xlink:href="#icon-lock"></use>
  50. </svg>
  51. {% elseif secret_group_shield %}
  52. <svg class="icon-white icon-medium">
  53. <use xlink:href="#icon-shield"></use>
  54. </svg>
  55. {% endif %}
  56. <span>{{ title }}</span></h1>
  57. {% if group_type %}
  58. <span>{{ group_type }}</span>
  59. {% endif %}
  60. {% if group_settings_help %}
  61. <span>
  62. {{ group_settings_help }}
  63. </span>
  64. {% endif %}
  65. &bullet;
  66. <span>
  67. {% trans %}1 member {% plural group_members %} @count members{% endtrans %}
  68. </span>
  69. </header>
  70. <footer class="hero-footer">
  71. <div class="hero-footer__text">
  72. {% if content.field_group_location|render is not empty and content.field_group_address|render is not empty %}
  73. <svg class="hero-footer-icon">
  74. <use xlink:href="#icon-location"></use>
  75. </svg>
  76. {% endif %}
  77. <span class="inline-center">
  78. {{ content.field_group_location }}
  79. {% if content.field_group_location|render is not empty and content.field_group_address|render is not empty %} &bullet;{% endif %}
  80. {{ content.field_group_address }} </span>
  81. </div>
  82. {% if group_operations_url %}
  83. <div class="hero-footer__cta">
  84. <div class="btn-group">
  85. {% if joined %}
  86. <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>
  87. <ul class="dropdown-menu dropdown-menu-right">
  88. <li><a href="{{ group_operations_url }}">{% trans %}Leave group{% endtrans %}</a></li>
  89. </ul>
  90. {% elseif closed_group %}
  91. <a href="{{ group_operations_url }}" class="btn btn-accent btn-lg btn-raised dropdown-toggle disabled" title="{{ cta }}">{{ cta }}</a>
  92. {% else %}
  93. <a href="{{ group_operations_url }}" class="btn btn-accent btn-lg btn-raised dropdown-toggle" title="{% trans %}Join{% endtrans %}">{% trans %}Join{% endtrans %}</a>
  94. {% endif %}
  95. </div>
  96. </div>
  97. {% endif %}
  98. </footer>
  99. </div> {# cover-wrap #}
  100. </div> {# cover #}