You are here

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

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>{{ content.label }}</h1>
  46. <p>
  47. {% if closed_group_lock %}
  48. <span>{% trans %}Closed group{% endtrans %}</span> &bullet;
  49. {% endif %}
  50. <span>
  51. {% trans %}1 member {% plural group_members %} @count members{% endtrans %}
  52. </span>
  53. </p>
  54. </header>
  55. <footer class="hero-footer">
  56. <div class="hero-footer__text">
  57. {% if content.field_group_location|render is not empty and content.field_group_address|render is not empty %}
  58. <svg class="hero-footer-icon">
  59. <use xlink:href="#icon-location"></use>
  60. </svg>
  61. {% endif %}
  62. <span class="inline-center">
  63. {{ content.field_group_location }}
  64. {% if content.field_group_location|render is not empty and content.field_group_address|render is not empty %} &bullet;{% endif %}
  65. {{ content.field_group_address }} </span>
  66. </div>
  67. {% if group_operations_url %}
  68. <div class="hero-footer__cta">
  69. <div class="btn-group">
  70. {% if joined %}
  71. <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>
  72. <ul class="dropdown-menu dropdown-menu-right">
  73. <li><a href="{{ group_operations_url }}">{% trans %}Leave group{% endtrans %}</a></li>
  74. </ul>
  75. {% elseif closed_group %}
  76. <a href="{{ group_operations_url }}" class="btn btn-accent btn-lg btn-raised dropdown-toggle disabled" title="{{ cta }}">{{ cta }}</a>
  77. {% else %}
  78. <a href="{{ group_operations_url }}" class="btn btn-accent btn-lg btn-raised dropdown-toggle" title="{% trans %}Join{% endtrans %}">{% trans %}Join{% endtrans %}</a>
  79. {% endif %}
  80. </div>
  81. </div>
  82. {% endif %}
  83. </footer>
  84. </div> {# cover-wrap #}
  85. </div> {# cover #}