Permissions & Authorization for Users #24
Initial Release; Includes Database and MVC refactoring
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
@model Disco.Web.Models.User.ShowModel
|
||||
@{
|
||||
Authorization.Require(Claims.User.ShowAssignmentHistory);
|
||||
}
|
||||
<div id="UserDetailTab-AssignmentHistory" class="UserPart">
|
||||
@if (Model.User.DeviceUserAssignments.Count > 0)
|
||||
{
|
||||
@@ -19,7 +22,14 @@
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.ActionLink(dua.Device.SerialNumber, MVC.Device.Show(dua.DeviceSerialNumber))
|
||||
@if (Authorization.Has(Claims.Device.Show))
|
||||
{
|
||||
@Html.ActionLink(dua.Device.SerialNumber, MVC.Device.Show(dua.DeviceSerialNumber))
|
||||
}
|
||||
else
|
||||
{
|
||||
@dua.Device.SerialNumber
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@dua.Device.AssetNumber
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18033
|
||||
// Runtime Version:4.0.30319.18051
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -28,19 +28,29 @@ namespace Disco.Web.Views.User.UserParts
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Authorization;
|
||||
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/UserParts/_AssignmentHistory.cshtml")]
|
||||
public partial class AssignmentHistory : System.Web.Mvc.WebViewPage<Disco.Web.Models.User.ShowModel>
|
||||
public partial class AssignmentHistory : Disco.Services.Web.WebViewPage<Disco.Web.Models.User.ShowModel>
|
||||
{
|
||||
public AssignmentHistory()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
WriteLiteral("<div");
|
||||
|
||||
#line 2 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
|
||||
Authorization.Require(Claims.User.ShowAssignmentHistory);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"UserDetailTab-AssignmentHistory\"");
|
||||
|
||||
@@ -49,13 +59,13 @@ WriteLiteral(" class=\"UserPart\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 3 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
#line 6 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 3 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
#line 6 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
if (Model.User.DeviceUserAssignments.Count > 0)
|
||||
{
|
||||
|
||||
@@ -82,13 +92,13 @@ WriteLiteral(@">
|
||||
");
|
||||
|
||||
|
||||
#line 18 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
#line 21 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 18 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
#line 21 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
foreach (var dua in Model.User.DeviceUserAssignments.OrderByDescending(m => m.AssignedDate))
|
||||
{
|
||||
|
||||
@@ -97,21 +107,58 @@ WriteLiteral(@">
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 22 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
Write(Html.ActionLink(dua.Device.SerialNumber, MVC.Device.Show(dua.DeviceSerialNumber)));
|
||||
#line 25 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 25 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
if (Authorization.Has(Claims.Device.Show))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 27 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
Write(Html.ActionLink(dua.Device.SerialNumber, MVC.Device.Show(dua.DeviceSerialNumber)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
#line 27 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 31 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
Write(dua.Device.SerialNumber);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 31 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 25 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
#line 35 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
Write(dua.Device.AssetNumber);
|
||||
|
||||
|
||||
@@ -122,7 +169,7 @@ WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 28 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
#line 38 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
Write(dua.Device.DeviceModel.ToString());
|
||||
|
||||
|
||||
@@ -133,7 +180,7 @@ WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 31 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
#line 41 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(dua.AssignedDate));
|
||||
|
||||
|
||||
@@ -144,7 +191,7 @@ WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 34 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
#line 44 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(dua.UnassignedDate, "Current"));
|
||||
|
||||
|
||||
@@ -153,7 +200,7 @@ WriteLiteral(" ");
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 37 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
#line 47 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -162,7 +209,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||
WriteLiteral(" </table>\r\n");
|
||||
|
||||
|
||||
#line 39 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
#line 49 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -177,7 +224,7 @@ WriteLiteral(" class=\"smallMessage\"");
|
||||
WriteLiteral(">No Assignment History Available</span>\r\n");
|
||||
|
||||
|
||||
#line 43 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
#line 53 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -187,7 +234,7 @@ WriteLiteral(" <script>\r\n $(\'#UserDetailTabItems\').append(\'<li><a
|
||||
"b-AssignmentHistory\">Assignment History [");
|
||||
|
||||
|
||||
#line 45 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
#line 55 "..\..\Views\User\UserParts\_AssignmentHistory.cshtml"
|
||||
Write(Model.User.DeviceUserAssignments.Count);
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
@model Disco.Web.Models.User.ShowModel
|
||||
@{
|
||||
Authorization.Require(Claims.User.ShowAuthorization);
|
||||
|
||||
Html.BundleDeferred("~/Style/Fancytree");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Fancytree");
|
||||
}
|
||||
<div id="UserDetailTab-Authorization" class="UserPart">
|
||||
<div id="UserDetailTab-AuthorizationContainer">
|
||||
|
||||
@if (Model.ClaimNavigator != null)
|
||||
{
|
||||
<div id="Config_AuthRoles_Claims_Tree">
|
||||
</div>
|
||||
<script>
|
||||
(function(){
|
||||
var claimNodes = @(new HtmlString(Newtonsoft.Json.JsonConvert.SerializeObject(Model.ClaimNavigatorFancyTreeNodes)));
|
||||
|
||||
$(function(){
|
||||
var tree = $('#Config_AuthRoles_Claims_Tree').fancytree({
|
||||
source: claimNodes,
|
||||
checkbox: true,
|
||||
selectMode: 3
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div>NO ACCESS</div>
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
<script>
|
||||
$('#UserDetailTabItems').append('<li><a href="#UserDetailTab-Authorization">Authorization</a></li>');
|
||||
</script>
|
||||
</div>
|
||||
@@ -0,0 +1,136 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18051
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Views.User.UserParts
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Authorization;
|
||||
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/UserParts/_Authorization.cshtml")]
|
||||
public partial class Authorization : Disco.Services.Web.WebViewPage<Disco.Web.Models.User.ShowModel>
|
||||
{
|
||||
public Authorization()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Views\User\UserParts\_Authorization.cshtml"
|
||||
|
||||
Authorization.Require(Claims.User.ShowAuthorization);
|
||||
|
||||
Html.BundleDeferred("~/Style/Fancytree");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Fancytree");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"UserDetailTab-Authorization\"");
|
||||
|
||||
WriteLiteral(" class=\"UserPart\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"UserDetailTab-AuthorizationContainer\"");
|
||||
|
||||
WriteLiteral(">\r\n \r\n");
|
||||
|
||||
|
||||
#line 11 "..\..\Views\User\UserParts\_Authorization.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 11 "..\..\Views\User\UserParts\_Authorization.cshtml"
|
||||
if (Model.ClaimNavigator != null)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"Config_AuthRoles_Claims_Tree\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script>\r\n (function(){\r\n " +
|
||||
" var claimNodes = ");
|
||||
|
||||
|
||||
#line 17 "..\..\Views\User\UserParts\_Authorization.cshtml"
|
||||
Write(new HtmlString(Newtonsoft.Json.JsonConvert.SerializeObject(Model.ClaimNavigatorFancyTreeNodes)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@";
|
||||
|
||||
$(function(){
|
||||
var tree = $('#Config_AuthRoles_Claims_Tree').fancytree({
|
||||
source: claimNodes,
|
||||
checkbox: true,
|
||||
selectMode: 3
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
");
|
||||
|
||||
|
||||
#line 28 "..\..\Views\User\UserParts\_Authorization.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div>NO ACCESS</div>\r\n");
|
||||
|
||||
|
||||
#line 32 "..\..\Views\User\UserParts\_Authorization.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n\r\n </div>\r\n <script>\r\n $(\'#UserDetailTabItems\').append(\'<li><a hre" +
|
||||
"f=\"#UserDetailTab-Authorization\">Authorization</a></li>\');\r\n </script>\r\n</div" +
|
||||
">");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -1,4 +1,7 @@
|
||||
@model Disco.Web.Models.User.ShowModel
|
||||
@{
|
||||
Authorization.Require(Claims.User.ShowJobs);
|
||||
}
|
||||
<div id="UserDetailTab-Jobs" class="UserPart">
|
||||
<div id="UserDetailTab-JobsContainer">
|
||||
@Html.Partial(MVC.Shared.Views._JobTable, Model.Jobs)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18033
|
||||
// Runtime Version:4.0.30319.18051
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -28,19 +28,29 @@ namespace Disco.Web.Views.User.UserParts
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Authorization;
|
||||
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/UserParts/_Jobs.cshtml")]
|
||||
public partial class Jobs : System.Web.Mvc.WebViewPage<Disco.Web.Models.User.ShowModel>
|
||||
public partial class Jobs : Disco.Services.Web.WebViewPage<Disco.Web.Models.User.ShowModel>
|
||||
{
|
||||
public Jobs()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
WriteLiteral("<div");
|
||||
|
||||
#line 2 "..\..\Views\User\UserParts\_Jobs.cshtml"
|
||||
|
||||
Authorization.Require(Claims.User.ShowJobs);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"UserDetailTab-Jobs\"");
|
||||
|
||||
@@ -55,7 +65,7 @@ WriteLiteral(">\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 4 "..\..\Views\User\UserParts\_Jobs.cshtml"
|
||||
#line 7 "..\..\Views\User\UserParts\_Jobs.cshtml"
|
||||
Write(Html.Partial(MVC.Shared.Views._JobTable, Model.Jobs));
|
||||
|
||||
|
||||
@@ -65,7 +75,7 @@ WriteLiteral("\r\n </div>\r\n <script>\r\n $(\'#UserDetailTabItems\
|
||||
"\"#UserDetailTab-Jobs\">Jobs [");
|
||||
|
||||
|
||||
#line 7 "..\..\Views\User\UserParts\_Jobs.cshtml"
|
||||
#line 10 "..\..\Views\User\UserParts\_Jobs.cshtml"
|
||||
Write(Model.User.Jobs == null ? 0 : Model.User.Jobs.Count);
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,23 @@
|
||||
@model Disco.Web.Models.User.ShowModel
|
||||
@{
|
||||
Authorization.Require(Claims.User.ShowAttachments);
|
||||
|
||||
var canAddAttachments = Authorization.Has(Claims.User.Actions.AddAttachments);
|
||||
var canRemoveAnyAttachments = Authorization.Has(Claims.User.Actions.RemoveAnyAttachments);
|
||||
var canRemoveOwnAttachments = Authorization.Has(Claims.User.Actions.RemoveOwnAttachments);
|
||||
|
||||
Html.BundleDeferred("~/Style/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
|
||||
|
||||
if (Authorization.Has(Claims.User.Actions.AddAttachments))
|
||||
{
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
|
||||
}
|
||||
}
|
||||
<div id="UserDetailTab-Resources" class="UserPart">
|
||||
<table id="userShowResources">
|
||||
<tr>
|
||||
<td id="Attachments">
|
||||
<td id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")">
|
||||
<div class="attachmentOutput">
|
||||
@if (Model.User.UserAttachments != null)
|
||||
{
|
||||
@@ -21,31 +31,35 @@
|
||||
{ @ua.DocumentTemplate.Description}
|
||||
else
|
||||
{ @ua.Comments }}
|
||||
</span><span class="author">@ua.TechUser.ToString()</span><span class="remove"></span>
|
||||
<span class="timestamp" title="@ua.Timestamp.ToFullDateTime()">@ua.Timestamp.ToFuzzy()</span>
|
||||
</span><span class="author">@ua.TechUser.ToString()</span>@if (canRemoveAnyAttachments || (canRemoveOwnAttachments && ua.TechUserId == CurrentUser.Id))
|
||||
{<text><span class="remove"></span></text>}<span class="timestamp" title="@ua.Timestamp.ToFullDateTime()">@ua.Timestamp.ToFuzzy()</span>
|
||||
</a>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="attachmentInput clearfix">
|
||||
<span class="action upload"></span><span class="action photo"></span>
|
||||
</div>
|
||||
@if (canAddAttachments)
|
||||
{
|
||||
<div class="attachmentInput clearfix">
|
||||
<span class="action upload"></span><span class="action photo"></span>
|
||||
</div>
|
||||
}
|
||||
<script type="text/javascript">
|
||||
Shadowbox.init({
|
||||
skipSetup: true,
|
||||
modal: true
|
||||
});
|
||||
$(function () {
|
||||
$Attachments = $('#Attachments');
|
||||
$attachmentOutput = $Attachments.find('.attachmentOutput');
|
||||
|
||||
@if (canAddAttachments)
|
||||
{<text>
|
||||
//#region Add Attachments
|
||||
if (!document.DiscoFunctions) {
|
||||
document.DiscoFunctions = {};
|
||||
}
|
||||
document.DiscoFunctions.addAttachment = addAttachment;
|
||||
|
||||
$Attachments = $('#Attachments');
|
||||
$attachmentOutput = $Attachments.find('.attachmentOutput');
|
||||
|
||||
$attachmentOutput.find('span.remove').click(removeAttachment);
|
||||
|
||||
$('#dialogUpload').dialog({
|
||||
autoOpen: false,
|
||||
draggable: false,
|
||||
@@ -58,13 +72,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
$('#dialogRemoveAttachment').dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
var onLoadNavigation = null;
|
||||
var isLoaded = null;
|
||||
Silverlight.createObject(
|
||||
@@ -83,119 +90,159 @@
|
||||
'UploadUrl=@(Url.Action(MVC.API.User.AttachmentUpload(Model.User.Id, null)))'
|
||||
);
|
||||
|
||||
$attachmentInput = $Attachments.find('.attachmentInput');
|
||||
$attachmentInput.find('.photo').click(function () {
|
||||
showDialog('/WebCam');
|
||||
});
|
||||
$attachmentInput.find('.upload').click(function () {
|
||||
showDialog('/File');
|
||||
});
|
||||
|
||||
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
|
||||
function showDialog(navigationPath) {
|
||||
$('#dialogUpload').dialog('open');
|
||||
if (isLoaded) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
|
||||
} else {
|
||||
onLoadNavigation = navigationPath;
|
||||
}
|
||||
};
|
||||
function addAttachment(id, quick) {
|
||||
var data = { id: id };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.User.Attachment())',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d.Result == 'OK') {
|
||||
var a = d.Attachment;
|
||||
|
||||
var e = $('<a><span class="icon"><img alt="Attachment Thumbnail" /></span><span class="comments"></span><span class="author"></span><span class="remove"></span><span class="timestamp"></span></a>');
|
||||
|
||||
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '@(Url.Action(MVC.API.User.AttachmentDownload()))/' + a.Id);
|
||||
e.find('.icon img').attr('src', '@(Url.Action(MVC.API.User.AttachmentThumbnail()))/' + a.Id);
|
||||
e.find('.comments').text(a.Comments);
|
||||
e.find('.author').text(a.Author);
|
||||
e.find('.timestamp').text(a.TimestampFuzzy).attr('title', a.TimestampFull);
|
||||
e.find('.remove').click(removeAttachment);
|
||||
if (!quick)
|
||||
e.hide();
|
||||
$attachmentOutput.append(e);
|
||||
if (!quick)
|
||||
e.show('slow');
|
||||
if (a.MimeType.toLowerCase().indexOf('image/') == 0)
|
||||
e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Comments });
|
||||
} else {
|
||||
alert('Unable to add attachment: ' + d.Result);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to add attachment: ' + textStatus);
|
||||
}
|
||||
$attachmentInput = $Attachments.find('.attachmentInput');
|
||||
$attachmentInput.find('.photo').click(function () {
|
||||
showDialog('/WebCam');
|
||||
});
|
||||
$attachmentInput.find('.upload').click(function () {
|
||||
showDialog('/File');
|
||||
});
|
||||
}
|
||||
function removeAttachment() {
|
||||
$this = $(this).closest('a');
|
||||
|
||||
var data = { id: $this.attr('data-attachmentid') };
|
||||
var $dialogRemoveAttachment = $('#dialogRemoveAttachment');
|
||||
$dialogRemoveAttachment.dialog("enable");
|
||||
$dialogRemoveAttachment.dialog('option', 'buttons', {
|
||||
"Remove": function () {
|
||||
$dialogRemoveAttachment.dialog("disable");
|
||||
$dialogRemoveAttachment.dialog("option", "buttons", null);
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.User.AttachmentRemove())',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$this.hide(300).delay(300).queue(function () {
|
||||
var $this = $(this);
|
||||
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
|
||||
Shadowbox.removeCache(this);
|
||||
$this.remove();
|
||||
});
|
||||
} else {
|
||||
alert('Unable to remove attachment: ' + d);
|
||||
}
|
||||
$dialogRemoveAttachment.dialog("close");
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to remove attachment: ' + textStatus);
|
||||
$dialogRemoveAttachment.dialog("close");
|
||||
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
|
||||
function showDialog(navigationPath) {
|
||||
$('#dialogUpload').dialog('open');
|
||||
if (isLoaded) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
|
||||
} else {
|
||||
onLoadNavigation = navigationPath;
|
||||
}
|
||||
};
|
||||
function addAttachment(id, quick) {
|
||||
var data = { id: id };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.User.Attachment())',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d.Result == 'OK') {
|
||||
var a = d.Attachment;
|
||||
@if (canRemoveAnyAttachments)
|
||||
{<text>buildAttachment(a, true);</text>}
|
||||
else if (canRemoveOwnAttachments)
|
||||
{<text>buildAttachment(a, (a.AuthorId === '@(CurrentUser.Id)'));</text>}
|
||||
else
|
||||
{<text>buildAttachment(a, false);</text>}
|
||||
|
||||
} else {
|
||||
alert('Unable to add attachment: ' + d.Result);
|
||||
}
|
||||
});
|
||||
},
|
||||
Cancel: function () {
|
||||
$dialogRemoveAttachment.dialog("close");
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to add attachment: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
function buildAttachment(a, canRemove) {
|
||||
var t = '<a><span class="icon"><img alt="Attachment Thumbnail" /></span><span class="comments"></span><span class="author"></span>';
|
||||
if (canRemove)
|
||||
t += '<span class="remove"></span>';
|
||||
t += '<span class="timestamp"></span></a>';
|
||||
|
||||
var e = $(t);
|
||||
|
||||
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '@(Url.Action(MVC.API.User.AttachmentDownload()))/' + a.Id);
|
||||
e.find('.icon img').attr('src', '@(Url.Action(MVC.API.User.AttachmentThumbnail()))/' + a.Id);
|
||||
e.find('.comments').text(a.Comments);
|
||||
e.find('.author').text(a.Author);
|
||||
e.find('.timestamp').text(a.TimestampFuzzy).attr('title', a.TimestampFull);
|
||||
if (canRemove)
|
||||
e.find('.remove').click(removeAttachment);
|
||||
if (!quick)
|
||||
e.hide();
|
||||
$attachmentOutput.append(e);
|
||||
if (!quick)
|
||||
e.show('slow');
|
||||
if (a.MimeType.toLowerCase().indexOf('image/') == 0)
|
||||
e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Comments });
|
||||
}
|
||||
|
||||
//#endregion
|
||||
</text>}
|
||||
@if (canRemoveAnyAttachments || canRemoveOwnAttachments)
|
||||
{<text>
|
||||
//#region Remove Attachments
|
||||
|
||||
$attachmentOutput.find('span.remove').click(removeAttachment);
|
||||
|
||||
$('#dialogRemoveAttachment').dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
$dialogRemoveAttachment.dialog('open');
|
||||
function removeAttachment() {
|
||||
$this = $(this).closest('a');
|
||||
|
||||
return false;
|
||||
}
|
||||
$attachmentOutput.children('a').each(function () {
|
||||
$this = $(this);
|
||||
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
|
||||
$this.shadowbox({ gallery: 'attachments', player: 'img', title: $this.find('.comments').text() });
|
||||
var data = { id: $this.attr('data-attachmentid') };
|
||||
var $dialogRemoveAttachment = $('#dialogRemoveAttachment');
|
||||
$dialogRemoveAttachment.dialog("enable");
|
||||
$dialogRemoveAttachment.dialog('option', 'buttons', {
|
||||
"Remove": function () {
|
||||
$dialogRemoveAttachment.dialog("disable");
|
||||
$dialogRemoveAttachment.dialog("option", "buttons", null);
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.User.AttachmentRemove())',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$this.hide(300).delay(300).queue(function () {
|
||||
var $this = $(this);
|
||||
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
|
||||
Shadowbox.removeCache(this);
|
||||
$this.remove();
|
||||
});
|
||||
} else {
|
||||
alert('Unable to remove attachment: ' + d);
|
||||
}
|
||||
$dialogRemoveAttachment.dialog("close");
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to remove attachment: ' + textStatus);
|
||||
$dialogRemoveAttachment.dialog("close");
|
||||
}
|
||||
});
|
||||
},
|
||||
Cancel: function () {
|
||||
$dialogRemoveAttachment.dialog("close");
|
||||
}
|
||||
});
|
||||
|
||||
$dialogRemoveAttachment.dialog('open');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//#endregion
|
||||
</text>}
|
||||
|
||||
$attachmentOutput.children('a').each(function () {
|
||||
$this = $(this);
|
||||
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
|
||||
$this.shadowbox({ gallery: 'attachments', player: 'img', title: $this.find('.comments').text() });
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="dialogUpload" title="Upload Attachment">
|
||||
<div id="silverlightHostUploadAttachment">
|
||||
@if (canAddAttachments)
|
||||
{
|
||||
<div id="dialogUpload" title="Upload Attachment">
|
||||
<div id="silverlightHostUploadAttachment">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dialogRemoveAttachment" title="Remove this Attachment?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Are you sure?
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
@if (canRemoveAnyAttachments || canRemoveOwnAttachments)
|
||||
{
|
||||
<div id="dialogRemoveAttachment" title="Remove this Attachment?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Are you sure?
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
<script>
|
||||
$('#UserDetailTabItems').append('<li><a href="#UserDetailTab-Resources" id="UserDetailTab-ResourcesLink">Attachments [@(Model.User.UserAttachments == null ? 0 : Model.User.UserAttachments.Count)]</a></li>');
|
||||
</script>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18033
|
||||
// Runtime Version:4.0.30319.18051
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.User.UserParts
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Authorization;
|
||||
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/UserParts/_Resources.cshtml")]
|
||||
public partial class Resources : System.Web.Mvc.WebViewPage<Disco.Web.Models.User.ShowModel>
|
||||
public partial class Resources : Disco.Services.Web.WebViewPage<Disco.Web.Models.User.ShowModel>
|
||||
{
|
||||
public Resources()
|
||||
{
|
||||
@@ -43,9 +45,19 @@ namespace Disco.Web.Views.User.UserParts
|
||||
|
||||
#line 2 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
|
||||
Authorization.Require(Claims.User.ShowAttachments);
|
||||
|
||||
var canAddAttachments = Authorization.Has(Claims.User.Actions.AddAttachments);
|
||||
var canRemoveAnyAttachments = Authorization.Has(Claims.User.Actions.RemoveAnyAttachments);
|
||||
var canRemoveOwnAttachments = Authorization.Has(Claims.User.Actions.RemoveOwnAttachments);
|
||||
|
||||
Html.BundleDeferred("~/Style/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
|
||||
|
||||
if (Authorization.Has(Claims.User.Actions.AddAttachments))
|
||||
{
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
@@ -64,6 +76,16 @@ WriteLiteral(">\r\n <tr>\r\n <td");
|
||||
|
||||
WriteLiteral(" id=\"Attachments\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 778), Tuple.Create("\"", 853)
|
||||
|
||||
#line 20 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 786), Tuple.Create<System.Object, System.Int32>(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 786), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"attachmentOutput\"");
|
||||
@@ -71,13 +93,13 @@ WriteLiteral(" class=\"attachmentOutput\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 12 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 22 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 12 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 22 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (Model.User.UserAttachments != null)
|
||||
{
|
||||
foreach (var ua in Model.User.UserAttachments)
|
||||
@@ -88,20 +110,20 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 618), Tuple.Create("\"", 676)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 1115), Tuple.Create("\"", 1173)
|
||||
|
||||
#line 16 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 625), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentDownload(ua.Id))
|
||||
#line 26 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1122), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentDownload(ua.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 625), false)
|
||||
, 1122), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" data-attachmentid=\"");
|
||||
|
||||
|
||||
#line 16 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 26 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(ua.Id);
|
||||
|
||||
|
||||
@@ -112,7 +134,7 @@ WriteLiteral("\"");
|
||||
WriteLiteral(" data-mimetype=\"");
|
||||
|
||||
|
||||
#line 16 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 26 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(ua.MimeType);
|
||||
|
||||
|
||||
@@ -124,68 +146,68 @@ WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"icon\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 782), Tuple.Create("\"", 802)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 1279), Tuple.Create("\"", 1299)
|
||||
|
||||
#line 17 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 790), Tuple.Create<System.Object, System.Int32>(ua.Filename
|
||||
#line 27 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1287), Tuple.Create<System.Object, System.Int32>(ua.Filename
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 790), false)
|
||||
, 1287), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <img");
|
||||
|
||||
WriteLiteral(" alt=\"Attachment Thumbnail\"");
|
||||
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 869), Tuple.Create("\"", 929)
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 1366), Tuple.Create("\"", 1426)
|
||||
|
||||
#line 18 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 875), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentThumbnail(ua.Id))
|
||||
#line 28 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1372), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentThumbnail(ua.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 875), false)
|
||||
, 1372), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" /></span>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"comments\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 992), Tuple.Create("\"", 1012)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 1489), Tuple.Create("\"", 1509)
|
||||
|
||||
#line 19 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1000), Tuple.Create<System.Object, System.Int32>(ua.Comments
|
||||
#line 29 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1497), Tuple.Create<System.Object, System.Int32>(ua.Comments
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1000), false)
|
||||
, 1497), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 20 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 30 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 20 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 30 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (!string.IsNullOrEmpty(ua.DocumentTemplateId))
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 21 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 31 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(ua.DocumentTemplate.Description);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 21 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 31 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -193,14 +215,14 @@ WriteLiteral(">\r\n");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 23 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 33 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(ua.Comments);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 23 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 33 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
@@ -212,35 +234,52 @@ WriteLiteral(" class=\"author\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 24 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 34 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(ua.TechUser.ToString());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span><span");
|
||||
WriteLiteral("</span>");
|
||||
|
||||
WriteLiteral(" class=\"remove\"");
|
||||
|
||||
WriteLiteral("></span>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"timestamp\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 1432), Tuple.Create("\"", 1470)
|
||||
|
||||
#line 25 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1440), Tuple.Create<System.Object, System.Int32>(ua.Timestamp.ToFullDateTime()
|
||||
#line 34 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (canRemoveAnyAttachments || (canRemoveOwnAttachments && ua.TechUserId == CurrentUser.Id))
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1440), false)
|
||||
WriteLiteral("<span");
|
||||
|
||||
WriteLiteral(" class=\"remove\"");
|
||||
|
||||
WriteLiteral("></span>");
|
||||
|
||||
|
||||
#line 35 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<span");
|
||||
|
||||
WriteLiteral(" class=\"timestamp\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 2095), Tuple.Create("\"", 2133)
|
||||
|
||||
#line 35 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2103), Tuple.Create<System.Object, System.Int32>(ua.Timestamp.ToFullDateTime()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2103), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 25 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(ua.Timestamp.ToFuzzy());
|
||||
#line 35 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(ua.Timestamp.ToFuzzy());
|
||||
|
||||
|
||||
#line default
|
||||
@@ -248,18 +287,34 @@ WriteLiteral(">");
|
||||
WriteLiteral("</span>\r\n </a> \r\n");
|
||||
|
||||
|
||||
#line 27 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 37 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n <div");
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
|
||||
#line 40 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 40 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (canAddAttachments)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"attachmentInput clearfix\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"action upload\"");
|
||||
|
||||
@@ -267,34 +322,69 @@ WriteLiteral("></span><span");
|
||||
|
||||
WriteLiteral(" class=\"action photo\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </div>\r\n <script");
|
||||
WriteLiteral("></span>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 45 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n Shadowbox.init({\r\n skipSetup: true," +
|
||||
"\r\n modal: true\r\n });\r\n " +
|
||||
" $(function () {\r\n if (!document.DiscoFunctions) {\r\n " +
|
||||
" document.DiscoFunctions = {};\r\n " +
|
||||
" }\r\n document.DiscoFunctions.addAttachment = addAttachmen" +
|
||||
"t;\r\n\r\n $Attachments = $(\'#Attachments\');\r\n " +
|
||||
" $attachmentOutput = $Attachments.find(\'.attachmentOutput\');\r\n\r\n " +
|
||||
" $attachmentOutput.find(\'span.remove\').click(removeAttachment);\r\n" +
|
||||
"\r\n $(\'#dialogUpload\').dialog({\r\n " +
|
||||
" autoOpen: false,\r\n draggable: false,\r\n " +
|
||||
" modal: true,\r\n resizable: false,\r\n " +
|
||||
" width: 860,\r\n height: 550,\r\n" +
|
||||
" close: function () {\r\n " +
|
||||
" silverlightUploadAttachment.content.Navigator.Navigate(\'/Hidden\');\r\n " +
|
||||
" }\r\n });\r\n\r\n $(\'#" +
|
||||
"dialogRemoveAttachment\').dialog({\r\n resizable: false," +
|
||||
"\r\n height: 140,\r\n modal: t" +
|
||||
"rue,\r\n autoOpen: false\r\n });\r\n" +
|
||||
"\r\n var onLoadNavigation = null;\r\n " +
|
||||
"var isLoaded = null;\r\n Silverlight.createObject(\r\n " +
|
||||
" \'");
|
||||
WriteLiteral(@">
|
||||
Shadowbox.init({
|
||||
skipSetup: true,
|
||||
modal: true
|
||||
});
|
||||
$(function () {
|
||||
$Attachments = $('#Attachments');
|
||||
$attachmentOutput = $Attachments.find('.attachmentOutput');
|
||||
|
||||
");
|
||||
|
||||
|
||||
#line 71 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 55 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 55 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (canAddAttachments)
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"
|
||||
//#region Add Attachments
|
||||
if (!document.DiscoFunctions) {
|
||||
document.DiscoFunctions = {};
|
||||
}
|
||||
document.DiscoFunctions.addAttachment = addAttachment;
|
||||
|
||||
$('#dialogUpload').dialog({
|
||||
autoOpen: false,
|
||||
draggable: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
width: 860,
|
||||
height: 550,
|
||||
close: function () {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
|
||||
}
|
||||
});
|
||||
|
||||
var onLoadNavigation = null;
|
||||
var isLoaded = null;
|
||||
Silverlight.createObject(
|
||||
'");
|
||||
|
||||
|
||||
#line 78 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap);
|
||||
|
||||
|
||||
@@ -315,7 +405,7 @@ WriteLiteral(@"',
|
||||
'UploadUrl=");
|
||||
|
||||
|
||||
#line 83 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 90 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.AttachmentUpload(Model.User.Id, null)));
|
||||
|
||||
|
||||
@@ -324,151 +414,330 @@ WriteLiteral(@"',
|
||||
WriteLiteral(@"'
|
||||
);
|
||||
|
||||
$attachmentInput = $Attachments.find('.attachmentInput');
|
||||
$attachmentInput.find('.photo').click(function () {
|
||||
showDialog('/WebCam');
|
||||
});
|
||||
$attachmentInput.find('.upload').click(function () {
|
||||
showDialog('/File');
|
||||
});
|
||||
$attachmentInput = $Attachments.find('.attachmentInput');
|
||||
$attachmentInput.find('.photo').click(function () {
|
||||
showDialog('/WebCam');
|
||||
});
|
||||
$attachmentInput.find('.upload').click(function () {
|
||||
showDialog('/File');
|
||||
});
|
||||
|
||||
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
|
||||
function showDialog(navigationPath) {
|
||||
$('#dialogUpload').dialog('open');
|
||||
if (isLoaded) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
|
||||
} else {
|
||||
onLoadNavigation = navigationPath;
|
||||
}
|
||||
};
|
||||
function addAttachment(id, quick) {
|
||||
var data = { id: id };
|
||||
$.ajax({
|
||||
url: '");
|
||||
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
|
||||
function showDialog(navigationPath) {
|
||||
$('#dialogUpload').dialog('open');
|
||||
if (isLoaded) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
|
||||
} else {
|
||||
onLoadNavigation = navigationPath;
|
||||
}
|
||||
};
|
||||
function addAttachment(id, quick) {
|
||||
var data = { id: id };
|
||||
$.ajax({
|
||||
url: '");
|
||||
|
||||
|
||||
#line 106 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.Attachment()));
|
||||
#line 113 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.Attachment()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d.Result == 'OK') {
|
||||
var a = d.Attachment;
|
||||
|
||||
var e = $('<a><span class=""icon""><img alt=""Attachment Thumbnail"" /></span><span class=""comments""></span><span class=""author""></span><span class=""remove""></span><span class=""timestamp""></span></a>');
|
||||
|
||||
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d.Result == 'OK') {
|
||||
var a = d.Attachment;
|
||||
");
|
||||
|
||||
|
||||
#line 115 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.AttachmentDownload()));
|
||||
#line 119 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 119 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (canRemoveAnyAttachments)
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("buildAttachment(a, true);");
|
||||
|
||||
|
||||
#line 120 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
else if (canRemoveOwnAttachments)
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("buildAttachment(a, (a.AuthorId === \'");
|
||||
|
||||
|
||||
#line 122 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(CurrentUser.Id);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon img\').attr(\'src\', " +
|
||||
"\'");
|
||||
WriteLiteral("\'));");
|
||||
|
||||
|
||||
#line 116 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.AttachmentThumbnail()));
|
||||
#line 122 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("buildAttachment(a, false);");
|
||||
|
||||
|
||||
#line 124 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\' + a.Id);\r\n e.find(\'.comments\').text(a.Comme" +
|
||||
"nts);\r\n e.find(\'.author\').text(a.Author);\r\n " +
|
||||
" e.find(\'.timestamp\').text(a.TimestampFuzzy).at" +
|
||||
"tr(\'title\', a.TimestampFull);\r\n e.find(\'.remo" +
|
||||
"ve\').click(removeAttachment);\r\n if (!quick)\r\n" +
|
||||
" e.hide();\r\n " +
|
||||
" $attachmentOutput.append(e);\r\n if (!qu" +
|
||||
"ick)\r\n e.show(\'slow\');\r\n " +
|
||||
" if (a.MimeType.toLowerCase().indexOf(\'image/\') == 0)\r\n " +
|
||||
" e.shadowbox({ gallery: \'attachments\', player: \'" +
|
||||
"img\', title: a.Comments });\r\n } else {\r\n " +
|
||||
" alert(\'Unable to add attachment: \' + d.Result);\r\n " +
|
||||
" }\r\n },\r\n " +
|
||||
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
|
||||
" alert(\'Unable to add attachment: \' + textStatus);\r\n " +
|
||||
" }\r\n });\r\n }\r\n " +
|
||||
" function removeAttachment() {\r\n $this = $(this)." +
|
||||
"closest(\'a\');\r\n\r\n var data = { id: $this.attr(\'data-attac" +
|
||||
"hmentid\') };\r\n var $dialogRemoveAttachment = $(\'#dialogRe" +
|
||||
"moveAttachment\');\r\n $dialogRemoveAttachment.dialog(\"enabl" +
|
||||
"e\");\r\n $dialogRemoveAttachment.dialog(\'option\', \'buttons\'" +
|
||||
", {\r\n \"Remove\": function () {\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"disable\");\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"option\", \"buttons\", null);\r\n " +
|
||||
" $.ajax({\r\n url: \'");
|
||||
WriteLiteral(@"
|
||||
} else {
|
||||
alert('Unable to add attachment: ' + d.Result);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to add attachment: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
function buildAttachment(a, canRemove) {
|
||||
var t = '<a><span");
|
||||
|
||||
WriteLiteral(" class=\"icon\"");
|
||||
|
||||
WriteLiteral("><img");
|
||||
|
||||
WriteLiteral(" alt=\"Attachment Thumbnail\"");
|
||||
|
||||
WriteLiteral(" /></span><span");
|
||||
|
||||
WriteLiteral(" class=\"comments\"");
|
||||
|
||||
WriteLiteral("></span><span");
|
||||
|
||||
WriteLiteral(" class=\"author\"");
|
||||
|
||||
WriteLiteral("></span>\';\r\n if (canRemove)\r\n " +
|
||||
" t += \'<span");
|
||||
|
||||
WriteLiteral(" class=\"remove\"");
|
||||
|
||||
WriteLiteral("></span>\';\r\n t += \'<span");
|
||||
|
||||
WriteLiteral(" class=\"timestamp\"");
|
||||
|
||||
WriteLiteral("></span></a>\';\r\n\r\n var e = $(t);\r\n\r\n " +
|
||||
" e.attr(\'data-attachmentid\', a.Id).attr(\'data-mimetype\', a.MimeType).at" +
|
||||
"tr(\'href\', \'");
|
||||
|
||||
|
||||
#line 148 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.AttachmentRemove()));
|
||||
#line 143 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.AttachmentDownload()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
|
||||
" data: data,\r\n success: function" +
|
||||
" (d) {\r\n if (d == \'OK\') {\r\n " +
|
||||
" $this.hide(300).delay(300).queue(function () {\r\n " +
|
||||
" var $this = $(this);\r\n " +
|
||||
" if ($this.attr(\'data-mimetype\').toLowerCase(" +
|
||||
").indexOf(\'image/\') == 0)\r\n S" +
|
||||
"hadowbox.removeCache(this);\r\n $th" +
|
||||
"is.remove();\r\n });\r\n " +
|
||||
" } else {\r\n ale" +
|
||||
"rt(\'Unable to remove attachment: \' + d);\r\n " +
|
||||
" }\r\n $dialogRemoveAttachment.dialog(\"clo" +
|
||||
"se\");\r\n },\r\n " +
|
||||
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
|
||||
" alert(\'Unable to remove attachment: \' + textStatus);\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
|
||||
" }\r\n });\r\n " +
|
||||
" },\r\n Cancel: function () {\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
|
||||
" }\r\n });\r\n\r\n $dialogRem" +
|
||||
"oveAttachment.dialog(\'open\');\r\n\r\n return false;\r\n " +
|
||||
" }\r\n $attachmentOutput.children(\'a\').each(function" +
|
||||
" () {\r\n $this = $(this);\r\n if ($th" +
|
||||
"is.attr(\'data-mimetype\').toLowerCase().indexOf(\'image/\') == 0)\r\n " +
|
||||
" $this.shadowbox({ gallery: \'attachments\', player: \'img\', title: $thi" +
|
||||
"s.find(\'.comments\').text() });\r\n });\r\n });\r\n " +
|
||||
" </script>\r\n </td>\r\n </tr>\r\n </table>\r\n <di" +
|
||||
"v");
|
||||
WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon img\').attr(\'src\', \'");
|
||||
|
||||
|
||||
#line 144 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.AttachmentThumbnail()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"/' + a.Id);
|
||||
e.find('.comments').text(a.Comments);
|
||||
e.find('.author').text(a.Author);
|
||||
e.find('.timestamp').text(a.TimestampFuzzy).attr('title', a.TimestampFull);
|
||||
if (canRemove)
|
||||
e.find('.remove').click(removeAttachment);
|
||||
if (!quick)
|
||||
e.hide();
|
||||
$attachmentOutput.append(e);
|
||||
if (!quick)
|
||||
e.show('slow');
|
||||
if (a.MimeType.toLowerCase().indexOf('image/') == 0)
|
||||
e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Comments });
|
||||
}
|
||||
|
||||
//#endregion
|
||||
");
|
||||
|
||||
|
||||
#line 160 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 161 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"
|
||||
//#region Remove Attachments
|
||||
|
||||
$attachmentOutput.find('span.remove').click(removeAttachment);
|
||||
|
||||
$('#dialogRemoveAttachment').dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
function removeAttachment() {
|
||||
$this = $(this).closest('a');
|
||||
|
||||
var data = { id: $this.attr('data-attachmentid') };
|
||||
var $dialogRemoveAttachment = $('#dialogRemoveAttachment');
|
||||
$dialogRemoveAttachment.dialog(""enable"");
|
||||
$dialogRemoveAttachment.dialog('option', 'buttons', {
|
||||
""Remove"": function () {
|
||||
$dialogRemoveAttachment.dialog(""disable"");
|
||||
$dialogRemoveAttachment.dialog(""option"", ""buttons"", null);
|
||||
$.ajax({
|
||||
url: '");
|
||||
|
||||
|
||||
#line 185 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.User.AttachmentRemove()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
|
||||
" data: data,\r\n succe" +
|
||||
"ss: function (d) {\r\n if (d == \'OK\') {" +
|
||||
"\r\n $this.hide(300).delay(300).que" +
|
||||
"ue(function () {\r\n var $this " +
|
||||
"= $(this);\r\n if ($this.attr(\'" +
|
||||
"data-mimetype\').toLowerCase().indexOf(\'image/\') == 0)\r\n " +
|
||||
" Shadowbox.removeCache(this);\r\n " +
|
||||
" $this.remove();\r\n " +
|
||||
" });\r\n } else {\r\n " +
|
||||
" alert(\'Unable to remove attachment:" +
|
||||
" \' + d);\r\n }\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
|
||||
" },\r\n error: functi" +
|
||||
"on (jqXHR, textStatus, errorThrown) {\r\n " +
|
||||
" alert(\'Unable to remove attachment: \' + textStatus);\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
|
||||
" }\r\n });\r\n " +
|
||||
" },\r\n Cancel: function () {\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
|
||||
" }\r\n });\r\n\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\'open\');\r\n\r\n " +
|
||||
" return false;\r\n }\r\n\r\n //#endr" +
|
||||
"egion\r\n ");
|
||||
|
||||
|
||||
#line 218 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"
|
||||
$attachmentOutput.children('a').each(function () {
|
||||
$this = $(this);
|
||||
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
|
||||
$this.shadowbox({ gallery: 'attachments', player: 'img', title: $this.find('.comments').text() });
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
");
|
||||
|
||||
|
||||
#line 230 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 230 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (canAddAttachments)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"dialogUpload\"");
|
||||
|
||||
WriteLiteral(" title=\"Upload Attachment\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"silverlightHostUploadAttachment\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n </div>\r\n <div");
|
||||
WriteLiteral(">\r\n </div>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 236 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 237 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"dialogRemoveAttachment\"");
|
||||
|
||||
WriteLiteral(" title=\"Remove this Attachment?\"");
|
||||
|
||||
WriteLiteral(">\r\n <p>\r\n <span");
|
||||
WriteLiteral(">\r\n <p>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||
|
||||
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
|
||||
|
||||
WriteLiteral("></span>\r\n Are you sure?\r\n </p>\r\n </div>\r\n <script>\r\n " +
|
||||
" $(\'#UserDetailTabItems\').append(\'<li><a href=\"#UserDetailTab-Resources\" id=\"" +
|
||||
"UserDetailTab-ResourcesLink\">Attachments [");
|
||||
WriteLiteral("></span>\r\n Are you sure?\r\n </p>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 200 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 245 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script>\r\n $(\'#UserDetailTabItems\').append(\'<li><a href=\"#UserDetailTa" +
|
||||
"b-Resources\" id=\"UserDetailTab-ResourcesLink\">Attachments [");
|
||||
|
||||
|
||||
#line 247 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Model.User.UserAttachments == null ? 0 : Model.User.UserAttachments.Count);
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
@model Disco.Web.Models.User.ShowModel
|
||||
@{
|
||||
Authorization.Require(Claims.User.Show);
|
||||
|
||||
var currentDeviceAssignments = Model.User.DeviceUserAssignments.Where(dua => !dua.UnassignedDate.HasValue).OrderByDescending(dua => dua.AssignedDate).ToList();
|
||||
}
|
||||
<table id="User_Show_Subjects">
|
||||
@@ -30,15 +32,6 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="User_Show_Details_Category" class="status">
|
||||
<table class="none verticalHeadings">
|
||||
<tr>
|
||||
<td>Type:
|
||||
</td>
|
||||
<td><span id="User_Show_Details_Category_Type" title="Type">@Model.User.Type</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="User_Show_Details_Attributes" class="status">
|
||||
<table class="none verticalHeadings">
|
||||
<tr>
|
||||
@@ -69,29 +62,32 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="User_Show_GenerateDocument_Container" class="status">
|
||||
@Html.DropDownList("User_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems)
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var generatePdfUrl = '@Url.Action(MVC.API.User.GeneratePdf(Model.User.Id, null))?DocumentTemplateId=';
|
||||
var $documentTemplates = $('#User_Show_GenerateDocument');
|
||||
$documentTemplates.change(function () {
|
||||
var v = $documentTemplates.val();
|
||||
if (v) {
|
||||
window.location.href = generatePdfUrl + v;
|
||||
$documentTemplates.val('').blur();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
@if (Authorization.Has(Claims.User.Actions.GenerateDocuments))
|
||||
{
|
||||
<div id="User_Show_GenerateDocument_Container" class="status">
|
||||
@Html.DropDownList("User_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems)
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var generatePdfUrl = '@Url.Action(MVC.API.User.GeneratePdf(Model.User.Id, null))?DocumentTemplateId=';
|
||||
var $documentTemplates = $('#User_Show_GenerateDocument');
|
||||
$documentTemplates.change(function () {
|
||||
var v = $documentTemplates.val();
|
||||
if (v) {
|
||||
window.location.href = generatePdfUrl + v;
|
||||
$documentTemplates.val('').blur();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
}
|
||||
<div id="User_Show_Details_Actions">
|
||||
@{
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
|
||||
}
|
||||
@Html.ActionLinkSmallButton("Create Job", MVC.Job.Create(Model.PrimaryDeviceSerialNumber, Model.User.Id), "User_Show_Details_Actions_CreateJob_Button")
|
||||
@if (currentDeviceAssignments.Count > 1)
|
||||
@if (Authorization.Has(Claims.Job.Actions.Create))
|
||||
{
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
|
||||
@Html.ActionLinkSmallButton("Create Job", MVC.Job.Create(Model.PrimaryDeviceSerialNumber, Model.User.Id), "User_Show_Details_Actions_CreateJob_Button")
|
||||
if (currentDeviceAssignments.Count > 1)
|
||||
{
|
||||
<div id="User_Show_Details_Actions_CreateJob_Dialog" class="dialog" title="Create Job for Which Device?">
|
||||
<div class="clearfix">
|
||||
<span class="ui-icon ui-icon-info" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
@@ -183,9 +179,9 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
<script>
|
||||
$(function () {
|
||||
$('#User_Show_Details_Actions_CreateJob_Button').click(function () {
|
||||
@@ -198,6 +194,7 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -211,9 +208,16 @@
|
||||
foreach (var assignment in currentDeviceAssignments)
|
||||
{
|
||||
<div class="User_Show_AssignedDevices_CurrentAssignment clearfix" data-deviceserialnumber="@assignment.DeviceSerialNumber">
|
||||
<a href="@Url.Action(MVC.Device.Show(assignment.Device.SerialNumber))">
|
||||
@if (Authorization.Has(Claims.Device.Show))
|
||||
{
|
||||
<a href="@Url.Action(MVC.Device.Show(assignment.Device.SerialNumber))">
|
||||
<img class="User_Show_AssignedDevices_CurrentAssignment_Image" alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash()))" />
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<img class="User_Show_AssignedDevices_CurrentAssignment_Image" alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash()))" />
|
||||
</a>
|
||||
}
|
||||
<div class="User_Show_AssignedDevices_CurrentAssignment_Details">
|
||||
<table class="none">
|
||||
<tbody>
|
||||
@@ -221,7 +225,16 @@
|
||||
<td>Serial Number:
|
||||
</td>
|
||||
<td>
|
||||
<span class="User_Show_AssignedDevices_CurrentAssignment_SerialNumber">@Html.ActionLink(assignment.Device.SerialNumber, MVC.Device.Show(assignment.Device.SerialNumber))</span> (<span>@assignment.Device.ComputerName</span>)
|
||||
<span class="User_Show_AssignedDevices_CurrentAssignment_SerialNumber">
|
||||
@if (Authorization.Has(Claims.Device.Show))
|
||||
{
|
||||
@Html.ActionLink(assignment.Device.SerialNumber, MVC.Device.Show(assignment.Device.SerialNumber))
|
||||
}
|
||||
else
|
||||
{
|
||||
@assignment.Device.SerialNumber
|
||||
}
|
||||
</span>(<span>@assignment.Device.ComputerName</span>)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18033
|
||||
// Runtime Version:4.0.30319.18051
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.User.UserParts
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Authorization;
|
||||
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/UserParts/_Subject.cshtml")]
|
||||
public partial class Subject : System.Web.Mvc.WebViewPage<Disco.Web.Models.User.ShowModel>
|
||||
public partial class Subject : Disco.Services.Web.WebViewPage<Disco.Web.Models.User.ShowModel>
|
||||
{
|
||||
public Subject()
|
||||
{
|
||||
@@ -43,6 +45,8 @@ namespace Disco.Web.Views.User.UserParts
|
||||
|
||||
#line 2 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
Authorization.Require(Claims.User.Show);
|
||||
|
||||
var currentDeviceAssignments = Model.User.DeviceUserAssignments.Where(dua => !dua.UnassignedDate.HasValue).OrderByDescending(dua => dua.AssignedDate).ToList();
|
||||
|
||||
|
||||
@@ -75,7 +79,7 @@ WriteLiteral(" title=\"Username\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 16 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 18 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Model.User.Id);
|
||||
|
||||
|
||||
@@ -92,7 +96,7 @@ WriteLiteral(" title=\"Display Name\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 21 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 23 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Model.User.DisplayName);
|
||||
|
||||
|
||||
@@ -109,7 +113,7 @@ WriteLiteral(" title=\"Given Name\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 25 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 27 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Model.User.GivenName);
|
||||
|
||||
|
||||
@@ -126,7 +130,7 @@ WriteLiteral(" title=\"Surname\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 29 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 31 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Model.User.Surname);
|
||||
|
||||
|
||||
@@ -135,33 +139,6 @@ WriteLiteral(">");
|
||||
WriteLiteral("</span></td>\r\n </tr>\r\n </table>" +
|
||||
"\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"User_Show_Details_Category\"");
|
||||
|
||||
WriteLiteral(" class=\"status\"");
|
||||
|
||||
WriteLiteral(">\r\n <table");
|
||||
|
||||
WriteLiteral(" class=\"none verticalHeadings\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <td>Type:\r\n " +
|
||||
" </td>\r\n <td><span");
|
||||
|
||||
WriteLiteral(" id=\"User_Show_Details_Category_Type\"");
|
||||
|
||||
WriteLiteral(" title=\"Type\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 38 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Model.User.Type);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span></td>\r\n </tr>\r\n </table>" +
|
||||
"\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"User_Show_Details_Attributes\"");
|
||||
|
||||
WriteLiteral(" class=\"status\"");
|
||||
@@ -174,13 +151,13 @@ WriteLiteral(">\r\n <tr>\r\n
|
||||
"td>\r\n <td>\r\n");
|
||||
|
||||
|
||||
#line 47 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 40 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 47 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 40 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
if (!string.IsNullOrEmpty(Model.User.EmailAddress))
|
||||
{
|
||||
|
||||
@@ -196,7 +173,7 @@ WriteLiteral(" title=\"Email Address [Update in Active Directory]\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 49 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 42 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Model.User.EmailAddress);
|
||||
|
||||
|
||||
@@ -205,7 +182,7 @@ WriteLiteral(">");
|
||||
WriteLiteral("</span>\r\n");
|
||||
|
||||
|
||||
#line 50 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 43 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -220,7 +197,7 @@ WriteLiteral(" class=\"smallMessage\"");
|
||||
WriteLiteral(">Unknown</span>\r\n");
|
||||
|
||||
|
||||
#line 54 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 47 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -231,13 +208,13 @@ WriteLiteral(" </td>\r\n
|
||||
" <td>\r\n");
|
||||
|
||||
|
||||
#line 60 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 53 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 60 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 53 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
if (!string.IsNullOrEmpty(Model.User.PhoneNumber))
|
||||
{
|
||||
|
||||
@@ -253,7 +230,7 @@ WriteLiteral(" title=\"Phone Number [Update in Active Directory]\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 62 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 55 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Model.User.PhoneNumber);
|
||||
|
||||
|
||||
@@ -262,7 +239,7 @@ WriteLiteral(">");
|
||||
WriteLiteral("</span>\r\n");
|
||||
|
||||
|
||||
#line 63 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 56 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -277,14 +254,30 @@ WriteLiteral(" class=\"smallMessage\"");
|
||||
WriteLiteral(">Unknown</span>\r\n");
|
||||
|
||||
|
||||
#line 67 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 60 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n " +
|
||||
" </table>\r\n </div>\r\n <div");
|
||||
" </table>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 65 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 65 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
if (Authorization.Has(Claims.User.Actions.GenerateDocuments))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"User_Show_GenerateDocument_Container\"");
|
||||
|
||||
@@ -292,84 +285,83 @@ WriteLiteral(" class=\"status\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 73 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Html.DropDownList("User_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems));
|
||||
#line 68 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Html.DropDownList("User_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n v" +
|
||||
"ar generatePdfUrl = \'");
|
||||
WriteLiteral(">\r\n $(function () {\r\n " +
|
||||
" var generatePdfUrl = \'");
|
||||
|
||||
|
||||
#line 76 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Url.Action(MVC.API.User.GeneratePdf(Model.User.Id, null)));
|
||||
#line 71 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Url.Action(MVC.API.User.GeneratePdf(Model.User.Id, null)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"?DocumentTemplateId=';
|
||||
var $documentTemplates = $('#User_Show_GenerateDocument');
|
||||
$documentTemplates.change(function () {
|
||||
var v = $documentTemplates.val();
|
||||
if (v) {
|
||||
window.location.href = generatePdfUrl + v;
|
||||
$documentTemplates.val('').blur();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<div");
|
||||
var $documentTemplates = $('#User_Show_GenerateDocument');
|
||||
$documentTemplates.change(function () {
|
||||
var v = $documentTemplates.val();
|
||||
if (v) {
|
||||
window.location.href = generatePdfUrl + v;
|
||||
$documentTemplates.val('').blur();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
");
|
||||
|
||||
|
||||
#line 83 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"User_Show_Details_Actions\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 89 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 85 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 89 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 92 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Html.ActionLinkSmallButton("Create Job", MVC.Job.Create(Model.PrimaryDeviceSerialNumber, Model.User.Id), "User_Show_Details_Actions_CreateJob_Button"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 93 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 93 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
if (currentDeviceAssignments.Count > 1)
|
||||
#line 85 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
if (Authorization.Has(Claims.Job.Actions.Create))
|
||||
{
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 88 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Html.ActionLinkSmallButton("Create Job", MVC.Job.Create(Model.PrimaryDeviceSerialNumber, Model.User.Id), "User_Show_Details_Actions_CreateJob_Button"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 88 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
if (currentDeviceAssignments.Count > 1)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
@@ -405,13 +397,13 @@ WriteLiteral(" class=\"none\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 102 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 98 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 102 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 98 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
foreach (var assignment in currentDeviceAssignments)
|
||||
{
|
||||
|
||||
@@ -425,7 +417,7 @@ WriteLiteral(" class=\"CreateJob_Assignment clearfix\"");
|
||||
WriteLiteral(" data-createjoburl=\"");
|
||||
|
||||
|
||||
#line 104 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 100 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Url.Action(MVC.Job.Create(assignment.DeviceSerialNumber, Model.User.Id)));
|
||||
|
||||
|
||||
@@ -439,14 +431,14 @@ WriteLiteral(" class=\"CreateJob_Assignment_Image\"");
|
||||
|
||||
WriteLiteral(" alt=\"Model Image\"");
|
||||
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 6326), Tuple.Create("\"", 6447)
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 6191), Tuple.Create("\"", 6312)
|
||||
|
||||
#line 105 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6332), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash()))
|
||||
#line 101 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6197), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash()))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 6332), false)
|
||||
, 6197), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" />\r\n <div");
|
||||
@@ -466,7 +458,7 @@ WriteLiteral(@">
|
||||
<span>");
|
||||
|
||||
|
||||
#line 113 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 109 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(assignment.Device.SerialNumber);
|
||||
|
||||
|
||||
@@ -475,7 +467,7 @@ WriteLiteral(@">
|
||||
WriteLiteral("</span> (<span>");
|
||||
|
||||
|
||||
#line 113 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 109 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(assignment.Device.ComputerName);
|
||||
|
||||
|
||||
@@ -491,7 +483,7 @@ WriteLiteral(@"</span>)
|
||||
<span>");
|
||||
|
||||
|
||||
#line 120 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 116 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(assignment.Device.DeviceModel.ToString());
|
||||
|
||||
|
||||
@@ -506,13 +498,13 @@ WriteLiteral(@"</span>
|
||||
");
|
||||
|
||||
|
||||
#line 126 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 122 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 126 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 122 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
if (!string.IsNullOrEmpty(assignment.Device.AssetNumber))
|
||||
{
|
||||
|
||||
@@ -522,7 +514,7 @@ WriteLiteral(@"</span>
|
||||
WriteLiteral(" <span>");
|
||||
|
||||
|
||||
#line 128 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 124 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(assignment.Device.AssetNumber);
|
||||
|
||||
|
||||
@@ -531,7 +523,7 @@ WriteLiteral("
|
||||
WriteLiteral("</span>\r\n");
|
||||
|
||||
|
||||
#line 129 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 125 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -546,7 +538,7 @@ WriteLiteral(" class=\"smallMessage\"");
|
||||
WriteLiteral(">Unknown</span>\r\n");
|
||||
|
||||
|
||||
#line 133 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 129 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -560,7 +552,7 @@ WriteLiteral(@" <
|
||||
<span>");
|
||||
|
||||
|
||||
#line 139 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 135 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(assignment.AssignedDate));
|
||||
|
||||
|
||||
@@ -576,7 +568,7 @@ WriteLiteral(@"</span>
|
||||
");
|
||||
|
||||
|
||||
#line 146 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 142 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -613,10 +605,10 @@ WriteLiteral(" <script>\r\n
|
||||
"ipt>\r\n");
|
||||
|
||||
|
||||
#line 186 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
#line 182 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
@@ -636,7 +628,8 @@ WriteLiteral(@" <script>
|
||||
");
|
||||
|
||||
|
||||
#line 201 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 197 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -654,13 +647,13 @@ WriteLiteral(" id=\"User_Show_AssignedDevices_Active\"");
|
||||
WriteLiteral(">\r\n <h3>Current Device Assignments</h3>\r\n");
|
||||
|
||||
|
||||
#line 209 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 206 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 209 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 206 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
if (currentDeviceAssignments.Count > 0)
|
||||
{
|
||||
foreach (var assignment in currentDeviceAssignments)
|
||||
@@ -676,7 +669,7 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment clearfix\"");
|
||||
WriteLiteral(" data-deviceserialnumber=\"");
|
||||
|
||||
|
||||
#line 213 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 210 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(assignment.DeviceSerialNumber);
|
||||
|
||||
|
||||
@@ -684,35 +677,87 @@ WriteLiteral(" data-deviceserialnumber=\"");
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">\r\n <a");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 13160), Tuple.Create("\"", 13227)
|
||||
|
||||
#line 214 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 13167), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Device.Show(assignment.Device.SerialNumber))
|
||||
#line 211 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 13167), false)
|
||||
|
||||
#line 211 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
if (Authorization.Has(Claims.Device.Show))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 13184), Tuple.Create("\"", 13251)
|
||||
|
||||
#line 213 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 13191), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Device.Show(assignment.Device.SerialNumber))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 13191), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <img");
|
||||
WriteLiteral(">\r\n <img");
|
||||
|
||||
WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_Image\"");
|
||||
|
||||
WriteLiteral(" alt=\"Model Image\"");
|
||||
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 13347), Tuple.Create("\"", 13468)
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 13375), Tuple.Create("\"", 13496)
|
||||
|
||||
#line 215 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 13353), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash()))
|
||||
#line 214 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 13381), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash()))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 13353), false)
|
||||
, 13381), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" />\r\n </a>\r\n <div");
|
||||
WriteLiteral(" />\r\n </a>\r\n");
|
||||
|
||||
|
||||
#line 216 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <img");
|
||||
|
||||
WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_Image\"");
|
||||
|
||||
WriteLiteral(" alt=\"Model Image\"");
|
||||
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 13768), Tuple.Create("\"", 13889)
|
||||
|
||||
#line 219 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 13774), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash()))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 13774), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
|
||||
#line 220 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_Details\"");
|
||||
|
||||
@@ -730,20 +775,59 @@ WriteLiteral(@">
|
||||
|
||||
WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_SerialNumber\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 224 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Html.ActionLink(assignment.Device.SerialNumber, MVC.Device.Show(assignment.Device.SerialNumber)));
|
||||
#line 229 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 229 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
if (Authorization.Has(Claims.Device.Show))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 231 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(Html.ActionLink(assignment.Device.SerialNumber, MVC.Device.Show(assignment.Device.SerialNumber)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span> (<span>");
|
||||
|
||||
#line 231 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 235 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(assignment.Device.SerialNumber);
|
||||
|
||||
|
||||
#line 224 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(assignment.Device.ComputerName);
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 235 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </span>(<span>");
|
||||
|
||||
|
||||
#line 237 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(assignment.Device.ComputerName);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -762,7 +846,7 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_Model\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 231 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 244 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(assignment.Device.DeviceModel.ToString());
|
||||
|
||||
|
||||
@@ -777,13 +861,13 @@ WriteLiteral(@"</span>
|
||||
");
|
||||
|
||||
|
||||
#line 237 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 250 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 237 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 250 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
if (!string.IsNullOrEmpty(assignment.Device.AssetNumber))
|
||||
{
|
||||
|
||||
@@ -797,7 +881,7 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_Asset\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 239 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 252 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(assignment.Device.AssetNumber);
|
||||
|
||||
|
||||
@@ -806,7 +890,7 @@ WriteLiteral(">");
|
||||
WriteLiteral("</span>\r\n");
|
||||
|
||||
|
||||
#line 240 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 253 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -821,7 +905,7 @@ WriteLiteral(" class=\"smallMessage\"");
|
||||
WriteLiteral(">Unknown</span>\r\n");
|
||||
|
||||
|
||||
#line 244 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 257 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -839,7 +923,7 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_Assigned\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 250 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 263 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(assignment.AssignedDate));
|
||||
|
||||
|
||||
@@ -855,7 +939,7 @@ WriteLiteral(@"</span>
|
||||
");
|
||||
|
||||
|
||||
#line 257 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 270 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -871,7 +955,7 @@ WriteLiteral(" class=\"smallMessage\"");
|
||||
WriteLiteral(">No Current Device Assignments</span>\r\n");
|
||||
|
||||
|
||||
#line 262 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
#line 275 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user