Feature #35: Livestamp implemented
Humanized dates now update automatically when a page is left open for some time.
This commit is contained in:
@@ -194,7 +194,7 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2011/7/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" />
|
||||
<UserProperties BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
|
||||
@@ -88,7 +88,6 @@
|
||||
<Compile Include="Repository\Device\DeviceCertificate.cs" />
|
||||
<Compile Include="Repository\DocumentTemplate\DocumentTemplate.cs" />
|
||||
<Compile Include="Repository\Job\Job.cs" />
|
||||
<Compile Include="Repository\Job\JobAssignment.cs" />
|
||||
<Compile Include="Repository\Job\JobAttachment.cs" />
|
||||
<Compile Include="Repository\Job\JobComponent.cs" />
|
||||
<Compile Include="Repository\Job\JobLog.cs" />
|
||||
@@ -167,7 +166,7 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2011/7/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using System.ComponentModel.DataAnnotations;
|
||||
//using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
//namespace Disco.Models.Repository
|
||||
//{
|
||||
// // Added 2012-10-23 G# - DBv5 Migration
|
||||
// public class JobAssignment
|
||||
// {
|
||||
// [Key, Required, ColumnAttribute(Order = 0)]
|
||||
// public int JobId { get; set; }
|
||||
// [Key, Required, ColumnAttribute(Order = 1)]
|
||||
// public string TechUserId { get; set; }
|
||||
// [Key, Required, ColumnAttribute(Order = 2)]
|
||||
// public DateTime AssignedDate { get; set; }
|
||||
|
||||
// public DateTime? UnassignedDate { get; set; }
|
||||
|
||||
// public DateTime? TargetCompletionDate { get; set; }
|
||||
|
||||
// [ForeignKey("JobId"), InverseProperty("JobAssignments")]
|
||||
// public virtual Job Job { get; set; }
|
||||
|
||||
// [ForeignKey("TechUserId")]
|
||||
// public User TechUser { get; set; }
|
||||
// }
|
||||
//}
|
||||
@@ -8,7 +8,6 @@ namespace Disco
|
||||
{
|
||||
public static class DateTimeExtensions
|
||||
{
|
||||
|
||||
public static string From(this DateTime moment, DateTime to, bool withoutSuffix)
|
||||
{
|
||||
var duration = to - moment;
|
||||
@@ -62,7 +61,6 @@ namespace Disco
|
||||
{
|
||||
return moment.FromNow("n/a");
|
||||
}
|
||||
|
||||
public static string Humanize(this TimeSpan duration, bool withSuffix)
|
||||
{
|
||||
string output = RelativeTime(duration.Ticks > 0 ? duration : duration.Negate(), true);
|
||||
@@ -123,25 +121,30 @@ namespace Disco
|
||||
else
|
||||
return NullValue;
|
||||
}
|
||||
public static long ToSortable(this DateTime? d)
|
||||
|
||||
private const long unixEpocOffset = 621355968000000000;
|
||||
public static long ToUnixEpoc(this DateTime d)
|
||||
{
|
||||
var epoc = new DateTime(unixEpocOffset, DateTimeKind.Utc);
|
||||
var offset = d.ToUniversalTime() - epoc;
|
||||
return offset.Ticks / 10000;
|
||||
}
|
||||
public static long? ToUnixEpoc(this DateTime? d)
|
||||
{
|
||||
if (d.HasValue)
|
||||
return d.Value.ToBinary();
|
||||
return d.Value.ToUnixEpoc();
|
||||
else
|
||||
return -1;
|
||||
return null;
|
||||
}
|
||||
public static long ToSortable(this DateTime d)
|
||||
|
||||
public static string ToISO8601(this DateTime d)
|
||||
{
|
||||
return d.ToBinary();
|
||||
return d.ToString("yyyy-MM-ddTHH\\:mm\\:sszzz");
|
||||
}
|
||||
public static string ToJavaScript(this DateTime d)
|
||||
{
|
||||
return d.ToString("yyyy/MM/dd hh:mm tt");
|
||||
}
|
||||
public static string ToJavaScript(this DateTime? d)
|
||||
public static string ToISO8601(this DateTime? d)
|
||||
{
|
||||
if (d.HasValue)
|
||||
return d.Value.ToString("yyyy/MM/dd hh:mm tt");
|
||||
return d.Value.ToISO8601();
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -6,10 +6,43 @@
|
||||
@using System.Web.Mvc
|
||||
@using System.Web.Mvc.Html;
|
||||
@using Disco.Services.Web;
|
||||
|
||||
|
||||
@helper FriendlyDate(DateTime d, string ElementId = null, bool WithoutSuffix = false)
|
||||
{<span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)))title="@d.ToFullDateTime()" data-discodatetime="@d.ToSortable()" data-datetimeformatted="@d.ToJavaScript()" class="date nowrap">@d.FromNow(WithoutSuffix)</span>}
|
||||
{<span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)))title="@d.ToFullDateTime()" data-livestamp="@d.ToUnixEpoc()" data-isodate="@d.ToISO8601()" class="date nowrap@(WithoutSuffix ? " noMomentSuffix" : null)">@d.ToFullDateTime()</span>}
|
||||
@helper FriendlyDate(DateTime? d, string NullValue = "n/a", string ElementId = null, bool WithoutSuffix = false)
|
||||
{<span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)))title="@d.ToFullDateTime(NullValue)" data-discodatetime="@d.ToSortable()" data-datetimeformatted="@d.ToJavaScript()" class="date nowrap">@d.FromNow(WithoutSuffix, NullValue)</span>}
|
||||
{<span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)))title="@d.ToFullDateTime(NullValue)" data-livestamp="@d.ToUnixEpoc()" data-isodate="@d.ToISO8601()" class="date nowrap@(WithoutSuffix ? " noMomentSuffix" : null)">@d.ToFullDateTime(NullValue)</span>}
|
||||
@helper FriendlyDateAndUser(DateTime? d, User u, string DateNullValue = "n/a", bool WithoutSuffix = false)
|
||||
{
|
||||
@FriendlyDate(d, DateNullValue, WithoutSuffix: WithoutSuffix);
|
||||
@FriendlyUser(u, null, " by");
|
||||
}
|
||||
@helper FriendlyDateAndUser(DateTime d, User u, bool WithoutSuffix = false)
|
||||
{
|
||||
@FriendlyDate(d, WithoutSuffix: WithoutSuffix);
|
||||
@FriendlyUser(u, null, " by");
|
||||
}
|
||||
@helper FriendlyDateAndTitleUser(DateTime? d, User u, string DateNullValue = "n/a", bool WithoutSuffix = false)
|
||||
{
|
||||
<span title="@d.ToFullDateTime(DateNullValue) by @u" data-livestamp="@d.ToUnixEpoc()" class="date nowrap@(WithoutSuffix ? " noMomentSuffix" : null)">@d.ToFullDateTime(DateNullValue)</span>
|
||||
}
|
||||
@helper FriendlyDateAndTitleUser(DateTime d, User u, bool WithoutSuffix = false)
|
||||
{
|
||||
<span title="@d.ToFullDateTime() by @u" data-livestamp="@d.ToUnixEpoc()" class="date nowrap@(WithoutSuffix ? " noMomentSuffix" : null)">@d.ToFullDateTime()</span>
|
||||
}
|
||||
@helper FriendlyUser(User u, string nullValue = null, string prepend = null)
|
||||
{
|
||||
if (u != null)
|
||||
{
|
||||
@prepend <span title="@u">@u.Id</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>@nullValue</span>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@helper RadioButtonList(string id, List<System.Web.Mvc.SelectListItem> items, int columns = 1)
|
||||
{
|
||||
@ItemList("radio", id, items, columns)
|
||||
@@ -18,6 +51,19 @@
|
||||
{
|
||||
@ItemList("checkbox", id, items, columns, alignEven, forceUniqueIds, htmlEncodeText)
|
||||
}
|
||||
@helper CheckboxBulkSelect(string BulkSelectContainerId, string ParentJQuerySelector = null)
|
||||
{Html.GetPageHelper().BundleDeferred("~/ClientScripts/Modules/Disco-jQueryExtensions");
|
||||
<span id="@BulkSelectContainerId" class="checkboxBulkSelectContainer">
|
||||
@if (string.IsNullOrWhiteSpace(ParentJQuerySelector))
|
||||
{
|
||||
<script type="text/javascript">$(function () { $('#@(BulkSelectContainerId)').checkboxBulkSelect(); });</script>
|
||||
}
|
||||
else
|
||||
{
|
||||
<script type="text/javascript">$(function () { $('#@(BulkSelectContainerId)').checkboxBulkSelect({ parentSelector: '@(ParentJQuerySelector)' }); });</script>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
@helper ItemList(string inputType, string id, List<System.Web.Mvc.SelectListItem> items, int columns = 1, bool alignEven = true, int? forceUniqueIds = null, bool htmlEncodeText = true)
|
||||
{
|
||||
int itemsPerColumn = items.Count / columns;
|
||||
@@ -49,35 +95,8 @@
|
||||
</tr>
|
||||
</table>
|
||||
}
|
||||
@helper FriendlyDateAndUser(DateTime? d, User u, string DateNullValue = "n/a", bool WithoutSuffix = false)
|
||||
{
|
||||
@FriendlyDate(d, DateNullValue, WithoutSuffix: WithoutSuffix);
|
||||
@FriendlyUser(u, null, " by");
|
||||
}
|
||||
@helper FriendlyDateAndUser(DateTime d, User u, bool WithoutSuffix = false)
|
||||
{
|
||||
@FriendlyDate(d, WithoutSuffix: WithoutSuffix);
|
||||
@FriendlyUser(u, null, " by");
|
||||
}
|
||||
@helper FriendlyDateAndTitleUser(DateTime? d, User u, string DateNullValue = "n/a", bool WithoutSuffix = false)
|
||||
{
|
||||
<span title="@d.ToFullDateTime(DateNullValue) by @u" data-discodatetime="@d.ToSortable()" class="date nowrap">@d.FromNow(WithoutSuffix, DateNullValue)</span>
|
||||
}
|
||||
@helper FriendlyDateAndTitleUser(DateTime d, User u, bool WithoutSuffix = false)
|
||||
{
|
||||
<span title="@d.ToFullDateTime() by @u" data-discodatetime="@d.ToSortable()" class="date nowrap">@d.FromNow(WithoutSuffix)</span>
|
||||
}
|
||||
@helper FriendlyUser(User u, string nullValue = null, string prepend = null)
|
||||
{
|
||||
if (u != null)
|
||||
{
|
||||
@prepend <span title="@u">@u.Id</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>@nullValue</span>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@helper Breadcrumbs(List<Tuple<string, ActionResult>> BreadCrumbs)
|
||||
{
|
||||
for (int index = 0; index < BreadCrumbs.Count; index++)
|
||||
@@ -116,17 +135,4 @@
|
||||
@helper BreadcrumbsTitle(string Title)
|
||||
{
|
||||
@Title
|
||||
}
|
||||
@helper CheckboxBulkSelect(string BulkSelectContainerId, string ParentJQuerySelector = null)
|
||||
{Html.GetPageHelper().BundleDeferred("~/ClientScripts/Modules/Disco-jQueryExtensions");
|
||||
<span id="@BulkSelectContainerId" class="checkboxBulkSelectContainer">
|
||||
@if (string.IsNullOrWhiteSpace(ParentJQuerySelector))
|
||||
{
|
||||
<script type="text/javascript">$(function () { $('#@(BulkSelectContainerId)').checkboxBulkSelect(); });</script>
|
||||
}
|
||||
else
|
||||
{
|
||||
<script type="text/javascript">$(function () { $('#@(BulkSelectContainerId)').checkboxBulkSelect({ parentSelector: '@(ParentJQuerySelector)' }); });</script>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -373,7 +373,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
var result = new
|
||||
{
|
||||
Timestamp = device.LastNetworkLogonDate,
|
||||
Friendly = device.LastNetworkLogonDate.FromNow("Unknown"),
|
||||
UnixEpoc = device.LastNetworkLogonDate.ToUnixEpoc(),
|
||||
Formatted = device.LastNetworkLogonDate.ToFullDateTime("Unknown")
|
||||
};
|
||||
|
||||
|
||||
@@ -279,8 +279,8 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
var m = undetectedDirectory.GetFiles("*.pdf").Select(f => new Models.DocumentTemplate.ImporterUndetectedFilesModel()
|
||||
{
|
||||
Id = System.IO.Path.GetFileNameWithoutExtension(f.Name),
|
||||
Timestamp = f.CreationTime.ToString(),
|
||||
TimestampFuzzy = f.CreationTime.FromNow()
|
||||
Timestamp = f.CreationTime.ToFullDateTime(),
|
||||
TimestampUnixEpoc = f.CreationTime.ToUnixEpoc()
|
||||
}).ToArray();
|
||||
|
||||
return Json(m);
|
||||
|
||||
@@ -17,28 +17,8 @@ namespace Disco.Web.Areas.API.Models.Attachment
|
||||
public string Comments { get; set; }
|
||||
public string Filename { get; set; }
|
||||
public string MimeType { get; set; }
|
||||
public string TimestampFuzzy
|
||||
{
|
||||
get
|
||||
{
|
||||
return Timestamp.FromNow();
|
||||
}
|
||||
set
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
public string TimestampFull
|
||||
{
|
||||
get
|
||||
{
|
||||
return Timestamp.ToFullDateTime();
|
||||
}
|
||||
set
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
public long TimestampUnixEpoc { get { return Timestamp.ToUnixEpoc(); } }
|
||||
public string TimestampFull { get { return Timestamp.ToFullDateTime(); } }
|
||||
|
||||
public static _AttachmentModel FromAttachment(Disco.Models.Repository.UserAttachment ua)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,6 @@ namespace Disco.Web.Areas.API.Models.DocumentTemplate
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Timestamp { get; set; }
|
||||
public string TimestampFuzzy { get; set; }
|
||||
public long TimestampUnixEpoc { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -15,28 +15,8 @@ namespace Disco.Web.Areas.API.Models.Job
|
||||
public string Author { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
public string Comments { get; set; }
|
||||
public string TimestampFuzzy
|
||||
{
|
||||
get
|
||||
{
|
||||
return Timestamp.FromNow();
|
||||
}
|
||||
set
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
public string TimestampFull
|
||||
{
|
||||
get
|
||||
{
|
||||
return Timestamp.ToFullDateTime();
|
||||
}
|
||||
set
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
public long TimestampUnixEpoc { get { return this.Timestamp.ToUnixEpoc(); } }
|
||||
public string TimestampFull { get { return Timestamp.ToFullDateTime(); } }
|
||||
|
||||
public static _CommentModel FromJobLog(Disco.Models.Repository.JobLog jl)
|
||||
{
|
||||
|
||||
@@ -13,14 +13,14 @@ namespace Disco.Web.Areas.API.Models.Job
|
||||
public string UserDescription { get; set; }
|
||||
public string DateTimeFull { get; set; }
|
||||
public string DateTimeFriendly { get; set; }
|
||||
public string DateTimeJavascript { get; set; }
|
||||
public long DateTimeSortable { get; set; }
|
||||
public string DateTimeISO8601 { get; set; }
|
||||
public long DateTimeUnixEpoc { get; set; }
|
||||
|
||||
public _DateChangeModel SetDateTime(DateTime? date)
|
||||
{
|
||||
this.DateTimeFriendly = date.FromNow(null);
|
||||
this.DateTimeJavascript = date.ToJavaScript();
|
||||
this.DateTimeSortable = date.ToSortable();
|
||||
this.DateTimeISO8601 = date.ToISO8601();
|
||||
this.DateTimeUnixEpoc = date.ToUnixEpoc() ?? -1;
|
||||
this.DateTimeFull = date.ToFullDateTime(null);
|
||||
|
||||
return this;
|
||||
|
||||
@@ -41888,6 +41888,150 @@ if ( $.watermark.runOnce ) {
|
||||
|
||||
///#source 1 1 /ClientSource/Scripts/Core/disco.moment.extensions.js
|
||||
moment.lang('en-au');
|
||||
///#source 1 1 /ClientSource/Scripts/Core/livestamp.js
|
||||
// Livestamp.js / v1.1.2 / (c) 2012 Matt Bradley / MIT License
|
||||
(function (plugin) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery', 'moment'], plugin);
|
||||
} else {
|
||||
// Browser globals
|
||||
plugin(jQuery, moment);
|
||||
}
|
||||
}(function ($, moment) {
|
||||
// DISCO: Update Interval = 30 seconds (not 1 second)
|
||||
var updateInterval = 30e3,
|
||||
paused = false,
|
||||
$livestamps = $([]),
|
||||
|
||||
init = function () {
|
||||
livestampGlobal.resume();
|
||||
},
|
||||
|
||||
prep = function ($el, timestamp) {
|
||||
var oldData = $el.data('livestampdata');
|
||||
// DISCO: Use milliseconds, not seconds
|
||||
//if (typeof timestamp == 'number')
|
||||
// timestamp *= 1e3;
|
||||
|
||||
$el.removeAttr('data-livestamp')
|
||||
.removeData('livestamp');
|
||||
|
||||
timestamp = moment(timestamp);
|
||||
if (moment.isMoment(timestamp) && !isNaN(+timestamp)) {
|
||||
var newData = $.extend({}, { 'original': $el.contents() }, oldData);
|
||||
newData.moment = moment(timestamp);
|
||||
// DISCO: Add 'WithoutSuffix' support
|
||||
newData.fromNowWithoutSuffix = $el.hasClass('noMomentSuffix');
|
||||
|
||||
$el.data('livestampdata', newData).empty();
|
||||
$livestamps.push($el[0]);
|
||||
}
|
||||
},
|
||||
|
||||
run = function () {
|
||||
if (paused) return;
|
||||
livestampGlobal.update();
|
||||
setTimeout(run, updateInterval);
|
||||
},
|
||||
|
||||
livestampGlobal = {
|
||||
update: function () {
|
||||
$('[data-livestamp]').each(function () {
|
||||
var $this = $(this);
|
||||
prep($this, $this.data('livestamp'));
|
||||
});
|
||||
|
||||
var toRemove = [];
|
||||
$livestamps.each(function () {
|
||||
var $this = $(this),
|
||||
data = $this.data('livestampdata');
|
||||
|
||||
if (data === undefined)
|
||||
toRemove.push(this);
|
||||
else if (moment.isMoment(data.moment)) {
|
||||
var from = $this.html(),
|
||||
to = data.moment.fromNow(data.fromNowWithoutSuffix); // DISCO: Implement 'WithoutSuffix' support
|
||||
|
||||
if (from != to) {
|
||||
var e = $.Event('change.livestamp');
|
||||
$this.trigger(e, [from, to]);
|
||||
if (!e.isDefaultPrevented())
|
||||
$this.html(to);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$livestamps = $livestamps.not(toRemove);
|
||||
delete $livestamps.prevObject
|
||||
},
|
||||
|
||||
pause: function () {
|
||||
paused = true;
|
||||
},
|
||||
|
||||
resume: function () {
|
||||
paused = false;
|
||||
run();
|
||||
},
|
||||
|
||||
interval: function (interval) {
|
||||
if (interval === undefined)
|
||||
return updateInterval;
|
||||
updateInterval = interval;
|
||||
}
|
||||
},
|
||||
|
||||
livestampLocal = {
|
||||
add: function ($el, timestamp) {
|
||||
// DISCO: Use milliseconds, not seconds
|
||||
//if (typeof timestamp == 'number')
|
||||
// timestamp *= 1e3;
|
||||
timestamp = moment(timestamp);
|
||||
|
||||
if (moment.isMoment(timestamp) && !isNaN(+timestamp)) {
|
||||
$el.each(function () {
|
||||
prep($(this), timestamp);
|
||||
});
|
||||
livestampGlobal.update();
|
||||
}
|
||||
|
||||
return $el;
|
||||
},
|
||||
|
||||
destroy: function ($el) {
|
||||
$livestamps = $livestamps.not($el);
|
||||
$el.each(function () {
|
||||
var $this = $(this),
|
||||
data = $this.data('livestampdata');
|
||||
|
||||
if (data === undefined)
|
||||
return $el;
|
||||
|
||||
$this
|
||||
.html(data.original ? data.original : '')
|
||||
.removeData('livestampdata');
|
||||
});
|
||||
|
||||
return $el;
|
||||
},
|
||||
|
||||
isLivestamp: function ($el) {
|
||||
return $el.data('livestampdata') !== undefined;
|
||||
}
|
||||
};
|
||||
|
||||
$.livestamp = livestampGlobal;
|
||||
$(init);
|
||||
$.fn.livestamp = function (method, options) {
|
||||
if (!livestampLocal[method]) {
|
||||
options = method;
|
||||
method = 'add';
|
||||
}
|
||||
|
||||
return livestampLocal[method](this, options);
|
||||
};
|
||||
}));
|
||||
///#source 1 1 /ClientSource/Scripts/Core/disco.dataTables.extensions.js
|
||||
jQuery.fn.dataTableExt.afnSortData['text'] = function (oSettings, iColumn) {
|
||||
var aData = [];
|
||||
@@ -41899,9 +42043,15 @@ jQuery.fn.dataTableExt.afnSortData['text'] = function (oSettings, iColumn) {
|
||||
jQuery.fn.dataTableExt.afnSortData['disco_datetime'] = function (oSettings, iColumn) {
|
||||
var aData = [];
|
||||
$('td:eq(' + iColumn + ')', oSettings.oApi._fnGetTrNodes(oSettings)).each(function () {
|
||||
var d = $(this).children('span.date[data-discodatetime]');
|
||||
var d = $(this).children('span.date');
|
||||
if (d.length > 0)
|
||||
aData.push((d.attr('data-discodatetime')) * 1);
|
||||
if (d.is('[data-livestamp]')){
|
||||
aData.push((d.attr('data-livestamp')) * 1);
|
||||
} else if (d.data('livestampdata') !== undefined) {
|
||||
aData.push(d.data('livestampdata').moment.valueOf());
|
||||
}else{
|
||||
aData.push(-1);
|
||||
}
|
||||
else
|
||||
aData.push(-1);
|
||||
});
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<file>/ClientSource/Scripts/Core/moment.js</file>
|
||||
<file>/ClientSource/Scripts/Core/moment.en-au.js</file>
|
||||
<file>/ClientSource/Scripts/Core/disco.moment.extensions.js</file>
|
||||
<file>/ClientSource/Scripts/Core/livestamp.js</file>
|
||||
<file>/ClientSource/Scripts/Core/disco.dataTables.extensions.js</file>
|
||||
<file>/ClientSource/Scripts/Core/disco.uicore.js</file>
|
||||
</bundle>
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -9,5 +9,6 @@
|
||||
/// <reference path="moment.js" />
|
||||
/// <reference path="moment.en-au.js" />
|
||||
/// <reference path="disco.moment.extensions.js" />
|
||||
/// <reference path="livestamp.js" />
|
||||
/// <reference path="disco.dataTables.extensions.js" />
|
||||
/// <reference path="disco.uicore.js" />
|
||||
@@ -8,9 +8,15 @@
|
||||
jQuery.fn.dataTableExt.afnSortData['disco_datetime'] = function (oSettings, iColumn) {
|
||||
var aData = [];
|
||||
$('td:eq(' + iColumn + ')', oSettings.oApi._fnGetTrNodes(oSettings)).each(function () {
|
||||
var d = $(this).children('span.date[data-discodatetime]');
|
||||
var d = $(this).children('span.date');
|
||||
if (d.length > 0)
|
||||
aData.push((d.attr('data-discodatetime')) * 1);
|
||||
if (d.is('[data-livestamp]')){
|
||||
aData.push((d.attr('data-livestamp')) * 1);
|
||||
} else if (d.data('livestampdata') !== undefined) {
|
||||
aData.push(d.data('livestampdata').moment.valueOf());
|
||||
}else{
|
||||
aData.push(-1);
|
||||
}
|
||||
else
|
||||
aData.push(-1);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
// Livestamp.js / v1.1.2 / (c) 2012 Matt Bradley / MIT License
|
||||
(function (plugin) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery', 'moment'], plugin);
|
||||
} else {
|
||||
// Browser globals
|
||||
plugin(jQuery, moment);
|
||||
}
|
||||
}(function ($, moment) {
|
||||
// DISCO: Update Interval = 30 seconds (not 1 second)
|
||||
var updateInterval = 30e3,
|
||||
paused = false,
|
||||
$livestamps = $([]),
|
||||
|
||||
init = function () {
|
||||
livestampGlobal.resume();
|
||||
},
|
||||
|
||||
prep = function ($el, timestamp) {
|
||||
var oldData = $el.data('livestampdata');
|
||||
// DISCO: Use milliseconds, not seconds
|
||||
//if (typeof timestamp == 'number')
|
||||
// timestamp *= 1e3;
|
||||
|
||||
$el.removeAttr('data-livestamp')
|
||||
.removeData('livestamp');
|
||||
|
||||
timestamp = moment(timestamp);
|
||||
if (moment.isMoment(timestamp) && !isNaN(+timestamp)) {
|
||||
var newData = $.extend({}, { 'original': $el.contents() }, oldData);
|
||||
newData.moment = moment(timestamp);
|
||||
// DISCO: Add 'WithoutSuffix' support
|
||||
newData.fromNowWithoutSuffix = $el.hasClass('noMomentSuffix');
|
||||
|
||||
$el.data('livestampdata', newData).empty();
|
||||
$livestamps.push($el[0]);
|
||||
}
|
||||
},
|
||||
|
||||
run = function () {
|
||||
if (paused) return;
|
||||
livestampGlobal.update();
|
||||
setTimeout(run, updateInterval);
|
||||
},
|
||||
|
||||
livestampGlobal = {
|
||||
update: function () {
|
||||
$('[data-livestamp]').each(function () {
|
||||
var $this = $(this);
|
||||
prep($this, $this.data('livestamp'));
|
||||
});
|
||||
|
||||
var toRemove = [];
|
||||
$livestamps.each(function () {
|
||||
var $this = $(this),
|
||||
data = $this.data('livestampdata');
|
||||
|
||||
if (data === undefined)
|
||||
toRemove.push(this);
|
||||
else if (moment.isMoment(data.moment)) {
|
||||
var from = $this.html(),
|
||||
to = data.moment.fromNow(data.fromNowWithoutSuffix); // DISCO: Implement 'WithoutSuffix' support
|
||||
|
||||
if (from != to) {
|
||||
var e = $.Event('change.livestamp');
|
||||
$this.trigger(e, [from, to]);
|
||||
if (!e.isDefaultPrevented())
|
||||
$this.html(to);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$livestamps = $livestamps.not(toRemove);
|
||||
delete $livestamps.prevObject
|
||||
},
|
||||
|
||||
pause: function () {
|
||||
paused = true;
|
||||
},
|
||||
|
||||
resume: function () {
|
||||
paused = false;
|
||||
run();
|
||||
},
|
||||
|
||||
interval: function (interval) {
|
||||
if (interval === undefined)
|
||||
return updateInterval;
|
||||
updateInterval = interval;
|
||||
}
|
||||
},
|
||||
|
||||
livestampLocal = {
|
||||
add: function ($el, timestamp) {
|
||||
// DISCO: Use milliseconds, not seconds
|
||||
//if (typeof timestamp == 'number')
|
||||
// timestamp *= 1e3;
|
||||
timestamp = moment(timestamp);
|
||||
|
||||
if (moment.isMoment(timestamp) && !isNaN(+timestamp)) {
|
||||
$el.each(function () {
|
||||
prep($(this), timestamp);
|
||||
});
|
||||
livestampGlobal.update();
|
||||
}
|
||||
|
||||
return $el;
|
||||
},
|
||||
|
||||
destroy: function ($el) {
|
||||
$livestamps = $livestamps.not($el);
|
||||
$el.each(function () {
|
||||
var $this = $(this),
|
||||
data = $this.data('livestampdata');
|
||||
|
||||
if (data === undefined)
|
||||
return $el;
|
||||
|
||||
$this
|
||||
.html(data.original ? data.original : '')
|
||||
.removeData('livestampdata');
|
||||
});
|
||||
|
||||
return $el;
|
||||
},
|
||||
|
||||
isLivestamp: function ($el) {
|
||||
return $el.data('livestampdata') !== undefined;
|
||||
}
|
||||
};
|
||||
|
||||
$.livestamp = livestampGlobal;
|
||||
$(init);
|
||||
$.fn.livestamp = function (method, options) {
|
||||
if (!livestampLocal[method]) {
|
||||
options = method;
|
||||
method = 'add';
|
||||
}
|
||||
|
||||
return livestampLocal[method](this, options);
|
||||
};
|
||||
}));
|
||||
@@ -1,4 +1,4 @@
|
||||
///#source 1 1 /ClientSource/Scripts/Modules/Disco-PropertyChangeHelpers/disco.propertychangehelpers.js
|
||||
///#source 1 1 /ClientSource/Scripts/Modules/Disco-PropertyChangeHelpers/disco.propertychangehelpers.js
|
||||
if (!document.DiscoFunctions) {
|
||||
document.DiscoFunctions = {};
|
||||
}
|
||||
@@ -260,13 +260,13 @@ if (!document.DiscoFunctions.DateDialogCreateUpdater)
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
if (response.DateTimeFull) {
|
||||
$dateField.attr('data-datetimeformatted', response.DateTimeJavascript)
|
||||
.attr('data-discodatetime', response.DateTimeSortable)
|
||||
$dateField.attr('data-isodate', response.DateTimeISO8601)
|
||||
.attr('data-livestamp', response.DateTimeUnixEpoc)
|
||||
.attr('title', response.DateTimeFull)
|
||||
.text(response.DateTimeFriendly);
|
||||
} else {
|
||||
$dateField.attr('data-datetimeformatted', '')
|
||||
.attr('data-discodatetime', '-1')
|
||||
$dateField.attr('data-isodate', '')
|
||||
.attr('data-livestamp', '-1')
|
||||
.attr('title', notSetDisplay)
|
||||
.text(notSetDisplay);
|
||||
}
|
||||
@@ -301,7 +301,7 @@ if (!document.DiscoFunctions.DateDialogCreateUpdater)
|
||||
d.dialog('option', 'title', friendlyName);
|
||||
dialogHeader.text(friendlyName + ' Date');
|
||||
|
||||
var dfVal = $('#' + DateField).attr('data-datetimeformatted');
|
||||
var dfVal = $('#' + DateField).attr('data-isodate');
|
||||
|
||||
if (dfVal)
|
||||
dialogDateBox.datetimepicker('setDate', new Date(dfVal));
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+5
-5
@@ -259,13 +259,13 @@ if (!document.DiscoFunctions.DateDialogCreateUpdater)
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
if (response.DateTimeFull) {
|
||||
$dateField.attr('data-datetimeformatted', response.DateTimeJavascript)
|
||||
.attr('data-discodatetime', response.DateTimeSortable)
|
||||
$dateField.attr('data-isodate', response.DateTimeISO8601)
|
||||
.attr('data-livestamp', response.DateTimeUnixEpoc)
|
||||
.attr('title', response.DateTimeFull)
|
||||
.text(response.DateTimeFriendly);
|
||||
} else {
|
||||
$dateField.attr('data-datetimeformatted', '')
|
||||
.attr('data-discodatetime', '-1')
|
||||
$dateField.attr('data-isodate', '')
|
||||
.attr('data-livestamp', '-1')
|
||||
.attr('title', notSetDisplay)
|
||||
.text(notSetDisplay);
|
||||
}
|
||||
@@ -300,7 +300,7 @@ if (!document.DiscoFunctions.DateDialogCreateUpdater)
|
||||
d.dialog('option', 'title', friendlyName);
|
||||
dialogHeader.text(friendlyName + ' Date');
|
||||
|
||||
var dfVal = $('#' + DateField).attr('data-datetimeformatted');
|
||||
var dfVal = $('#' + DateField).attr('data-isodate');
|
||||
|
||||
if (dfVal)
|
||||
dialogDateBox.datetimepicker('setDate', new Date(dfVal));
|
||||
|
||||
@@ -974,6 +974,7 @@
|
||||
<None Include="ClientSource\Scripts\Core\moment.en-au.js" />
|
||||
<None Include="ClientSource\Scripts\Core\moment.js" />
|
||||
<None Include="ClientSource\Scripts\Core\_references.js" />
|
||||
<None Include="ClientSource\Scripts\Core\livestamp.js" />
|
||||
<Content Include="ClientSource\Scripts\Modules\Disco-AjaxHelperIcons.min.js">
|
||||
<DependentUpon>Disco-AjaxHelperIcons.js.bundle</DependentUpon>
|
||||
</Content>
|
||||
@@ -2013,7 +2014,7 @@
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
<UserProperties BuildVersion_StartDate="2011/7/1" BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" BuildVersion_StartDate="2011/7/1" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
else
|
||||
{ @da.Comments }}
|
||||
</span><span class="author">@da.TechUser.ToString()</span>@if (canRemoveAnyAttachments || (canRemoveOwnAttachments && da.TechUserId == CurrentUser.Id))
|
||||
{<text><span class="remove fa fa-times-circle"></span></text>}<span class="timestamp" title="@da.Timestamp.ToFullDateTime()">@da.Timestamp.FromNow()</span>
|
||||
{<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>
|
||||
}
|
||||
}
|
||||
@@ -153,7 +153,7 @@
|
||||
e.find('.icon img').attr('src', '@(Url.Action(MVC.API.Device.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('.timestamp').text(a.TimestampFull).attr('title', a.TimestampFull).livestamp(a.TimestampUnixEpoc);
|
||||
if (canRemove)
|
||||
e.find('.remove').click(removeAttachment);
|
||||
if (!quick)
|
||||
@@ -199,6 +199,7 @@
|
||||
var $this = $(this);
|
||||
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
|
||||
Shadowbox.removeCache(this);
|
||||
$this.find('.timestamp').livestamp('destroy');
|
||||
$this.remove();
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Disco.Web.Views.Device.DeviceParts
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
@@ -276,11 +277,22 @@ WriteAttribute("title", Tuple.Create(" title=\"", 2144), Tuple.Create("\"", 2182
|
||||
, 2152), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" data-livestamp=\"");
|
||||
|
||||
|
||||
#line 35 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
|
||||
Write(da.Timestamp.ToUnixEpoc());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 35 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
|
||||
Write(da.Timestamp.FromNow());
|
||||
Write(da.Timestamp.ToFullDateTime());
|
||||
|
||||
|
||||
#line default
|
||||
@@ -584,7 +596,7 @@ WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon img\').
|
||||
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);
|
||||
e.find('.timestamp').text(a.TimestampFull).attr('title', a.TimestampFull).livestamp(a.TimestampUnixEpoc);
|
||||
if (canRemove)
|
||||
e.find('.remove').click(removeAttachment);
|
||||
if (!quick)
|
||||
@@ -654,25 +666,26 @@ WriteLiteral("\',\r\n dataType: \'json\',
|
||||
"= $(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 //#endr" +
|
||||
"egion\r\n ");
|
||||
" $this.find(\'.timestamp\').livestamp(\'destroy\');\r" +
|
||||
"\n $this.remove();\r\n " +
|
||||
" });\r\n " +
|
||||
" } else {\r\n alert(\'Unable t" +
|
||||
"o remove attachment: \' + d);\r\n }\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"close\")" +
|
||||
";\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 \"Canc" +
|
||||
"el\": 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 " +
|
||||
" //#endregion\r\n ");
|
||||
|
||||
|
||||
#line 225 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
|
||||
#line 226 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -714,7 +727,7 @@ WriteLiteral("></i> Are you sure?\r\n </p>\r\n </div>\r\n <scr
|
||||
"etailTab-ResourcesLink\">Attachments [");
|
||||
|
||||
|
||||
#line 247 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
|
||||
#line 248 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
|
||||
Write(Model.Device.DeviceAttachments == null ? 0 : Model.Device.DeviceAttachments.Count);
|
||||
|
||||
|
||||
|
||||
@@ -143,7 +143,13 @@
|
||||
alert('Unable to retrieve latest network logon date:\n' + response);
|
||||
$('<span>').addClass('smallMessage').text('[may not be current]').appendTo(span);
|
||||
} else {
|
||||
span.attr('title', response.Formatted).text(response.Friendly);
|
||||
var spanClasses = '',
|
||||
diff = moment().valueOf() - response.UnixEpoc;
|
||||
if (diff > 2592000000) // 30 Days
|
||||
spanClasses = 'error';
|
||||
else if (diff > 604800000) // 7 Days
|
||||
spanClasses = 'alert';
|
||||
span.removeClass('alert error').addClass(spanClasses).attr('title', response.Formatted).text(response.Formatted).livestamp(response.UnixEpoc);
|
||||
}
|
||||
});
|
||||
window.setTimeout(function () {
|
||||
@@ -372,7 +378,7 @@
|
||||
@foreach (var db in Model.DeviceBatches.OrderBy(i => i.Name))
|
||||
{
|
||||
<li>
|
||||
<input type="radio" data-devicebatchid="@db.Id" name="DeviceBatch" id="DeviceBatch_@(db.Id)" /><label for="DeviceBatch_@(db.Id)" title="Purchased: @(db.PurchaseDate.FromNow())">@db.Name</label></li>
|
||||
<input type="radio" data-devicebatchid="@db.Id" name="DeviceBatch" id="DeviceBatch_@(db.Id)" /><label for="DeviceBatch_@(db.Id)" title="Purchased: @(db.PurchaseDate.ToLongDateString())">@db.Name</label></li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -526,7 +526,7 @@
|
||||
<script>
|
||||
$(function () {
|
||||
var updateUrl = '@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))';
|
||||
var jobOpenDate = '@(Model.Job.OpenedDate.ToJavaScript())';
|
||||
var jobOpenDate = '@(Model.Job.OpenedDate.ToISO8601())';
|
||||
|
||||
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Claim Form Sent Date', 'Job_JobMetaInsurance_ClaimFormSentDate', 'Job_JobMetaInsurance_ClaimFormSentUserId', 'InsuranceClaimFormSentDate', 'Not Sent', jobOpenDate, false);
|
||||
});
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Disco.Web.Views.Job.JobParts
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
@@ -1674,7 +1675,7 @@ WriteLiteral("\';\r\n var jobOpenDate = \'");
|
||||
|
||||
|
||||
#line 529 "..\..\Views\Job\JobParts\Insurance.cshtml"
|
||||
Write(Model.Job.OpenedDate.ToJavaScript());
|
||||
Write(Model.Job.OpenedDate.ToISO8601());
|
||||
|
||||
|
||||
#line default
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
<script>
|
||||
$(function () {
|
||||
var updateUrl = '@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))';
|
||||
var jobOpenDate = '@(Model.Job.OpenedDate.ToJavaScript())';
|
||||
var jobOpenDate = '@(Model.Job.OpenedDate.ToISO8601())';
|
||||
|
||||
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.AccountingChargeRequired))
|
||||
{<text>document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Accounting Charge Required', 'Job_JobMetaNonWarranty_AccountingChargeRequiredDate', 'Job_JobMetaNonWarranty_AccountingChargeRequiredUser', 'NonWarrantyAccountingChargeRequired', 'Not Required', jobOpenDate, false);</text>}
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Disco.Web.Views.Job.JobParts
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
@@ -460,7 +461,7 @@ WriteLiteral("\';\r\n var jobOpenDate = \'");
|
||||
|
||||
|
||||
#line 128 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Model.Job.OpenedDate.ToJavaScript());
|
||||
Write(Model.Job.OpenedDate.ToISO8601());
|
||||
|
||||
|
||||
#line default
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<script>
|
||||
$(function () {
|
||||
var updateUrl = '@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))';
|
||||
var jobOpenDate = '@(Model.Job.OpenedDate.ToJavaScript())';
|
||||
var jobOpenDate = '@(Model.Job.OpenedDate.ToISO8601())';
|
||||
|
||||
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerLoggedDate))
|
||||
{<text>document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Repairer Name', 'Job_JobMetaNonWarranty_RepairerLoggedDate', null, 'NonWarrantyRepairerLoggedDate', 'Not Logged', jobOpenDate, false);</text>}
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Disco.Web.Views.Job.JobParts
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
@@ -345,7 +346,7 @@ WriteLiteral("\';\r\n var jobOpenDate = \'");
|
||||
|
||||
|
||||
#line 84 "..\..\Views\Job\JobParts\Repairs.cshtml"
|
||||
Write(Model.Job.OpenedDate.ToJavaScript());
|
||||
Write(Model.Job.OpenedDate.ToISO8601());
|
||||
|
||||
|
||||
#line default
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
{
|
||||
<div data-logid="@jl.Id">
|
||||
<span class="author">@jl.TechUser.ToString()</span>@if (canRemoveAnyLogs || (canRemoveOwnLogs && jl.TechUserId == CurrentUser.Id))
|
||||
{<text><span class="remove fa fa-times-circle"></span></text>}<span class="timestamp" title="@jl.Timestamp.ToFullDateTime()">@jl.Timestamp.FromNow()</span>
|
||||
{<text><span class="remove fa fa-times-circle"></span></text>}<span class="timestamp" data-livestamp="@(jl.Timestamp.ToUnixEpoc())" title="@jl.Timestamp.ToFullDateTime()">@jl.Timestamp.ToFullDateTime()</span>
|
||||
<span class="comment">@jl.Comments.ToMultilineJobRefString()</span>
|
||||
</div>
|
||||
}
|
||||
@@ -59,7 +59,7 @@
|
||||
else
|
||||
{ @ja.Comments }}
|
||||
</span><span class="author">@ja.TechUser.ToString()</span>@if (canRemoveAnyAttachments || (canRemoveOwnAttachments && ja.TechUserId == CurrentUser.Id))
|
||||
{<text><span class="remove fa fa-times-circle"></span></text>}<span class="timestamp" title="@ja.Timestamp.ToFullDateTime()">@ja.Timestamp.FromNow()</span>
|
||||
{<text><span class="remove fa fa-times-circle"></span></text>}<span class="timestamp" data-livestamp="@(ja.Timestamp.ToUnixEpoc())" title="@ja.Timestamp.ToFullDateTime()">@ja.Timestamp.ToFullDateTime()</span>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
@@ -244,7 +244,9 @@
|
||||
}
|
||||
function liveRemoveComment(key) {
|
||||
$CommentOutput.children('div[data-logid="' + key + '"]').slideUp(300).delay(300).queue(function () {
|
||||
$(this).remove();
|
||||
var $this = $(this);
|
||||
$this.find('.timestamp').livestamp('destroy');
|
||||
$this.remove();
|
||||
});
|
||||
}
|
||||
function addComment(c, quick, canRemove) {
|
||||
@@ -256,7 +258,7 @@
|
||||
var e = $(t);
|
||||
e.attr('data-logid', c.Id);
|
||||
e.find('.author').text(c.Author);
|
||||
e.find('.timestamp').text(c.TimestampFuzzy).attr('title', c.TimestampFull);
|
||||
e.find('.timestamp').text(c.TimestampFull).attr('title', c.TimestampFull).livestamp(c.TimestampUnixEpoc);
|
||||
if (canRemove)
|
||||
e.find('.remove').click(removePost);
|
||||
var eComment = e.find('.comment').text(c.Comments);
|
||||
@@ -474,7 +476,7 @@
|
||||
e.find('.icon img').attr('src', '@(Url.Action(MVC.API.Job.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('.timestamp').text(a.TimestampFull).attr('title', a.TimestampFull).livestamp(a.TimestampUnixEpoc);
|
||||
if (canRemove)
|
||||
e.find('.remove').click(removeLocalAttachment);
|
||||
if (!quick)
|
||||
|
||||
@@ -194,21 +194,32 @@ WriteLiteral("<span");
|
||||
|
||||
WriteLiteral(" class=\"timestamp\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 1831), Tuple.Create("\"", 1869)
|
||||
WriteLiteral(" data-livestamp=\"");
|
||||
|
||||
|
||||
#line 33 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1839), Tuple.Create<System.Object, System.Int32>(jl.Timestamp.ToFullDateTime()
|
||||
Write(jl.Timestamp.ToUnixEpoc());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1839), false)
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 1877), Tuple.Create("\"", 1915)
|
||||
|
||||
#line 33 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1885), Tuple.Create<System.Object, System.Int32>(jl.Timestamp.ToFullDateTime()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1885), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 33 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(jl.Timestamp.FromNow());
|
||||
Write(jl.Timestamp.ToFullDateTime());
|
||||
|
||||
|
||||
#line default
|
||||
@@ -301,14 +312,14 @@ WriteLiteral(" <td");
|
||||
|
||||
WriteLiteral(" id=\"Attachments\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 2567), Tuple.Create("\"", 2642)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 2620), Tuple.Create("\"", 2695)
|
||||
|
||||
#line 49 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2575), Tuple.Create<System.Object, System.Int32>(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments"
|
||||
, Tuple.Create(Tuple.Create("", 2628), Tuple.Create<System.Object, System.Int32>(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2575), false)
|
||||
, 2628), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
@@ -333,14 +344,14 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 2810), Tuple.Create("\"", 2867)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 2863), Tuple.Create("\"", 2920)
|
||||
|
||||
#line 53 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2817), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
|
||||
, Tuple.Create(Tuple.Create("", 2870), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2817), false)
|
||||
, 2870), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" data-attachmentid=\"");
|
||||
@@ -369,42 +380,42 @@ WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"icon\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 2973), Tuple.Create("\"", 2993)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 3026), Tuple.Create("\"", 3046)
|
||||
|
||||
#line 54 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2981), Tuple.Create<System.Object, System.Int32>(ja.Filename
|
||||
, Tuple.Create(Tuple.Create("", 3034), Tuple.Create<System.Object, System.Int32>(ja.Filename
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2981), false)
|
||||
, 3034), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <img");
|
||||
|
||||
WriteLiteral(" alt=\"Attachment Thumbnail\"");
|
||||
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 3060), Tuple.Create("\"", 3119)
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 3113), Tuple.Create("\"", 3172)
|
||||
|
||||
#line 55 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3066), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
|
||||
, Tuple.Create(Tuple.Create("", 3119), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3066), false)
|
||||
, 3119), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" /></span>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"comments\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 3182), Tuple.Create("\"", 3202)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 3235), Tuple.Create("\"", 3255)
|
||||
|
||||
#line 56 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3190), Tuple.Create<System.Object, System.Int32>(ja.Comments
|
||||
, Tuple.Create(Tuple.Create("", 3243), Tuple.Create<System.Object, System.Int32>(ja.Comments
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3190), false)
|
||||
, 3243), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
@@ -488,21 +499,32 @@ WriteLiteral("<span");
|
||||
|
||||
WriteLiteral(" class=\"timestamp\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 3807), Tuple.Create("\"", 3845)
|
||||
WriteLiteral(" data-livestamp=\"");
|
||||
|
||||
|
||||
#line 62 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3815), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
|
||||
Write(ja.Timestamp.ToUnixEpoc());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3815), false)
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 3906), Tuple.Create("\"", 3944)
|
||||
|
||||
#line 62 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3914), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3914), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 62 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(ja.Timestamp.FromNow());
|
||||
Write(ja.Timestamp.ToFullDateTime());
|
||||
|
||||
|
||||
#line default
|
||||
@@ -909,38 +931,29 @@ WriteLiteral("addComment(d, false, false);");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to load live comment ' + id + ': ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function liveRemoveComment(key) {
|
||||
$CommentOutput.children('div[data-logid=""' + key + '""]').slideUp(300).delay(300).queue(function () {
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
function addComment(c, quick, canRemove) {
|
||||
var t = '<div><span class=""author"" />';
|
||||
if (canRemove)
|
||||
t += '<span class=""remove fa fa-times-circle"" />';
|
||||
t += '<span class=""timestamp"" /><span class=""comment"" /></div>';
|
||||
|
||||
var e = $(t);
|
||||
e.attr('data-logid', c.Id);
|
||||
e.find('.author').text(c.Author);
|
||||
e.find('.timestamp').text(c.TimestampFuzzy).attr('title', c.TimestampFull);
|
||||
if (canRemove)
|
||||
e.find('.remove').click(removePost);
|
||||
var eComment = e.find('.comment').text(c.Comments);
|
||||
var commentHtml = eComment.text().replace(/\r\n|\r|\n/g, '<br />');
|
||||
commentHtml = commentHtml.replace(/\#(\d+)/g, '<a href=""");
|
||||
WriteLiteral("\r\n }\r\n },\r\n " +
|
||||
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
|
||||
" alert(\'Unable to load live comment \' + id + \': \' + textStatus);\r\n " +
|
||||
" }\r\n });\r\n }\r\n }\r\n " +
|
||||
" function liveRemoveComment(key) {\r\n $CommentOutput.childre" +
|
||||
"n(\'div[data-logid=\"\' + key + \'\"]\').slideUp(300).delay(300).queue(function () {\r\n" +
|
||||
" var $this = $(this);\r\n $this.find(\'.times" +
|
||||
"tamp\').livestamp(\'destroy\');\r\n $this.remove();\r\n " +
|
||||
" });\r\n }\r\n function addComment(c, quick, canRemove) {\r\n " +
|
||||
" var t = \'<div><span class=\"author\" />\';\r\n if (canR" +
|
||||
"emove)\r\n t += \'<span class=\"remove fa fa-times-circle\" />\';\r\n" +
|
||||
" t += \'<span class=\"timestamp\" /><span class=\"comment\" /></div>\';" +
|
||||
"\r\n\r\n var e = $(t);\r\n e.attr(\'data-logid\', c.Id);\r\n" +
|
||||
" e.find(\'.author\').text(c.Author);\r\n e.find(\'.time" +
|
||||
"stamp\').text(c.TimestampFull).attr(\'title\', c.TimestampFull).livestamp(c.Timesta" +
|
||||
"mpUnixEpoc);\r\n if (canRemove)\r\n e.find(\'.remov" +
|
||||
"e\').click(removePost);\r\n var eComment = e.find(\'.comment\').text(c" +
|
||||
".Comments);\r\n var commentHtml = eComment.text().replace(/\\r\\n|\\r|" +
|
||||
"\\n/g, \'<br />\');\r\n commentHtml = commentHtml.replace(/\\#(\\d+)/g, " +
|
||||
"\'<a href=\"");
|
||||
|
||||
|
||||
#line 264 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 266 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.Job.Show(null)));
|
||||
|
||||
|
||||
@@ -970,14 +983,14 @@ WriteLiteral(@"?id=$1"">#$1</a>');
|
||||
");
|
||||
|
||||
|
||||
#line 285 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 287 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 286 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 288 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
if (canShowAttachments)
|
||||
{
|
||||
|
||||
@@ -998,7 +1011,7 @@ WriteLiteral(@" <script>
|
||||
var jobId = parseInt('");
|
||||
|
||||
|
||||
#line 299 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 301 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Model.Job.Id);
|
||||
|
||||
|
||||
@@ -1009,13 +1022,13 @@ WriteLiteral("\');\r\n\r\n //#region Attachments\r\n var $
|
||||
"tput\');\r\n\r\n");
|
||||
|
||||
|
||||
#line 305 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 307 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 305 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 307 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
if (canAddAttachments)
|
||||
{
|
||||
|
||||
@@ -1046,7 +1059,7 @@ WriteLiteral(@"
|
||||
'");
|
||||
|
||||
|
||||
#line 328 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 330 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap);
|
||||
|
||||
|
||||
@@ -1067,7 +1080,7 @@ WriteLiteral(@"',
|
||||
'UploadUrl=");
|
||||
|
||||
|
||||
#line 340 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 342 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.AttachmentUpload(Model.Job.Id, null)));
|
||||
|
||||
|
||||
@@ -1102,7 +1115,7 @@ WriteLiteral(@"');
|
||||
");
|
||||
|
||||
|
||||
#line 366 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 368 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -1111,13 +1124,13 @@ WriteLiteral(@"');
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 368 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 370 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 368 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 370 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
|
||||
{
|
||||
|
||||
@@ -1152,7 +1165,7 @@ WriteLiteral(@"
|
||||
url: '");
|
||||
|
||||
|
||||
#line 395 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 397 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.AttachmentRemove()));
|
||||
|
||||
|
||||
@@ -1180,7 +1193,7 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n
|
||||
" }\r\n\r\n //#endregion\r\n\r\n ");
|
||||
|
||||
|
||||
#line 428 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 430 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -1191,7 +1204,7 @@ WriteLiteral("\r\n function addAttachment(key, quick) {\r\n\r\n
|
||||
" $.ajax({\r\n url: \'");
|
||||
|
||||
|
||||
#line 436 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 438 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.Attachment()));
|
||||
|
||||
|
||||
@@ -1203,13 +1216,13 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n
|
||||
"");
|
||||
|
||||
|
||||
#line 442 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 444 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 442 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 444 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
if (canRemoveAnyAttachments)
|
||||
{
|
||||
|
||||
@@ -1223,7 +1236,7 @@ WriteLiteral("buildAttachment(a, true, quick);");
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 445 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 447 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
else if (canRemoveOwnAttachments)
|
||||
{
|
||||
@@ -1236,7 +1249,7 @@ WriteLiteral(" ");
|
||||
WriteLiteral("buildAttachment(a, (a.AuthorId === \'");
|
||||
|
||||
|
||||
#line 448 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 450 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(CurrentUser.Id);
|
||||
|
||||
|
||||
@@ -1247,7 +1260,7 @@ WriteLiteral("\'), quick);");
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 449 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 451 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1262,7 +1275,7 @@ WriteLiteral("buildAttachment(a, false, quick);");
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 453 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 455 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -1290,7 +1303,7 @@ WriteLiteral(@" } else {
|
||||
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
|
||||
|
||||
|
||||
#line 473 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 475 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.AttachmentDownload()));
|
||||
|
||||
|
||||
@@ -1299,7 +1312,7 @@ WriteLiteral(@" } else {
|
||||
WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon img\').attr(\'src\', \'");
|
||||
|
||||
|
||||
#line 474 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 476 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.AttachmentThumbnail()));
|
||||
|
||||
|
||||
@@ -1307,39 +1320,39 @@ WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon img\').attr(\'s
|
||||
#line hidden
|
||||
WriteLiteral("/\' + a.Id);\r\n e.find(\'.comments\').text(a.Comments);\r\n " +
|
||||
" e.find(\'.author\').text(a.Author);\r\n e.find(\'.times" +
|
||||
"tamp\').text(a.TimestampFuzzy).attr(\'title\', a.TimestampFull);\r\n " +
|
||||
" if (canRemove)\r\n e.find(\'.remove\').click(removeLocalAt" +
|
||||
"tachment);\r\n if (!quick)\r\n e.hide();\r\n" +
|
||||
" $attachmentOutput.append(e);\r\n if (!quick" +
|
||||
")\r\n e.show(\'slow\');\r\n if (a.MimeType.t" +
|
||||
"oLowerCase().indexOf(\'image/\') == 0)\r\n e.shadowbox({ gall" +
|
||||
"ery: \'attachments\', player: \'img\', title: a.Comments });\r\n }\r\n " +
|
||||
" }\r\n\r\n function removeAttachment(key) {\r\n if (" +
|
||||
"key.JobId == jobId) {\r\n var $element = $attachmentOutput.find" +
|
||||
"(\'a[data-attachmentid=\"\' + key.Id + \'\"]\');\r\n if ($element.len" +
|
||||
"gth > 0) {\r\n $element.hide(300).delay(300).queue(function" +
|
||||
" () {\r\n if ($element.attr(\'data-mimetype\').toLowerCas" +
|
||||
"e().indexOf(\'image/\') == 0)\r\n Shadowbox.removeCac" +
|
||||
"he(this);\r\n $element.remove();\r\n " +
|
||||
" });\r\n }\r\n }\r\n }\r\n\r\n\r\n\r\n " +
|
||||
" $attachmentOutput.children(\'a\').each(function () {\r\n $this = $" +
|
||||
"(this);\r\n if ($this.attr(\'data-mimetype\').toLowerCase().indexOf(\'" +
|
||||
"image/\') == 0)\r\n $this.shadowbox({ gallery: \'attachments\', pl" +
|
||||
"ayer: \'img\', title: $this.find(\'.comments\').text() });\r\n });\r\n\r\n " +
|
||||
" // Add Globally Available Functions\r\n document.DiscoFunctions." +
|
||||
"liveAddAttachment = addAttachment;\r\n document.DiscoFunctions.liveRemo" +
|
||||
"veAttachment = removeAttachment;\r\n\r\n //#endregion\r\n });\r\n\r\n\r\n " +
|
||||
" </script>\r\n");
|
||||
"tamp\').text(a.TimestampFull).attr(\'title\', a.TimestampFull).livestamp(a.Timestam" +
|
||||
"pUnixEpoc);\r\n if (canRemove)\r\n e.find(" +
|
||||
"\'.remove\').click(removeLocalAttachment);\r\n if (!quick)\r\n " +
|
||||
" e.hide();\r\n $attachmentOutput.append(e);\r\n" +
|
||||
" if (!quick)\r\n e.show(\'slow\');\r\n " +
|
||||
" if (a.MimeType.toLowerCase().indexOf(\'image/\') == 0)\r\n " +
|
||||
" e.shadowbox({ gallery: \'attachments\', player: \'img\', title: a.Commen" +
|
||||
"ts });\r\n }\r\n }\r\n\r\n function removeAttachmen" +
|
||||
"t(key) {\r\n if (key.JobId == jobId) {\r\n var $el" +
|
||||
"ement = $attachmentOutput.find(\'a[data-attachmentid=\"\' + key.Id + \'\"]\');\r\n " +
|
||||
" if ($element.length > 0) {\r\n $element.hide(" +
|
||||
"300).delay(300).queue(function () {\r\n if ($element.at" +
|
||||
"tr(\'data-mimetype\').toLowerCase().indexOf(\'image/\') == 0)\r\n " +
|
||||
" Shadowbox.removeCache(this);\r\n $element.re" +
|
||||
"move();\r\n });\r\n }\r\n }\r\n" +
|
||||
" }\r\n\r\n\r\n\r\n $attachmentOutput.children(\'a\').each(function (" +
|
||||
") {\r\n $this = $(this);\r\n if ($this.attr(\'data-mime" +
|
||||
"type\').toLowerCase().indexOf(\'image/\') == 0)\r\n $this.shadowbo" +
|
||||
"x({ gallery: \'attachments\', player: \'img\', title: $this.find(\'.comments\').text()" +
|
||||
" });\r\n });\r\n\r\n // Add Globally Available Functions\r\n " +
|
||||
" document.DiscoFunctions.liveAddAttachment = addAttachment;\r\n do" +
|
||||
"cument.DiscoFunctions.liveRemoveAttachment = removeAttachment;\r\n\r\n //" +
|
||||
"#endregion\r\n });\r\n\r\n\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 520 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 522 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 521 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 523 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
if (canShowLogs && canShowAttachments)
|
||||
{
|
||||
|
||||
@@ -1349,7 +1362,7 @@ WriteLiteral("/\' + a.Id);\r\n e.find(\'.comments\').text(a.C
|
||||
WriteLiteral(" <script>\r\n $(function () {\r\n var jobId = parseInt(\'");
|
||||
|
||||
|
||||
#line 525 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 527 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Model.Job.Id);
|
||||
|
||||
|
||||
@@ -1378,7 +1391,7 @@ WriteLiteral("\');\r\n\r\n //#region LiveEvents\r\n functi
|
||||
" var liveMessagesConnection = $.connection(\'");
|
||||
|
||||
|
||||
#line 558 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 560 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Content("~/API/Repository/Notifications"));
|
||||
|
||||
|
||||
@@ -1397,7 +1410,7 @@ WriteLiteral(@"', { addToGroups: 'JobLog,JobAttachment' })
|
||||
");
|
||||
|
||||
|
||||
#line 568 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 570 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
else if (canShowLogs)
|
||||
{
|
||||
@@ -1408,7 +1421,7 @@ else if (canShowLogs)
|
||||
WriteLiteral(" <script>\r\n $(function () {\r\n var jobId = parseInt(\'");
|
||||
|
||||
|
||||
#line 573 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 575 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Model.Job.Id);
|
||||
|
||||
|
||||
@@ -1436,7 +1449,7 @@ WriteLiteral(@"');
|
||||
var liveMessagesConnection = $.connection('");
|
||||
|
||||
|
||||
#line 592 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 594 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Content("~/API/Repository/Notifications"));
|
||||
|
||||
|
||||
@@ -1455,7 +1468,7 @@ WriteLiteral(@"', { addToGroups: 'JobLog' })
|
||||
");
|
||||
|
||||
|
||||
#line 602 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 604 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
else if (canShowAttachments)
|
||||
{
|
||||
@@ -1466,7 +1479,7 @@ else if (canShowAttachments)
|
||||
WriteLiteral(" <script>\r\n $(function () {\r\n var jobId = parseInt(\'");
|
||||
|
||||
|
||||
#line 607 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 609 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Model.Job.Id);
|
||||
|
||||
|
||||
@@ -1492,7 +1505,7 @@ WriteLiteral(@"');
|
||||
var liveMessagesConnection = $.connection('");
|
||||
|
||||
|
||||
#line 624 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 626 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
Write(Url.Content("~/API/Repository/Notifications"));
|
||||
|
||||
|
||||
@@ -1511,7 +1524,7 @@ WriteLiteral(@"', { addToGroups: 'JobAttachment' })
|
||||
");
|
||||
|
||||
|
||||
#line 634 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
#line 636 "..\..\Views\Job\JobParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
{
|
||||
<div id="Job_Show_Device_Details_HWar">
|
||||
<div>DEVICE WARRANTY</div>
|
||||
<div>Until: <span id="Job_Show_Device_Details_HWar_ValidUntil">@Model.Job.Device.DeviceBatch.WarrantyValidUntil.FromNow("Unknown")</span></div>
|
||||
<div>Until: <span id="Job_Show_Device_Details_HWar_ValidUntil" data-livestamp="@Model.Job.Device.DeviceBatch.WarrantyValidUntil.ToUnixEpoc()">@Model.Job.Device.DeviceBatch.WarrantyValidUntil.ToFullDateTime("Unknown")</span></div>
|
||||
@if (!string.IsNullOrWhiteSpace(Model.Job.Device.DeviceBatch.WarrantyDetails))
|
||||
{
|
||||
<a id="Job_Show_Device_Details_HWar_Details_Button" href="#">Show Details</a>
|
||||
@@ -232,7 +232,7 @@
|
||||
<div id="Job_Show_Device_Details_HNWar">
|
||||
<div>INSURANCE</div>
|
||||
<div id="Job_Show_Device_Details_HNWar_InsuranceSupplier">@Model.Job.Device.DeviceBatch.InsuranceSupplier</div>
|
||||
<div>Until: <span id="Job_Show_Device_Details_HNWar_ValidUntil">@Model.Job.Device.DeviceBatch.InsuredUntil.FromNow("Unknown")</span></div>
|
||||
<div>Until: <span id="Job_Show_Device_Details_HNWar_ValidUntil" data-livestamp="@Model.Job.Device.DeviceBatch.InsuredUntil.ToUnixEpoc()">@Model.Job.Device.DeviceBatch.InsuredUntil.ToFullDateTime("Unknown")</span></div>
|
||||
@if (!string.IsNullOrWhiteSpace(Model.Job.Device.DeviceBatch.InsuranceDetails))
|
||||
{
|
||||
<a id="Job_Show_Device_Details_HNWar_Details_Button" href="#">Show Details</a>
|
||||
@@ -370,7 +370,7 @@
|
||||
{
|
||||
<div id="Job_Show_User_WaitingForUserAction" class="status">
|
||||
<h4>Awaiting Action</h4>
|
||||
Since: @Model.Job.WaitingForUserAction.FromNow()
|
||||
Since: <span data-livestamp="@Model.Job.WaitingForUserAction.ToUnixEpoc()">@Model.Job.WaitingForUserAction.ToFullDateTime()</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -840,11 +840,22 @@ WriteLiteral(">\r\n <div>DEVICE WARRANTY</div>\r\
|
||||
|
||||
WriteLiteral(" id=\"Job_Show_Device_Details_HWar_ValidUntil\"");
|
||||
|
||||
WriteLiteral(" data-livestamp=\"");
|
||||
|
||||
|
||||
#line 205 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
Write(Model.Job.Device.DeviceBatch.WarrantyValidUntil.ToUnixEpoc());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 205 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
Write(Model.Job.Device.DeviceBatch.WarrantyValidUntil.FromNow("Unknown"));
|
||||
Write(Model.Job.Device.DeviceBatch.WarrantyValidUntil.ToFullDateTime("Unknown"));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -879,17 +890,17 @@ WriteLiteral(" id=\"Job_Show_Device_Details_HWar_Details_Dialog\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 13905), Tuple.Create("\"", 13970)
|
||||
, Tuple.Create(Tuple.Create("", 13913), Tuple.Create("Warranty", 13913), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 13921), Tuple.Create("Details", 13922), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 13929), Tuple.Create("for", 13930), true)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 13991), Tuple.Create("\"", 14056)
|
||||
, Tuple.Create(Tuple.Create("", 13999), Tuple.Create("Warranty", 13999), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 14007), Tuple.Create("Details", 14008), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 14015), Tuple.Create("for", 14016), true)
|
||||
|
||||
#line 209 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 13933), Tuple.Create<System.Object, System.Int32>(Model.Job.Device.DeviceBatch.Name
|
||||
, Tuple.Create(Tuple.Create(" ", 14019), Tuple.Create<System.Object, System.Int32>(Model.Job.Device.DeviceBatch.Name
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 13934), false)
|
||||
, 14020), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <div>");
|
||||
@@ -964,11 +975,22 @@ WriteLiteral("</div>\r\n <div>Until: <span");
|
||||
|
||||
WriteLiteral(" id=\"Job_Show_Device_Details_HNWar_ValidUntil\"");
|
||||
|
||||
WriteLiteral(" data-livestamp=\"");
|
||||
|
||||
|
||||
#line 235 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
Write(Model.Job.Device.DeviceBatch.InsuredUntil.ToUnixEpoc());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 235 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
Write(Model.Job.Device.DeviceBatch.InsuredUntil.FromNow("Unknown"));
|
||||
Write(Model.Job.Device.DeviceBatch.InsuredUntil.ToFullDateTime("Unknown"));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -1003,17 +1025,17 @@ WriteLiteral(" id=\"Job_Show_Device_Details_HNWar_Details_Dialog\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 16153), Tuple.Create("\"", 16219)
|
||||
, Tuple.Create(Tuple.Create("", 16161), Tuple.Create("Insurance", 16161), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 16170), Tuple.Create("Details", 16171), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 16178), Tuple.Create("for", 16179), true)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 16319), Tuple.Create("\"", 16385)
|
||||
, Tuple.Create(Tuple.Create("", 16327), Tuple.Create("Insurance", 16327), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 16336), Tuple.Create("Details", 16337), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 16344), Tuple.Create("for", 16345), true)
|
||||
|
||||
#line 239 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 16182), Tuple.Create<System.Object, System.Int32>(Model.Job.Device.DeviceBatch.Name
|
||||
, Tuple.Create(Tuple.Create(" ", 16348), Tuple.Create<System.Object, System.Int32>(Model.Job.Device.DeviceBatch.Name
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 16183), false)
|
||||
, 16349), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <div>");
|
||||
@@ -1495,15 +1517,15 @@ WriteLiteral(" title=\"Email Address\"");
|
||||
|
||||
WriteLiteral(">Email: <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 24754), Tuple.Create("\"", 24798)
|
||||
, Tuple.Create(Tuple.Create("", 24761), Tuple.Create("mailto:", 24761), true)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 24920), Tuple.Create("\"", 24964)
|
||||
, Tuple.Create(Tuple.Create("", 24927), Tuple.Create("mailto:", 24927), true)
|
||||
|
||||
#line 367 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 24768), Tuple.Create<System.Object, System.Int32>(Model.Job.User.EmailAddress
|
||||
, Tuple.Create(Tuple.Create("", 24934), Tuple.Create<System.Object, System.Int32>(Model.Job.User.EmailAddress
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 24768), false)
|
||||
, 24934), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
@@ -1542,16 +1564,29 @@ WriteLiteral(" id=\"Job_Show_User_WaitingForUserAction\"");
|
||||
WriteLiteral(" class=\"status\"");
|
||||
|
||||
WriteLiteral(">\r\n <h4>Awaiting Action</h4>\r\n " +
|
||||
" Since: ");
|
||||
" Since: <span");
|
||||
|
||||
WriteLiteral(" data-livestamp=\"");
|
||||
|
||||
|
||||
#line 373 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
Write(Model.Job.WaitingForUserAction.FromNow());
|
||||
Write(Model.Job.WaitingForUserAction.ToUnixEpoc());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 373 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
Write(Model.Job.WaitingForUserAction.ToFullDateTime());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 375 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
@@ -1977,14 +2012,14 @@ WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"JobId\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 35345), Tuple.Create("\"", 35366)
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 35593), Tuple.Create("\"", 35614)
|
||||
|
||||
#line 564 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 35353), Tuple.Create<System.Object, System.Int32>(Model.Job.Id
|
||||
, Tuple.Create(Tuple.Create("", 35601), Tuple.Create<System.Object, System.Int32>(Model.Job.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 35353), false)
|
||||
, 35601), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
@@ -2048,26 +2083,26 @@ WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 35815), Tuple.Create("\"", 35882)
|
||||
, Tuple.Create(Tuple.Create("", 35823), Tuple.Create("fa", 35823), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 35825), Tuple.Create("fa-", 35826), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 36063), Tuple.Create("\"", 36130)
|
||||
, Tuple.Create(Tuple.Create("", 36071), Tuple.Create("fa", 36071), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 36073), Tuple.Create("fa-", 36074), true)
|
||||
|
||||
#line 569 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 35829), Tuple.Create<System.Object, System.Int32>(jobQueue.Icon
|
||||
, Tuple.Create(Tuple.Create("", 36077), Tuple.Create<System.Object, System.Int32>(jobQueue.Icon
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 35829), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 35845), Tuple.Create("fa-fw", 35846), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 35851), Tuple.Create("fa-lg", 35852), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 35857), Tuple.Create("d-", 35858), true)
|
||||
, 36077), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 36093), Tuple.Create("fa-fw", 36094), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 36099), Tuple.Create("fa-lg", 36100), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 36105), Tuple.Create("d-", 36106), true)
|
||||
|
||||
#line 569 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 35860), Tuple.Create<System.Object, System.Int32>(jobQueue.IconColour
|
||||
, Tuple.Create(Tuple.Create("", 36108), Tuple.Create<System.Object, System.Int32>(jobQueue.IconColour
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 35860), false)
|
||||
, 36108), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>");
|
||||
@@ -2108,27 +2143,27 @@ WriteLiteral(" ");
|
||||
#line hidden
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 36196), Tuple.Create("\"", 36244)
|
||||
, Tuple.Create(Tuple.Create("", 36204), Tuple.Create("fa", 36204), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 36206), Tuple.Create("d-priority-", 36207), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 36444), Tuple.Create("\"", 36492)
|
||||
, Tuple.Create(Tuple.Create("", 36452), Tuple.Create("fa", 36452), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 36454), Tuple.Create("d-priority-", 36455), true)
|
||||
|
||||
#line 576 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 36218), Tuple.Create<System.Object, System.Int32>(priorityValue.ToLower()
|
||||
, Tuple.Create(Tuple.Create("", 36466), Tuple.Create<System.Object, System.Int32>(priorityValue.ToLower()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 36218), false)
|
||||
, 36466), false)
|
||||
);
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 36245), Tuple.Create("\"", 36278)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 36493), Tuple.Create("\"", 36526)
|
||||
|
||||
#line 576 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 36253), Tuple.Create<System.Object, System.Int32>(priorityValue
|
||||
, Tuple.Create(Tuple.Create("", 36501), Tuple.Create<System.Object, System.Int32>(priorityValue
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 36253), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 36269), Tuple.Create("Priority", 36270), true)
|
||||
, 36501), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 36517), Tuple.Create("Priority", 36518), true)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n </div>\r\n <div>\r\n " +
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
else
|
||||
{ @ua.Comments }}
|
||||
</span><span class="author">@ua.TechUser.ToString()</span>@if (canRemoveAnyAttachments || (canRemoveOwnAttachments && ua.TechUserId == CurrentUser.Id))
|
||||
{<text><span class="remove fa fa-times-circle"></span></text>}<span class="timestamp" title="@ua.Timestamp.ToFullDateTime()">@ua.Timestamp.FromNow()</span>
|
||||
{<text><span class="remove fa fa-times-circle"></span></text>}<span class="timestamp" data-livestamp="@(ua.Timestamp.ToUnixEpoc())" title="@ua.Timestamp.ToFullDateTime()">@ua.Timestamp.ToFullDateTime()</span>
|
||||
</a>
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@
|
||||
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('.timestamp').text(a.TimestampFull).attr('title', a.TimestampFull).livestamp(a.TimestampUnixEpoc);
|
||||
if (canRemove)
|
||||
e.find('.remove').click(removeAttachment);
|
||||
if (!quick)
|
||||
@@ -196,6 +196,7 @@
|
||||
var $this = $(this);
|
||||
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
|
||||
Shadowbox.removeCache(this);
|
||||
$this.find('.timestamp').livestamp('destroy');
|
||||
$this.remove();
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Disco.Web.Views.User.UserParts
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
@@ -266,21 +267,32 @@ WriteLiteral("<span");
|
||||
|
||||
WriteLiteral(" class=\"timestamp\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 2114), Tuple.Create("\"", 2152)
|
||||
WriteLiteral(" data-livestamp=\"");
|
||||
|
||||
|
||||
#line 35 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2122), Tuple.Create<System.Object, System.Int32>(ua.Timestamp.ToFullDateTime()
|
||||
Write(ua.Timestamp.ToUnixEpoc());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2122), false)
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 2160), Tuple.Create("\"", 2198)
|
||||
|
||||
#line 35 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2168), Tuple.Create<System.Object, System.Int32>(ua.Timestamp.ToFullDateTime()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2168), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 35 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(ua.Timestamp.FromNow());
|
||||
Write(ua.Timestamp.ToFullDateTime());
|
||||
|
||||
|
||||
#line default
|
||||
@@ -580,7 +592,7 @@ WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon img\').
|
||||
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);
|
||||
e.find('.timestamp').text(a.TimestampFull).attr('title', a.TimestampFull).livestamp(a.TimestampUnixEpoc);
|
||||
if (canRemove)
|
||||
e.find('.remove').click(removeAttachment);
|
||||
if (!quick)
|
||||
@@ -651,25 +663,26 @@ WriteLiteral("\',\r\n dataType: \'json\',
|
||||
"= $(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 ");
|
||||
" $this.find(\'.timestamp\').livestamp(\'destroy\');\r" +
|
||||
"\n $this.remove();\r\n " +
|
||||
" });\r\n " +
|
||||
" } else {\r\n alert(\'Unable t" +
|
||||
"o remove attachment: \' + d);\r\n }\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"close\")" +
|
||||
";\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 Cance" +
|
||||
"l: function () {\r\n $dialogRemoveAttachment.di" +
|
||||
"alog(\"close\");\r\n }\r\n }" +
|
||||
");\r\n\r\n $dialogRemoveAttachment.dialog(\'open\');\r\n\r\n " +
|
||||
" return false;\r\n }\r\n\r\n " +
|
||||
" //#endregion\r\n ");
|
||||
|
||||
|
||||
#line 223 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 224 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -689,13 +702,13 @@ WriteLiteral(@"
|
||||
");
|
||||
|
||||
|
||||
#line 235 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 236 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 235 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 236 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (canAddAttachments)
|
||||
{
|
||||
|
||||
@@ -715,7 +728,7 @@ WriteLiteral(" id=\"silverlightHostUploadAttachment\"");
|
||||
WriteLiteral(">\r\n </div>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 241 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 242 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -724,7 +737,7 @@ WriteLiteral(">\r\n </div>\r\n </div>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 242 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 243 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
|
||||
{
|
||||
|
||||
@@ -744,7 +757,7 @@ WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");
|
||||
WriteLiteral("></i> Are you sure?\r\n </p>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 249 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 250 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -754,7 +767,7 @@ WriteLiteral(" <script>\r\n $(\'#UserDetailTabItems\').append(\'<li><a
|
||||
"b-Resources\" id=\"UserDetailTab-ResourcesLink\">Attachments [");
|
||||
|
||||
|
||||
#line 251 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
#line 252 "..\..\Views\User\UserParts\_Resources.cshtml"
|
||||
Write(Model.User.UserAttachments == null ? 0 : Model.User.UserAttachments.Count);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user