From acc92bda94da32b947ea8a758173c4f6bb257ca3 Mon Sep 17 00:00:00 2001 From: Taras Kruts <taras.kruts@lemberg.co.uk> Date: Wed, 2 Oct 2019 23:33:39 +0300 Subject: [PATCH] Issue #3083877 by ribel: Add group statistic block --- templates/group/group--hero--sky.html.twig | 43 +++++++++++++++++++ .../group/group--statistic--sky.html.twig | 40 +++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 templates/group/group--hero--sky.html.twig create mode 100644 templates/group/group--statistic--sky.html.twig diff --git a/templates/group/group--hero--sky.html.twig b/templates/group/group--hero--sky.html.twig new file mode 100644 index 00000000..1987876b --- /dev/null +++ b/templates/group/group--hero--sky.html.twig @@ -0,0 +1,43 @@ +{{ attach_library('socialbase/hero') }} +{{ attach_library('socialblue/hero--sky') }} + +{% set cover_classes = [ + 'cover hero__group', + group_hero_styled_image_url ? 'cover-img cover-img-gradient', +] %} + +<div{{ attributes.addClass(cover_classes) }} {% if group_hero_styled_image_url %} style="background-image: url('{{ group_hero_styled_image_url }}');" {% endif %}> + <div class="hero__bgimage-overlay"></div> + {% if group_edit_url %} + <div class="hero-action-button"> + <a href="{{ group_edit_url }}" title="{% trans %}Edit group{% endtrans %}" class="btn btn-default btn-floating"> + <svg class="icon-gray icon-medium"> + <use xlink:href="#icon-edit"></use> + </svg> + </a> + </div> + {% endif %} + <div class="cover-wrap"> + <header class="page-title"> + {% if group_type %} + <div class="teaser__tag"> + {{ group_type }} + </div> + {% endif %} + <h1>{{ content.label }}</h1> + </header> + <footer class="hero-footer"> + <div class="hero-footer__text"> + {% if content.field_group_location|render is not empty and content.field_group_address|render is not empty %} + <svg class="hero-footer-icon"> + <use xlink:href="#icon-location"></use> + </svg> + {% endif %} + <span class="inline-center"> + {{ content.field_group_location }} + {% if content.field_group_location|render is not empty and content.field_group_address|render is not empty %} •{% endif %} + {{ content.field_group_address }} </span> + </div> + </footer> + </div> {# cover-wrap #} +</div> {# cover #} diff --git a/templates/group/group--statistic--sky.html.twig b/templates/group/group--statistic--sky.html.twig new file mode 100644 index 00000000..6efccbdc --- /dev/null +++ b/templates/group/group--statistic--sky.html.twig @@ -0,0 +1,40 @@ +<div class="card__counter"> + <ul> + <li> + <span class="card__counter-quantity">{{ group_events }}</span> + <span class="card__counter-text">{% trans %}event{% plural group_events %}events{% endtrans %}</span> + </li> + <li> + <span class="card__counter-quantity">{{ group_topics }}</span> + <span class="card__counter-text">{% trans %}topic{% plural group_topics %}topics{% endtrans %}</span> + </li> + <li> + <span class="card__counter-quantity">{{ group_members }}</span> + <span class="card__counter-text">{% trans %}member{% plural group_members %}members{% endtrans %}</span> + </li> + </ul> +</div> +{% if group_operations_url %} + <div class="hero-footer__cta"> + <div class="btn-group"> + {% if joined %} + <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> + <ul class="dropdown-menu dropdown-menu-right"> + <li><a href="{{ group_operations_url }}">{% trans %}Leave group{% endtrans %}</a></li> + </ul> + {% elseif closed_group %} + <a href="{{ group_operations_url }}" class="btn btn-accent disabled" title="{{ cta }}">{{ cta }}</a> + {% else %} + <a href="{{ group_operations_url }}" class="btn btn-accent" title="{% trans %}Join{% endtrans %}">{% trans %}Join{% endtrans %}</a> + {% endif %} + </div> + </div> +{% endif %} + +{% if group_stream_url %} + <footer class="card__actionbar"> + <a href="{{ group_stream_url }}" class="card__link card__link-arrow"> + {% trans %}See group stream{% endtrans %} + </a> + </footer> +{% endif %} -- GitLab