<commit_before>﻿@using SFA.DAS.Common.Domain.Types
@model OrchestratorResponse<SearchOrganisationResultsViewModel>

@{
    ViewBag.PageID = "select-your-organisation";
    ViewBag.Title = "Select your organisation";
    ViewBag.HideNav = !Model.Data.IsExistingAccount;
    ViewBag.Section = "organisations";
    ViewBag.ZenDeskLabel = "eas-select-your-organisation";
}

@{
    ViewBag.GaData.Vpv = Model.Data.IsExistingAccount ? "/accounts/organisations/search/results/select-your-organisation" : "/onboarding/search/results/select-your-organisation";
}

@{Layout = "~/Views/Shared/_Layout_CDN.cshtml"; }

<div class="govuk-grid-row">
    <div class="govuk-grid-column-two-thirds">
        <h1 class="govuk-heading-xl">@ViewBag.Title</h1>
        <form action="@Url.Action("SearchForOrganisationResults")" method="POST" role="search" aria-label="On this page">
            <div class="govuk-form-group">
                <label for="searchTerm" class="govuk-label">
                    Search results
                </label>
                <div class="das-search-form__group">
                    <input id="searchTerm" name="searchTerm" title="Search" class="govuk-input das-search-form__input" type="text" value="@Model.Data.SearchTerm" />
                    <div class="das-search-form__button-wrap">
                        <button class="govuk-button das-search-form__button" type="submit">Search</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<div class="govuk-grid-row">
    <section class="govuk-grid-column-one-third">
        <form id="filter" action="@Url.Action("SearchForOrganisationResults")?searchTerm=@(HttpUtility.UrlEncode(Model.Data.SearchTerm))" method="POST">
            <div class="das-filter">
                <div class="das-filter__header">
                    <h2 class="govuk-heading-m das-filter__heading">Filter results</h2>
                </div>
                <div class="das-filter__body">
                    <fieldset class="govuk-fieldset">
                        <legend class="govuk-fieldset__legend  govuk-fieldset__legend--s">
                            <h3 class="govuk-fieldset__heading">
                                <span class="govuk-visually-hidden">Filter by </span>Organisation type
                            </h3>
                        </legend>
                        <div class="govuk-radios govuk-radios--small">
                            <div class="govuk-radios__item">
                                <input class="govuk-radios__input" id="company" name="organisationType" type="radio" value="CompaniesHouse" @(Model.Data.OrganisationType == OrganisationType.CompaniesHouse ? "checked=\"checked\"" : "")>
                                <label class="govuk-label govuk-radios__label" for="company">
                                    Company
                                </label>
                            </div>
                            <div class="govuk-radios__item">
                                <input class="govuk-radios__input" id="charity" name="organisationType" type="radio" value="Charities" @(Model.Data.OrganisationType == OrganisationType.Charities ? "checked=\"checked\"" : "")>
                                <label class="govuk-label govuk-radios__label" for="charity">
                                    Charity
                                </label>
                            </div>
                            <div class="govuk-radios__item">
                                <input class="govuk-radios__input" id="publicSector" name="organisationType" type="radio" value="PublicBodies" @(Model.Data.OrganisationType == OrganisationType.PublicBodies ? "checked=\"checked\"" : "")>
                                <label class="govuk-label govuk-radios__label" for="publicSector">
                                    Public sector
                                </label>
                            </div>
                            <div class="govuk-radios__item">
                                <input class="govuk-radios__input" id="all" name="organisationType" type="radio" value="" @(Model.Data.OrganisationType == null ? "checked=\"checked\"" : "")>
                                <label class="govuk-label govuk-radios__label" for="all">
                                    Show all
                                </label>
                            </div>
                        </div>
                    </fieldset>
                    <div class="form-group das-js-hide">
                        <button type="submit" class="govuk-button govuk-button--secondary">Apply filter</button>
                    </div>
                </div>
            </div>
        </form>
    </section>

    <section class="govuk-grid-column-two-thirds">
        @if (Model.Data.Results.Data != null)
        {
            <h2 class="govuk-heading-m">@(Model.Data?.Results.TotalResults ?? 0) results found</h2>
            <hr class="govuk-section-break govuk-section-break--visible">
            <div class="das-search-results">
                <ol class="das-search-results__list">
                @foreach (var organisation in Model.Data.Results.Data)
                {
                    if (!organisation.AddedToAccount)
                    {
                        <li class="das-search-results__list-item">
                            <form action="@Url.Action("Confirm")" method="post">
                                <input type="hidden" name="DateOfInception" value="@organisation.DateOfInception" />
                                <input type="hidden" name="ReferenceNumber" value="@organisation.ReferenceNumber" />
                                <input type="hidden" name="Sector" value="@organisation.Sector" />
                                <input type="hidden" name="Type" value="@organisation.Type" />
                                <input type="hidden" name="Name" value="@organisation.Name" />
                                <input type="hidden" name="Address" value="@organisation.Address" />
                                <h2 class="govuk-heading-s das-search-results__heading">
                                    <button type="submit">@organisation.Name</button>
                                </h2>
                            </form>
                            <dl class="das-definition-list das-definition-list--inline">
                                <dt class="das-definition-list__title">Address</dt>
                                <dd class="das-definition-list__definition">@(string.IsNullOrEmpty(organisation.Address) ? "No address supplied" : organisation.Address)</dd>
                                <dt class="das-definition-list__title">Type</dt>
                                <dd class="das-definition-list__definition">@organisation.Type.GetDescription()</dd>
                            </dl>
                        </li>
                    }
                    else<commit_msg>Add missing class to the button<commit_after>﻿@using SFA.DAS.Common.Domain.Types
@model OrchestratorResponse<SearchOrganisationResultsViewModel>

@{
    ViewBag.PageID = "select-your-organisation";
    ViewBag.Title = "Select your organisation";
    ViewBag.HideNav = !Model.Data.IsExistingAccount;
    ViewBag.Section = "organisations";
    ViewBag.ZenDeskLabel = "eas-select-your-organisation";
}

@{
    ViewBag.GaData.Vpv = Model.Data.IsExistingAccount ? "/accounts/organisations/search/results/select-your-organisation" : "/onboarding/search/results/select-your-organisation";
}

@{Layout = "~/Views/Shared/_Layout_CDN.cshtml"; }

<div class="govuk-grid-row">
    <div class="govuk-grid-column-two-thirds">
        <h1 class="govuk-heading-xl">@ViewBag.Title</h1>
        <form action="@Url.Action("SearchForOrganisationResults")" method="POST" role="search" aria-label="On this page">
            <div class="govuk-form-group">
                <label for="searchTerm" class="govuk-label">
                    Search results
                </label>
                <div class="das-search-form__group">
                    <input id="searchTerm" name="searchTerm" title="Search" class="govuk-input das-search-form__input" type="text" value="@Model.Data.SearchTerm" />
                    <div class="das-search-form__button-wrap">
                        <button class="govuk-button das-search-form__button" type="submit">Search</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<div class="govuk-grid-row">
    <section class="govuk-grid-column-one-third">
        <form id="filter" action="@Url.Action("SearchForOrganisationResults")?searchTerm=@(HttpUtility.UrlEncode(Model.Data.SearchTerm))" method="POST">
            <div class="das-filter">
                <div class="das-filter__header">
                    <h2 class="govuk-heading-m das-filter__heading">Filter results</h2>
                </div>
                <div class="das-filter__body">
                    <fieldset class="govuk-fieldset">
                        <legend class="govuk-fieldset__legend  govuk-fieldset__legend--s">
                            <h3 class="govuk-fieldset__heading">
                                <span class="govuk-visually-hidden">Filter by </span>Organisation type
                            </h3>
                        </legend>
                        <div class="govuk-radios govuk-radios--small">
                            <div class="govuk-radios__item">
                                <input class="govuk-radios__input" id="company" name="organisationType" type="radio" value="CompaniesHouse" @(Model.Data.OrganisationType == OrganisationType.CompaniesHouse ? "checked=\"checked\"" : "")>
                                <label class="govuk-label govuk-radios__label" for="company">
                                    Company
                                </label>
                            </div>
                            <div class="govuk-radios__item">
                                <input class="govuk-radios__input" id="charity" name="organisationType" type="radio" value="Charities" @(Model.Data.OrganisationType == OrganisationType.Charities ? "checked=\"checked\"" : "")>
                                <label class="govuk-label govuk-radios__label" for="charity">
                                    Charity
                                </label>
                            </div>
                            <div class="govuk-radios__item">
                                <input class="govuk-radios__input" id="publicSector" name="organisationType" type="radio" value="PublicBodies" @(Model.Data.OrganisationType == OrganisationType.PublicBodies ? "checked=\"checked\"" : "")>
                                <label class="govuk-label govuk-radios__label" for="publicSector">
                                    Public sector
                                </label>
                            </div>
                            <div class="govuk-radios__item">
                                <input class="govuk-radios__input" id="all" name="organisationType" type="radio" value="" @(Model.Data.OrganisationType == null ? "checked=\"checked\"" : "")>
                                <label class="govuk-label govuk-radios__label" for="all">
                                    Show all
                                </label>
                            </div>
                        </div>
                    </fieldset>
                    <div class="form-group das-js-hide">
                        <button type="submit" class="govuk-button govuk-button--secondary">Apply filter</button>
                    </div>
                </div>
            </div>
        </form>
    </section>

    <section class="govuk-grid-column-two-thirds">
        @if (Model.Data.Results.Data != null)
        {
            <h2 class="govuk-heading-m">@(Model.Data?.Results.TotalResults ?? 0) results found</h2>
            <hr class="govuk-section-break govuk-section-break--visible">
            <div class="das-search-results">
                <ol class="das-search-results__list">
                @foreach (var organisation in Model.Data.Results.Data)
                {
                    if (!organisation.AddedToAccount)
                    {
                        <li class="das-search-results__list-item">
                            <form action="@Url.Action("Confirm")" method="post">
                                <input type="hidden" name="DateOfInception" value="@organisation.DateOfInception" />
                                <input type="hidden" name="ReferenceNumber" value="@organisation.ReferenceNumber" />
                                <input type="hidden" name="Sector" value="@organisation.Sector" />
                                <input type="hidden" name="Type" value="@organisation.Type" />
                                <input type="hidden" name="Name" value="@organisation.Name" />
                                <input type="hidden" name="Address" value="@organisation.Address" />
                                <h2 class="govuk-heading-s das-search-results__heading">
                                    <button type="submit" class="das-button--inline-link">@organisation.Name</button>
                                </h2>
                            </form>
                            <dl class="das-definition-list das-definition-list--inline">
                                <dt class="das-definition-list__title">Address</dt>
                                <dd class="das-definition-list__definition">@(string.IsNullOrEmpty(organisation.Address) ? "No address supplied" : organisation.Address)</dd>
                                <dt class="das-definition-list__title">Type</dt>
                                <dd class="das-definition-list__definition">@organisation.Type.GetDescription()</dd>
                            </dl>
                        </li>
                    }
                    else
{'fraction_non_alphanumeric': 0.12956645344705045, 'fraction_numerical': 0.0015636105188343995, 'mean_word_length': 1.558828877977814, 'pattern_counts': {'":': 0, '<': 197, '<?xml version=': 0, '>': 197, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2149018', 'n_tokens_mistral': 3714, 'n_tokens_neox': 3523, 'n_words': 541}