{% load i18n cms_tags extra_tags thumbnail %}
{% spaceless %}
{% if organization %}
  {% with organization_page=organization.extended_object %}
    <a href="{{ organization_page.get_absolute_url }}" title="{{ organization_page.get_title }}" class="course-detail__aside__main-org-logo">
      {% get_placeholder_plugins "logo" organization_page as plugins or %}
        <div class="course-detail__aside__main-org-logo__empty">{% trans "Main organization" %}</div>
      {% endget_placeholder_plugins %}
      {% blockplugin plugins.0 %}
        <img src="{% thumbnail instance.picture 200x113 upscale subject_location=instance.picture.subject_location %}"
          srcset="
            {% thumbnail instance.picture 200x113 upscale subject_location=instance.picture.subject_location %} 200w,
            {% if instance.picture.width >= 400 %}{% thumbnail instance.picture 400x225 upscale subject_location=instance.picture.subject_location %} 400w,{% endif %}
            {% if instance.picture.width >= 600 %}{% thumbnail instance.picture 600x338 upscale subject_location=instance.picture.subject_location %} 600w{% endif %}
            {% if instance.picture.width >= 800 %}{% thumbnail instance.picture 800x450 upscale subject_location=instance.picture.subject_location %} 800w{% endif %}
          "
          sizes="30vw"
          alt="{% if instance.picture.default_alt_text %}{{ instance.picture.default_alt_text }}{% else %}{% trans 'main organization logo' %}{% endif %}"
        />
      {% endblockplugin %}
    </a>
  {% endwith %}
{% else %}
  <div class="course-detail__aside__main-org-logo">
    <div class="course-detail__aside__main-org-logo__empty">
      {% trans "Main organization" %}
    </div>
  </div>
{% endif %}
{% endspaceless %}
