social_course-8.x-2.11/templates/group--course-basic--teaser.html.twig

templates/group--course-basic--teaser.html.twig
{{ attach_library('socialbase/teaser') }}

{%
  set classes = [
  'card',
  'teaser',
  not content.field_group_image|render ? 'no-image'
]
%}

<div{{ attributes.addClass(classes) }}>
  <div class='teaser__image'>
    {{ content.field_group_image }}
    <div class="teaser__teaser-type">
      <svg class="teaser__teaser-type-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
        <title>{% trans %}Course:{% endtrans %} &nbsp;{{- label|render|striptags|trim -}}</title>
        <path d="M0 0h24v24H0z" fill="none"/>
        <path d="M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3L1 9l11 6 9-4.91V17h2V9L12 3z"/>
      </svg>
    </div>
  </div>
  <div class='teaser__body'>
    <div class="teaser__content">
      {{ title_prefix }}
      {% if not page %}
        <h4{{ title_attributes }} class="teaser__title">
          <a href="{{ url }}" rel="bookmark">{{ label }}</a>
        </h4>
      {% endif %}
      {{ title_suffix }}
      <div class="teaser__content-line">
        <svg class="teaser__content-type-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
           <title>{{ 'Course status'|t }}</title>
          <path d="M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"/>
          <path fill="none" d="M0 0h24v24H0z"/>
        </svg>
        <div class="teaser__content-text">{{ finished_sections }} / {{ course_sections }} {% trans %}sections completed{% endtrans %}</div>
      </div>

      {% if content.field_course_type|render is not empty %}
        {% embed "node--teaser__field.html.twig" %}
          {%- block field_icon -%} label {%- endblock -%}
          {% block svg_title %} <title>{{ 'Course type'|t }}</title> {% endblock %}
          {%- block field_value -%} {{ content.field_course_type }} {%- endblock -%}
        {% endembed %}
      {% endif %}

    </div>

    <div class="card__actionbar">
      <div class="badge teaser__badge">
        <svg class="badge__icon">
          <title>{% trans %}Visibility{% endtrans %}</title>
          <use xlink:href="#icon-community"></use>
        </svg>
      </div>
      {% if course_status == 'enrolled' %}
        <span class="badge badge-start teaser__badge badge--section-not-started">
            {% trans %}You have enrolled{% endtrans %}
        </span>
      {% elseif course_status == 'started' %}
        <span class="badge teaser__badge badge-warning">
          <span class="badge__container">
            <span class="badge__label">{% trans %}You have started{% endtrans %} </span>
          </span>
        </span>
      {% elseif course_status == 'finished' %}
        <span class="badge teaser__badge badge-success">
            <span class="badge__container">
              <span class="badge__label">{% trans %}You have finished{% endtrans %} </span>
            </span>
          </span>
      {% endif %}

      <a href="{{ url }}" class="card__link" title="{{ label }}">
        {% trans %}Read more{% endtrans %}
      </a>
    </div>

  </div>
</div>

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc