Files
Disco/Disco.Web/Views/User/Show.generated.cs
T
2025-07-12 19:55:58 +10:00

507 lines
18 KiB
C#

#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.User
{
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\User\Show.cshtml"
using Disco.Services.Users.UserFlags;
#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/User/Show.cshtml")]
public partial class Show : Disco.Services.Web.WebViewPage<Disco.Web.Models.User.ShowModel>
{
public Show()
{
}
public override void Execute()
{
#line 3 "..\..\Views\User\Show.cshtml"
Authorization.Require(Claims.User.Show);
ViewBag.Title = Html.ToBreadcrumb("Users", MVC.User.Index(), string.Format("User: {0} ({1})", Model.User.DisplayName, Model.User.FriendlyId()));
var requiresLive = Authorization.HasAny(Claims.User.ShowComments, Claims.User.ShowAttachments);
if (requiresLive)
{
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
}
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" id=\"User_Show\"");
WriteLiteral(" data-userid=\"");
#line 15 "..\..\Views\User\Show.cshtml"
Write(Model.User.UserId);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n");
#line 16 "..\..\Views\User\Show.cshtml"
#line default
#line hidden
#line 16 "..\..\Views\User\Show.cshtml"
if (Authorization.Has(Claims.User.ShowFlagAssignments))
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"User_Show_Flags\"");
WriteLiteral(">\r\n");
#line 19 "..\..\Views\User\Show.cshtml"
#line default
#line hidden
#line 19 "..\..\Views\User\Show.cshtml"
foreach (var flag in Model.User.UserFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, UserFlagService.GetUserFlag(f.UserFlagId))))
{
#line default
#line hidden
WriteLiteral(" <i");
WriteAttribute("class", Tuple.Create(" class=\"", 867), Tuple.Create("\"", 943)
, Tuple.Create(Tuple.Create("", 875), Tuple.Create("flag", 875), true)
, Tuple.Create(Tuple.Create(" ", 879), Tuple.Create("fa", 880), true)
, Tuple.Create(Tuple.Create(" ", 882), Tuple.Create("fa-", 883), true)
#line 21 "..\..\Views\User\Show.cshtml"
, Tuple.Create(Tuple.Create("", 886), Tuple.Create<System.Object, System.Int32>(flag.Item2.Icon
#line default
#line hidden
, 886), false)
, Tuple.Create(Tuple.Create(" ", 904), Tuple.Create("fa-fw", 905), true)
, Tuple.Create(Tuple.Create(" ", 910), Tuple.Create("fa-lg", 911), true)
, Tuple.Create(Tuple.Create(" ", 916), Tuple.Create("d-", 917), true)
#line 21 "..\..\Views\User\Show.cshtml"
, Tuple.Create(Tuple.Create("", 919), Tuple.Create<System.Object, System.Int32>(flag.Item2.IconColour
#line default
#line hidden
, 919), false)
);
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"details\"");
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"name\"");
WriteLiteral(">");
#line 23 "..\..\Views\User\Show.cshtml"
Write(flag.Item2.Name);
#line default
#line hidden
WriteLiteral("</span>");
#line 23 "..\..\Views\User\Show.cshtml"
if (flag.Item1.Comments != null)
{
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"comments\"");
WriteLiteral(">");
#line 24 "..\..\Views\User\Show.cshtml"
Write(flag.Item1.Comments.ToHtmlComment());
#line default
#line hidden
WriteLiteral("</span>");
#line 24 "..\..\Views\User\Show.cshtml"
}
#line default
#line hidden
WriteLiteral("<span");
WriteLiteral(" class=\"added\"");
WriteLiteral(">");
#line 24 "..\..\Views\User\Show.cshtml"
Write(CommonHelpers.FriendlyDateAndUser(flag.Item1.AddedDate, flag.Item1.AddedUser));
#line default
#line hidden
WriteLiteral("</span>\r\n </span>\r\n </i>\r\n");
#line 27 "..\..\Views\User\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
$('#User_Show_Flags')
.appendTo('#layout_PageHeading')
.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(); });
});
}
});
});
</script>
");
#line 60 "..\..\Views\User\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 61 "..\..\Views\User\Show.cshtml"
Write(Html.Partial(MVC.User.Views.UserParts._Subject, Model));
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var $tabs = $(\'#UserDetailTabs\');\r\n " +
" if ($tabs.children().length > 1) {\r\n $tabs.tabs({\r\n " +
" activate: function (event, ui) {\r\n window.set" +
"Timeout(function () {\r\n var $window = $(window);\r\n " +
" var tabHeight = $tabs.height();\r\n " +
" var tabOffset = $tabs.offset();\r\n var windowScr" +
"ollTop = $window.scrollTop();\r\n var windowHeight = $w" +
"indow.height();\r\n\r\n var tabTopNotShown = windowScroll" +
"Top - tabOffset.top;\r\n if (tabTopNotShown > 0) {\r\n " +
" $(\'html\').animate({ scrollTop: tabOffset.top }, 125" +
");\r\n } else {\r\n var ta" +
"bBottomNotShown = ((windowScrollTop + windowHeight) - (tabHeight + tabOffset.top" +
")) * -1;\r\n if (tabBottomNotShown > 0) {\r\n " +
" if (tabHeight > windowHeight)\r\n " +
" $(\'html\').animate({ scrollTop: tabOffset.top }, 125);\r\n " +
" else\r\n $(\'h" +
"tml\').animate({ scrollTop: windowScrollTop + tabBottomNotShown }, 125);\r\n " +
" }\r\n }\r\n " +
" }, 1);\r\n }\r\n });\r\n } else {\r\n " +
" $tabs.hide();\r\n }\r\n });\r\n </script>\r\n <div");
WriteLiteral(" id=\"UserDetailTabs\"");
WriteLiteral(">\r\n <ul");
WriteLiteral(" id=\"UserDetailTabItems\"");
WriteLiteral("></ul>\r\n");
#line 97 "..\..\Views\User\Show.cshtml"
#line default
#line hidden
#line 97 "..\..\Views\User\Show.cshtml"
if (Authorization.HasAny(Claims.User.ShowComments, Claims.User.ShowJobs))
{
#line default
#line hidden
#line 99 "..\..\Views\User\Show.cshtml"
Write(Html.Partial(MVC.User.Views.UserParts._CommentsAndJobs, Model));
#line default
#line hidden
#line 99 "..\..\Views\User\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 101 "..\..\Views\User\Show.cshtml"
if (Authorization.Has(Claims.User.ShowAssignmentHistory))
{
#line default
#line hidden
#line 103 "..\..\Views\User\Show.cshtml"
Write(Html.Partial(MVC.User.Views.UserParts._AssignmentHistory, Model));
#line default
#line hidden
#line 103 "..\..\Views\User\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 105 "..\..\Views\User\Show.cshtml"
if (Authorization.Has(Claims.User.ShowAttachments))
{
#line default
#line hidden
#line 107 "..\..\Views\User\Show.cshtml"
Write(Html.Partial(MVC.User.Views.UserParts._Resources, Model));
#line default
#line hidden
#line 107 "..\..\Views\User\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 109 "..\..\Views\User\Show.cshtml"
if (Authorization.Has(Claims.User.ShowFlagAssignments))
{
#line default
#line hidden
#line 111 "..\..\Views\User\Show.cshtml"
Write(Html.Partial(MVC.User.Views.UserParts._Flags, Model));
#line default
#line hidden
#line 111 "..\..\Views\User\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 113 "..\..\Views\User\Show.cshtml"
if (Authorization.Has(Claims.User.ShowAuthorization))
{
#line default
#line hidden
#line 115 "..\..\Views\User\Show.cshtml"
Write(Html.Partial(MVC.User.Views.UserParts._Authorization, Model));
#line default
#line hidden
#line 115 "..\..\Views\User\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
#line 118 "..\..\Views\User\Show.cshtml"
#line default
#line hidden
#line 118 "..\..\Views\User\Show.cshtml"
if (requiresLive)
{
#line default
#line hidden
WriteLiteral(" <script>\r\n $(function () {\r\n if (!document.Disc" +
"oFunctions)\r\n return;\r\n\r\n const userId = $(\'#U" +
"ser_Show\').attr(\'data-userid\');\r\n // Connect to Hub\r\n " +
" var hub = $.connection.userUpdates;\r\n\r\n // Map Functions\r\n " +
" if (document.DiscoFunctions.onCommentAdded)\r\n hu" +
"b.client.commentAdded = document.DiscoFunctions.onCommentAdded;\r\n " +
" if (document.DiscoFunctions.onCommentRemoved)\r\n hub.client.c" +
"ommentRemoved = document.DiscoFunctions.onCommentRemoved;\r\n if (d" +
"ocument.DiscoFunctions.onAttachmentAdded)\r\n hub.client.attach" +
"mentAdded = document.DiscoFunctions.onAttachmentAdded;\r\n if (docu" +
"ment.DiscoFunctions.onAttachmentRemoved)\r\n hub.client.attachm" +
"entRemoved = document.DiscoFunctions.onAttachmentRemoved;\r\n\r\n $.c" +
"onnection.hub.qs = { UserId: userId };\r\n $.connection.hub.error(o" +
"nHubFailed);\r\n $.connection.hub.disconnected(onHubFailed);\r\n\r\n " +
" $.connection.hub.reconnecting(function () {\r\n $(" +
"\'#AttachmentsContainer\').find(\'span.action.enabled\').addClass(\'disabled\');\r\n " +
" $(\'#Comments\').find(\'button\').prop(\'disabled\', true);\r\n " +
" });\r\n $.connection.hub.reconnected(function () {\r\n " +
" $(\'#AttachmentsContainer\').find(\'span.action.enabled\').removeClass(\'" +
"disabled\');\r\n $(\'#Comments\').find(\'button\').prop(\'disabled\', " +
"false);\r\n });\r\n\r\n // Start Connection\r\n " +
" $.connection.hub.start(function () {\r\n $(\'#AttachmentsCo" +
"ntainer\').find(\'span.action.enabled\').removeClass(\'disabled\');\r\n " +
" $(\'#Comments\').find(\'button\').prop(\'disabled\', false);\r\n }).f" +
"ail(onHubFailed);\r\n\r\n function onHubFailed(error) {\r\n " +
" // Disable UI\r\n $(\'#AttachmentsContainer\').find(\'span" +
".action.enabled\').addClass(\'disabled\');\r\n $(\'#Comments\').find" +
"(\'button\').prop(\'disabled\', true);\r\n\r\n // Show Dialog Message" +
"\r\n if ($(\'.disconnected-dialog\').length == 0) {\r\n " +
" $(\'<div>\')\r\n .addClass(\'dialog disconnect" +
"ed-dialog\')\r\n .html(\'<h3><span class=\"fa-stack fa-lg\"" +
"><i class=\"fa fa-wifi fa-stack-1x\"></i><i class=\"fa fa-ban fa-stack-2x error\"></" +
"i></span>Disconnected from the Disco ICT Server</h3><div>This page is not receiv" +
"ing live updates. Please ensure you are connected to the server, then refresh th" +
"is page to enable features.</div>\')\r\n .dialog({\r\n " +
" resizable: false,\r\n t" +
"itle: \'Disconnected\',\r\n width: 400,\r\n " +
" modal: true,\r\n buttons: {\r\n " +
" \'Refresh Now\': function () {\r\n " +
" $(this).dialog(\'option\', \'buttons\', null);\r\n " +
" window.location.reload(true);\r\n " +
" },\r\n \'Close\': function () {\r\n " +
" $(this).dialog(\'destroy\');\r\n " +
" }\r\n }\r\n " +
" });\r\n }\r\n }\r\n });\r\n " +
" </script>\r\n");
#line 187 "..\..\Views\User\Show.cshtml"
}
#line default
#line hidden
WriteLiteral("</div>\r\n");
}
}
}
#pragma warning restore 1591