<commit_before>﻿@using Purchasing.Core.Domain
@model ReviewOrderViewModel

@if (!Model.Complete)
{
    <section id="approvals" class="ui-corner-all display-form">

        <header class="ui-corner-top ui-widget-header">Approvals</header>

        <div class="section-contents">
    
            <table class="noicon">
                <tbody>
                    @foreach (var approval in Model.OrderedUniqueApprovals)
                    {
                        var approvalDisplayName = (approval.User != null ? Model.ApprovalUsers.First(x => x.Id == approval.User.Id.ToLower()).FullName : string.Format("[Any Workgroup {0}]", approval.StatusCode.Name)) + (approval.SecondaryUser != null ? " or " + Model.ApprovalUsers.First(x=>x.Id == approval.SecondaryUser.Id.ToLower()).FullName : string.Empty);
                        <tr class='@(approval.Completed ? "approval-complete" : "approval-incomplete")'>
                            <td>@approval.StatusCode.Name</td>
                            <td class="name">
                                @approvalDisplayName
                                @if (approval.User == null)
                                {
                                    <a class='workgroupDetails showTip ui-icon ui-icon-person' data-role='@approval.StatusCode.Id' title='Lookup all the people who have workgroup access to this order at this Status.'></a>
                                }
                            </td>
                            <td>@(approval.Completed ? "Approved" : "Pending")</td>
                            @if (Model.CanEditOrder)
                            {
                                <td>
                                    @if (approval.StatusCode.Id == OrderStatusCode.Codes.Purchaser && (Model.Order.StatusCode.Id == OrderStatusCode.Codes.Purchaser || Model.Order.StatusCode.Id == OrderStatusCode.Codes.AccountManager))
                                    {
                                        @Html.ActionLink("Reroute Purchaser", "ReroutePurchaser", new { id = Model.Order.Id }, new { @Class = "button" }) 
                                    }
                                    else if (!approval.Completed && approval.StatusCode.Level == Model.Order.StatusCode.Level && Model.ExternalApprovals.Contains(approval))
                                    {
                                        <a href="#" class="button reroute" data-approval-id="@approval.Id">ReRoute Approval</a><commit_msg>tolower of other user id's. Probably not needed if we can ensure all userid's in the database are lower case.<commit_after>﻿@using Purchasing.Core.Domain
@model ReviewOrderViewModel

@if (!Model.Complete)
{
    <section id="approvals" class="ui-corner-all display-form">

        <header class="ui-corner-top ui-widget-header">Approvals</header>

        <div class="section-contents">
    
            <table class="noicon">
                <tbody>
                    @foreach (var approval in Model.OrderedUniqueApprovals)
                    {
                        var approvalDisplayName = (approval.User != null ? Model.ApprovalUsers.First(x => x.Id.ToLower() == approval.User.Id.ToLower()).FullName : string.Format("[Any Workgroup {0}]", approval.StatusCode.Name)) + (approval.SecondaryUser != null ? " or " + Model.ApprovalUsers.First(x=>x.Id.ToLower() == approval.SecondaryUser.Id.ToLower()).FullName : string.Empty);
                        <tr class='@(approval.Completed ? "approval-complete" : "approval-incomplete")'>
                            <td>@approval.StatusCode.Name</td>
                            <td class="name">
                                @approvalDisplayName
                                @if (approval.User == null)
                                {
                                    <a class='workgroupDetails showTip ui-icon ui-icon-person' data-role='@approval.StatusCode.Id' title='Lookup all the people who have workgroup access to this order at this Status.'></a>
                                }
                            </td>
                            <td>@(approval.Completed ? "Approved" : "Pending")</td>
                            @if (Model.CanEditOrder)
                            {
                                <td>
                                    @if (approval.StatusCode.Id == OrderStatusCode.Codes.Purchaser && (Model.Order.StatusCode.Id == OrderStatusCode.Codes.Purchaser || Model.Order.StatusCode.Id == OrderStatusCode.Codes.AccountManager))
                                    {
                                        @Html.ActionLink("Reroute Purchaser", "ReroutePurchaser", new { id = Model.Order.Id }, new { @Class = "button" }) 
                                    }
                                    else if (!approval.Completed && approval.StatusCode.Level == Model.Order.StatusCode.Level && Model.ExternalApprovals.Contains(approval))
                                    {
                                        <a href="#" class="button reroute" data-approval-id="@approval.Id">ReRoute Approval</a>
{'fraction_non_alphanumeric': 0.11892532595811932, 'fraction_numerical': 0.0003951007506914263, 'mean_word_length': 1.5114087301587302, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1784107', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1241, 'n_words': 230}