{% load i18n cms_tags extra_tags thumbnail %}
{% spaceless %}
<div class="course-detail__aside__main-org-logo">
  {% if organization %}
    {% with organization_page=organization.extended_object %}
      <a href="{{ organization_page.get_absolute_url }}" title="{{ organization_page.get_title }}">
        {% 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 500x500 crop upscale subject_location=instance.picture.subject_location %}"
            srcset="
              {% thumbnail instance.picture 500x500 crop upscale subject_location=instance.picture.subject_location %} 500w,
              {% if instance.picture.width >= 1000 %}{% thumbnail instance.picture 1000x1000 crop upscale subject_location=instance.picture.subject_location %} 1000w,{% endif %}
              {% if instance.picture.width >= 1500 %}{% thumbnail instance.picture 1500x1500 crop upscale subject_location=instance.picture.subject_location %} 1500w{% endif %}
            "
            sizes="500px"
            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__empty">
      {% trans "Main organization" %}
    </div>
  {% endif %}
</div>
{% endspaceless %}
