#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Disco.Web.Views.Device
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Text;
    using System.Web;
    using System.Web.Helpers;
    using System.Web.Mvc;
    using System.Web.Mvc.Ajax;
    using System.Web.Mvc.Html;
    using System.Web.Routing;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.WebPages;
    using Disco;
    using Disco.Models.Repository;
    using Disco.Services;
    using Disco.Services.Authorization;
    
    #line 2 "..\..\Views\Device\_DeviceTable.cshtml"
    using Disco.Services.Devices.DeviceFlags;
    
    #line default
    #line hidden
    using Disco.Services.Web;
    using Disco.Web;
    using Disco.Web.Extensions;
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
    [System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/_DeviceTable.cshtml")]
    public partial class _DeviceTable : Disco.Services.Web.WebViewPage<IEnumerable<Disco.Models.Services.Searching.DeviceSearchResultItem>>
    {
        public _DeviceTable()
        {
        }
        public override void Execute()
        {
            
            #line 3 "..\..\Views\Device\_DeviceTable.cshtml"
  
    var canShowDevices = Authorization.Has(Claims.Device.Show);
    var canShowUsers = Authorization.Has(Claims.User.Show);

    Html.BundleDeferred("~/ClientScripts/Modules/Disco-DataTableHelpers");

            
            #line default
            #line hidden
WriteLiteral("\r\n<div");

WriteLiteral(" class=\"genericData deviceTable\"");

WriteLiteral(">\r\n");

            
            #line 10 "..\..\Views\Device\_DeviceTable.cshtml"
    
            
            #line default
            #line hidden
            
            #line 10 "..\..\Views\Device\_DeviceTable.cshtml"
     if (Model != null && Model.Count() > 0)
    {

            
            #line default
            #line hidden
WriteLiteral("        <table");

WriteLiteral(" class=\"genericData deviceTable\"");

WriteLiteral(">\r\n            <thead>\r\n                <tr>\r\n                    <th>Serial</th>" +
"\r\n                    <th>Asset</th>\r\n                    <th");

WriteLiteral(" class=\"date\"");

WriteLiteral(@">Decommissioned</th>
                    <th>Name</th>
                    <th>Model</th>
                    <th>Profile</th>
                    <th>Batch</th>
                    <th>Assigned User</th>
                    <th>Jobs</th>
                </tr>
            </thead>
            <tbody>
");

            
            #line 27 "..\..\Views\Device\_DeviceTable.cshtml"
                
            
            #line default
            #line hidden
            
            #line 27 "..\..\Views\Device\_DeviceTable.cshtml"
                 foreach (var item in Model)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr");

WriteAttribute("class", Tuple.Create(" class=\"", 1024), Tuple.Create("\"", 1101)
            
            #line 29 "..\..\Views\Device\_DeviceTable.cshtml"
, Tuple.Create(Tuple.Create("", 1032), Tuple.Create<System.Object, System.Int32>(item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty
            
            #line default
            #line hidden
, 1032), false)
);

WriteLiteral(">\r\n                        <td>\r\n");

            
            #line 31 "..\..\Views\Device\_DeviceTable.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 31 "..\..\Views\Device\_DeviceTable.cshtml"
                             if (canShowDevices)
                            {
            
            #line default
            #line hidden
            
            #line 32 "..\..\Views\Device\_DeviceTable.cshtml"
                        Write(Html.ActionLink(item.Id, MVC.Device.Show(item.Id)));

            
            #line default
            #line hidden
            
            #line 32 "..\..\Views\Device\_DeviceTable.cshtml"
                                                                                }
                        else
                        {
            
            #line default
            #line hidden
            
            #line 34 "..\..\Views\Device\_DeviceTable.cshtml"
                    Write(item.Id);

            
            #line default
            #line hidden
            
            #line 34 "..\..\Views\Device\_DeviceTable.cshtml"
                                 }

            
            #line default
            #line hidden
WriteLiteral("                            ");

            
            #line 35 "..\..\Views\Device\_DeviceTable.cshtml"
                             if (Authorization.Has(Claims.Device.ShowFlagAssignments))
                            {
                                
            
            #line default
            #line hidden
            
            #line 37 "..\..\Views\Device\_DeviceTable.cshtml"
                                 if (item.DeviceFlagAssignments != null && item.DeviceFlagAssignments.Count > 0)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <div");

WriteLiteral(" class=\"flags\"");

WriteLiteral(">\r\n");

            
            #line 40 "..\..\Views\Device\_DeviceTable.cshtml"
                                        
            
            #line default
            #line hidden
            
            #line 40 "..\..\Views\Device\_DeviceTable.cshtml"
                                         foreach (var flag in item.DeviceFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, DeviceFlagService.GetDeviceFlag(f.DeviceFlagId))))
                                        {

            
            #line default
            #line hidden
WriteLiteral("                                            <i");

WriteAttribute("class", Tuple.Create(" class=\"", 1953), Tuple.Create("\"", 2023)
, Tuple.Create(Tuple.Create("", 1961), Tuple.Create("flag", 1961), true)
, Tuple.Create(Tuple.Create(" ", 1965), Tuple.Create("fa", 1966), true)
, Tuple.Create(Tuple.Create(" ", 1968), Tuple.Create("fa-", 1969), true)
            
            #line 42 "..\..\Views\Device\_DeviceTable.cshtml"
, Tuple.Create(Tuple.Create("", 1972), Tuple.Create<System.Object, System.Int32>(flag.Item2.Icon
            
            #line default
            #line hidden
, 1972), false)
, Tuple.Create(Tuple.Create(" ", 1990), Tuple.Create("fa-fw", 1991), true)
, Tuple.Create(Tuple.Create(" ", 1996), Tuple.Create("d-", 1997), true)
            
            #line 42 "..\..\Views\Device\_DeviceTable.cshtml"
             , Tuple.Create(Tuple.Create("", 1999), Tuple.Create<System.Object, System.Int32>(flag.Item2.IconColour
            
            #line default
            #line hidden
, 1999), false)
);

WriteLiteral(">\r\n                                                <span");

WriteLiteral(" class=\"details\"");

WriteLiteral(">\r\n                                                    <span");

WriteLiteral(" class=\"name\"");

WriteLiteral(">");

            
            #line 44 "..\..\Views\Device\_DeviceTable.cshtml"
                                                                  Write(flag.Item2.Name);

            
            #line default
            #line hidden
WriteLiteral("</span>");

            
            #line 44 "..\..\Views\Device\_DeviceTable.cshtml"
                                                                                               if (flag.Item1.Comments != null)
                                                    {
            
            #line default
            #line hidden
WriteLiteral("<span");

WriteLiteral(" class=\"comments\"");

WriteLiteral(">");

            
            #line 45 "..\..\Views\Device\_DeviceTable.cshtml"
                                                                       Write(flag.Item1.Comments.ToHtmlComment());

            
            #line default
            #line hidden
WriteLiteral("</span>");

            
            #line 45 "..\..\Views\Device\_DeviceTable.cshtml"
                                                                                                                       }
            
            #line default
            #line hidden
WriteLiteral("<span");

WriteLiteral(" class=\"added\"");

WriteLiteral(">");

            
            #line 45 "..\..\Views\Device\_DeviceTable.cshtml"
                                                                                                                                       Write(CommonHelpers.FriendlyDateAndUser(flag.Item1.AddedDate, flag.Item1.AddedUserId));

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n                                                </span>\r\n               " +
"                             </i>\r\n");

            
            #line 48 "..\..\Views\Device\_DeviceTable.cshtml"
                                        }
            
            #line default
            #line hidden
WriteLiteral("\r\n                                    </div>\r\n");

            
            #line 50 "..\..\Views\Device\_DeviceTable.cshtml"
                                }
            
            #line default
            #line hidden
            
            #line 50 "..\..\Views\Device\_DeviceTable.cshtml"
                                 
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td>\r\n");

WriteLiteral("                            ");

            
            #line 54 "..\..\Views\Device\_DeviceTable.cshtml"
                       Write(item.AssetNumber);

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </td>\r\n                        <td>\r\n");

            
            #line 57 "..\..\Views\Device\_DeviceTable.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 57 "..\..\Views\Device\_DeviceTable.cshtml"
                             if (item.DecommissionedDate.HasValue)
                            {
            
            #line default
            #line hidden
            
            #line 58 "..\..\Views\Device\_DeviceTable.cshtml"
                        Write(CommonHelpers.FriendlyDate(item.DecommissionedDate.Value));

            
            #line default
            #line hidden
            
            #line 58 "..\..\Views\Device\_DeviceTable.cshtml"
                                                                                       }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td>\r\n");

            
            #line 61 "..\..\Views\Device\_DeviceTable.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 61 "..\..\Views\Device\_DeviceTable.cshtml"
                             if (string.IsNullOrWhiteSpace(item.ComputerName))
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">Unknown</span>\r\n");

            
            #line 64 "..\..\Views\Device\_DeviceTable.cshtml"
                            }
                            else
                            {
                                
            
            #line default
            #line hidden
            
            #line 67 "..\..\Views\Device\_DeviceTable.cshtml"
                           Write(item.ComputerName);

            
            #line default
            #line hidden
            
            #line 67 "..\..\Views\Device\_DeviceTable.cshtml"
                                                  
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td>\r\n");

            
            #line 71 "..\..\Views\Device\_DeviceTable.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 71 "..\..\Views\Device\_DeviceTable.cshtml"
                             if (item.DeviceModelDescription != null)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span>");

            
            #line 73 "..\..\Views\Device\_DeviceTable.cshtml"
                                 Write(item.DeviceModelDescription);

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n");

            
            #line 74 "..\..\Views\Device\_DeviceTable.cshtml"
                            }
                            else
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">Unknown</span>\r\n");

            
            #line 78 "..\..\Views\Device\_DeviceTable.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td>\r\n");

