{% load wagtailimages_tags wagtailcore_tags static core_tags gem_tags %}

{% block content %}
  <div class="surveys surveys{{form.get_effective_extra_style_hints}} surveys--call-to-action surveys--page">
    {% if self.image %}
      <div class="surveys--page__image-wrapper">
        {% image self.image width-165 as icon_small %}
        <img src="{{ icon_small.url }}" alt="{{ self.title }}" class="surveys--page__image" />
      </div>
    {% else %}
      <div class="identity-image identity-image--survey"></div>
    {% endif %}
    <div class="heading heading__component"><h1>{{self.title}}</h1></div>
    {% if self.introduction %}
      <div class="heading heading__subheading">
        <h4>{{page.introduction|smarttruncatechars:500|safe}}</h4>
      </div>
    {% endif %}

    {% if user.is_authenticated and user.is_active or request.is_preview or self.allow_anonymous_submissions %}
      {% include "forms/form_modules/form.html" %}
    {% endif %}
  </div>
{% endblock %}
