{% if banner %}
  {% if closable %}
    <a class='annoy-banner-on annoy-banner-on_{{ banner.place }}'
       href="{{ banner.get_url }}"
       data-target="#annoy-banner-{{ banner.id }}"
    >
      {{ banner.open_label }}
    </a>
  {% endif %}
  <div class="
              annoy-banner
              annoy-banner_{{ banner.place }}
              annoy-banner-style_{{ banner.style }}
              {% if banner.get_image %}with-image{% endif %}
              {% if banner.smallfont %}banner-smallfont{% endif %}
              "
        id="annoy-banner-{{ banner.id }}"
	style="
           {% if banner.text_color %}color: {{ banner.text_color }};{% endif %}
           {% if banner.background_color %}background-color: {{ banner.background_color }};{% endif %}
        ">
    {% if not banner.action_label %}
    <a
      {% if banner.is_external %}target="_blank"{% endif %}
      href="{{ banner.get_url }}">
    {% endif %}
    <div class="annoy-banner-inner">

      {% if banner.get_image %}
      <div>
        <img src="{{ banner.get_image.url }}">
	</div>
      {% endif %}
      <div class="text">
        {{ banner.get_text|safe|linebreaks }}
      </div>

      {% if banner.action_label %}
      <a class="action"
	 {% if banner.is_external %}target="_blank"{% endif %}
	 href="{{ banner.get_url }}">
          {{ banner.action_label }}
        </a>
      {% endif %}
    </div>
    {% if not banner.action_label %}
      </a>
    {% endif %}
    {% if closable %}
      <a class='annoy-banner-off annoy-banner-off_{{ banner.place }}'>{{ banner.close_label|default:"x" }}</a>
    {% endif %}
  </div>

{% endif %}
