<commit_before>{% extends 'layout/base.html' %}
{% from 'macros/forms.html' import form_buttons, form_field, form_fieldset %}
{% set current_page = 'shop' %}
{% set title = 'Bestellen' %}

{% block body %}

  <h1>{{ title }}</h1>

  <form action="{{ url_for('.order') }}" method="post">

    <h2>Deine Daten</h2>
    {%- call form_fieldset() %}
      {{ form_field(form.first_names, maxlength=40, autofocus='autofocus') }}
      {{ form_field(form.last_name, maxlength=40) }}
      {{ form_field(form.date_of_birth, size=10, maxlength=10, note='<small>Format: <tt>TT.MM.JJJJ</tt> (T = Tag, M = Monat, J = Jahr)</small>'|safe) }}
      {{ form_field(form.street, maxlength=40) }}
      {{ form_field(form.zip_code, size=5, maxlength=5) }}
      {{ form_field(form.city, maxlength=40) }}
    {%- endcall %}

    <h2>Artikel</h2>
    <table class="index wide">
      <thead>
        <tr>
          <th>Anzahl</th>
          <th>Beschreibung</th>
          <th>Stückpreis</th>
        </tr>
      </thead>
      <tbody>
        {%- for article in articles %}
        <tr>
          <td>
            {%- set field = form|attr('article_%s'|format(article.id)) %}
            {{ field() }}
            {%- if field.errors %}
            <ol class="errors">
              {%- for error in field.errors %}
              <li><strong>Fehler:</strong> <span>{{ error }}</span></li>
              {%- endfor %}
            </ol>
            {%- endif -%}
          </td>
          <td><strong>{{ article.description }}</strong></td>
          <td style="text-align: right;">{{ article.price.to_string() }}</td>
        </tr>
        {%- endfor %}
      </tbody>
    </table>
    <p><small>Im Preis ist gemäß § 19 UStG keine Umsatzsteuer enthalten (Kleinunternehmerregelung).</small></p>

    {{ form_buttons('Kostenpflichtig bestellen') }}
  </form>

{%- endblock body %}<commit_msg>Show message instead of the order form if no articles are available for order.<commit_after>{% extends 'layout/base.html' %}
{% from 'macros/forms.html' import form_buttons, form_field, form_fieldset %}
{% set current_page = 'shop' %}
{% set title = 'Bestellen' %}

{% block body %}

  <h1>{{ title }}</h1>

  {%- if articles %}
  <form action="{{ url_for('.order') }}" method="post">

    <h2>Deine Daten</h2>
    {%- call form_fieldset() %}
      {{ form_field(form.first_names, maxlength=40, autofocus='autofocus') }}
      {{ form_field(form.last_name, maxlength=40) }}
      {{ form_field(form.date_of_birth, size=10, maxlength=10, note='<small>Format: <tt>TT.MM.JJJJ</tt> (T = Tag, M = Monat, J = Jahr)</small>'|safe) }}
      {{ form_field(form.street, maxlength=40) }}
      {{ form_field(form.zip_code, size=5, maxlength=5) }}
      {{ form_field(form.city, maxlength=40) }}
    {%- endcall %}

    <h2>Artikel</h2>
    <table class="index wide">
      <thead>
        <tr>
          <th>Anzahl</th>
          <th>Beschreibung</th>
          <th>Stückpreis</th>
        </tr>
      </thead>
      <tbody>
        {%- for article in articles %}
        <tr>
          <td>
            {%- set field = form|attr('article_%s'|format(article.id)) %}
            {{ field() }}
            {%- if field.errors %}
            <ol class="errors">
              {%- for error in field.errors %}
              <li><strong>Fehler:</strong> <span>{{ error }}</span></li>
              {%- endfor %}
            </ol>
            {%- endif -%}
          </td>
          <td><strong>{{ article.description }}</strong></td>
          <td style="text-align: right;">{{ article.price.to_string() }}</td>
        </tr>
        {%- endfor %}
      </tbody>
    </table>
    <p><small>Im Preis ist gemäß § 19 UStG keine Umsatzsteuer enthalten (Kleinunternehmerregelung).</small></p>

    {{ form_buttons('Kostenpflichtig bestellen') }}
  </form>
  {%- else %}
  <p>Es sind derzeit keine Artikel verfügbar.</p>
  {%- endif %}

{%- endblock body %}
{'fraction_non_alphanumeric': 0.1946222791293214, 'fraction_numerical': 0.011267605633802818, 'mean_word_length': 2.344178082191781, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 0, '>': 101, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1086196', 'n_tokens_mistral': 1437, 'n_tokens_neox': 1334, 'n_words': 259}