<commit_before>{% extends "_base_page.html" %}
{% import "macros/forms.html" as forms %}

{% block page_title %}Edit supplier – Digital Marketplace{% endblock %}

{% block breadcrumb %}
  {%
    with items = [
      {
        "link": "/",
        "label": "Digital Marketplace"
      },
      {
        "link": url_for(".dashboard"),
        "label": current_user.supplier_name
      }
    ]
  %}
    {% include "toolkit/breadcrumb.html" %}
  {% endwith %}
{% endblock %}

{% block main_content %}
  <div class="grid-row">
    <div class="column-one-whole">
      {% with
        context = "Edit supplier information",
        heading = current_user.supplier_name
      %}
        {% include 'toolkit/page-heading.html' %}
      {% endwith %}
    </div>
  </div>

  {% if error %}
  <div class="validation-masthead" aria-labelledby="validation-masthead-heading">
    <h3 class="validation-masthead-heading" id="validation-masthead-heading">
      {{ error }}
    </h3>
  </div>
  {% endif %}
  {% if supplier_form.errors or contact_form.errors %}
      <div class="validation-masthead" aria-labelledby="validation-masthead-heading">
          <h3 class="validation-masthead-heading" id="validation-masthead-heading">
              There was a problem with your answer to the following questions
          </h3>
          {% for field_name, field_errors in supplier_form.errors|dictsort %}
            {% for error in field_errors %}
              <a href="#{{ field_name }}-label" class="validation-masthead-link">{{ supplier_form[field_name].label }}</a>
            {% endfor %}
          {% endfor %}

          {% for field_name, field_errors in contact_form.errors|dictsort %}
            {% for error in field_errors %}
            <a href="#contact_{{ field_name }}-label" class="validation-masthead-link">{{ contact_form[field_name].label }}</a>
            {% endfor %}
          {% endfor %}
      </div>
  {% endif %}

  <form action="{{ url_for('.update_supplier') }}" method="post" enctype="multipart/form-data">

  <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />

  <div class="grid-row">
    <div class="column-one-whole">
      {{ forms.question_textarea('description', 'Supplier summary', supplier_form.description.data, '50 words max', errors=supplier_form.description.errors, max_length_in_words=50) }}

      {{ forms.question_list_entry('clients', 'Clients', supplier_form.clients.data, '1 client per box, max 10 clients', errors=supplier_form.clients.errors, item_name='client', number_of_items=10) }}

      {{ forms.question_input('contact_contactName', 'Contact name', contact_form.contactName.data, 'Primary contact', errors=contact_form.contactName.errors) }}
      {{ forms.question_input('contact_website', 'Website', contact_form.website.data, errors=contact_form.website.errors) }}
      {{ forms.question_input('contact_email', 'Email address', contact_form.email.data, errors=contact_form.email.errors) }}
      {{ forms.question_input('contact_phoneNumber', 'Phone number', contact_form.phoneNumber.data, errors=contact_form.phoneNumber.errors) }}

      <div class="question">
        <label class="question-heading-with-hint"><commit_msg>Add grid to edit supplier page<commit_after>{% extends "_base_page.html" %}
{% import "macros/forms.html" as forms %}

{% block page_title %}Edit supplier – Digital Marketplace{% endblock %}

{% block breadcrumb %}
  {%
    with items = [
      {
        "link": "/",
        "label": "Digital Marketplace"
      },
      {
        "link": url_for(".dashboard"),
        "label": current_user.supplier_name
      }
    ]
  %}
    {% include "toolkit/breadcrumb.html" %}
  {% endwith %}
{% endblock %}

{% block main_content %}
  <div class="grid-row">
    <div class="column-one-whole">
      {% with
        context = "Edit supplier information",
        heading = current_user.supplier_name
      %}
        {% include 'toolkit/page-heading.html' %}
      {% endwith %}
    </div>
  </div>

  {% if error %}
  <div class="validation-masthead" aria-labelledby="validation-masthead-heading">
    <h3 class="validation-masthead-heading" id="validation-masthead-heading">
      {{ error }}
    </h3>
  </div>
  {% endif %}
  {% if supplier_form.errors or contact_form.errors %}
      <div class="validation-masthead" aria-labelledby="validation-masthead-heading">
          <h3 class="validation-masthead-heading" id="validation-masthead-heading">
              There was a problem with your answer to the following questions
          </h3>
          {% for field_name, field_errors in supplier_form.errors|dictsort %}
            {% for error in field_errors %}
              <a href="#{{ field_name }}-label" class="validation-masthead-link">{{ supplier_form[field_name].label }}</a>
            {% endfor %}
          {% endfor %}

          {% for field_name, field_errors in contact_form.errors|dictsort %}
            {% for error in field_errors %}
            <a href="#contact_{{ field_name }}-label" class="validation-masthead-link">{{ contact_form[field_name].label }}</a>
            {% endfor %}
          {% endfor %}
      </div>
  {% endif %}

  <form action="{{ url_for('.update_supplier') }}" method="post" enctype="multipart/form-data">

  <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />

  <div class="grid-row">
    <div class="column-two-thirds">
      {{ forms.question_textarea('description', 'Supplier summary', supplier_form.description.data, '50 words max', errors=supplier_form.description.errors, max_length_in_words=50) }}

      {{ forms.question_list_entry('clients', 'Clients', supplier_form.clients.data, '1 client per box, max 10 clients', errors=supplier_form.clients.errors, item_name='client', number_of_items=10) }}

      {{ forms.question_input('contact_contactName', 'Contact name', contact_form.contactName.data, 'Primary contact', errors=contact_form.contactName.errors) }}
      {{ forms.question_input('contact_website', 'Website', contact_form.website.data, errors=contact_form.website.errors) }}
      {{ forms.question_input('contact_email', 'Email address', contact_form.email.data, errors=contact_form.email.errors) }}
      {{ forms.question_input('contact_phoneNumber', 'Phone number', contact_form.phoneNumber.data, errors=contact_form.phoneNumber.errors) }}

      <div class="question">
        <label class="question-heading-with-hint">
{'fraction_non_alphanumeric': 0.1560549313358302, 'fraction_numerical': 0.004057428214731586, 'mean_word_length': 3.3658038147138964, 'pattern_counts': {'":': 8, '<': 47, '<?xml version=': 0, '>': 47, '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': '2355027', 'n_tokens_mistral': 2045, 'n_tokens_neox': 1900, 'n_words': 368}