<commit_before><!DOCTYPE html>
<html lang="en" class="govuk-template" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <th:block th:insert="fragments/layout :: head" th:with="pageTitle='Project team'"/>
</head>
<body class="govuk-template__body project-detail team"
      th:classappend="${model.isInternalUserView() ? 'competition-management' : ''}">

<th:block th:insert="fragments/layout :: body-start"/>
<th:block th:insert="fragments/layout :: global-header"/>
<th:block th:insert="fragments/modals :: modal-overlay"/>

<div class="govuk-width-container">
    <th:block th:insert="fragments/layout :: phase-banner"/>
    <th:block th:unless="${model.isInternalUserView()}">
        <th:block th:insert="fragments/layout :: header-sub"
                  th:with="linkTitle='Set up your project',linkUrl=@{/project/{id}(id=${model.projectId})}"/>
    </th:block>

    <th:block th:if="${model.isInternalUserView()}">
        <th:block th:insert="fragments/layout :: header-sub"
                  th:with="linkTitle='Projects in setup',linkUrl=@{/competition/{id}/status (id=${model.competitionId})}"/>
    </th:block>

    <main class="govuk-main-wrapper" id="main-content" role="main">
        <div th:if="${#fields.hasErrors('${form.*}')}" 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(form)"/>
        </div>

        <th:block th:insert="fragments/layout :: page-title"
                  th:with="pageTitle='Project team',subTitle=${model.projectName},size='govuk-heading-xl'"/>

        <p class="govuk-body">The lead partner must choose a project manager who will be responsible for setting up the
            project. Each partner must provide a finance contact. We will contact the assigned person with any finance
            queries.</p>
        <p class="govuk-body">Everyone below can view all of project setup. If you add a new person they will show as
            pending until they register for the website. Once they register you can assign them a role.</p>
        <th:block th:unless="${model.isInternalUserView() or model.isReadOnly()}">
            <table class="govuk-table">
                <thead class="govuk-table__head">
                <tr class="govuk-table__row">
                    <th scope="col" class="govuk-table__header larger-cols"><span class="govuk-visually-hidden">Role</span>
                    </th>
                    <th scope="col" class="govuk-table__header"><span class="govuk-visually-hidden">Name</span></th>
                    <th scope="col" class="govuk-table__header smaller-col"><span
                        class="govuk-visually-hidden">Status</span></th>
                </tr>
                </thead>
                <tbody class="govuk-table__body">
                <tr th:if="${model.userLeadPartner}"
                    class="govuk-table__row">
                    <td class="govuk-table__cell">
                        <a th:unless="${model.grantOfferLetterGenerated}"
                           th:href="@{/project/{id}/team/project-manager(id=${model.projectId})}" class="govuk-link">Project
                            manager</a>
                        <th:block th:if="${model.grantOfferLetterGenerated}">Project manager</th:block>
                    </td>
                    <td class="govuk-table__cell"
                        th:text="${model.projectManager != null ? model.projectManager?.userName : '-'}">
                    </td>
                    <td class="govuk-table__cell">
                        <strong th:if="${model.projectManager == null}" class="incomplete-status">Incomplete</strong>
                        <strong th:unless="${model.projectManager == null}" class="complete-status">Complete</strong>
                    </td>
                </tr>
                <tr class="govuk-table__row">
                    <td class="govuk-table__cell">
                        <a th:href="@{/project/{projectId}/team/finance-contact/organisation/{organisationId}(projectId=${model.projectId},organisationId=${model.loggedInUserOrg.orgId})}"
                           class="govuk-link">Your finance contact</a>
                    </td>
                    <td class="govuk-table__cell"
                        th:text="${model.loggedInUserOrg.getFinanceContact() != null ? model.loggedInUserOrg.getFinanceContact().name : '-'}">
                    </td>
                    <td class="govuk-table__cell">
                        <strong th:if="${model.loggedInUserOrg.getFinanceContact() == null}"
                                class="incomplete-status">Incomplete</strong>
                        <strong th:unless="${model.loggedInUserOrg.getFinanceContact() == null}"
                                class="complete-status">Complete</strong>
                    </td>
                </tr>
                </tbody>
            </table>
        </th:block>

        <form th:action="@{${#ifsUtil.formPostUri(#httpServletRequest)}}" th:object="${form}" novalidate="novalidate"
              method="post">
            <th:block th:each="organisation: ${model.partnerOrgs}">
                <h2 class="govuk-heading-m govuk-!-margin-bottom-0">
                    <th:block th:text="${organisation.orgName}"></th:block>
                    <th:block th:if="${organisation.leadOrg}">(Lead)</th:block>
                </h2>
                <table class="govuk-table"
                       th:classappend="${organisation.editable and !model.readOnly ? 'govuk-!-margin-bottom-2' : ''}">
                    <thead class="govuk-table__head">
                    <tr class="govuk-table__row">
                        <th scope="col" class="govuk-table__header larger-cols">Full name</th>
                        <th scope="col" class="govuk-table__header smaller-col">Email</th>
                        <th scope="col" class="govuk-table__header width-200"><span
                            class="govuk-visually-hidden">Remove</span></th>
                    </tr>
                    </thead>
                    <tbody class="govuk-table__body">
                    <tr th:each="user : ${organisation.users}"
                        class="govuk-table__row">
                        <td class="govuk-table__cell"
                            th:text="${user.displayName}"
                            th:classappend="${user.invite ? 'hint' : ''}"></td>
                        <td class="govuk-table__cell"
                            th:text="${user.getEmail()}"
                            th:classappend="${user.invite ? 'hint' : ''}">-
                        </td>
                        <td class="govuk-table__cell"
                            th:classappend="${user.invite ? 'hint' : ''}">
                            <th:block th:if="${organisation.editable and !model.isReadOnly()}">
                                <th:block
                                    th:if="${!user.invite and model.loggedInUserId != user.id and !user.isFinanceContact() and !user.isProjectManager() and !model.isInternalUserView()}">
                                    <th:block th:insert="fragments/modals :: modal-project-team-remove (${user})"/>
                                    <a th:attr="data-js-modal=${'modal-project-team-remove-' + user.id}"
                                       th:href="@{/project/{projectId}/team/remove-user/{userId}(projectId=${model.projectId},userId=${user.id})}"
                                       class="govuk-link">Remove</a>
                                </th:block>
                                <th:block th:if="${user.invite}">
                                    <button class="button-clear govuk-!-margin-right-1" type="submit"
                                            name="resend-invite" th:value="${user.id}">Resend invite<commit_msg>IFS-5873 change line back<commit_after><!DOCTYPE html>
