<commit_before>{% extends "_base_page.html" %}

{% block page_title %}Your account - Digital Marketplace{% endblock %}

{% block body_classes %}brief-builder{% endblock %}

{% block breadcrumb %}
  {%
    with items = [
      {
        "link": url_for("main.index"),
        "label": "Home"
      },
      {
        "link": url_for(".buyer_dashboard"),
        "label": "Dashboard"
      },
      {
        "link": url_for(".view_brief_overview", framework_slug=brief.frameworkSlug, lot_slug=brief.lotSlug, brief_id=brief.id),
        "label": "Brief Overview"
      },
      {
        "label": brief.title
      }
    ]
  %}
    {% include "toolkit/breadcrumb.html" %}
  {% endwith %}
{% endblock %}

{% block main_content %}

<div class="callout--info">
  <h2>Publishing a brief is not yet available</h2>
  <p>The Digital Marketplace team will notify you when it's activated.</p>
</div>

<div class='grid-row'>
  <div class='column-two-thirds large-paragraph'>
    {% with
        heading = "Publish your requirements and evaluation criteria" if not published else "Question and answer dates",
        smaller = True,
        with_breadcrumb = True
    %}
        {% include "toolkit/page-heading.html" %}
    {% endwith %}

    {% if not published %}
      <div class="dmspeak">
        <p>All requirements are published on the Digital Marketplace where anyone can see them.</p>
      </div>
        {% if brief.lotSlug == 'digital-specialists' and not brief.requirementsLength %}
          <p><a href="{{ url_for('.edit_brief_question', framework_slug=brief.frameworkSlug, lot_slug=brief.lotSlug, brief_id=brief.id, section_slug='set-how-long-your-requirements-will-be-live-for', question_id='requirementsLength') }}">Set how long your requirements will be open for</a></p>
          <div class="dmspeak">
            <p>This will show you what the supplier application deadline will be if you publish your requirements today.</p>
          </div>
        {% else %}
          <p>Your requirements will be open for {{ dates.application_open_weeks }}.</p>
          <div class="dmspeak">
            <p>If you publish your requirements today ({{ dates.published_date | shortdateformat }}), suppliers will be able to apply until {{ dates.closing_time }}, {{ dates.closing_date | shortdateformat}}.</p>
          </div>
        {% endif %}
    {% endif %}

    <p>Supplier questions will be sent to:</p>
    <div class="dmspeak">
      <p>{{ email_address }}</p>
    </div>
    <div class="dmspeak">
      <p>Make sure this email address {% if not published %}will be{% else %}is{% endif %} monitored. If you’re away while suppliers can still ask questions, you should make sure your emails are forwarded to a colleague.</p>
    </div>

    {% if not published and unanswered_required > 0 %}
      <div class="dmspeak">
        <p><strong>You still need to complete the following questions before your requirements can be published:</strong></p>
      </div>
      {% for section in sections %}
        {% for question in section.questions %}
          {% if question.answer_required %}
            <ul>
              <li>
                <a href="{{ url_for('.edit_brief_question', framework_slug=brief.frameworkSlug, lot_slug=brief.lotSlug, brief_id=brief.id, section_slug=section.slug, question_id=question.id) }}">{{ question.question or question.name }}</a>
              </li>
            </ul>
          {% endif %}
        {% endfor %}
      {% endfor %}
    {% elif brief.lotSlug != 'digital-specialists' or brief.requirementsLength %}
      {% import "toolkit/summary-table.html" as summary %}
        {% call summary.mapping_table(
        row_bold_borders=True,
        text_large = True,
        no_bottom_border=True,
        caption="If you publish today, you must be aware of the following dates:" if not published,
        caption_visible=not published,
        field_headings=[
          "Date",
          "Notice",
        ],
        field_headings_visible=False
      ) %}
        {% call summary.row(no_border=True) %}
          {{ summary.field_heading_date("Today" if not published else (brief.publishedAt | shortdateformat), scope='row') }}
          {{ summary.text("Suppliers can apply and ask questions about your requirements.") }}
        {% endcall %}
        {% if brief.questionAndAnswerSessionDetails %}
          {% call summary.row(bold_border=True) %}
            {{ summary.field_heading_date("Before {}".format(dates.questions_close | shortdateformat), rowspan='3', scope='row') }}
            {{ summary.text_bold("Details of your question and answer session") }}
            {% if not published %}
              {{ summary.edit_link("Edit", url_for('.edit_brief_question', framework_slug=brief.frameworkSlug, lot_slug=brief.lotSlug, brief_id=brief.id, section_slug=question_and_answers.slug, question_id=question_and_answers.id)) }}
            {% endif %}
          {% endcall %}
          {% call summary.row(no_border=True) %}
            {{ summary.text(brief.questionAndAnswerSessionDetails) }}
          {% endcall %}
          {% call summary.row(no_border=True) %}
            {{ summary.text_bold("You must hold your question and answer session before {}.".format(dates.questions_close | shortdateformat), border=True) }}
          {% endcall %}
        {% endif %}
        {% call summary.row(bold_border=True) %}
          {{ summary.field_heading_date(dates.questions_close | shortdateformat, scope='row') }}
          {{ summary.text("The last day suppliers can ask questions.") }}
        {% endcall %}
        {% call summary.row(bold_border=True) %}
          {{ summary.field_heading_date(dates.answers_close | shortdateformat, scope='row') }}
          {{ summary.text("You must have published answers to all suppliers’ questions.") }}
        {% endcall %}
        {% call summary.row(bold_border=True) %}
          {{ summary.field_heading_date(dates.closing_date | shortdateformat, scope='row') }}
          {{ summary.text("The last day suppliers can apply.") }}
        {% endcall %}
      {% endcall %}
      {% if not published %}
        <div>
            <p>
                <a href="{{ url_for('main.get_brief_by_id', framework_slug=brief.frameworkSlug, brief_id=brief.id) }}"
                   target="_blank" rel="external">Preview this brief</a>
            </p>
        </div>
        <form action="{{ url_for('.publish_brief', framework_slug=brief.frameworkSlug, lot_slug=brief.lotSlug, brief_id=brief.id) }}" method="POST">
          {{ form.csrf_token }}
          {#
          with
          type = "save",
          role = "button",
          label = "Publish brief"
          #}
          {# include "toolkit/button.html" #}
          {# endwith #}
          <input type="submit" value="Publish brief" class="button-save" role="button" disabled="">
        </form>
      {% endif %}
    {% endif %}
    <br><commit_msg>Revert "Disable publishing a brief"<commit_after>{% extends "_base_page.html" %}

{% block page_title %}Your account - Digital Marketplace{% endblock %}

{% block body_classes %}brief-builder{% endblock %}

{% block breadcrumb %}
  {%
    with items = [
      {
        "link": url_for("main.index"),
        "label": "Home"
      },
      {
        "link": url_for(".buyer_dashboard"),
        "label": "Dashboard"
      },
      {
        "link": url_for(".view_brief_overview", framework_slug=brief.frameworkSlug, lot_slug=brief.lotSlug, brief_id=brief.id),
        "label": "Brief Overview"
      },
      {
        "label": brief.title
      }
    ]
  %}
    {% include "toolkit/breadcrumb.html" %}
  {% endwith %}
{% endblock %}

{% block main_content %}

<div class='grid-row'>
  <div class='column-two-thirds large-paragraph'>
    {% with
        heading = "Publish your requirements and evaluation criteria" if not published else "Question and answer dates",
        smaller = True,
        with_breadcrumb = True
    %}
        {% include "toolkit/page-heading.html" %}
    {% endwith %}

    {% if not published %}
      <div class="dmspeak">
        <p>All requirements are published on the Digital Marketplace where anyone can see them.</p>
      </div>
        {% if brief.lotSlug == 'digital-specialists' and not brief.requirementsLength %}
          <p><a href="{{ url_for('.edit_brief_question', framework_slug=brief.frameworkSlug, lot_slug=brief.lotSlug, brief_id=brief.id, section_slug='set-how-long-your-requirements-will-be-live-for', question_id='requirementsLength') }}">Set how long your requirements will be open for</a></p>
          <div class="dmspeak">
            <p>This will show you what the supplier application deadline will be if you publish your requirements today.</p>
          </div>
        {% else %}
          <p>Your requirements will be open for {{ dates.application_open_weeks }}.</p>
          <div class="dmspeak">
            <p>If you publish your requirements today ({{ dates.published_date | shortdateformat }}), suppliers will be able to apply until {{ dates.closing_time }}, {{ dates.closing_date | shortdateformat}}.</p>
          </div>
        {% endif %}
    {% endif %}

    <p>Supplier questions will be sent to:</p>
    <div class="dmspeak">
      <p>{{ email_address }}</p>
    </div>
    <div class="dmspeak">
      <p>Make sure this email address {% if not published %}will be{% else %}is{% endif %} monitored. If you’re away while suppliers can still ask questions, you should make sure your emails are forwarded to a colleague.</p>
    </div>

    {% if not published and unanswered_required > 0 %}
      <div class="dmspeak">
        <p><strong>You still need to complete the following questions before your requirements can be published:</strong></p>
      </div>
      {% for section in sections %}
        {% for question in section.questions %}
          {% if question.answer_required %}
            <ul>
              <li>
                <a href="{{ url_for('.edit_brief_question', framework_slug=brief.frameworkSlug, lot_slug=brief.lotSlug, brief_id=brief.id, section_slug=section.slug, question_id=question.id) }}">{{ question.question or question.name }}</a>
              </li>
            </ul>
          {% endif %}
        {% endfor %}
      {% endfor %}
    {% elif brief.lotSlug != 'digital-specialists' or brief.requirementsLength %}
      {% import "toolkit/summary-table.html" as summary %}
        {% call summary.mapping_table(
        row_bold_borders=True,
        text_large = True,
        no_bottom_border=True,
        caption="If you publish today, you must be aware of the following dates:" if not published,
        caption_visible=not published,
        field_headings=[
          "Date",
          "Notice",
        ],
        field_headings_visible=False
      ) %}
        {% call summary.row(no_border=True) %}
          {{ summary.field_heading_date("Today" if not published else (brief.publishedAt | shortdateformat), scope='row') }}
          {{ summary.text("Suppliers can apply and ask questions about your requirements.") }}
        {% endcall %}
        {% if brief.questionAndAnswerSessionDetails %}
          {% call summary.row(bold_border=True) %}
            {{ summary.field_heading_date("Before {}".format(dates.questions_close | shortdateformat), rowspan='3', scope='row') }}
            {{ summary.text_bold("Details of your question and answer session") }}
            {% if not published %}
              {{ summary.edit_link("Edit", url_for('.edit_brief_question', framework_slug=brief.frameworkSlug, lot_slug=brief.lotSlug, brief_id=brief.id, section_slug=question_and_answers.slug, question_id=question_and_answers.id)) }}
            {% endif %}
          {% endcall %}
          {% call summary.row(no_border=True) %}
            {{ summary.text(brief.questionAndAnswerSessionDetails) }}
          {% endcall %}
          {% call summary.row(no_border=True) %}
            {{ summary.text_bold("You must hold your question and answer session before {}.".format(dates.questions_close | shortdateformat), border=True) }}
          {% endcall %}
        {% endif %}
        {% call summary.row(bold_border=True) %}
          {{ summary.field_heading_date(dates.questions_close | shortdateformat, scope='row') }}
          {{ summary.text("The last day suppliers can ask questions.") }}
        {% endcall %}
        {% call summary.row(bold_border=True) %}
          {{ summary.field_heading_date(dates.answers_close | shortdateformat, scope='row') }}
          {{ summary.text("You must have published answers to all suppliers’ questions.") }}
        {% endcall %}
        {% call summary.row(bold_border=True) %}
          {{ summary.field_heading_date(dates.closing_date | shortdateformat, scope='row') }}
          {{ summary.text("The last day suppliers can apply.") }}
        {% endcall %}
      {% endcall %}
      {% if not published %}
        <div>
            <p>
                <a href="{{ url_for('main.get_brief_by_id', framework_slug=brief.frameworkSlug, brief_id=brief.id) }}"
                   target="_blank">Preview this brief</a> <span>(opens in new tab)</span>
            </p>
        </div>
        <form action="{{ url_for('.publish_brief', framework_slug=brief.frameworkSlug, lot_slug=brief.lotSlug, brief_id=brief.id) }}" method="POST">
          {{ form.csrf_token }}
          {%
          with
          type = "save",
          role = "button",
          label = "Publish brief"
          %}
          {% include "toolkit/button.html" %}
          {% endwith %}
        </form>
      {% endif %}
    {% endif %}
    <br>
{'fraction_non_alphanumeric': 0.13907918968692448, 'fraction_numerical': 0.0004419889502762431, 'mean_word_length': 2.587737843551797, 'pattern_counts': {'":': 14, '<': 114, '<?xml version=': 0, '>': 116, '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': '821556', 'n_tokens_mistral': 4106, 'n_tokens_neox': 3821, 'n_words': 931}