qol: make attachment comments optional

This commit is contained in:
Gary Sharp committed 2024-12-18 18:40:23 +11:00
1 parent 77acf0bfdb
commit 9f10eeeb70
21 files changed
+647 -433

No files matched your search

@@ -127,30 +127,20 @@ namespace Disco.BI.Extensions
public static void Delete(this DocumentTemplate dt, DiscoDataContext Database)
{
// Find & Rename all references
foreach (DeviceAttachment a in Database.DeviceAttachments.Where(a => a.DocumentTemplateId == dt.Id))
void updateAttachment(IAttachment a)
{
a.Comments = string.Format("{0} - {1}", dt.Description, a.Comments);
if (a.Comments.Length > 500)
a.Comments = a.Comments.Substring(0, 500);
var comments = $"{dt.Description} - {a.Comments}";
if (comments.Length > 500)
comments = comments.Substring(0, 500);
a.Comments = comments;
a.DocumentTemplateId = null;
a.DocumentTemplate = null;
}
foreach (JobAttachment a in Database.JobAttachments.Where(a => a.DocumentTemplateId == dt.Id))
{
a.Comments = string.Format("{0} - {1}", dt.Description, a.Comments);
if (a.Comments.Length > 500)
a.Comments = a.Comments.Substring(0, 500);
a.DocumentTemplateId = null;
a.DocumentTemplate = null;
}
foreach (var a in Database.DeviceAttachments.Where(a => a.DocumentTemplateId == dt.Id))
updateAttachment(a);
foreach (var a in Database.JobAttachments.Where(a => a.DocumentTemplateId == dt.Id))
updateAttachment(a);
foreach (UserAttachment a in Database.UserAttachments.Where(a => a.DocumentTemplateId == dt.Id))
{
a.Comments = string.Format("{0} - {1}", dt.Description, a.Comments);
if (a.Comments.Length > 500)
a.Comments = a.Comments.Substring(0, 500);
a.DocumentTemplateId = null;
a.DocumentTemplate = null;
}
updateAttachment(a);
// Remove Linked Group
ActiveDirectory.Context.ManagedGroups.Remove(DocumentTemplateDevicesManagedGroup.GetKey(dt));
@@ -161,8 +151,8 @@ namespace Disco.BI.Extensions
// Delete Template
string templateRepositoryFilename = dt.RepositoryFilename(Database);
if (System.IO.File.Exists(templateRepositoryFilename))
System.IO.File.Delete(templateRepositoryFilename);
if (File.Exists(templateRepositoryFilename))
File.Delete(templateRepositoryFilename);
// Remove from Cache
dt.FilterExpressionInvalidateCache();
+7
View File
@@ -183,6 +183,10 @@
<Compile Include="Migrations\202403030134280_DBv24.Designer.cs">
<DependentUpon>202403030134280_DBv24.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\202412180604170_DBv25.cs" />
<Compile Include="Migrations\202412180604170_DBv25.Designer.cs">
<DependentUpon>202412180604170_DBv25.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Migrations\DiscoDataMigrator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -270,6 +274,9 @@
<EmbeddedResource Include="Migrations\202403030134280_DBv24.resx">
<DependentUpon>202403030134280_DBv24.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202412180604170_DBv25.resx">
<DependentUpon>202412180604170_DBv25.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
+27
View File
@@ -0,0 +1,27 @@
// <auto-generated />
namespace Disco.Data.Migrations
{
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
public sealed partial class DBv25 : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(DBv25));
string IMigrationMetadata.Id
{
get { return "202412180604170_DBv25"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,22 @@
namespace Disco.Data.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class DBv25 : DbMigration
{
public override void Up()
{
AlterColumn("dbo.UserAttachments", "Comments", c => c.String(maxLength: 500));
AlterColumn("dbo.JobAttachments", "Comments", c => c.String(maxLength: 500));
AlterColumn("dbo.DeviceAttachments", "Comments", c => c.String(maxLength: 500));
}
public override void Down()
{
AlterColumn("dbo.DeviceAttachments", "Comments", c => c.String(nullable: false, maxLength: 500));
AlterColumn("dbo.JobAttachments", "Comments", c => c.String(nullable: false, maxLength: 500));
AlterColumn("dbo.UserAttachments", "Comments", c => c.String(nullable: false, maxLength: 500));
}
}
}
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Target" xml:space="preserve">
<value>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 truncated
</data>
</root>
@@ -16,7 +16,7 @@ namespace Disco.Models.Repository
[Required, StringLength(500)]
public string MimeType { get; set; }
public DateTime Timestamp { get; set; }
[Required, StringLength(500)]
[StringLength(500)]
public string Comments { get; set; }
public string DocumentTemplateId { get; set; }
+1 -1
View File
@@ -17,7 +17,7 @@ namespace Disco.Models.Repository
[Required, StringLength(500)]
public string MimeType { get; set; }
public DateTime Timestamp { get; set; }
[StringLength(500), Required]
[StringLength(500)]
public string Comments { get; set; }
public string DocumentTemplateId { get; set; }
@@ -16,7 +16,7 @@ namespace Disco.Models.Repository
[StringLength(500), Required]
public string MimeType { get; set; }
public DateTime Timestamp { get; set; }
[Required, StringLength(500)]
[StringLength(500)]
public string Comments { get; set; }
public string DocumentTemplateId { get; set; }
@@ -512,8 +512,8 @@ namespace Disco.Web.Areas.API.Controllers
return HttpNotFound("Invalid Attachment Number");
}
[DiscoAuthorize(Claims.Device.Actions.AddAttachments)]
public virtual ActionResult AttachmentUpload(string id, string Comments)
[DiscoAuthorize(Claims.Device.Actions.AddAttachments), ValidateAntiForgeryToken]
public virtual ActionResult AttachmentUpload(string id, string comments)
{
var d = Database.Devices.Find(id);
if (d != null)
@@ -527,6 +527,9 @@ namespace Disco.Web.Areas.API.Controllers
if (string.IsNullOrEmpty(contentType) || contentType.Equals("unknown/unknown", StringComparison.OrdinalIgnoreCase))
contentType = MimeTypes.ResolveMimeType(file.FileName);
if (string.IsNullOrWhiteSpace(comments))
comments = null;
var da = new DeviceAttachment()
{
DeviceSerialNumber = d.SerialNumber,
@@ -534,7 +537,7 @@ namespace Disco.Web.Areas.API.Controllers
Filename = file.FileName,
MimeType = contentType,
Timestamp = DateTime.Now,
Comments = Comments
Comments = comments
};
Database.DeviceAttachments.Add(da);
Database.SaveChanges();
@@ -554,10 +557,12 @@ namespace Disco.Web.Areas.API.Controllers
[DiscoAuthorize(Claims.Device.ShowAttachments)]
public virtual ActionResult Attachment(int id)
{
var da = Database.DeviceAttachments.Include("DocumentTemplate").Include("TechUser").Where(m => m.Id == id).FirstOrDefault();
var da = Database.DeviceAttachments
.Include(a => a.DocumentTemplate)
.Include(a => a.TechUser)
.Where(m => m.Id == id).FirstOrDefault();
if (da != null)
{
var m = new Models.Attachment.AttachmentModel()
{
Attachment = Models.Attachment._AttachmentModel.FromAttachment(da),
@@ -1919,8 +1919,8 @@ namespace Disco.Web.Areas.API.Controllers
return HttpNotFound("Invalid Attachment Number");
}
[DiscoAuthorize(Claims.Job.Actions.AddAttachments)]
public virtual ActionResult AttachmentUpload(int id, string Comments)
[DiscoAuthorize(Claims.Job.Actions.AddAttachments), ValidateAntiForgeryToken]
public virtual ActionResult AttachmentUpload(int id, string comments)
{
var j = Database.Jobs.Find(id);
if (j != null)
@@ -1934,6 +1934,9 @@ namespace Disco.Web.Areas.API.Controllers
if (string.IsNullOrEmpty(contentType) || contentType.Equals("unknown/unknown", StringComparison.OrdinalIgnoreCase))
contentType = MimeTypes.ResolveMimeType(file.FileName);
if (string.IsNullOrWhiteSpace(comments))
comments = null;
var ja = new JobAttachment()
{
JobId = j.Id,
@@ -1941,7 +1944,7 @@ namespace Disco.Web.Areas.API.Controllers
Filename = file.FileName,
MimeType = contentType,
Timestamp = DateTime.Now,
Comments = Comments
Comments = comments
};
Database.JobAttachments.Add(ja);
Database.SaveChanges();
@@ -1961,10 +1964,12 @@ namespace Disco.Web.Areas.API.Controllers
[DiscoAuthorize(Claims.Job.ShowAttachments)]
public virtual ActionResult Attachment(int id)
{
var ja = Database.JobAttachments.Include("DocumentTemplate").Include("TechUser").Where(m => m.Id == id).FirstOrDefault();
var ja = Database.JobAttachments
.Include(a => a.DocumentTemplate)
.Include(a => a.TechUser)
.Where(m => m.Id == id).FirstOrDefault();
if (ja != null)
{
var m = new Models.Attachment.AttachmentModel()
{
Attachment = Models.Attachment._AttachmentModel.FromAttachment(ja),
@@ -56,8 +56,8 @@ namespace Disco.Web.Areas.API.Controllers
return HttpNotFound("Invalid Attachment Number");
}
[DiscoAuthorize(Claims.User.Actions.AddAttachments)]
public virtual ActionResult AttachmentUpload(string id, string Domain, string Comments)
[DiscoAuthorize(Claims.User.Actions.AddAttachments), ValidateAntiForgeryToken]
public virtual ActionResult AttachmentUpload(string id, string Domain, string comments)
{
id = ActiveDirectory.ParseDomainAccountId(id, Domain);
@@ -73,6 +73,9 @@ namespace Disco.Web.Areas.API.Controllers
if (string.IsNullOrEmpty(contentType) || contentType.Equals("unknown/unknown", StringComparison.OrdinalIgnoreCase))
contentType = MimeTypes.ResolveMimeType(file.FileName);
if (string.IsNullOrWhiteSpace(comments))
comments = null;
var ua = new Disco.Models.Repository.UserAttachment()
{
UserId = u.UserId,
@@ -80,7 +83,7 @@ namespace Disco.Web.Areas.API.Controllers
Filename = file.FileName,
MimeType = contentType,
Timestamp = DateTime.Now,
Comments = Comments
Comments = comments
};
Database.UserAttachments.Add(ua);
Database.SaveChanges();
@@ -100,7 +103,10 @@ namespace Disco.Web.Areas.API.Controllers
[DiscoAuthorize(Claims.User.ShowAttachments)]
public virtual ActionResult Attachment(int id)
{
var ua = Database.UserAttachments.Include("DocumentTemplate").Include("TechUser").Where(m => m.Id == id).FirstOrDefault();
var ua = Database.UserAttachments
.Include(a => a.DocumentTemplate)
.Include(a => a.TechUser)
.Where(m => m.Id == id).FirstOrDefault();
if (ua != null)
{
@@ -20,7 +20,7 @@ namespace Disco.Web.Areas.API.Models.Attachment
if (DocumentTemplateId != null && DocumentTemplateDescription != null)
return DocumentTemplateDescription;
else
return Comments;
return Comments ?? Filename;
}
}
public string Filename { get; set; }
@@ -1,12 +1,13 @@
(function (window, document, $) {
"use strict";
var attachmentUploader = function (uploadUrl, dropTarget, uploadProgressContainer) {
var attachmentUploader = function ($host) {
var self = this;
self.uploadUrl = uploadUrl;
self.dropTarget = dropTarget;
self.uploadProgressContainer = uploadProgressContainer;
self.$host = $host;
self.uploadUrl = $host.attr('data-uploadurl');
self.dropTarget = $host.find('.Disco-AttachmentUpload-DropTarget');
self.uploadProgressContainer = $host.find('.Disco-AttachmentUpload-Progress');
// #region File Selection Support
self._uploadFilesInput = null;
@@ -168,7 +169,7 @@
title: 'Upload File',
'class': 'dialog Disco-AttachmentUpload-CommentDialog'
});
dialog.html('<table><tr><th>File Name:</th><td class="filename"></td></tr><tr><th>Comments:</th><td><input class="comments" type="text"></input></td></tr><tr><td class="thumbnail" colspan="2"><img /></td></tr></table>');
dialog.html('<table><tr><th>File Name:</th><td class="filename"></td></tr><tr><th>Comments:</th><td><input class="comments" type="text" placeholder="optional" /></td></tr><tr><td class="thumbnail" colspan="2"><img /></td></tr></table>');
if (!!thumbnailHandler) {
var td = dialog.find('td.thumbnail');
@@ -181,11 +182,9 @@
var comments = dialog.find('input.comments')
.keypress(function (e) {
if (e.which === 13) {
if (!!comments.val()) {
result = true;
dialog.dialog("close");
}
}
});
dialog.dialog({
@@ -195,15 +194,11 @@
autoOpen: true,
buttons: {
"Upload": function () {
if (!!comments.val()) {
result = true;
dialog.dialog("close");
window.setTimeout(function () {
comments.focus();
}, 1);
} else {
alert('Please provide a comment for this attachment.');
}
},
Cancel: function () {
dialog.dialog("close");
@@ -262,30 +257,34 @@
processNextFile();
};
self._uploadFile = function (fileData, fileName, comments) {
var formData = new FormData();
var xhr = new XMLHttpRequest();
var progress = $('<div>')
self._uploadFile = async function (fileData, fileName, comments) {
const formData = new FormData();
const progress = $('<div>')
.append($('<i>').addClass('fa fa-cog fa-spin'))
.append($('<span>').text('Uploading: ' + fileName))
.appendTo(self.uploadProgressContainer);
formData.append('Comments', comments);
formData.append('File', fileData, fileName);
formData.append('__RequestVerificationToken', self.$host.find('input[name="__RequestVerificationToken"]').val());
formData.append('comments', comments);
formData.append('file', fileData, fileName);
const result = await fetch(self.uploadUrl, {
method: 'POST',
body: formData
});
xhr.open("POST", self.uploadUrl, true);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status !== 200) {
alert('Error Uploading [' + fileName + ']: ' + xhr.statusText);
}
progress.slideUp(400, function () {
progress.remove();
});
if (!result.ok) {
alert('Error Uploading [' + fileName + ']: ' + result.statusText);
const errorText = await result.text();
console.error('Failed to upload file [' + fileName + ']: ' + errorText);
}
};
xhr.send(formData);
};
// #endregion
return self;
@@ -1 +1 @@
(function(n,t,i){"use strict";var r=function(r,u,f){var e=this;if(e.uploadUrl=r,e.dropTarget=u,e.uploadProgressContainer=f,e._uploadFilesInput=null,e.uploadFiles=function(){!e._uploadFilesInput||e._uploadFilesInput.remove();e._uploadFilesInput=i("<input>");e._uploadFilesInput.attr({type:"file",multiple:"multiple",title:"Disco ICT File Uploading"}).hide().change(function(n){var t=n.target.files;!!t&&t.length>0&&e._uploadFiles(t);e._uploadFilesInput.remove()}).appendTo(e.uploadProgressContainer).click()},!!e.dropTarget){var h=i(t),o=!1,s=null;h.on("dragover",function(){e.dropTarget.addClass("dragHighlight");e.dropTarget.removeClass("dragHover");o=!1});h.on("dragleave",function(){!s||n.clearInterval(s);o=!0;n.setTimeout(function(){o&&e.dropTarget.removeClass("dragHighlight");s=null},200)});e.dropTarget.on("dragover",function(n){n.stopPropagation();n.preventDefault();e.dropTarget.addClass("dragHover");o=!1;n.originalEvent.dataTransfer.dropEffect="copy"});e.dropTarget.on("drop",function(n){n.stopPropagation();n.preventDefault();o=!0;e.dropTarget.removeClass("dragHighlight");var t=n.originalEvent.dataTransfer.files;e._uploadFiles(t)})}return e.uploadImage=function(){let f=null,o=!1;var u=i("<div><video><\/video><\/div>").attr({id:"Disco_AttachmentUpload_ImageDialog",title:"Upload Image","class":"dialog Disco-AttachmentUpload-ImageDialog"});u.dialog({autoOpen:!0,draggable:!1,modal:!0,resizable:!1,width:720,height:405,close:function(){f&&f.getTracks().forEach(n=>n.stop());n.setTimeout(function(){u.dialog("destroy")},1)}}).closest(".ui-dialog").children(".ui-dialog-titlebar").css("border-bottom","none");const r=u.find("video")[0];navigator.mediaDevices.getUserMedia({audio:!1,video:{width:{ideal:1920},height:{ideal:1080},facingMode:"environment"}}).then(n=>{f=n,r.srcObject=n,r.play()}).catch(n=>{console.error(n),u.dialog("destroy")});r.addEventListener("canplay",()=>{if(!o){const i=720;let n=r.videoHeight/(r.videoWidth/i);isNaN(n)&&(n=405);r.setAttribute("width",i);r.setAttribute("height",n);o=!0;u.dialog("option","buttons",[{text:"Capture",click:()=>{const n=t.createElement("canvas");n.width=r.videoWidth;n.height=r.videoHeight;const i=n.getContext("2d");i.drawImage(r,0,0);n.toBlob(n=>{e._uploadImage(n)},"image/jpg")}}]);u.css("height","");u.closest(".ui-dialog").children(".ui-dialog-buttonpane").css("margin-top",0).find(".ui-button:first").focus()}})},e.getFileComments=function(t,r,u){var o=!1,f=i("<div>").attr({title:"Upload File","class":"dialog Disco-AttachmentUpload-CommentDialog"}),s,h,e;f.html('<table><tr><th>File Name:<\/th><td class="filename"><\/td><\/tr><tr><th>Comments:<\/th><td><input class="comments" type="text"><\/input><\/td><\/tr><tr><td class="thumbnail" colspan="2"><img /><\/td><\/tr><\/table>');!r||(s=f.find("td.thumbnail"),h=s.find("img"),r(h)&&s.show());f.find("td.filename").text(t).attr("title",t);e=f.find("input.comments").keypress(function(n){n.which===13&&(!e.val()||(o=!0,f.dialog("close")))});f.dialog({resizable:!1,width:400,modal:!0,autoOpen:!0,buttons:{Upload:function(){e.val()?(o=!0,f.dialog("close"),n.setTimeout(function(){e.focus()},1)):alert("Please provide a comment for this attachment.")},Cancel:function(){f.dialog("close")}},close:function(){var n=e.val();f.dialog("destroy").remove();u(o,n)}})},e._uploadImage=function(n){var t="CapturedImage-"+moment().format("YYYYMMDD-HHmmss")+".jpg";e.getFileComments(t,function(t){const i=URL.createObjectURL(n);return t.attr("src",i),!0},function(i,r){i&&e._uploadFile(n,t,r)})},e._uploadFiles=function(n){var t=i.makeArray(n),r=function(){if(t&&t.length!==0){var n=t.shift();e.getFileComments(n.name,function(t){if(!!n.type&&n.type.indexOf("image/")===0){var i=new FileReader;return i.onload=function(n){t.attr("src",n.target.result)},i.readAsDataURL(n),!0}return!1},function(t,i){t&&(e._uploadFile(n,n.name,i),r())})}};r()},e._uploadFile=function(n,t,r){var f=new FormData,u=new XMLHttpRequest,o=i("<div>").append(i("<i>").addClass("fa fa-cog fa-spin")).append(i("<span>").text("Uploading: "+t)).appendTo(e.uploadProgressContainer);f.append("Comments",r);f.append("File",n,t);u.open("POST",e.uploadUrl,!0);u.onreadystatechange=function(){u.readyState===4&&(u.status!==200&&alert("Error Uploading ["+t+"]: "+u.statusText),o.slideUp(400,function(){o.remove()}))};u.send(f)},e};t.Disco||(t.Disco={});t.Disco.AttachmentUploader=r})(this,document,$);
(function(n,t,i){"use strict";var r=function(r){var u=this;if(u.$host=r,u.uploadUrl=r.attr("data-uploadurl"),u.dropTarget=r.find(".Disco-AttachmentUpload-DropTarget"),u.uploadProgressContainer=r.find(".Disco-AttachmentUpload-Progress"),u._uploadFilesInput=null,u.uploadFiles=function(){!u._uploadFilesInput||u._uploadFilesInput.remove();u._uploadFilesInput=i("<input>");u._uploadFilesInput.attr({type:"file",multiple:"multiple",title:"Disco ICT File Uploading"}).hide().change(function(n){var t=n.target.files;!!t&&t.length>0&&u._uploadFiles(t);u._uploadFilesInput.remove()}).appendTo(u.uploadProgressContainer).click()},!!u.dropTarget){var o=i(t),f=!1,e=null;o.on("dragover",function(){u.dropTarget.addClass("dragHighlight");u.dropTarget.removeClass("dragHover");f=!1});o.on("dragleave",function(){!e||n.clearInterval(e);f=!0;n.setTimeout(function(){f&&u.dropTarget.removeClass("dragHighlight");e=null},200)});u.dropTarget.on("dragover",function(n){n.stopPropagation();n.preventDefault();u.dropTarget.addClass("dragHover");f=!1;n.originalEvent.dataTransfer.dropEffect="copy"});u.dropTarget.on("drop",function(n){n.stopPropagation();n.preventDefault();f=!0;u.dropTarget.removeClass("dragHighlight");var t=n.originalEvent.dataTransfer.files;u._uploadFiles(t)})}return u.uploadImage=function(){let e=null,o=!1;var f=i("<div><video><\/video><\/div>").attr({id:"Disco_AttachmentUpload_ImageDialog",title:"Upload Image","class":"dialog Disco-AttachmentUpload-ImageDialog"});f.dialog({autoOpen:!0,draggable:!1,modal:!0,resizable:!1,width:720,height:405,close:function(){e&&e.getTracks().forEach(n=>n.stop());n.setTimeout(function(){f.dialog("destroy")},1)}}).closest(".ui-dialog").children(".ui-dialog-titlebar").css("border-bottom","none");const r=f.find("video")[0];navigator.mediaDevices.getUserMedia({audio:!1,video:{width:{ideal:1920},height:{ideal:1080},facingMode:"environment"}}).then(n=>{e=n,r.srcObject=n,r.play()}).catch(n=>{console.error(n),f.dialog("destroy")});r.addEventListener("canplay",()=>{if(!o){const i=720;let n=r.videoHeight/(r.videoWidth/i);isNaN(n)&&(n=405);r.setAttribute("width",i);r.setAttribute("height",n);o=!0;f.dialog("option","buttons",[{text:"Capture",click:()=>{const n=t.createElement("canvas");n.width=r.videoWidth;n.height=r.videoHeight;const i=n.getContext("2d");i.drawImage(r,0,0);n.toBlob(n=>{u._uploadImage(n)},"image/jpg")}}]);f.css("height","");f.closest(".ui-dialog").children(".ui-dialog-buttonpane").css("margin-top",0).find(".ui-button:first").focus()}})},u.getFileComments=function(t,r,u){var e=!1,f=i("<div>").attr({title:"Upload File","class":"dialog Disco-AttachmentUpload-CommentDialog"}),o,h,s;f.html('<table><tr><th>File Name:<\/th><td class="filename"><\/td><\/tr><tr><th>Comments:<\/th><td><input class="comments" type="text" placeholder="optional" /><\/td><\/tr><tr><td class="thumbnail" colspan="2"><img /><\/td><\/tr><\/table>');!r||(o=f.find("td.thumbnail"),h=o.find("img"),r(h)&&o.show());f.find("td.filename").text(t).attr("title",t);s=f.find("input.comments").keypress(function(n){n.which===13&&(e=!0,f.dialog("close"))});f.dialog({resizable:!1,width:400,modal:!0,autoOpen:!0,buttons:{Upload:function(){e=!0;f.dialog("close");n.setTimeout(function(){s.focus()},1)},Cancel:function(){f.dialog("close")}},close:function(){var n=s.val();f.dialog("destroy").remove();u(e,n)}})},u._uploadImage=function(n){var t="CapturedImage-"+moment().format("YYYYMMDD-HHmmss")+".jpg";u.getFileComments(t,function(t){const i=URL.createObjectURL(n);return t.attr("src",i),!0},function(i,r){i&&u._uploadFile(n,t,r)})},u._uploadFiles=function(n){var t=i.makeArray(n),r=function(){if(t&&t.length!==0){var n=t.shift();u.getFileComments(n.name,function(t){if(!!n.type&&n.type.indexOf("image/")===0){var i=new FileReader;return i.onload=function(n){t.attr("src",n.target.result)},i.readAsDataURL(n),!0}return!1},function(t,i){t&&(u._uploadFile(n,n.name,i),r())})}};r()},u._uploadFile=async function(n,t,r){const f=new FormData,o=i("<div>").append(i("<i>").addClass("fa fa-cog fa-spin")).append(i("<span>").text("Uploading: "+t)).appendTo(u.uploadProgressContainer);f.append("__RequestVerificationToken",u.$host.find('input[name="__RequestVerificationToken"]').val());f.append("comments",r);f.append("file",n,t);const e=await fetch(u.uploadUrl,{method:"POST",body:f});if(o.slideUp(400,function(){o.remove()}),!e.ok){alert("Error Uploading ["+t+"]: "+e.statusText);const n=await e.text();console.error("Failed to upload file ["+t+"]: "+n)}},u};t.Disco||(t.Disco={});t.Disco.AttachmentUploader=r})(this,document,$);
@@ -1,12 +1,13 @@
(function (window, document, $) {
"use strict";
var attachmentUploader = function (uploadUrl, dropTarget, uploadProgressContainer) {
var attachmentUploader = function ($host) {
var self = this;
self.uploadUrl = uploadUrl;
self.dropTarget = dropTarget;
self.uploadProgressContainer = uploadProgressContainer;
self.$host = $host;
self.uploadUrl = $host.attr('data-uploadurl');
self.dropTarget = $host.find('.Disco-AttachmentUpload-DropTarget');
self.uploadProgressContainer = $host.find('.Disco-AttachmentUpload-Progress');
// #region File Selection Support
self._uploadFilesInput = null;
@@ -168,7 +169,7 @@
title: 'Upload File',
'class': 'dialog Disco-AttachmentUpload-CommentDialog'
});
dialog.html('<table><tr><th>File Name:</th><td class="filename"></td></tr><tr><th>Comments:</th><td><input class="comments" type="text"></input></td></tr><tr><td class="thumbnail" colspan="2"><img /></td></tr></table>');
dialog.html('<table><tr><th>File Name:</th><td class="filename"></td></tr><tr><th>Comments:</th><td><input class="comments" type="text" placeholder="optional" /></td></tr><tr><td class="thumbnail" colspan="2"><img /></td></tr></table>');
if (!!thumbnailHandler) {
var td = dialog.find('td.thumbnail');
@@ -181,11 +182,9 @@
var comments = dialog.find('input.comments')
.keypress(function (e) {
if (e.which === 13) {
if (!!comments.val()) {
result = true;
dialog.dialog("close");
}
}
});
dialog.dialog({
@@ -195,15 +194,11 @@
autoOpen: true,
buttons: {
"Upload": function () {
if (!!comments.val()) {
result = true;
dialog.dialog("close");
window.setTimeout(function () {
comments.focus();
}, 1);
} else {
alert('Please provide a comment for this attachment.');
}
},
Cancel: function () {
dialog.dialog("close");
@@ -262,30 +257,34 @@
processNextFile();
};
self._uploadFile = function (fileData, fileName, comments) {
var formData = new FormData();
var xhr = new XMLHttpRequest();
var progress = $('<div>')
self._uploadFile = async function (fileData, fileName, comments) {
const formData = new FormData();
const progress = $('<div>')
.append($('<i>').addClass('fa fa-cog fa-spin'))
.append($('<span>').text('Uploading: ' + fileName))
.appendTo(self.uploadProgressContainer);
formData.append('Comments', comments);
formData.append('File', fileData, fileName);
formData.append('__RequestVerificationToken', self.$host.find('input[name="__RequestVerificationToken"]').val());
formData.append('comments', comments);
formData.append('file', fileData, fileName);
const result = await fetch(self.uploadUrl, {
method: 'POST',
body: formData
});
xhr.open("POST", self.uploadUrl, true);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status !== 200) {
alert('Error Uploading [' + fileName + ']: ' + xhr.statusText);
}
progress.slideUp(400, function () {
progress.remove();
});
if (!result.ok) {
alert('Error Uploading [' + fileName + ']: ' + result.statusText);
const errorText = await result.text();
console.error('Failed to upload file [' + fileName + ']: ' + errorText);
}
};
xhr.send(formData);
};
// #endregion
return self;
@@ -19,7 +19,8 @@
<table id="deviceShowResources">
<tr>
<td id="AttachmentsContainer">
<div id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")">
<div id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")" data-uploadurl="@(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)))">
@Html.AntiForgeryToken()
<div class="Disco-AttachmentUpload-DropTarget">
<h2>Drop Attachments Here</h2>
</div>
@@ -31,11 +32,11 @@
<a href="@Url.Action(MVC.API.Device.AttachmentDownload(da.Id))" data-attachmentid="@da.Id" data-mimetype="@da.MimeType">
<span class="icon" title="@da.Filename">
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id)))" /></span>
<span class="comments" title="@da.Comments">
<span class="comments" title="@(da.Comments ?? da.Filename)">
@{if (!string.IsNullOrEmpty(da.DocumentTemplateId))
{ @da.DocumentTemplate.Description}
else
{ @da.Comments }}
{ @(da.Comments ?? da.Filename) }}
</span><span class="author">@da.TechUser.ToString()</span>@if (canRemoveAnyAttachments || (canRemoveOwnAttachments && da.TechUserId.Equals(CurrentUser.UserId, StringComparison.OrdinalIgnoreCase)))
{<text><span class="remove fa fa-times-circle"></span></text>}<span class="timestamp" title="@da.Timestamp.ToFullDateTime()" data-livestamp="@da.Timestamp.ToUnixEpoc()">@da.Timestamp.ToFullDateTime()</span>
</a>
@@ -235,10 +236,7 @@
@if (canAddAttachments)
{<text>
//#region Add Attachments
var attachmentUploader = new document.Disco.AttachmentUploader(
'@(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)))',
$Attachments.find('.Disco-AttachmentUpload-DropTarget'),
$Attachments.find('.Disco-AttachmentUpload-Progress'));
var attachmentUploader = new document.Disco.AttachmentUploader($Attachments);
var $attachmentInput = $Attachments.find('.attachmentInput');
if (window.location.protocol != 'https:') {
@@ -92,7 +92,29 @@ WriteAttribute("class", Tuple.Create(" class=\"", 888), Tuple.Create("\"", 963)
, 896), false)
);
WriteLiteral(">\r\n <div");
WriteLiteral(" data-uploadurl=\"");
#line 22 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 23 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Html.AntiForgeryToken());
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"Disco-AttachmentUpload-DropTarget\"");
@@ -104,13 +126,13 @@ WriteLiteral(" class=\"attachmentOutput\"");
WriteLiteral(">\r\n");
#line 27 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 28 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line default
#line hidden
#line 27 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 28 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (Model.Device.DeviceAttachments != null)
{
foreach (var da in Model.Device.DeviceAttachments)
@@ -121,20 +143,20 @@ WriteLiteral(">\r\n");
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 1410), Tuple.Create("\"", 1470)
WriteAttribute("href", Tuple.Create(" href=\"", 1553), Tuple.Create("\"", 1613)
#line 31 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1417), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentDownload(da.Id))
#line 32 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1560), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentDownload(da.Id))
#line default
#line hidden
, 1417), false)
, 1560), false)
);
WriteLiteral(" data-attachmentid=\"");
#line 31 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 32 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.Id);
@@ -145,7 +167,7 @@ WriteLiteral("\"");
WriteLiteral(" data-mimetype=\"");
#line 31 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 32 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.MimeType);
@@ -157,68 +179,68 @@ WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1580), Tuple.Create("\"", 1600)
WriteAttribute("title", Tuple.Create(" title=\"", 1723), Tuple.Create("\"", 1743)
#line 32 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1588), Tuple.Create<System.Object, System.Int32>(da.Filename
#line 33 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1731), Tuple.Create<System.Object, System.Int32>(da.Filename
#line default
#line hidden
, 1588), false)
, 1731), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 1671), Tuple.Create("\"", 1733)
WriteAttribute("src", Tuple.Create(" src=\"", 1814), Tuple.Create("\"", 1876)
#line 33 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1677), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id))
#line 34 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1820), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id))
#line default
#line hidden
, 1677), false)
, 1820), false)
);
WriteLiteral(" /></span>\r\n <span");
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1800), Tuple.Create("\"", 1820)
WriteAttribute("title", Tuple.Create(" title=\"", 1943), Tuple.Create("\"", 1980)
#line 34 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1808), Tuple.Create<System.Object, System.Int32>(da.Comments
#line 35 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1951), Tuple.Create<System.Object, System.Int32>(da.Comments ?? da.Filename
#line default
#line hidden
, 1808), false)
, 1951), false)
);
WriteLiteral(">\r\n");
#line 35 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 36 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line default
#line hidden
#line 35 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 36 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (!string.IsNullOrEmpty(da.DocumentTemplateId))
{
#line default
#line hidden
#line 36 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 37 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.DocumentTemplate.Description);
#line default
#line hidden
#line 36 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 37 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
else
{
@@ -226,14 +248,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 38 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.Comments);
#line 39 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.Comments ?? da.Filename);
#line default
#line hidden
#line 38 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 39 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
#line default
@@ -245,7 +267,7 @@ WriteLiteral(" class=\"author\"");
WriteLiteral(">");
#line 39 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 40 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.TechUser.ToString());
@@ -254,7 +276,7 @@ WriteLiteral(">");
WriteLiteral("</span>");
#line 39 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 40 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (canRemoveAnyAttachments || (canRemoveOwnAttachments && da.TechUserId.Equals(CurrentUser.UserId, StringComparison.OrdinalIgnoreCase)))
{
@@ -267,7 +289,7 @@ WriteLiteral(" class=\"remove fa fa-times-circle\"");
WriteLiteral("></span>");
#line 40 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 41 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
#line default
@@ -276,20 +298,20 @@ WriteLiteral("<span");
WriteLiteral(" class=\"timestamp\"");
WriteAttribute("title", Tuple.Create(" title=\"", 2494), Tuple.Create("\"", 2532)
WriteAttribute("title", Tuple.Create(" title=\"", 2671), Tuple.Create("\"", 2709)
#line 40 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 2502), Tuple.Create<System.Object, System.Int32>(da.Timestamp.ToFullDateTime()
#line 41 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 2679), Tuple.Create<System.Object, System.Int32>(da.Timestamp.ToFullDateTime()
#line default
#line hidden
, 2502), false)
, 2679), false)
);
WriteLiteral(" data-livestamp=\"");
#line 40 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 41 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.Timestamp.ToUnixEpoc());
@@ -300,7 +322,7 @@ WriteLiteral("\"");
WriteLiteral(">");
#line 40 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 41 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(da.Timestamp.ToFullDateTime());
@@ -309,7 +331,7 @@ WriteLiteral(">");
WriteLiteral("</span>\r\n </a> \r\n");
#line 42 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 43 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
}
@@ -319,13 +341,13 @@ WriteLiteral("</span>\r\n </a> \r\n");
WriteLiteral(" </div>\r\n");
#line 45 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 46 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line default
#line hidden
#line 45 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 46 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (canAddAttachments)
{
@@ -357,7 +379,7 @@ WriteLiteral(" title=\"Capture Image\"");
WriteLiteral("></span>\r\n </div>\r\n");
#line 51 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 52 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
@@ -389,7 +411,7 @@ WriteLiteral(@">
$.connection.hub.qs = { DeviceSerialNumber: '");
#line 71 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 72 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Model.Device.SerialNumber);
@@ -434,7 +456,7 @@ WriteLiteral("\' };\r\n $.connection.hub.error(onHubF
"$.ajax({\r\n url: \'");
#line 117 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 118 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.Attachment()));
@@ -449,13 +471,13 @@ WriteLiteral(@"',
");
#line 123 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 124 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line default
#line hidden
#line 123 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 124 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (canRemoveAnyAttachments)
{
@@ -469,7 +491,7 @@ WriteLiteral("buildAttachment(a, true, quick);");
WriteLiteral("\r\n");
#line 126 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 127 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
else if (canRemoveOwnAttachments)
{
@@ -482,7 +504,7 @@ WriteLiteral(" ");
WriteLiteral("buildAttachment(a, (a.AuthorId === \'");
#line 129 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 130 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(CurrentUser.UserId);
@@ -493,7 +515,7 @@ WriteLiteral("\'), quick);");
WriteLiteral("\r\n");
#line 130 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 131 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
else
{
@@ -508,7 +530,7 @@ WriteLiteral("buildAttachment(a, false, quick);");
WriteLiteral("\r\n");
#line 134 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 135 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
@@ -535,7 +557,7 @@ WriteLiteral(@" } else {
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
#line 153 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 154 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentDownload()));
@@ -567,7 +589,7 @@ WriteLiteral(@"/' + a.Id);
img.attr('src', '");
#line 176 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 177 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentThumbnail()));
@@ -618,66 +640,55 @@ WriteLiteral("/\' + a.Id + \'?v=\' + retryCount);\r\n
" }\r\n\r\n");
#line 235 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 236 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line default
#line hidden
#line 235 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 236 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (canAddAttachments)
{
#line default
#line hidden
WriteLiteral("\r\n //#region Add Attachments\r\n " +
" var attachmentUploader = new document.Disco.AttachmentUploader(\r\n " +
" \'");
#line 239 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)));
#line default
#line hidden
WriteLiteral("\',\r\n $Attachments.find(\'.Disco-AttachmentUpload-DropTa" +
"rget\'),\r\n $Attachments.find(\'.Disco-AttachmentUpload-" +
"Progress\'));\r\n\r\n var $attachmentInput = $Attachments." +
"find(\'.attachmentInput\');\r\n if (window.location.proto" +
"col != \'https:\') {\r\n $attachmentInput.find(\'.phot" +
"o\')\r\n .removeClass(\'enabled\')\r\n " +
" .addClass(\'disabled\')\r\n " +
" .attr(\'title\', \'Capture Image: this functionality is only available over a HTTP" +
"S connection\');\r\n }\r\n $att" +
"achmentInput.find(\'.photo\').click(function () {\r\n " +
" if (!$(this).hasClass(\'enabled\'))\r\n alert(\'T" +
"his functionality is only available over a HTTPS connection\');\r\n " +
" var attachmentUploader = new document.Disco.AttachmentUploader($Attachments)" +
";\r\n\r\n var $attachmentInput = $Attachments.find(\'.atta" +
"chmentInput\');\r\n if (window.location.protocol != \'htt" +
"ps:\') {\r\n $attachmentInput.find(\'.photo\')\r\n " +
" .removeClass(\'enabled\')\r\n " +
" .addClass(\'disabled\')\r\n .attr(\'tit" +
"le\', \'Capture Image: this functionality is only available over a HTTPS connectio" +
"n\');\r\n }\r\n $attachmentInpu" +
"t.find(\'.photo\').click(function () {\r\n if (!$(thi" +
"s).hasClass(\'enabled\'))\r\n alert(\'This functio" +
"nality is only available over a HTTPS connection\');\r\n " +
" else if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh this p" +
"age and try again\');\r\n else\r\n " +
" attachmentUploader.uploadImage();\r\n }" +
");\r\n $attachmentInput.find(\'.upload\').click(function " +
"() {\r\n if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, plea" +
"se refresh this page and try again\');\r\n else\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh this page and try" +
" again\');\r\n else\r\n " +
" attachmentUploader.uploadImage();\r\n });\r\n " +
" $attachmentInput.find(\'.upload\').click(function () {\r\n " +
" if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh " +
"this page and try again\');\r\n else\r\n " +
" attachmentUploader.uploadFiles();\r\n " +
" });\r\n\r\n var resourcesTab;\r\n " +
" $(document).on(\'dragover\', function () {\r\n " +
" if (!resourcesTab) {\r\n var tabs =" +
" $Attachments.closest(\'.ui-tabs\');\r\n resource" +
"sTab = {\r\n tabs: tabs,\r\n " +
" resourcesIndex: tabs.children(\'ul.ui-tabs-nav\').find(\'a[h" +
"ref=\"#DeviceDetailTab-Resources\"]\').closest(\'li\').index()\r\n " +
" };\r\n }\r\n " +
" var selectedIndex = resourcesTab.tabs.tabs(\'option\', \'active\');\r\n " +
" if (!resourcesTab) {\r\n var tabs = $Attachmen" +
"ts.closest(\'.ui-tabs\');\r\n resourcesTab = {\r\n " +
" tabs: tabs,\r\n " +
" resourcesIndex: tabs.children(\'ul.ui-tabs-nav\').find(\'a[href=\"#Devic" +
"eDetailTab-Resources\"]\').closest(\'li\').index()\r\n " +
" };\r\n }\r\n var s" +
"electedIndex = resourcesTab.tabs.tabs(\'option\', \'active\');\r\n " +
" if (resourcesTab.resourcesIndex !== selectedIndex)\r\n " +
" resourcesTab.tabs.tabs(\'option\', \'active\', resour" +
"cesTab.resourcesIndex);\r\n });\r\n " +
" //#endregion\r\n ");
" resourcesTab.tabs.tabs(\'option\', \'active\', resourcesTab.reso" +
"urcesIndex);\r\n });\r\n //#en" +
"dregion\r\n ");
#line 279 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 277 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
@@ -686,7 +697,7 @@ WriteLiteral("\',\r\n $Attachments.find(\'.Disco-Atta
WriteLiteral(" ");
#line 280 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 278 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
{
@@ -719,7 +730,7 @@ WriteLiteral(@"
url: '");
#line 305 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 303 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentRemove()));
@@ -747,7 +758,7 @@ WriteLiteral("\',\r\n dataType: \'jso
"endregion\r\n ");
#line 332 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 330 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
}
@@ -784,7 +795,7 @@ WriteLiteral("></i>&nbsp;Are you sure?\r\n </p>\r\n </div>\r\n <scr
"etailTab-ResourcesLink\">Attachments [");
#line 353 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
#line 351 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Model.Device.DeviceAttachments == null ? 0 : Model.Device.DeviceAttachments.Count);
@@ -53,7 +53,8 @@
@if (canShowAttachments)
{
<td id="AttachmentsContainer">
<div id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")">
<div id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")" data-uploadurl="@(Url.Action(MVC.API.Job.AttachmentUpload(Model.Job.Id, null)))">
@Html.AntiForgeryToken()
<div class="Disco-AttachmentUpload-DropTarget">
<h2>Drop Attachments Here</h2>
</div>
@@ -62,7 +63,8 @@
{
<a href="@Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))" data-attachmentid="@ja.Id" data-mimetype="@ja.MimeType">
<span class="icon" title="@ja.Filename">
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id)))" /></span>
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id)))" />
</span>
<span class="comments" title="@ja.Comments">
@{if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{ @ja.DocumentTemplate.Description}
@@ -317,10 +319,7 @@
@if (canAddAttachments)
{<text>
//#region Add Attachments
var attachmentUploader = new document.Disco.AttachmentUploader(
'@(Url.Action(MVC.API.Job.AttachmentUpload(Model.Job.Id, null)))',
$Attachments.find('.Disco-AttachmentUpload-DropTarget'),
$Attachments.find('.Disco-AttachmentUpload-Progress'));
var attachmentUploader = new document.Disco.AttachmentUploader($Attachments);
var $attachmentInput = $Attachments.find('.attachmentInput');
if (window.location.protocol != 'https:') {
@@ -333,7 +333,29 @@ WriteAttribute("class", Tuple.Create(" class=\"", 2989), Tuple.Create("\"", 3064
, 2997), false)
);
WriteLiteral(">\r\n <div");
WriteLiteral(" data-uploadurl=\"");
#line 56 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentUpload(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 57 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Html.AntiForgeryToken());
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"Disco-AttachmentUpload-DropTarget\"");
@@ -345,13 +367,13 @@ WriteLiteral(" class=\"attachmentOutput\"");
WriteLiteral(">\r\n");
#line 61 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 62 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 61 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 62 "..\..\Views\Job\JobParts\Resources.cshtml"
foreach (var ja in Model.Job.JobAttachments)
{
@@ -360,20 +382,20 @@ WriteLiteral(">\r\n");
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 3401), Tuple.Create("\"", 3458)
WriteAttribute("href", Tuple.Create(" href=\"", 3528), Tuple.Create("\"", 3585)
#line 63 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3408), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
#line 64 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3535), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
#line default
#line hidden
, 3408), false)
, 3535), false)
);
WriteLiteral(" data-attachmentid=\"");
#line 63 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 64 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(ja.Id);
@@ -384,7 +406,7 @@ WriteLiteral("\"");
WriteLiteral(" data-mimetype=\"");
#line 63 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 64 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(ja.MimeType);
@@ -396,68 +418,69 @@ WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 3568), Tuple.Create("\"", 3588)
WriteAttribute("title", Tuple.Create(" title=\"", 3695), Tuple.Create("\"", 3715)
#line 64 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3576), Tuple.Create<System.Object, System.Int32>(ja.Filename
#line 65 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3703), Tuple.Create<System.Object, System.Int32>(ja.Filename
#line default
#line hidden
, 3576), false)
, 3703), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 3659), Tuple.Create("\"", 3718)
WriteAttribute("src", Tuple.Create(" src=\"", 3786), Tuple.Create("\"", 3845)
#line 65 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3665), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
#line 66 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3792), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
#line default
#line hidden
, 3665), false)
, 3792), false)
);
WriteLiteral(" /></span>\r\n <span");
WriteLiteral(" />\r\n </span>\r\n <sp" +
"an");
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 3785), Tuple.Create("\"", 3805)
WriteAttribute("title", Tuple.Create(" title=\"", 3946), Tuple.Create("\"", 3966)
#line 66 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3793), Tuple.Create<System.Object, System.Int32>(ja.Comments
#line 68 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3954), Tuple.Create<System.Object, System.Int32>(ja.Comments
#line default
#line hidden
, 3793), false)
, 3954), false)
);
WriteLiteral(">\r\n");
#line 67 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 69 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 67 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 69 "..\..\Views\Job\JobParts\Resources.cshtml"
if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{
#line default
#line hidden
#line 68 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 70 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(ja.DocumentTemplate.Description);
#line default
#line hidden
#line 68 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 70 "..\..\Views\Job\JobParts\Resources.cshtml"
}
else
{
@@ -465,14 +488,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 70 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 72 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(ja.Comments);
#line default
#line hidden
#line 70 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 72 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
@@ -484,7 +507,7 @@ WriteLiteral(" class=\"author\"");
WriteLiteral(">");
#line 71 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 73 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(ja.TechUser.ToStringFriendly());
@@ -493,7 +516,7 @@ WriteLiteral(">");
WriteLiteral("</span>");
#line 71 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 73 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canRemoveAnyAttachments || (canRemoveOwnAttachments && ja.TechUserId.Equals(CurrentUser.UserId, StringComparison.OrdinalIgnoreCase)))
{
@@ -506,7 +529,7 @@ WriteLiteral(" class=\"remove fa fa-times-circle\"");
WriteLiteral("></span>");
#line 72 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 74 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
@@ -518,7 +541,7 @@ WriteLiteral(" class=\"timestamp\"");
WriteLiteral(" data-livestamp=\"");
#line 72 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 74 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(ja.Timestamp.ToUnixEpoc());
@@ -526,29 +549,29 @@ WriteLiteral(" data-livestamp=\"");
#line hidden
WriteLiteral("\"");
WriteAttribute("title", Tuple.Create(" title=\"", 4541), Tuple.Create("\"", 4579)
WriteAttribute("title", Tuple.Create(" title=\"", 4634), Tuple.Create("\"", 4672)
#line 72 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 4549), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
#line 74 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 4642), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
#line default
#line hidden
, 4549), false)
, 4642), false)
);
WriteLiteral(">");
#line 72 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 74 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(ja.Timestamp.ToFullDateTime());
#line default
#line hidden
WriteLiteral("</span>\r\n </a> \r\n");
WriteLiteral("</span>\r\n </a>\r\n");
#line 74 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 76 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -557,13 +580,13 @@ WriteLiteral("</span>\r\n </a> \r\n");
WriteLiteral(" </div>\r\n");
#line 76 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 78 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 76 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 78 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canAddAttachments)
{
@@ -595,7 +618,7 @@ WriteLiteral(" title=\"Capture Image\"");
WriteLiteral("></span>\r\n </div>\r\n");
#line 82 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 84 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -604,7 +627,7 @@ WriteLiteral("></span>\r\n </div>\r\n");
WriteLiteral(" </div>\r\n </td>\r\n");
#line 85 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 87 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -613,7 +636,7 @@ WriteLiteral(" </div>\r\n </td>\r\n");
WriteLiteral(" </tr>\r\n</table>\r\n");
#line 88 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 90 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowLogs && (canRemoveAnyLogs || canRemoveOwnLogs))
{
@@ -635,14 +658,14 @@ WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");
WriteLiteral("></i>&nbsp;Are you sure?\r\n </p>\r\n </div>\r\n");
#line 95 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 97 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
#line 96 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 98 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowAttachments && (canRemoveAnyAttachments || canRemoveOwnAttachments))
{
@@ -664,14 +687,14 @@ WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");
WriteLiteral("></i>&nbsp;Are you sure?\r\n </p>\r\n </div>\r\n");
#line 103 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 105 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
#line 104 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 106 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowLogs)
{
@@ -683,7 +706,7 @@ WriteLiteral(" <script>\r\n if (!document.DiscoFunctions) {\r\n
"arseInt(\'");
#line 112 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 114 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Model.Job.Id);
@@ -708,13 +731,13 @@ WriteLiteral(@"');
");
#line 128 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 130 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 128 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 130 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canAddLogs)
{
@@ -752,7 +775,7 @@ WriteLiteral(@"
url: '");
#line 158 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 160 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.CommentPost(Model.Job.Id, null)));
@@ -782,7 +805,7 @@ WriteLiteral(@"',
");
#line 179 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 181 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -791,7 +814,7 @@ WriteLiteral(@"',
WriteLiteral(" ");
#line 180 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 182 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canRemoveAnyLogs || canRemoveOwnLogs)
{
@@ -825,7 +848,7 @@ WriteLiteral(@"
url: '");
#line 206 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 208 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.CommentRemove()));
@@ -863,7 +886,7 @@ WriteLiteral(@"',
");
#line 235 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 237 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -873,7 +896,7 @@ WriteLiteral("\r\n function loadLiveComment(key) {\r\n
" url: \'");
#line 239 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 241 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.Comment()));
@@ -884,13 +907,13 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n
"d.JobId == jobId) {\r\n");
#line 244 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 246 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 244 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 246 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canRemoveAnyLogs)
{
@@ -899,7 +922,7 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n
WriteLiteral("addComment(d, false, true);");
#line 245 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 247 "..\..\Views\Job\JobParts\Resources.cshtml"
}
else if (canRemoveOwnLogs)
{
@@ -909,7 +932,7 @@ WriteLiteral("addComment(d, false, true);");
WriteLiteral("addComment(d, false, (d.AuthorId === \'");
#line 247 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 249 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(CurrentUser.UserId);
@@ -918,7 +941,7 @@ WriteLiteral("addComment(d, false, (d.AuthorId === \'");
WriteLiteral("\'));");
#line 247 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 249 "..\..\Views\Job\JobParts\Resources.cshtml"
}
else
{
@@ -928,7 +951,7 @@ WriteLiteral("\'));");
WriteLiteral("addComment(d, false, false);");
#line 249 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 251 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -962,14 +985,14 @@ WriteLiteral("\r\n }\r\n },\r\n
"= liveRemoveComment;\r\n //#endregion\r\n });\r\n </script>\r\n");
#line 297 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 299 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
#line 298 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 300 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowAttachments)
{
@@ -990,7 +1013,7 @@ WriteLiteral(@" <script>
var jobId = parseInt('");
#line 311 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 313 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Model.Job.Id);
@@ -1001,58 +1024,47 @@ WriteLiteral("\');\r\n\r\n //#region Attachments\r\n var $
"tput\');\r\n\r\n");
#line 317 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 319 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 317 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 319 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canAddAttachments)
{
#line default
#line hidden
WriteLiteral("\r\n //#region Add Attachments\r\n var attachmentUploader = new" +
" document.Disco.AttachmentUploader(\r\n \'");
" document.Disco.AttachmentUploader($Attachments);\r\n\r\n var $attachment" +
"Input = $Attachments.find(\'.attachmentInput\');\r\n if (window.location." +
"protocol != \'https:\') {\r\n $attachmentInput.find(\'.photo\')\r\n " +
" .removeClass(\'enabled\')\r\n .addClass(\'disabled\')" +
"\r\n .attr(\'title\', \'Capture Image: this functionality is only " +
"available over a HTTPS connection\');\r\n }\r\n $attachmentInpu" +
"t.find(\'.photo\').click(function () {\r\n if (!$(this).hasClass(\'ena" +
"bled\'))\r\n alert(\'This functionality is only available over a " +
"HTTPS connection\');\r\n else if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh t" +
"his page and try again\');\r\n else\r\n attachmentU" +
"ploader.uploadImage();\r\n });\r\n $attachmentInput.find(\'.upl" +
"oad\').click(function () {\r\n if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh " +
"this page and try again\');\r\n else\r\n attachment" +
"Uploader.uploadFiles();\r\n });\r\n\r\n var resourcesTab;\r\n " +
" $(document).on(\'dragover\', function () {\r\n if (!resourcesT" +
"ab) {\r\n var tabs = $Attachments.closest(\'.ui-tabs\');\r\n " +
" resourcesTab = {\r\n tabs: tabs,\r\n " +
" resourcesIndex: tabs.children(\'ul.ui-tabs-nav\').find(\'a[href=\"#jobDe" +
"tailTab-Resources\"]\').closest(\'li\').index()\r\n };\r\n " +
" }\r\n var selectedIndex = resourcesTab.tabs.tabs(\'option\', \'ac" +
"tive\');\r\n if (resourcesTab.resourcesIndex !== selectedIndex)\r\n " +
" resourcesTab.tabs.tabs(\'option\', \'active\', resourcesTab.resourc" +
"esIndex);\r\n });\r\n //#endregion\r\n ");
#line 321 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentUpload(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\',\r\n $Attachments.find(\'.Disco-AttachmentUpload-DropTarget\'),\r\n " +
" $Attachments.find(\'.Disco-AttachmentUpload-Progress\'));\r\n\r\n " +
" var $attachmentInput = $Attachments.find(\'.attachmentInput\');\r\n i" +
"f (window.location.protocol != \'https:\') {\r\n $attachmentInput.fin" +
"d(\'.photo\')\r\n .removeClass(\'enabled\')\r\n .a" +
"ddClass(\'disabled\')\r\n .attr(\'title\', \'Capture Image: this fun" +
"ctionality is only available over a HTTPS connection\');\r\n }\r\n " +
" $attachmentInput.find(\'.photo\').click(function () {\r\n if (!$(" +
"this).hasClass(\'enabled\'))\r\n alert(\'This functionality is onl" +
"y available over a HTTPS connection\');\r\n else if ($(this).hasClas" +
"s(\'disabled\'))\r\n alert(\'Disconnected from the Disco ICT Serve" +
"r, please refresh this page and try again\');\r\n else\r\n " +
" attachmentUploader.uploadImage();\r\n });\r\n $attachm" +
"entInput.find(\'.upload\').click(function () {\r\n if ($(this).hasCla" +
"ss(\'disabled\'))\r\n alert(\'Disconnected from the Disco ICT Serv" +
"er, please refresh this page and try again\');\r\n else\r\n " +
" attachmentUploader.uploadFiles();\r\n });\r\n\r\n var r" +
"esourcesTab;\r\n $(document).on(\'dragover\', function () {\r\n " +
" if (!resourcesTab) {\r\n var tabs = $Attachments.closest(\'." +
"ui-tabs\');\r\n resourcesTab = {\r\n tabs: " +
"tabs,\r\n resourcesIndex: tabs.children(\'ul.ui-tabs-nav\').f" +
"ind(\'a[href=\"#jobDetailTab-Resources\"]\').closest(\'li\').index()\r\n " +
" };\r\n }\r\n var selectedIndex = resourcesTab.tabs" +
".tabs(\'option\', \'active\');\r\n if (resourcesTab.resourcesIndex !== " +
"selectedIndex)\r\n resourcesTab.tabs.tabs(\'option\', \'active\', r" +
"esourcesTab.resourcesIndex);\r\n });\r\n //#endregion\r\n " +
" ");
#line 361 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 360 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -1061,13 +1073,13 @@ WriteLiteral("\',\r\n $Attachments.find(\'.Disco-AttachmentUpload
WriteLiteral("\r\n");
#line 363 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 362 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 363 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 362 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
{
@@ -1102,7 +1114,7 @@ WriteLiteral(@"
url: '");
#line 390 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 389 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentRemove()));
@@ -1138,7 +1150,7 @@ WriteLiteral(@"',
");
#line 417 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 416 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -1148,7 +1160,7 @@ WriteLiteral("\r\n function addAttachment(key, quick) {\r\n
"id: key };\r\n $.ajax({\r\n url: \'");
#line 422 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 421 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.Attachment()));
@@ -1159,13 +1171,13 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n
"\'OK\') {\r\n var a = d.Attachment;\r\n");
#line 428 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 427 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 428 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 427 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canRemoveAnyAttachments)
{
@@ -1179,7 +1191,7 @@ WriteLiteral("buildAttachment(a, true, quick);");
WriteLiteral("\r\n");
#line 431 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 430 "..\..\Views\Job\JobParts\Resources.cshtml"
}
else if (canRemoveOwnAttachments)
{
@@ -1192,7 +1204,7 @@ WriteLiteral(" ");
WriteLiteral("buildAttachment(a, (a.AuthorId === \'");
#line 434 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 433 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(CurrentUser.UserId);
@@ -1203,7 +1215,7 @@ WriteLiteral("\'), quick);");
WriteLiteral("\r\n");
#line 435 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 434 "..\..\Views\Job\JobParts\Resources.cshtml"
}
else
{
@@ -1218,7 +1230,7 @@ WriteLiteral("buildAttachment(a, false, quick);");
WriteLiteral("\r\n");
#line 439 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 438 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -1245,7 +1257,7 @@ WriteLiteral(@" } else {
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
#line 458 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 457 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentDownload()));
@@ -1277,7 +1289,7 @@ WriteLiteral(@"/' + a.Id);
img.attr('src', '");
#line 481 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 480 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentThumbnail()));
@@ -1324,14 +1336,14 @@ WriteLiteral("/\' + a.Id + \'?v=\' + retryCount);\r\n };\
"script>\r\n");
#line 551 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 550 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
#line 552 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 551 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowLogs || canShowAttachments)
{
@@ -1341,7 +1353,7 @@ WriteLiteral("/\' + a.Id + \'?v=\' + retryCount);\r\n };\
WriteLiteral(" <script>\r\n $(function () {\r\n var jobId = parseInt(\'");
#line 556 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 555 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Model.Job.Id);
@@ -1351,7 +1363,7 @@ WriteLiteral("\');\r\n\r\n //#region LiveEvents\r\n var hu
"dates;\r\n\r\n // Map Functions\r\n");
#line 562 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 561 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowLogs)
{
@@ -1362,14 +1374,14 @@ WriteLiteral("\r\n hub.client.addLog = document.DiscoFunctions.liveLo
" ");
#line 566 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 565 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
#line 567 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 566 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowAttachments)
{
@@ -1390,7 +1402,7 @@ WriteLiteral(@"
");
#line 580 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 579 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -1432,7 +1444,7 @@ WriteLiteral("\r\n $.connection.hub.qs = { JobId: jobId };\r\n
"egion\r\n });\r\n </script>\r\n");
#line 633 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 632 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
@@ -19,7 +19,8 @@
<table id="userShowResources">
<tr>
<td id="AttachmentsContainer">
<div id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")">
<div id="Attachments" class="@(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments")" data-uploadurl="@(Url.Action(MVC.API.User.AttachmentUpload(Model.User.UserId, null)))">
@Html.AntiForgeryToken()
<div class="Disco-AttachmentUpload-DropTarget">
<h2>Drop Attachments Here</h2>
</div>
@@ -30,7 +31,8 @@
{
<a href="@Url.Action(MVC.API.User.AttachmentDownload(ua.Id))" data-attachmentid="@ua.Id" data-mimetype="@ua.MimeType">
<span class="icon" title="@ua.Filename">
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.User.AttachmentThumbnail(ua.Id)))" /></span>
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.User.AttachmentThumbnail(ua.Id)))" />
</span>
<span class="comments" title="@ua.Comments">
@{if (!string.IsNullOrEmpty(ua.DocumentTemplateId))
{ @ua.DocumentTemplate.Description}
@@ -232,10 +234,7 @@
@if (canAddAttachments)
{<text>
//#region Add Attachments
var attachmentUploader = new document.Disco.AttachmentUploader(
'@(Url.Action(MVC.API.User.AttachmentUpload(Model.User.UserId, null)))',
$Attachments.find('.Disco-AttachmentUpload-DropTarget'),
$Attachments.find('.Disco-AttachmentUpload-Progress'));
var attachmentUploader = new document.Disco.AttachmentUploader($Attachments);
var $attachmentInput = $Attachments.find('.attachmentInput');
if (window.location.protocol != 'https:') {
@@ -92,7 +92,29 @@ WriteAttribute("class", Tuple.Create(" class=\"", 872), Tuple.Create("\"", 947)
, 880), false)
);
WriteLiteral(">\r\n <div");
WriteLiteral(" data-uploadurl=\"");
#line 22 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(Url.Action(MVC.API.User.AttachmentUpload(Model.User.UserId, null)));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 23 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(Html.AntiForgeryToken());
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"Disco-AttachmentUpload-DropTarget\"");
@@ -104,13 +126,13 @@ WriteLiteral(" class=\"attachmentOutput\"");
WriteLiteral(">\r\n");
#line 27 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 28 "..\..\Views\User\UserParts\_Resources.cshtml"
#line default
#line hidden
#line 27 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 28 "..\..\Views\User\UserParts\_Resources.cshtml"
if (Model.User.UserAttachments != null)
{
foreach (var ua in Model.User.UserAttachments)
@@ -121,20 +143,20 @@ WriteLiteral(">\r\n");
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 1386), Tuple.Create("\"", 1444)
WriteAttribute("href", Tuple.Create(" href=\"", 1523), Tuple.Create("\"", 1581)
#line 31 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1393), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentDownload(ua.Id))
#line 32 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1530), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentDownload(ua.Id))
#line default
#line hidden
, 1393), false)
, 1530), false)
);
WriteLiteral(" data-attachmentid=\"");
#line 31 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 32 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(ua.Id);
@@ -145,7 +167,7 @@ WriteLiteral("\"");
WriteLiteral(" data-mimetype=\"");
#line 31 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 32 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(ua.MimeType);
@@ -157,68 +179,69 @@ WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1554), Tuple.Create("\"", 1574)
WriteAttribute("title", Tuple.Create(" title=\"", 1695), Tuple.Create("\"", 1715)
#line 32 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1562), Tuple.Create<System.Object, System.Int32>(ua.Filename
#line 33 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1703), Tuple.Create<System.Object, System.Int32>(ua.Filename
#line default
#line hidden
, 1562), false)
, 1703), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 1645), Tuple.Create("\"", 1705)
WriteAttribute("src", Tuple.Create(" src=\"", 1790), Tuple.Create("\"", 1850)
#line 33 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1651), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentThumbnail(ua.Id))
#line 34 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1796), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.User.AttachmentThumbnail(ua.Id))
#line default
#line hidden
, 1651), false)
, 1796), false)
);
WriteLiteral(" /></span>\r\n <span");
WriteLiteral(" />\r\n </span>\r\n " +
" <span");
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1772), Tuple.Create("\"", 1792)
WriteAttribute("title", Tuple.Create(" title=\"", 1959), Tuple.Create("\"", 1979)
#line 34 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1780), Tuple.Create<System.Object, System.Int32>(ua.Comments
#line 36 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1967), Tuple.Create<System.Object, System.Int32>(ua.Comments
#line default
#line hidden
, 1780), false)
, 1967), false)
);
WriteLiteral(">\r\n");
#line 35 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 37 "..\..\Views\User\UserParts\_Resources.cshtml"
#line default
#line hidden
#line 35 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 37 "..\..\Views\User\UserParts\_Resources.cshtml"
if (!string.IsNullOrEmpty(ua.DocumentTemplateId))
{
#line default
#line hidden
#line 36 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 38 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(ua.DocumentTemplate.Description);
#line default
#line hidden
#line 36 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 38 "..\..\Views\User\UserParts\_Resources.cshtml"
}
else
{
@@ -226,14 +249,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 38 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 40 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(ua.Comments);
#line default
#line hidden
#line 38 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 40 "..\..\Views\User\UserParts\_Resources.cshtml"
}
#line default
@@ -245,7 +268,7 @@ WriteLiteral(" class=\"author\"");
WriteLiteral(">");
#line 39 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 41 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(ua.TechUser.ToStringFriendly());
@@ -254,7 +277,7 @@ WriteLiteral(">");
WriteLiteral("</span>");
#line 39 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 41 "..\..\Views\User\UserParts\_Resources.cshtml"
if (canRemoveAnyAttachments || (canRemoveOwnAttachments && ua.TechUserId.Equals(CurrentUser.UserId, StringComparison.OrdinalIgnoreCase)))
{
@@ -267,7 +290,7 @@ WriteLiteral(" class=\"remove fa fa-times-circle\"");
WriteLiteral("></span>");
#line 40 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 42 "..\..\Views\User\UserParts\_Resources.cshtml"
}
#line default
@@ -279,7 +302,7 @@ WriteLiteral(" class=\"timestamp\"");
WriteLiteral(" data-livestamp=\"");
#line 40 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 42 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(ua.Timestamp.ToUnixEpoc());
@@ -287,29 +310,29 @@ WriteLiteral(" data-livestamp=\"");
#line hidden
WriteLiteral("\"");
WriteAttribute("title", Tuple.Create(" title=\"", 2528), Tuple.Create("\"", 2566)
WriteAttribute("title", Tuple.Create(" title=\"", 2671), Tuple.Create("\"", 2709)
#line 40 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 2536), Tuple.Create<System.Object, System.Int32>(ua.Timestamp.ToFullDateTime()
#line 42 "..\..\Views\User\UserParts\_Resources.cshtml"
, Tuple.Create(Tuple.Create("", 2679), Tuple.Create<System.Object, System.Int32>(ua.Timestamp.ToFullDateTime()
#line default
#line hidden
, 2536), false)
, 2679), false)
);
WriteLiteral(">");
#line 40 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 42 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(ua.Timestamp.ToFullDateTime());
#line default
#line hidden
WriteLiteral("</span>\r\n </a> \r\n");
WriteLiteral("</span>\r\n </a>\r\n");
#line 42 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 44 "..\..\Views\User\UserParts\_Resources.cshtml"
}
}
@@ -319,13 +342,13 @@ WriteLiteral("</span>\r\n </a> \r\n");
WriteLiteral(" </div>\r\n");
#line 45 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 47 "..\..\Views\User\UserParts\_Resources.cshtml"
#line default
#line hidden
#line 45 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 47 "..\..\Views\User\UserParts\_Resources.cshtml"
if (canAddAttachments)
{
@@ -357,7 +380,7 @@ WriteLiteral(" title=\"Capture Image\"");
WriteLiteral("></span>\r\n </div>\r\n");
#line 51 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 53 "..\..\Views\User\UserParts\_Resources.cshtml"
}
@@ -387,7 +410,7 @@ WriteLiteral(@">
$.connection.hub.qs = { UserId: '");
#line 69 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 71 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(Model.User.UserId.Replace(@"\", @"\\"));
@@ -432,7 +455,7 @@ WriteLiteral("\' };\r\n $.connection.hub.error(onHubF
"$.ajax({\r\n url: \'");
#line 115 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 117 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(Url.Action(MVC.API.User.Attachment()));
@@ -447,13 +470,13 @@ WriteLiteral(@"',
");
#line 121 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 123 "..\..\Views\User\UserParts\_Resources.cshtml"
#line default
#line hidden
#line 121 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 123 "..\..\Views\User\UserParts\_Resources.cshtml"
if (canRemoveAnyAttachments)
{
@@ -467,7 +490,7 @@ WriteLiteral("buildAttachment(a, true, quick);");
WriteLiteral("\r\n");
#line 124 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 126 "..\..\Views\User\UserParts\_Resources.cshtml"
}
else if (canRemoveOwnAttachments)
{
@@ -480,7 +503,7 @@ WriteLiteral(" ");
WriteLiteral("buildAttachment(a, (a.AuthorId === \'");
#line 127 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 129 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(CurrentUser.UserId);
@@ -491,7 +514,7 @@ WriteLiteral("\'), quick);");
WriteLiteral("\r\n");
#line 128 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 130 "..\..\Views\User\UserParts\_Resources.cshtml"
}
else
{
@@ -506,7 +529,7 @@ WriteLiteral("buildAttachment(a, false, quick);");
WriteLiteral("\r\n");
#line 132 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 134 "..\..\Views\User\UserParts\_Resources.cshtml"
}
@@ -532,7 +555,7 @@ WriteLiteral(@" } else {
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
#line 150 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 152 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(Url.Action(MVC.API.User.AttachmentDownload()));
@@ -564,7 +587,7 @@ WriteLiteral(@"/' + a.Id);
img.attr('src', '");
#line 173 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 175 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(Url.Action(MVC.API.User.AttachmentThumbnail()));
@@ -615,66 +638,55 @@ WriteLiteral("/\' + a.Id + \'?v=\' + retryCount);\r\n
" }\r\n\r\n");
#line 232 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 234 "..\..\Views\User\UserParts\_Resources.cshtml"
#line default
#line hidden
#line 232 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 234 "..\..\Views\User\UserParts\_Resources.cshtml"
if (canAddAttachments)
{
#line default
#line hidden
WriteLiteral("\r\n //#region Add Attachments\r\n " +
" var attachmentUploader = new document.Disco.AttachmentUploader(\r\n " +
" \'");
#line 236 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(Url.Action(MVC.API.User.AttachmentUpload(Model.User.UserId, null)));
#line default
#line hidden
WriteLiteral("\',\r\n $Attachments.find(\'.Disco-AttachmentUpload-DropTa" +
"rget\'),\r\n $Attachments.find(\'.Disco-AttachmentUpload-" +
"Progress\'));\r\n\r\n var $attachmentInput = $Attachments." +
"find(\'.attachmentInput\');\r\n if (window.location.proto" +
"col != \'https:\') {\r\n $attachmentInput.find(\'.phot" +
"o\')\r\n .removeClass(\'enabled\')\r\n " +
" .addClass(\'disabled\')\r\n " +
" .attr(\'title\', \'Capture Image: this functionality is only available over a HTTP" +
"S connection\');\r\n }\r\n $att" +
"achmentInput.find(\'.photo\').click(function () {\r\n " +
" if (!$(this).hasClass(\'enabled\'))\r\n alert(\'T" +
"his functionality is only available over a HTTPS connection\');\r\n " +
" var attachmentUploader = new document.Disco.AttachmentUploader($Attachments)" +
";\r\n\r\n var $attachmentInput = $Attachments.find(\'.atta" +
"chmentInput\');\r\n if (window.location.protocol != \'htt" +
"ps:\') {\r\n $attachmentInput.find(\'.photo\')\r\n " +
" .removeClass(\'enabled\')\r\n " +
" .addClass(\'disabled\')\r\n .attr(\'tit" +
"le\', \'Capture Image: this functionality is only available over a HTTPS connectio" +
"n\');\r\n }\r\n $attachmentInpu" +
"t.find(\'.photo\').click(function () {\r\n if (!$(thi" +
"s).hasClass(\'enabled\'))\r\n alert(\'This functio" +
"nality is only available over a HTTPS connection\');\r\n " +
" else if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh this p" +
"age and try again\');\r\n else\r\n " +
" attachmentUploader.uploadImage();\r\n }" +
");\r\n $attachmentInput.find(\'.upload\').click(function " +
"() {\r\n if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, plea" +
"se refresh this page and try again\');\r\n else\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh this page and try" +
" again\');\r\n else\r\n " +
" attachmentUploader.uploadImage();\r\n });\r\n " +
" $attachmentInput.find(\'.upload\').click(function () {\r\n " +
" if ($(this).hasClass(\'disabled\'))\r\n " +
" alert(\'Disconnected from the Disco ICT Server, please refresh " +
"this page and try again\');\r\n else\r\n " +
" attachmentUploader.uploadFiles();\r\n " +
" });\r\n\r\n var resourcesTab;\r\n " +
" $(document).on(\'dragover\', function () {\r\n " +
" if (!resourcesTab) {\r\n var tabs =" +
" $Attachments.closest(\'.ui-tabs\');\r\n resource" +
"sTab = {\r\n tabs: tabs,\r\n " +
" resourcesIndex: tabs.children(\'ul.ui-tabs-nav\').find(\'a[h" +
"ref=\"#UserDetailTab-Resources\"]\').closest(\'li\').index()\r\n " +
" };\r\n }\r\n " +
" var selectedIndex = resourcesTab.tabs.tabs(\'option\', \'active\');\r\n " +
" if (!resourcesTab) {\r\n var tabs = $Attachmen" +
"ts.closest(\'.ui-tabs\');\r\n resourcesTab = {\r\n " +
" tabs: tabs,\r\n " +
" resourcesIndex: tabs.children(\'ul.ui-tabs-nav\').find(\'a[href=\"#UserD" +
"etailTab-Resources\"]\').closest(\'li\').index()\r\n " +
" };\r\n }\r\n var sel" +
"ectedIndex = resourcesTab.tabs.tabs(\'option\', \'active\');\r\n " +
" if (resourcesTab.resourcesIndex !== selectedIndex)\r\n " +
" resourcesTab.tabs.tabs(\'option\', \'active\', resource" +
"sTab.resourcesIndex);\r\n });\r\n " +
" //#endregion\r\n ");
" resourcesTab.tabs.tabs(\'option\', \'active\', resourcesTab.resour" +
"cesIndex);\r\n });\r\n //#endr" +
"egion\r\n ");
#line 276 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 275 "..\..\Views\User\UserParts\_Resources.cshtml"
}
@@ -683,7 +695,7 @@ WriteLiteral("\',\r\n $Attachments.find(\'.Disco-Atta
WriteLiteral(" ");
#line 277 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 276 "..\..\Views\User\UserParts\_Resources.cshtml"
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
{
@@ -717,7 +729,7 @@ WriteLiteral(@"
url: '");
#line 303 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 302 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(Url.Action(MVC.API.User.AttachmentRemove()));
@@ -745,7 +757,7 @@ WriteLiteral("\',\r\n dataType: \'jso
"/#endregion\r\n ");
#line 331 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 330 "..\..\Views\User\UserParts\_Resources.cshtml"
}
@@ -769,7 +781,7 @@ WriteLiteral(@"
$('#UserDetailTabItems').append('<li><a href=""#UserDetailTab-Resources"" id=""UserDetailTab-ResourcesLink"">Attachments [");
#line 347 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 346 "..\..\Views\User\UserParts\_Resources.cshtml"
Write(Model.User.UserAttachments == null ? 0 : Model.User.UserAttachments.Count);
@@ -778,7 +790,7 @@ WriteLiteral(@"
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>\r\n");
#line 350 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 349 "..\..\Views\User\UserParts\_Resources.cshtml"
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
{
@@ -800,7 +812,7 @@ WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");
WriteLiteral("></i>&nbsp;Are you sure?\r\n </p>\r\n </div>\r\n");
#line 357 "..\..\Views\User\UserParts\_Resources.cshtml"
#line 356 "..\..\Views\User\UserParts\_Resources.cshtml"
}
#line default