<html lang="en" class="govuk-template" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <th:block th:insert="fragments/layout :: head" th:with="pageTitle='Project team'"/>
</head>
<body class="govuk-template__body project-detail team"
      th:classappend="${model.isInternalUserView() ? 'competition-management' : ''}">

<th:block th:insert="fragments/layout :: body-start"/>
<th:block th:insert="fragments/layout :: global-header"/>
<th:block th:insert="fragments/modals :: modal-overlay"/>

<div class="govuk-width-container">
    <th:block th:insert="fragments/layout :: phase-banner"/>
    <th:block th:unless="${model.isInternalUserView()}">
        <th:block th:insert="fragments/layout :: header-sub"
                  th:with="linkTitle='Set up your project',linkUrl=@{/project/{id}(id=${model.projectId})}"/>
    </th:block>

    <th:block th:if="${model.isInternalUserView()}">
        <th:block th:insert="fragments/layout :: header-sub"
                  th:with="linkTitle='Projects in setup',linkUrl=@{/competition/{id}/status (id=${model.competitionId})}"/>
    </th:block>

    <main class="govuk-main-wrapper" id="main-content" role="main">
        <div th:if="${#fields.hasErrors('${form.*}')}" 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(form)"/>
        </div>

        <th:block th:insert="fragments/layout :: page-title"
                  th:with="pageTitle='Project team',subTitle=${model.projectName},size='govuk-heading-xl'"/>

        <p class="govuk-body">The lead partner must choose a project manager who will be responsible for setting up the
            project. Each partner must provide a finance contact. We will contact the assigned person with any finance
            queries.</p>
        <p class="govuk-body">Everyone below can view all of project setup. If you add a new person they will show as
            pending until they register for the website. Once they register you can assign them a role.</p>
        <th:block th:unless="${model.isInternalUserView() or model.isReadOnly()}">
            <table class="govuk-table">
                <thead class="govuk-table__head">
                <tr class="govuk-table__row">
                    <th scope="col" class="govuk-table__header larger-cols"><span class="govuk-visually-hidden">Role</span>
                    </th>
                    <th scope="col" class="govuk-table__header"><span class="govuk-visually-hidden">Name</span></th>
                    <th scope="col" class="govuk-table__header smaller-col"><span
                        class="govuk-visually-hidden">Status</span></th>
                </tr>
                </thead>
                <tbody class="govuk-table__body">
                <tr th:if="${model.userLeadPartner}"
                    class="govuk-table__row">
                    <td class="govuk-table__cell">
                        <a th:unless="${model.grantOfferLetterGenerated}"
                           th:href="@{/project/{id}/team/project-manager(id=${model.projectId})}" class="govuk-link">Project
                            manager</a>
                        <th:block th:if="${model.grantOfferLetterGenerated}">Project manager</th:block>
                    </td>
                    <td class="govuk-table__cell"
                        th:text="${model.projectManager != null ? model.projectManager?.userName : '-'}">
                    </td>
                    <td class="govuk-table__cell">
                        <strong th:if="${model.projectManager == null}" class="incomplete-status">Incomplete</strong>
                        <strong th:unless="${model.projectManager == null}" class="complete-status">Complete</strong>
                    </td>
                </tr>
                <tr class="govuk-table__row">
                    <td class="govuk-table__cell">
                        <a th:href="@{/project/{projectId}/team/finance-contact/organisation/{organisationId}(projectId=${model.projectId},organisationId=${model.loggedInUserOrg.orgId})}"
                           class="govuk-link">Your finance contact</a>
                    </td>
                    <td class="govuk-table__cell"
                        th:text="${model.loggedInUserOrg.getFinanceContact() != null ? model.loggedInUserOrg.getFinanceContact().name : '-'}">
                    </td>
                    <td class="govuk-table__cell">
                        <strong th:if="${model.loggedInUserOrg.getFinanceContact() == null}"
                                class="incomplete-status">Incomplete</strong>
                        <strong th:unless="${model.loggedInUserOrg.getFinanceContact() == null}"
                                class="complete-status">Complete</strong>
                    </td>
                </tr>
                </tbody>
            </table>
        </th:block>

        <form th:action="@{${#ifsUtil.formPostUri(#httpServletRequest)}}" th:object="${form}" novalidate="novalidate"
              method="post">
            <th:block th:each="organisation: ${model.partnerOrgs}">
                <h2 class="govuk-heading-m govuk-!-margin-bottom-0">
                    <th:block th:text="${organisation.orgName}"></th:block>
                    <th:block th:if="${organisation.leadOrg}">(Lead)</th:block>
                </h2>
                <table class="govuk-table"
                       th:classappend="${organisation.editable and !model.isReadOnly() ? 'govuk-!-margin-bottom-2' : ''}">
                    <thead class="govuk-table__head">
                    <tr class="govuk-table__row">
                        <th scope="col" class="govuk-table__header larger-cols">Full name</th>
                        <th scope="col" class="govuk-table__header smaller-col">Email</th>
                        <th scope="col" class="govuk-table__header width-200"><span
                            class="govuk-visually-hidden">Remove</span></th>
                    </tr>
                    </thead>
                    <tbody class="govuk-table__body">
                    <tr th:each="user : ${organisation.users}"
                        class="govuk-table__row">
                        <td class="govuk-table__cell"
                            th:text="${user.displayName}"
                            th:classappend="${user.invite ? 'hint' : ''}"></td>
                        <td class="govuk-table__cell"
                            th:text="${user.getEmail()}"
                            th:classappend="${user.invite ? 'hint' : ''}">-
                        </td>
                        <td class="govuk-table__cell"
                            th:classappend="${user.invite ? 'hint' : ''}">
                            <th:block th:if="${organisation.editable and !model.isReadOnly()}">
                                <th:block
                                    th:if="${!user.invite and model.loggedInUserId != user.id and !user.isFinanceContact() and !user.isProjectManager() and !model.isInternalUserView()}">
                                    <th:block th:insert="fragments/modals :: modal-project-team-remove (${user})"/>
                                    <a th:attr="data-js-modal=${'modal-project-team-remove-' + user.id}"
                                       th:href="@{/project/{projectId}/team/remove-user/{userId}(projectId=${model.projectId},userId=${user.id})}"
                                       class="govuk-link">Remove</a>
                                </th:block>
                                <th:block th:if="${user.invite}">
                                    <button class="button-clear govuk-!-margin-right-1" type="submit"
                                            name="resend-invite" th:value="${user.id}">Resend invite
{'fraction_non_alphanumeric': 0.15512104283054004, 'fraction_numerical': 0.0022346368715083797, 'mean_word_length': 1.8672361630183307, 'pattern_counts': {'":': 0, '<': 235, '<?xml version=': 0, '>': 235, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3441683', 'n_tokens_mistral': 4479, 'n_tokens_neox': 4277, 'n_words': 680}