WriteLiteral("                            ");

            
            #line 81 "..\..\Views\Device\_DeviceTable.cshtml"
                       Write(item.DeviceProfileName);

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </td>\r\n                        <td>\r\n");

            
            #line 84 "..\..\Views\Device\_DeviceTable.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 84 "..\..\Views\Device\_DeviceTable.cshtml"
                             if (item.DeviceBatchName != null)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span>");

            
            #line 86 "..\..\Views\Device\_DeviceTable.cshtml"
                                 Write(item.DeviceBatchName);

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n");

            
            #line 87 "..\..\Views\Device\_DeviceTable.cshtml"
                            }
                            else
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">N/A</span>\r\n");

            
            #line 91 "..\..\Views\Device\_DeviceTable.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td>\r\n");

            
            #line 94 "..\..\Views\Device\_DeviceTable.cshtml"
                            
            
            #line default
            #line hidden
            
            #line 94 "..\..\Views\Device\_DeviceTable.cshtml"
                             if (string.IsNullOrEmpty(item.AssignedUserId))
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">N/A</span>\r\n");

            
            #line 97 "..\..\Views\Device\_DeviceTable.cshtml"
                            }
                            else
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span>\r\n");

            
            #line 101 "..\..\Views\Device\_DeviceTable.cshtml"
                                    
            
            #line default
            #line hidden
            
            #line 101 "..\..\Views\Device\_DeviceTable.cshtml"
                                     if (canShowUsers)
                                    {
                                        
            
            #line default
            #line hidden
            
            #line 103 "..\..\Views\Device\_DeviceTable.cshtml"
                                   Write(Html.ActionLink(item.AssignedUserDescription, MVC.User.Show(item.AssignedUserId)));

            
            #line default
            #line hidden
            
            #line 103 "..\..\Views\Device\_DeviceTable.cshtml"
                                                                                                                          
                                    }
                                    else
                                    {
                                        
            
            #line default
            #line hidden
            
            #line 107 "..\..\Views\Device\_DeviceTable.cshtml"
                                   Write(item.AssignedUserDescription);

            
            #line default
            #line hidden
            
            #line 107 "..\..\Views\Device\_DeviceTable.cshtml"
                                                                     
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                </span>\r\n");

            
            #line 110 "..\..\Views\Device\_DeviceTable.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td>\r\n");

WriteLiteral("                            ");

            
            #line 113 "..\..\Views\Device\_DeviceTable.cshtml"
                       Write(item.JobCount);

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </td>\r\n                    </tr>\r\n");

            
            #line 116 "..\..\Views\Device\_DeviceTable.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\r\n        </table>\r\n");

WriteLiteral("        <script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
    $(function () {
        var userTable = $('table.deviceTable');

        userTable.each(function () {
            var $this = $(this);

            if (!$this.data('deviceTable_Flags')) {
                $this.tooltip({
                    items: 'i.flag',
                    content: function () {
                        var $this = $(this);
                        return $this.children('.details').html();
                    },
                    tooltipClass: 'FlagAssignment_Tooltip',
                    position: {
                        my: ""right top"",
                        at: ""right bottom"",
                        collision: ""flipfit flip""
                    },
                    hade: {
                        effect: ''
                    },
                    close: function (e, ui) {
                        ui.tooltip.hover(
                            function () {
                                $(this).stop(true).fadeTo(100, 1);
                            },
                            function () {
                                $(this).fadeOut(100, function () { $(this).remove(); });
                            });
                    }
                });

                $this.data('deviceTable_Flags', true)
            }
        });
    });
        </script>
");

            
            #line 158 "..\..\Views\Device\_DeviceTable.cshtml"
    }
    else
    {

            
            #line default
            #line hidden
WriteLiteral("        <span");

WriteLiteral(" class=\"smallMessage\"");

WriteLiteral(">No Devices Found</span>\r\n");

            
            #line 162 "..\..\Views\Device\_DeviceTable.cshtml"
    }

            
            #line default
            #line hidden
WriteLiteral("</div>\r\n");

        }
    }
}
#pragma warning restore 1591
