{% extends "base.html" %}

{% import "macros/form.html" as Form %}
{% import "macros/element.html" as Element %}

{% block page_heading %}
  Your income and tax
{% endblock %}

{% block inner_content %}
  <p>
    We need to know how much money you have coming in, because this affects
    whether or not you can get legal aid. Please answer these questions as
    fully and accurately as you can.
  </p>
  <form method="POST" action="{{ url_for('.income') }}">
    {{ form.csrf_token }}
    {{ Form.handle_errors(form) }}

    {% set is_hidden = not (session.is_employed or session.is_self_employed) %}
    {{ Form.money_interval_field(form.earnings, is_hidden) }}
    {{ Form.money_interval_field(form.income_tax, is_hidden) }}
    {{ Form.money_interval_field(form.national_insurance, is_hidden) }}
    {{ Form.money_interval_field(form.working_tax_credit, is_hidden) }}
    {{ Form.money_interval_field(form.maintenance) }}
    {{ Form.money_interval_field(form.pension) }}
    {{ Form.money_interval_field(form.other_income) }}

    {{ Form.actions('Continue') }}
  </form>
{% endblock %}

{% extends "base.html" %}

{% import "macros/form.html" as Form %}
{% import "macros/element.html" as Element %}

{% block page_heading %}
  Your income and tax
{% endblock %}

{% block inner_content %}
  <p>
    We need to know how much money you have coming in, because this affects
    whether or not you can get legal aid. Please answer these questions as
    fully and accurately as you can.
  </p>
  <form method="POST" action="{{ url_for('.income') }}">
    {{ form.csrf_token }}
    {{ Form.handle_errors(form) }}

    {% set is_hidden = not (session.is_employed or session.is_self_employed) %}

    {% for set in form.sets %}
      {% if loop.index == 1 or session.has_partner and loop.index > 1 %}
        <fieldset>
          {% if session.has_partner %}
            <h3>{{set.title}}</h3>
            {% if set.name == 'you' %}
              <p>
                This section is for any money that is paid to you personally
                - for example, your wages. You should record income for your
                partner, if you have one, in the next section.
              </p>
            {% endif %}
          {% endif %}
          {% for field in set.fields %}
            {% if field in (
              'earnings',
              'income_tax',
              'national_insurance',
              'working_tax_credit'
            ) %}
              {{ Form.money_interval_field(form[field], is_hidden) }}
            {% else %}
              {{ Form.money_interval_field(form[field]) }}
            {% endif %}
          {% endfor %}
        </fieldset>
      {% endif %}
    {% endfor %}

    {{ Form.actions('Continue') }}
  </form>
{% endblock %}

Create form field sets for Income form
Create form field sets for Income form
