You are here

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

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. <div{{ attributes.addClass(cover_classes) }} {% if group_hero_styled_image_url %} style="background-image: url('{{ group_hero_styled_image_url }}');" {% endif %}>
  30. <div class="hero__bgimage-overlay"></div>
  31. {% if group_edit_url %}
  32. <div class="hero-action-button">
  33. <a href="{{ group_edit_url }}" title="Edit group" class="btn btn-default btn-floating">
  34. <svg class="icon-gray icon-medium">
  35. <use xlink:href="#icon-edit"></use>
  36. </svg>
  37. </a>
  38. </div>
  39. {% endif %}
  40. <div class="cover-wrap">
  41. <header class="page-title">
  42. <h1>{{ content.label }}</h1>
  43. <p>
  44. {% if closed_group_lock %}
  45. <span>{% trans %}Closed group{% endtrans %}</span> &bullet;
  46. {% endif %}
  47. <span>
  48. {% trans %}1 member {% plural group_members %} @count members{% endtrans %}
  49. </span>
  50. </p>
  51. </header>
  52. <footer class="hero-footer">
  53. <div class="hero-footer__text">
  54. {% if content.field_group_location|render is not empty and content.field_group_address|render is not empty %}
  55. <svg class="hero-footer-icon">
  56. <use xlink:href="#icon-location"></use>
  57. </svg>
  58. {% endif %}
  59. <span class="inline-center">
  60. {{ content.field_group_location }}
  61. {% if content.field_group_location|render is not empty and content.field_group_address|render is not empty %} &bullet;{% endif %}
  62. {{ content.field_group_address }} </span>
  63. </div>
  64. {% if group_operations_url %}
  65. <div class="hero-footer__cta">
  66. <div class="btn-group">
  67. {% if joined %}
  68. <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 %}Joined{% endtrans %}<span class="caret"></span></button>
  69. <ul class="dropdown-menu dropdown-menu-right">
  70. <li><a href="{{ group_operations_url }}">{% trans %}Leave group{% endtrans %}</a></li>
  71. </ul>
  72. {% elseif closed_group %}
  73. <a href="{{ group_operations_url }}" class="btn btn-accent btn-lg btn-raised dropdown-toggle disabled" title="{{ cta }}">{{ cta }}</a>
  74. {% else %}
  75. <a href="{{ group_operations_url }}" class="btn btn-accent btn-lg btn-raised dropdown-toggle" title="Join">{% trans %}Join{% endtrans %}</a>
  76. {% endif %}
  77. </div>
  78. </div>
  79. {% endif %}
  80. </footer>
  81. </div> {# cover-wrap #}
  82. </div> {# cover #}