{% extends "base.html" %}

{% block title %}{{ portal.name }}{% endblock %}

{% block head_extras %}
<link rel="stylesheet" href="{{ settings.root_path }}/css_dist/form.css">
{% endblock %}

{% block main %}
<main class="phono-form__container">
  <form action="submit" method="post">
    <section>
      {% for field in fields %}
      <div class="phono-form__field">
        {% if field.column_present %}
          {{ prompts_html.get(field.field.name).cloned().unwrap_or_default() | safe }}
          {% match field.field.presentation.0 %}
          {% when Presentation::Text { input_mode } %}
          {% match input_mode %}
          {% when TextInputMode::SingleLine %}
            <input
              type="text"
              class="form-section__input form-section__input--text"
              name="{{ field.field.name }}"
            >
          {% when TextInputMode::MultiLine %}
            <textarea name="{{ field.field.name }}"></textarea>
          {% else %}
          {% endmatch %}
          {% else %}
          {% endmatch %}
        {% endif %}
      </div>
      {% endfor %}
    </section>
    <section>
      <button class="button--primary" type="submit">
        Continue
      </button>
    </section>
  </form>
</main>
{% endblock %}
