{% load i18n %}

    <h1>{% trans 'Catalog' %} {{ catalog.title }}</h1>

    <p>
        <strong>{% trans 'URI' %}:</strong> {{ catalog.uri }}
    </p>

    {% if catalog.comment %}

    <p>
        <strong>{% trans 'Comment' %}:</strong> {{ catalog.comment }}
    </p>

    {% endif %}

    {% for section in catalog.sections.all %}

    <h2>{% trans 'Section' %} {{ section.title }}</h2>

    <p>
        <strong>{% trans 'URI' %}:</strong> {{ section.uri }}
    </p>

    {% if section.comment %}

    <p>
        <strong>{% trans 'Comment' %}:</strong> {{ section.comment }}
    </p>

    {% endif %}

    {% for questionset in section.questionsets.all %}

    <h3>{% trans 'Question set' %} {{ questionset.title }}</h3>

    <p>
        <strong>{% trans 'URI' %}:</strong> {{ questionset.uri }}
    </p>

    {% if questionset.help  %}

    <p>
        <strong>{% trans 'Help' %}:</strong> {{ questionset.help }}
    </p>

    {% endif %}

    {% if questionset.verbose_name or questionset.verbose_name_plural %}

    <p>
        <strong>{% trans 'Verbose name' %}:</strong>
    </p>

    <ul>
        <li>{% trans 'Verbose name' %}: {{ questionset.verbose_name }}</li>
        <li>{% trans 'Verbose name plural' %}: {{ questionset.verbose_name_plural }}</li>
    </ul>

    {% endif %}

    {% if questionset.comment %}

    <p>
        <strong>{% trans 'Comment' %}:</strong> {{ questionset.comment }}
    </p>

    {% endif %}

    <p>
        <strong>{% trans 'Questions:' %}</strong>
    </p>

    <ul>
        {% for question in questionset.questions.all %}
        <li>
            <p>
                <strong>{% trans 'URI' %}:</strong> {{ question.uri }}
            </p>

            {% if question.comment %}

            <p>
                <strong>{% trans 'Comment' %}:</strong> {{ questionset.comment }}
            </p>

            {% endif %}

            <p>
                <strong>{% trans 'Text' %}:</strong> {{ question.text }}
            </p>

            {% if question.help  %}

            <p>
                <strong>{% trans 'Help' %}:</strong> {{ question.help | default_if_none:'n/a' }}
            </p>

            {% endif %}

            {% if question.attribute.optionsets.all %}

            <p>
                <strong>{% trans 'Options' %}:</strong>
            </p>

            <ul>
                {% for optionset in question.attribute.optionsets.all %}
                {% for option in optionset.options.all %}
                <li>
                    {{ option.text }}{% if option.additional_input %}: __________{% endif %}
                </li>
                {% endfor %}
                {% endfor %}
            </ul>

            {% endif %}

            {% if question.verbose_name or question.verbose_name_plural %}

            <p>
                <strong>{% trans 'Verbose name' %}:</strong>
            </p>

            <ul>
                <li>{% trans 'Verbose name' %}: {{ question.verbose_name }}</li>
                <li>{% trans 'Verbose name plural' %}: {{ question.verbose_name_plural }}</li>
            </ul>

            {% endif %}

            {% if question.minimum or question.maximum or question.step %}

            <p>
                <strong>{% trans 'Range' %}:</strong>
            </p>

            <ul>
                <li>{% trans 'Minimum' %}: {{ question.minimum }}</li>
                <li>{% trans 'Maximum' %}: {{ question.maximum }}</li>
                <li>{% trans 'Step' %}: {{ question.step }}</li>
            </ul>

            {% endif %}

            {% if question.comment %}

            <p>
                <strong>{% trans 'Comment' %}:</strong> {{ question.comment }}
            </p>

            {% endif %}

        </li>
        {% endfor %}
    </ul>

    {% endfor %}

{% endfor %}
