Files
Disco/Disco.Web/Areas/API/Models/Job/_CommentModel.cs
T
Gary Sharp 4c3a68da30 Feature #26: User Flags
Flags can be associated with Users. Includes minor updates to Job Queues
and improved visibility of user information.
2014-06-10 17:16:24 +10:00

37 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Disco.BI;
using Disco.BI.Extensions;
namespace Disco.Web.Areas.API.Models.Job
{
public class _CommentModel
{
public int Id { get; set; }
public int JobId { get; set; }
public string AuthorId { get; set; }
public string Author { get; set; }
public DateTime Timestamp { get; set; }
public string Comments { get; set; }
public string HtmlComments { get; set; }
public long TimestampUnixEpoc { get { return this.Timestamp.ToUnixEpoc(); } }
public string TimestampFull { get { return Timestamp.ToFullDateTime(); } }
public static _CommentModel FromJobLog(Disco.Models.Repository.JobLog jl)
{
return new _CommentModel
{
Id = jl.Id,
JobId = jl.JobId,
AuthorId = jl.TechUserId,
Author = jl.TechUser.ToString(),
Timestamp = jl.Timestamp,
Comments = jl.Comments,
HtmlComments = jl.Comments.ToHtmlComment().ToString()
};
}
}
}