<commit_before><!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">

<!-- =================Section: Milestones (4) =========================== -->
<th:block th:fragment="section-content">
    <div th:if="${#fields.hasErrors('${competitionSetupForm.*}')}" class="govuk-error-summary" role="alert" aria-labelledby="error-summary-title" tabindex="-1" data-module="error-summary">
        <h2 class="govuk-error-summary__title" id="error-summary-title">There is a problem</h2>
        <th:block th:insert="fragments/elements :: error-summary-list(competitionSetupForm)" />
    </div>

    <th:block th:insert="fragments/layout :: page-title" th:with="pageTitle='Milestones',size='govuk-heading-xl'" />

    <div class="govuk-body panel">
        Define the competition milestones. Make sure that dates are in order of milestones, for example the briefing date cannot come after the submission date.
    </div>

    <form th:action="@{(${model.general.editable} ? '' : 'milestones/edit')}"
          th:attr="data-competition=${model.general.competition.id}" data-section="milestones"
          method="post" th:object="${competitionSetupForm}" novalidate="novalidate">
        <div th:if="${model.general.editable}" id="section-4-edit">

            <table class="govuk-table milestones-table">
                <thead class="govuk-table__head">
                <tr class="govuk-table__row">
                    <th class="govuk-table__header" scope="col" id="milestone">Milestone</th>
                    <th class="govuk-table__header" scope="col" id="time">Time</th>
                    <th class="govuk-table__header" scope="col" id="weekday">Weekday</th>
                    <th class="govuk-table__header" scope="col" id="day">Day</th>
                    <th class="govuk-table__header" scope="col" id="month">Month</th>
                    <th class="govuk-table__header" scope="col" id="year">Year</th>
                </tr>
                </thead>
                <tbody class="govuk-table__body">
                  <tr th:each="(milestoneEntry : ${competitionSetupForm.milestoneEntries})"
                      th:if="${milestoneEntry.value.milestoneType.presetDate}"
                      class="govuk-table__row date-group form-group-row"
                      data-future-date=""
                      th:attr="data-date-invalid-errormessage=${milestoneEntry.value.milestoneType.milestoneDescription + ': Please enter a valid date.'},
                               data-date-future-errormessage=${milestoneEntry.value.milestoneType.milestoneDescription  + ': Please enter a future date' + (milestoneEntry.value.firstMilestone ? '' : ' that is after the previous milestone') + '.'}">
                      <th class="govuk-table__header" scope="row">
                          <legend th:id="${'milestone-' + milestoneEntry.key}" th:text="${milestoneEntry.value.milestoneType.milestoneDescription}" />
                      </th>
                      <td class="govuk-table__cell time">
                        <input type="hidden"
                               required="required"
                               th:name="'milestoneEntries[' + ${milestoneEntry.key} + '].milestoneType'"
                               th:value="${milestoneEntry.key}" />
                        <input type="hidden"
                               th:name="'milestoneEntries[' + ${milestoneEntry.key} + '].editable'"
                               th:value="${milestoneEntry.value.editable}" />
                          <select th:if="${milestoneEntry.value.timeOption}"
                                  th:id="'milestoneEntries[' + ${milestoneEntry.key} + '].time'"
                                  aria-labelledby="time"
                                  class="govuk-select"
                                  required="required"
                                  th:name="'milestoneEntries[' + ${milestoneEntry.key} + '].time'"
                                  th:readonly="${!milestoneEntry.value.readonly}">
                              <option th:each="time : ${T(org.innovateuk.ifs.management.competition.setup.core.form.MilestoneTime).values()}"
                                      th:text="${time.display}" th:value="${time}" th:attr="data-time=${time.hour}" th:selected="${time == milestoneEntry.value.time}"></option>
                          </select>
                          <th:block th:if="${milestoneEntry.value.middayTime}" >
                              12:00 pm
                            <input type="hidden"
                                data-time="12"
                                th:name="'milestoneEntries[' + ${milestoneEntry.key} + '].time'"
                                th:id="'milestoneEntries[' + ${milestoneEntry.key} + '].time'"
                                th:value="${T(org.innovateuk.ifs.management.competition.setup.core.form.MilestoneTime).TWELVE_PM}">
                          </th:block>
                      </td>
                      <td class="govuk-table__cell js-addWeekDay" th:id="'milestoneWeekdayEntry-' + ${milestoneEntry.key}" th:text="${milestoneEntry.value.dayOfWeek}"></td>
                      <td class="govuk-table__cell day">
                          <input type="text"
                                 placeholder="DD"
                                 min="1"
                                 max="31"
                                 data-maxlength-errormessage=""
                                 required="required"
                                 pattern="^[0-9]{1,2}$"
                                 data-prevent-input-regex="[^0-9]"
                                 maxlength="2"
                                 minlength="1"
                                 aria-labelledby="day"
                                 class="govuk-input govuk-input--width-4"
                                 th:attr="aria-labelledby=${'day milestone-' + milestoneEntry.key},
                                           data-date=${milestoneEntry.value.day+'-'+milestoneEntry.value.month+'-'+milestoneEntry.value.year}"
                                 th:value="${milestoneEntry.value.day}"
                                 th:name="'milestoneEntries[' + ${milestoneEntry.key} + '].day'"
                                 th:readonly="${milestoneEntry.value.readonly}" />
                      </td>
                      <td class="govuk-table__cell month">
                          <input type="text"
                                placeholder="MM"
                                min="1"
                                max="12"
                                required="required"
                                pattern="^[0-9]{1,2}$"
                                data-prevent-input-regex="[^0-9]"
                                maxlength="2"
                                minlength="1"
                                aria-labelledby="month"
                                class="govuk-input govuk-input--width-4"
                                th:attr="aria-labelledby=${'month milestone-' + milestoneEntry.key},data-date=${milestoneEntry.value.day+'-'+milestoneEntry.value.month+'-'+milestoneEntry.value.year}"
                                th:value="${milestoneEntry.value.month}"
                                th:name="'milestoneEntries[' + ${milestoneEntry.key} + '].month'"
                                th:readonly="${milestoneEntry.value.readonly}"/>
                      </td>
                      <td class="govuk-table__cell year">
                          <input type="text"
                                 placeholder="YYYY"
                                 pattern="[0-9]{4,}"
                                 data-prevent-input-regex="[^0-9]"
                                 maxlength="4"
                                 minlength="4"
                                 aria-labelledby="year"
                                 th:attr="aria-labelledby=${'year milestone-' + milestoneEntry.key},
                                 data-date=${milestoneEntry.value.day+'-'+milestoneEntry.value.month+'-'+milestoneEntry.value.year},
                                 min=${#dates.format(#dates.createNow(), 'yyyy')}"
                                 required="required"
                                 class="govuk-input govuk-input--width-4"
                                 th:value="${milestoneEntry.value.year}"
                                 th:name="'milestoneEntries[' + ${milestoneEntry.key} + '].year'"
                                 th:readonly="${milestoneEntry.value.readonly}" />
                          </td>
                    </tr>
                </tbody>
            </table>
            <button class="govuk-button govuk-!-margin-top-6">Done</button>

        </div>

        <th:block th:unless="${model.general.editable}">
            <table class="govuk-table">
                <thead class="govuk-table__head">
                    <tr class="govuk-table__row">
                        <th class="govuk-table__header" scope="col" id="milestone">Milestone</th>
                        <th class="govuk-table__header" scope="col">Time</th>
                        <th class="govuk-table__header" scope="col">Weekday</th>
                        <th class="govuk-table__header" scope="col">Date</th>
                    </tr>
                </thead>
                <tbody class="govuk-table__body">
                    <tr class="govuk-table__row" th:each="milestoneEntry : ${competitionSetupForm.milestoneEntries}"
                        th:if="${milestoneEntry.value.milestoneType.presetDate}">
                        <td class="govuk-table__cell" th:text="${milestoneEntry.value.milestoneType.milestoneDescription}"></td>
                        <td class="govuk-table__cell">
                            <th:block th:if="${milestoneEntry.value.timeOption}" th:text="${milestoneEntry.value.time.display}"/>
                            <th:block th:if="${milestoneEntry.value.middayTime}">12:00 pm</th:block>
                        </td>
                        <td class="govuk-table__cell" th:text="${milestoneEntry.value.dayOfWeek}"></td>
                        <td class="govuk-table__cell" th:text="${#temporals.format(milestoneEntry.value.date, 'd MMMM yyyy')}"></td>
                    </tr>
                </tbody>
            </table>
            <button th:unless="${model.general.state.preventEdit}" type="submit" class="govuk-button govuk-!-margin-top-6">Edit</button>
        </th:block>
    </form>

    <ul class="govuk-list pagination">
        <li class="prev">
            <a rel="prev" title="Navigate to previous part"
               th:href="@{/competition/setup/{competitionId}/section/{sectionPath}(competitionId=${model.general.competition.id},sectionPath='completion-stage')}">
                <span class="pagination-label">Previous</span>
                <span class="pagination-part-title">Completion stage</span>
            </a>
        </li>
        <li class="next">
            <a rel="next" title="Navigate to next part" th:href="@{/competition/setup/{sectionPath}/{competitionId}(competitionId=${model.general.competition.id},sectionPath='public-content')}">
                <span class="pagination-label">Next</span>
                <span class="pagination-part-title">Public content</span>
            </a>
        </li>
    </ul>
</th:block>
</html>
<commit_msg>IFS-6574 tidy up of thymeleaf expressions<commit_after><!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">

<!-- =================Section: Milestones (4) =========================== -->
<th:block th:fragment="section-content">
    <div th:if="${#fields.hasErrors('${competitionSetupForm.*}')}" class="govuk-error-summary" role="alert" aria-labelledby="error-summary-title" tabindex="-1" data-module="error-summary">
        <h2 class="govuk-error-summary__title" id="error-summary-title">There is a problem</h2>
        <th:block th:insert="fragments/elements :: error-summary-list(competitionSetupForm)" />
    </div>

    <th:block th:insert="fragments/layout :: page-title" th:with="pageTitle='Milestones',size='govuk-heading-xl'" />

    <div class="govuk-body panel">
        Define the competition milestones. Make sure that dates are in order of milestones, for example the briefing date cannot come after the submission date.
    </div>

    <form th:action="@{(${model.general.editable} ? '' : 'milestones/edit')}"
          th:attr="data-competition=${model.general.competition.id}" data-section="milestones"
          method="post" th:object="${competitionSetupForm}" novalidate="novalidate">
        <div th:if="${model.general.editable}" id="section-4-edit">

            <table class="govuk-table milestones-table">
                <thead class="govuk-table__head">
                <tr class="govuk-table__row">
                    <th class="govuk-table__header" scope="col" id="milestone">Milestone</th>
                    <th class="govuk-table__header" scope="col" id="time">Time</th>
                    <th class="govuk-table__header" scope="col" id="weekday">Weekday</th>
                    <th class="govuk-table__header" scope="col" id="day">Day</th>
                    <th class="govuk-table__header" scope="col" id="month">Month</th>
                    <th class="govuk-table__header" scope="col" id="year">Year</th>
                </tr>
                </thead>
                <tbody class="govuk-table__body">
                  <tr th:each="(milestoneEntry : ${competitionSetupForm.milestoneEntries})"
                      th:if="${milestoneEntry.value.milestoneType.presetDate}"
                      class="govuk-table__row date-group form-group-row"
                      data-future-date=""
                      th:attr="data-date-invalid-errormessage=${milestoneEntry.value.milestoneType.milestoneDescription + ': Please enter a valid date.'},
                               data-date-future-errormessage=${milestoneEntry.value.milestoneType.milestoneDescription  + ': Please enter a future date' + (milestoneEntry.value.firstMilestone ? '' : ' that is after the previous milestone') + '.'}">
                      <th class="govuk-table__header" scope="row">
                          <legend th:id="${'milestone-' + milestoneEntry.key}" th:text="${milestoneEntry.value.milestoneType.milestoneDescription}" />
                      </th>
                      <td class="govuk-table__cell time">
                        <input type="hidden"
                               required="required"
                               th:name="'milestoneEntries[' + ${milestoneEntry.key} + '].milestoneType'"
                               th:value="${milestoneEntry.key}" />
                        <input type="hidden"
                               th:name="'milestoneEntries[' + ${milestoneEntry.key} + '].editable'"
                               th:value="${milestoneEntry.value.editable}" />
                          <select th:if="${milestoneEntry.value.timeOption}"
                                  th:id="'milestoneEntries[' + ${milestoneEntry.key} + '].time'"
                                  aria-labelledby="time"
                                  class="govuk-select"
                                  required="required"
                                  th:name="'milestoneEntries[' + ${milestoneEntry.key} + '].time'"
                                  th:readonly="${!milestoneEntry.value.readonly}">
                              <option th:each="time : ${T(org.innovateuk.ifs.management.competition.setup.core.form.MilestoneTime).values()}"
                                      th:text="${time.display}" th:value="${time}" th:attr="data-time=${time.hour}" th:selected="${time == milestoneEntry.value.time}"></option>
                          </select>
                          <th:block th:if="${milestoneEntry.value.middayTime}" >
                              12:00 pm
                            <input type="hidden"
                                data-time="12"
                                th:name="'milestoneEntries[' + ${milestoneEntry.key} + '].time'"
                                th:id="'milestoneEntries[' + ${milestoneEntry.key} + '].time'"
                                th:value="${T(org.innovateuk.ifs.management.competition.setup.core.form.MilestoneTime).TWELVE_PM}">
                          </th:block>
                      </td>
                      <td class="govuk-table__cell js-addWeekDay" th:id="'milestoneWeekdayEntry-' + ${milestoneEntry.key}" th:text="${milestoneEntry.value.dayOfWeek}"></td>
                      <td class="govuk-table__cell day">
                          <input type="text"
                                 placeholder="DD"
                                 min="1"
                                 max="31"
                                 data-maxlength-errormessage=""
                                 required="required"
                                 pattern="^[0-9]{1,2}$"
                                 data-prevent-input-regex="[^0-9]"
                                 maxlength="2"
                                 minlength="1"
                                 aria-labelledby="day"
                                 class="govuk-input govuk-input--width-4"
                                 th:attr="aria-labelledby=|day milestone-${milestoneEntry.key}|,
                                 data-date=|${milestoneEntry.value.day}-${milestoneEntry.value.month}-${milestoneEntry.value.year}|"
                                 th:value="${milestoneEntry.value.day}"
                                 th:name="'milestoneEntries[' + ${milestoneEntry.key} + '].day'"
                                 th:readonly="${milestoneEntry.value.readonly}" />
                      </td>
                      <td class="govuk-table__cell month">
                          <input type="text"
                                placeholder="MM"
                                min="1"
                                max="12"
                                required="required"
                                pattern="^[0-9]{1,2}$"
                                data-prevent-input-regex="[^0-9]"
                                maxlength="2"
                                minlength="1"
                                aria-labelledby="month"
                                class="govuk-input govuk-input--width-4"
                                th:attr="aria-labelledby=|day milestone-${milestoneEntry.key}|,
                                data-date=|${milestoneEntry.value.day}-${milestoneEntry.value.month}-${milestoneEntry.value.year}|"
                                th:value="${milestoneEntry.value.month}"
                                th:name="'milestoneEntries[' + ${milestoneEntry.key} + '].month'"
                                th:readonly="${milestoneEntry.value.readonly}"/>
                      </td>
                      <td class="govuk-table__cell year">
                          <input type="text"
                                 placeholder="YYYY"
                                 pattern="[0-9]{4,}"
                                 data-prevent-input-regex="[^0-9]"
                                 maxlength="4"
                                 minlength="4"
                                 aria-labelledby="year"
                                 th:attr="aria-labelledby=|year milestone-${milestoneEntry.key}|,
                                 data-date=|${milestoneEntry.value.day}-${milestoneEntry.value.month}-${milestoneEntry.value.year}|,
                                 min=${#dates.format(#dates.createNow(), 'yyyy')}"
                                 required="required"
                                 class="govuk-input govuk-input--width-4"
                                 th:value="${milestoneEntry.value.year}"
                                 th:name="'milestoneEntries[' + ${milestoneEntry.key} + '].year'"
                                 th:readonly="${milestoneEntry.value.readonly}" />
                          </td>
                    </tr>
                </tbody>
            </table>
            <button class="govuk-button govuk-!-margin-top-6">Done</button>

        </div>

        <th:block th:unless="${model.general.editable}">
            <table class="govuk-table">
                <thead class="govuk-table__head">
                    <tr class="govuk-table__row">
                        <th class="govuk-table__header" scope="col" id="milestone">Milestone</th>
                        <th class="govuk-table__header" scope="col">Time</th>
                        <th class="govuk-table__header" scope="col">Weekday</th>
                        <th class="govuk-table__header" scope="col">Date</th>
                    </tr>
                </thead>
                <tbody class="govuk-table__body">
                    <tr class="govuk-table__row" th:each="milestoneEntry : ${competitionSetupForm.milestoneEntries}"
                        th:if="${milestoneEntry.value.milestoneType.presetDate}">
                        <td class="govuk-table__cell" th:text="${milestoneEntry.value.milestoneType.milestoneDescription}"></td>
                        <td class="govuk-table__cell">
                            <th:block th:if="${milestoneEntry.value.timeOption}" th:text="${milestoneEntry.value.time.display}"/>
                            <th:block th:if="${milestoneEntry.value.middayTime}">12:00 pm</th:block>
                        </td>
                        <td class="govuk-table__cell" th:text="${milestoneEntry.value.dayOfWeek}"></td>
                        <td class="govuk-table__cell" th:text="${#temporals.format(milestoneEntry.value.date, 'd MMMM yyyy')}"></td>
                    </tr>
                </tbody>
            </table>
            <button th:unless="${model.general.state.preventEdit}" type="submit" class="govuk-button govuk-!-margin-top-6">Edit</button>
        </th:block>
    </form>

    <ul class="govuk-list pagination">
        <li class="prev">
            <a rel="prev" title="Navigate to previous part"
               th:href="@{/competition/setup/{competitionId}/section/{sectionPath}(competitionId=${model.general.competition.id},sectionPath='completion-stage')}">
                <span class="pagination-label">Previous</span>
                <span class="pagination-part-title">Completion stage</span>
            </a>
        </li>
        <li class="next">
            <a rel="next" title="Navigate to next part" th:href="@{/competition/setup/{sectionPath}/{competitionId}(competitionId=${model.general.competition.id},sectionPath='public-content')}">
                <span class="pagination-label">Next</span>
                <span class="pagination-part-title">Public content</span>
            </a>
        </li>
    </ul>
</th:block>
</html>

{'fraction_non_alphanumeric': 0.14747950462236176, 'fraction_numerical': 0.004884004884004884, 'mean_word_length': 1.5217725973169123, 'pattern_counts': {'":': 0, '<': 239, '<?xml version=': 0, '>': 239, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 75, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4447809', 'n_tokens_mistral': 6097, 'n_tokens_neox': 5759, 'n_words': 769}