Update email and formating.
This commit is contained in:
@@ -106,6 +106,8 @@ namespace LeafWeb.Core.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime LastStatusChange => StatusHistory.Last().DateTime;
|
||||
|
||||
public TimeSpan TimeInProgress
|
||||
{
|
||||
get
|
||||
|
||||
@@ -1 +1 @@
|
||||
C:\Users\poprhythm\AppData\Local\Temp\Temporary ASP.NET Files\vs\f80e29bb\faae20bf\App_Web_all.generated.cs.8f9494c4.re2ngwmg.dll
|
||||
C:\Users\poprhythm\AppData\Local\Temp\Temporary ASP.NET Files\vs\f80e29bb\faae20bf\App_Web_all.generated.cs.8f9494c4.ieyf0avo.dll
|
||||
@@ -11,7 +11,7 @@
|
||||
<loggerToMatch value="LeafWeb" />
|
||||
<acceptOnMatch value="false" />
|
||||
</filter>
|
||||
<file type="log4net.Util.PatternString" value="App_Data\Logs\UmbracoTraceLog.%property{log4net:HostName}.txt" />
|
||||
<file type="log4net.Util.PatternString" value="App_Data\Logs\UmbracoTraceLog.txt" />
|
||||
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
|
||||
<appendToFile value="true" />
|
||||
<rollingStyle value="Date" />
|
||||
@@ -27,7 +27,7 @@
|
||||
<loggerToMatch value="LeafWeb" />
|
||||
</filter>
|
||||
<filter type="log4net.Filter.DenyAllFilter" />
|
||||
<file type="log4net.Util.PatternString" value="App_Data\Logs\LeafWeb.%property{log4net:HostName}.txt" />
|
||||
<file type="log4net.Util.PatternString" value="App_Data\Logs\LeafWeb.txt" />
|
||||
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
|
||||
<appendToFile value="true" />
|
||||
<rollingStyle value="Date" />
|
||||
|
||||
@@ -200,3 +200,10 @@ form .validation-summary-errors ul {
|
||||
code, pre {
|
||||
line-height: 1; }
|
||||
|
||||
.alert {
|
||||
position: absolute;
|
||||
left: 30%;
|
||||
top: 10em;
|
||||
width: 40%;
|
||||
z-index: 1; }
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
body.debug header .brand{position:relative;}body.debug header .brand:before{content:"";font-family:FontAwesome;font-style:normal;font-weight:normal;text-decoration:inherit;color:#f00;font-size:60px;padding-right:.5em;position:absolute;top:10px;left:0;}h1{padding:24px 0 12px 0;}p{padding:12px 0;}footer{margin-top:24px !important;}.row-no-padding [class*="col-"]{padding-left:0 !important;padding-right:0 !important;}.home .dark .row:first-child .column:first-child h1{padding-top:0;}.home .blogarchive{padding-top:20px;}.top-buffer{margin-top:20px;}.detail-actions>a,.detail-actions>form>button{margin-top:20px;float:left;clear:left;}.banner-link{white-space:normal;padding:20px;background:#000;background:rgba(0,0,0,.5);-moz-border-radius:10px;border-radius:10px;}.banner-link .glyphicon{color:#8cc641;}a.banner-link:hover{text-decoration:none;background:rgba(0,0,0,.6);}a.banner-link:hover .glyphicon{color:#a8ed4f;}.headline-icon h1:after{color:rgba(172,214,118,.8);font-family:"Glyphicons Halflings";font-size:.8em;padding-left:10px;}.headline-icon.headline-icon-file h1:after{content:"";}.headline-icon.headline-icon-leaf h1:after{content:"";}.headline-icon.headline-icon-question h1:after{content:"";}.headline-icon.headline-icon-stats h1:after{content:"";}.headline-icon.headline-icon-user h1:after{content:"";}.headline-icon.headline-icon-list h1:after{content:"";}.status{white-space:nowrap;}.status:after{font-family:"Glyphicons Halflings";font-size:.8em;padding-left:5px;}.status.status-pending{color:#f0ad4e;}.status.status-pending:after{content:"";}.status.status-complete{color:#337ab7;}.status.status-complete:after{content:"";}.status.status-exception{color:#a94442;}.status.status-exception:after{content:"";}.status.status-running,.status.status-starting,.status.status-finishing{color:#3c763d;}.status.status-running:after{content:"";}.status.status-starting:after{content:"";}.status.status-finishing:after{content:"";}.status.status-cancelpending,.status.status-cancelling{color:#f0ad4e;}.status.status-cancelled{color:#ec971f;}.status.status-cancelpending:after{content:"";}.status.status-cancelling:after{content:"";}.status.status-cancelled:after{content:"";}#chart{padding-top:20px;}.btn-file{position:relative;overflow:hidden;}.btn-file input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:100px;text-align:right;filter:alpha(opacity=0);opacity:0;outline:none;background:#fff;cursor:inherit;display:block;}form .validation-summary-errors ul{list-style-type:none;}.autocomplete-suggestions{border:1px solid #999;background:#fff;overflow:auto;}.autocomplete-suggestion{padding:2px 5px;white-space:nowrap;overflow:hidden;}.autocomplete-selected{background:#f0f0f0;}.autocomplete-suggestions strong{font-weight:normal;color:#39f;}.autocomplete-group{padding:2px 5px;}.autocomplete-group strong{display:block;border-bottom:1px solid #000;}.toggle{width:15px;}.dropdown-menu li form .btn-link{display:block;color:#333;clear:both;float:left;font-size:1rem;font-weight:normal;line-height:1.42857;min-width:160px;padding:3px 20px;text-align:left;white-space:nowrap;}.dropdown-menu li form .btn-link:focus,.dropdown-menu li form .btn-link:hover{text-decoration:none;color:#262626;background-color:#f5f5f5;}.divider-right{border-right:1px dashed #333;}.read{overflow:hidden;font-size:16px !important;transition:all .3s;margin-bottom:10px;}.read-less{height:90px !important;}code,pre{line-height:1;}
|
||||
body.debug header .brand{position:relative;}body.debug header .brand:before{content:"";font-family:FontAwesome;font-style:normal;font-weight:normal;text-decoration:inherit;color:#f00;font-size:60px;padding-right:.5em;position:absolute;top:10px;left:0;}h1{padding:24px 0 12px 0;}p{padding:12px 0;}footer{margin-top:24px !important;}.row-no-padding [class*="col-"]{padding-left:0 !important;padding-right:0 !important;}.home .dark .row:first-child .column:first-child h1{padding-top:0;}.home .blogarchive{padding-top:20px;}.top-buffer{margin-top:20px;}.detail-actions>a,.detail-actions>form>button{margin-top:20px;float:left;clear:left;}.banner-link{white-space:normal;padding:20px;background:#000;background:rgba(0,0,0,.5);-moz-border-radius:10px;border-radius:10px;}.banner-link .glyphicon{color:#8cc641;}a.banner-link:hover{text-decoration:none;background:rgba(0,0,0,.6);}a.banner-link:hover .glyphicon{color:#a8ed4f;}.headline-icon h1:after{color:rgba(172,214,118,.8);font-family:"Glyphicons Halflings";font-size:.8em;padding-left:10px;}.headline-icon.headline-icon-file h1:after{content:"";}.headline-icon.headline-icon-leaf h1:after{content:"";}.headline-icon.headline-icon-question h1:after{content:"";}.headline-icon.headline-icon-stats h1:after{content:"";}.headline-icon.headline-icon-user h1:after{content:"";}.headline-icon.headline-icon-list h1:after{content:"";}.status{white-space:nowrap;}.status:after{font-family:"Glyphicons Halflings";font-size:.8em;padding-left:5px;}.status.status-pending{color:#f0ad4e;}.status.status-pending:after{content:"";}.status.status-complete{color:#337ab7;}.status.status-complete:after{content:"";}.status.status-exception{color:#a94442;}.status.status-exception:after{content:"";}.status.status-running,.status.status-starting,.status.status-finishing{color:#3c763d;}.status.status-running:after{content:"";}.status.status-starting:after{content:"";}.status.status-finishing:after{content:"";}.status.status-cancelpending,.status.status-cancelling{color:#f0ad4e;}.status.status-cancelled{color:#ec971f;}.status.status-cancelpending:after{content:"";}.status.status-cancelling:after{content:"";}.status.status-cancelled:after{content:"";}#chart{padding-top:20px;}.btn-file{position:relative;overflow:hidden;}.btn-file input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:100px;text-align:right;filter:alpha(opacity=0);opacity:0;outline:none;background:#fff;cursor:inherit;display:block;}form .validation-summary-errors ul{list-style-type:none;}.autocomplete-suggestions{border:1px solid #999;background:#fff;overflow:auto;}.autocomplete-suggestion{padding:2px 5px;white-space:nowrap;overflow:hidden;}.autocomplete-selected{background:#f0f0f0;}.autocomplete-suggestions strong{font-weight:normal;color:#39f;}.autocomplete-group{padding:2px 5px;}.autocomplete-group strong{display:block;border-bottom:1px solid #000;}.toggle{width:15px;}.dropdown-menu li form .btn-link{display:block;color:#333;clear:both;float:left;font-size:1rem;font-weight:normal;line-height:1.42857;min-width:160px;padding:3px 20px;text-align:left;white-space:nowrap;}.dropdown-menu li form .btn-link:focus,.dropdown-menu li form .btn-link:hover{text-decoration:none;color:#262626;background-color:#f5f5f5;}.divider-right{border-right:1px dashed #333;}.read{overflow:hidden;font-size:16px !important;transition:all .3s;margin-bottom:10px;}.read-less{height:90px !important;}code,pre{line-height:1;}.alert{position:absolute;left:30%;top:10em;width:40%;z-index:1;}
|
||||
@@ -252,4 +252,12 @@ form .validation-summary-errors ul {
|
||||
|
||||
code,pre {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.alert {
|
||||
position: absolute;
|
||||
left: 30%;
|
||||
top: 10em;
|
||||
width: 40%;
|
||||
z-index:1;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.Web.Mvc;
|
||||
using log4net;
|
||||
using LeafWeb.WebCms.Models;
|
||||
using LeafWeb.WebCms.Services;
|
||||
|
||||
namespace LeafWeb.WebCms.Controllers
|
||||
{
|
||||
public class ContactController : BaseController
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
var viewModel = new ContactForm();
|
||||
return PartialView(viewModel);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Submit(ContactForm viewModel)
|
||||
{
|
||||
if (ModelState.IsValid) // HttpParamMatch indicates it's backing out from Confirm
|
||||
{
|
||||
// convert viewModel into Model
|
||||
new EmailNotificationService().SendContactEmail(viewModel);
|
||||
|
||||
var logger = LogManager.GetLogger(GetType());
|
||||
logger.Info($"Contact: Name:{viewModel.Name} Added, Email:{viewModel.Email}, Message:{viewModel.Message}");
|
||||
|
||||
SetStatusMessage("Your message has been sent!", StatusType.Success);
|
||||
return RedirectToCurrentUmbracoPage();
|
||||
}
|
||||
|
||||
return CurrentUmbracoPage();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Caching;
|
||||
using System.Web.Mvc;
|
||||
using Hangfire;
|
||||
using LeafWeb.Core.Entities;
|
||||
@@ -15,6 +17,8 @@ namespace LeafWeb.WebCms.Controllers
|
||||
[MemberAuthorize]
|
||||
public class QueueController : BaseController
|
||||
{
|
||||
private const int TimeSamples = 40;
|
||||
|
||||
public ActionResult Index(string query)
|
||||
{
|
||||
var resultItems =
|
||||
@@ -34,9 +38,7 @@ namespace LeafWeb.WebCms.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
// completed leaf input for computing runtime statistics
|
||||
var completedLeafInput = DataService.GetLeafInputRecentlyCompleted(100);
|
||||
var timeInProgressEstimater = new TimeInProgressEstimater(completedLeafInput);
|
||||
var timeInProgressEstimater = TimeInProgressEstimater();
|
||||
|
||||
var serviceDescription = ServiceDescription();
|
||||
|
||||
@@ -49,10 +51,24 @@ namespace LeafWeb.WebCms.Controllers
|
||||
return View(queueViewModel);
|
||||
}
|
||||
|
||||
private TimeInProgressEstimater TimeInProgressEstimater()
|
||||
{
|
||||
var estimater = HttpRuntime.Cache["TimeInProgressEstimater"];
|
||||
if (estimater == null)
|
||||
{
|
||||
// completed leaf input for computing runtime statistics
|
||||
var completedLeafInput = DataService.GetLeafInputRecentlyCompleted(TimeSamples);
|
||||
estimater = new TimeInProgressEstimater(completedLeafInput);
|
||||
HttpRuntime.Cache.Insert("TimeInProgressEstimater", estimater, null, DateTime.Now.AddHours(12), Cache.NoSlidingExpiration);
|
||||
}
|
||||
|
||||
return (TimeInProgressEstimater)estimater;
|
||||
}
|
||||
|
||||
public ActionResult LeafInputStatistics()
|
||||
{
|
||||
var data =
|
||||
from li in DataService.GetLeafInputRecentlyCompleted(100)
|
||||
from li in DataService.GetLeafInputRecentlyCompleted(TimeSamples)
|
||||
select $"{li.InputFiles.Count}, {li.TimeInProgress.TotalSeconds}";
|
||||
return Content(string.Join("<br />", data));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace LeafWeb.WebCms.Models
|
||||
{
|
||||
public class ContactForm
|
||||
{
|
||||
[Display(Name = "Name")]
|
||||
[Required(ErrorMessage = "Name required")]
|
||||
[RegularExpression(@"[A-Za-z().]+(\s+[A-Za-z().]+)+", ErrorMessage = "Please provide full name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Display(Name = "Email address")]
|
||||
[Required(ErrorMessage = "An email address is required")]
|
||||
[DataType(DataType.EmailAddress)]
|
||||
[RegularExpression(@"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}", ErrorMessage = "Must be an email address")]
|
||||
public string Email { get; set; }
|
||||
|
||||
[UIHint("Multiline")]
|
||||
[Required(ErrorMessage = "A message is required")]
|
||||
[MinLength(32, ErrorMessage = "Minimum of 32 characters")]
|
||||
[MaxLength(1024, ErrorMessage = "Maximum of 1024 characters")]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ using log4net;
|
||||
using LeafWeb.Core.DAL;
|
||||
using LeafWeb.Core.Entities;
|
||||
using LeafWeb.Core.Utility;
|
||||
using LeafWeb.WebCms.Models;
|
||||
|
||||
namespace LeafWeb.WebCms.Services
|
||||
{
|
||||
@@ -17,13 +18,14 @@ namespace LeafWeb.WebCms.Services
|
||||
|
||||
private readonly string _emailFromAddress;
|
||||
|
||||
private const string EmailSuccessSubject = "LeafWeb results";
|
||||
private const string EmailErrorSubject = "LeafWeb processing error";
|
||||
private const string EmailSystemErrorSubject = "LeafWeb system error";
|
||||
private const string EmailCancelledSubject = "LeafWeb cancelled";
|
||||
private const string SuccessSubject = "LeafWeb results";
|
||||
private const string ErrorSubject = "LeafWeb processing error";
|
||||
private const string SystemErrorSubject = "LeafWeb system error";
|
||||
private const string CancelledSubject = "LeafWeb cancelled";
|
||||
private const string ContactSubject = "LeafWeb Contact Message";
|
||||
|
||||
/// <summary>
|
||||
/// Comma separated values
|
||||
/// Semicolon separated values
|
||||
/// </summary>
|
||||
private readonly string _adminEmailAddresses;
|
||||
|
||||
@@ -93,7 +95,7 @@ namespace LeafWeb.WebCms.Services
|
||||
var body = $"Your leaf analysis job, {leafInput.Identifier}, has been cancelled. " +
|
||||
"Contact the administrator with any questions.";
|
||||
|
||||
var message = new MailMessage(_emailFromAddress, leafInput.Email, FormatSubject(EmailCancelledSubject, leafInput), body);
|
||||
var message = new MailMessage(_emailFromAddress, leafInput.Email, FormatSubject(CancelledSubject, leafInput), body);
|
||||
SendMessage(message);
|
||||
}
|
||||
|
||||
@@ -120,14 +122,14 @@ namespace LeafWeb.WebCms.Services
|
||||
+ Environment.NewLine + Environment.NewLine
|
||||
+ downloadUrl;
|
||||
|
||||
var message = new MailMessage(_emailFromAddress, leafInput.Email, FormatSubject(EmailSuccessSubject, leafInput), body);
|
||||
var message = new MailMessage(_emailFromAddress, leafInput.Email, FormatSubject(SuccessSubject, leafInput), body);
|
||||
SendMessage(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
body += "Please see the attached results.";
|
||||
|
||||
var message = new MailMessage(_emailFromAddress, leafInput.Email, EmailSuccessSubject, body);
|
||||
var message = new MailMessage(_emailFromAddress, leafInput.Email, SuccessSubject, body);
|
||||
|
||||
var fileStreams =
|
||||
(from outputFile in
|
||||
@@ -164,7 +166,7 @@ namespace LeafWeb.WebCms.Services
|
||||
|
||||
body += FormatWarningMessage(leafInput);
|
||||
|
||||
var message = new MailMessage(_emailFromAddress, leafInput.Email, FormatSubject(EmailErrorSubject, leafInput), body);
|
||||
var message = new MailMessage(_emailFromAddress, leafInput.Email, FormatSubject(ErrorSubject, leafInput), body);
|
||||
SendMessage(message);
|
||||
}
|
||||
|
||||
@@ -174,7 +176,25 @@ namespace LeafWeb.WebCms.Services
|
||||
+ "System administrators have been notified. You will be notified again when the system error "
|
||||
+ "has been resolved and your data has been processed.";
|
||||
|
||||
var message = new MailMessage(_emailFromAddress, leafInputEmail, EmailSystemErrorSubject, body);
|
||||
var message = new MailMessage(_emailFromAddress, leafInputEmail, SystemErrorSubject, body);
|
||||
SendMessage(message);
|
||||
}
|
||||
|
||||
public void SendContactEmail(ContactForm contact)
|
||||
{
|
||||
var body =
|
||||
$"via LeafWeb, ${contact.Name} sent the following message from the Contact form." +
|
||||
Environment.NewLine + Environment.NewLine +
|
||||
"Message" +
|
||||
Environment.NewLine + Environment.NewLine +
|
||||
"--------" +
|
||||
Environment.NewLine +
|
||||
contact.Message;
|
||||
|
||||
var message = new MailMessage(_emailFromAddress, _adminEmailAddresses, ContactSubject, body)
|
||||
{
|
||||
From = new MailAddress(contact.Email, contact.Name)
|
||||
};
|
||||
SendMessage(message);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
@using ClientDependency.Core.Mvc
|
||||
@using LeafWeb.WebCms.Controllers
|
||||
@model ContactForm
|
||||
@{
|
||||
Html.RequiresJs("~/scripts/jquery.validate.min.js", 2);
|
||||
Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.min.js", 2);
|
||||
Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.bootstrap.min.js", 2);
|
||||
Html.RequiresJs("~/scripts/jquery.validate.custom.js", 2);
|
||||
}
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-push-2 well">
|
||||
@Html.Partial("_ValidationSummary")
|
||||
|
||||
@using (Html.BeginUmbracoForm<ContactController>("Submit"))
|
||||
{
|
||||
@Html.EditorFor(m => m.Name)
|
||||
@Html.EditorFor(m => m.Email)
|
||||
@Html.EditorFor(m => m.Message)
|
||||
<input type="submit" id="submit-form" class="hidden"/>}
|
||||
<label for="submit-form" class="btn btn-primary pull-right">Send</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,4 @@
|
||||
@inherits Umbraco.Web.Macros.PartialViewMacroPage
|
||||
@{
|
||||
Html.RenderAction("Index", "Contact");
|
||||
}
|
||||
@@ -33,15 +33,6 @@
|
||||
</button>
|
||||
}
|
||||
|
||||
|
||||
@*@using (Html.BeginUmbracoForm<QueueController>(
|
||||
"SendUserChartLink", null, new { @class = "confirm", confirm_msg = "Confirm sending email to user" }))
|
||||
{
|
||||
<input type="hidden" name="id" value="@Model.LeafInputId" />
|
||||
<button type="submit" class="btn btn-default" @{if (!Model.HasLeafChart) { <text> disabled="disabled" </text> }}>
|
||||
<span class="glyphicon glyphicon-send"></span> Email User Chart link
|
||||
</button>
|
||||
}*@
|
||||
@DeleteLink(Model.LeafInputId, Model.Identifier, Model.IsDeletable)
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
@@ -49,7 +40,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@helper DeleteLink(int id, string identifier, bool deletable)
|
||||
{
|
||||
using (Html.BeginUmbracoForm<QueueController>(
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
grid.Column("Identifier", "Identifier"),
|
||||
grid.Column("SiteId", "Site Id"),
|
||||
grid.Column("Name", "Submitted By"),
|
||||
grid.Column("TimeInProgress", "Statistics", item => TimeInProgress(item.Value)),
|
||||
grid.Column("TimeInProgress", "Statistics", item => Statistics(item.Value)),
|
||||
grid.Column("CurrentStatus", "Status", item => Status(item.Value)),
|
||||
grid.Column("Total Results: " + Model.Items.Count(), format: item => Btns(item.Value))),
|
||||
htmlAttributes: new {@class = "table table-striped table-bordered table-hover table-condensed"}
|
||||
@@ -48,28 +48,28 @@ else
|
||||
|
||||
@helper Status(LeafInput leafInput)
|
||||
{
|
||||
if (leafInput.IsPending)
|
||||
{
|
||||
<span class="text-nowrap">
|
||||
<span class="text-muted" title="@leafInput.PendingPriority.ToString() Priority">
|
||||
@Html.Partial("DisplayTemplates/PriorityIcon", leafInput.PendingPriority)
|
||||
if (leafInput.IsPending)
|
||||
{
|
||||
<span class="text-nowrap">
|
||||
<span class="text-muted" title="@leafInput.PendingPriority.ToString() Priority">
|
||||
@Html.Partial("DisplayTemplates/PriorityIcon", leafInput.PendingPriority)
|
||||
</span>
|
||||
@Html.Partial("DisplayTemplates/_LeafInputStatus", leafInput.CurrentStatus.ToString())
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-nowrap">
|
||||
@Html.Partial("DisplayTemplates/_LeafInputStatus", leafInput.CurrentStatus.ToString())
|
||||
@if (leafInput.OutputErrorMessage != null)
|
||||
{
|
||||
<i class="fa fa-warning text-danger" title="Generated Error Message"></i>
|
||||
} else if (leafInput.OutputWarningMessage != null)
|
||||
{
|
||||
<i class="fa fa-warning text-info" title="Generated Warning Message"></i>
|
||||
}
|
||||
</span>
|
||||
@Html.Partial("DisplayTemplates/_LeafInputStatus", leafInput.CurrentStatus.ToString())
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-nowrap">
|
||||
@Html.Partial("DisplayTemplates/_LeafInputStatus", leafInput.CurrentStatus.ToString())
|
||||
@if (leafInput.OutputErrorMessage != null)
|
||||
{
|
||||
<i class="fa fa-warning text-danger"></i>
|
||||
} else if (leafInput.OutputWarningMessage != null)
|
||||
{
|
||||
<i class="fa fa-warning text-info"></i>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
}
|
||||
|
||||
@helper Btns(LeafInput item)
|
||||
@@ -129,41 +129,41 @@ else
|
||||
<span class="glyphicon glyphicon-download"></span> ToUser
|
||||
</a>
|
||||
}
|
||||
@helper TimeInProgress(LeafInput leafInput)
|
||||
@helper Statistics(LeafInput leafInput)
|
||||
{
|
||||
var summary = new List<string> { "Added Time: " + leafInput.Added };
|
||||
if (leafInput.StartTime.HasValue)
|
||||
{
|
||||
summary.Add("Start Time: " + leafInput.StartTime.Value);
|
||||
}
|
||||
if (leafInput.EndTime.HasValue)
|
||||
{
|
||||
summary.Add("End Time: " + leafInput.EndTime.Value);
|
||||
}
|
||||
var summaryText = string.Join(Environment.NewLine, summary);
|
||||
<span class="text-nowrap" title="@summaryText">
|
||||
<i class="fa fa-file-o"></i> @leafInput.InputFiles.Count @if(leafInput.InputFiles.Count > 1) {<text>LeafInputs</text>} else { <text>LeafInput</text>}
|
||||
<br />
|
||||
@if (leafInput.TimeInProgress > TimeSpan.Zero)
|
||||
var summary = new List<string> { "Added Time: " + leafInput.Added };
|
||||
if (leafInput.StartTime.HasValue)
|
||||
{
|
||||
<text>
|
||||
<i class="fa fa-clock-o"></i> @leafInput.TimeInProgress.ToRoundedReadableString()
|
||||
</text>
|
||||
summary.Add("Start Time: " + leafInput.StartTime.Value);
|
||||
}
|
||||
else if (leafInput.IsPending)
|
||||
if (leafInput.EndTime.HasValue)
|
||||
{
|
||||
<text>
|
||||
<i class="fa fa-hourglass-start"></i> @Html.Partial("DisplayTemplates/_TimeRemaining", Tuple.Create(leafInput, Model.TimeInProgressEstimater)) est.
|
||||
</text>
|
||||
summary.Add("End Time: " + leafInput.EndTime.Value);
|
||||
}
|
||||
@if (leafInput.IsRunning)
|
||||
{
|
||||
<text>
|
||||
var summaryText = string.Join(Environment.NewLine, summary);
|
||||
<span class="text-nowrap" title="@summaryText">
|
||||
<i class="fa fa-file-o"></i> @leafInput.InputFiles.Count @if(leafInput.InputFiles.Count > 1) {<text>LeafInputs</text>} else { <text>LeafInput</text>}
|
||||
<br />
|
||||
<i class="fa fa-hourglass-half"></i> @Html.Partial("DisplayTemplates/_TimeRemaining", Tuple.Create(leafInput, Model.TimeInProgressEstimater)) left
|
||||
</text>
|
||||
}
|
||||
</span>
|
||||
@if (leafInput.TimeInProgress > TimeSpan.Zero)
|
||||
{
|
||||
<text>
|
||||
<i class="fa fa-clock-o"></i> @leafInput.TimeInProgress.ToRoundedReadableString()
|
||||
</text>
|
||||
}
|
||||
else if (leafInput.IsPending)
|
||||
{
|
||||
<text>
|
||||
<i class="fa fa-hourglass-start"></i> @Html.Partial("DisplayTemplates/_TimeRemaining", Tuple.Create(leafInput, Model.TimeInProgressEstimater)) est.
|
||||
</text>
|
||||
}
|
||||
@if (leafInput.IsRunning)
|
||||
{
|
||||
<text>
|
||||
<br />
|
||||
<i class="fa fa-hourglass-half"></i> @Html.Partial("DisplayTemplates/_TimeRemaining", Tuple.Create(leafInput, Model.TimeInProgressEstimater)) left
|
||||
</text>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
@helper DeleteLink(LeafInput item)
|
||||
{
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
@if (TempData.ContainsKey("StatusMessage"))
|
||||
{
|
||||
<p class="center-content alert @Html.Raw(TempData["StatusMessage-Type"])">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<p class="alert @Html.Raw(TempData["StatusMessage-Type"])">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
@Html.Raw(TempData["StatusMessage"])
|
||||
</p>
|
||||
}
|
||||
else if (ViewBag.StatusMessage != null)
|
||||
{
|
||||
<p class="center-content alert">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<p class="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
@ViewBag.StatusMessage
|
||||
</p>
|
||||
}
|
||||
@@ -894,6 +894,8 @@
|
||||
<Content Include="Views\Shared\DisplayTemplates\PriorityIcon.cshtml" />
|
||||
<Content Include="Views\Shared\DisplayTemplates\_TimeRemaining.cshtml" />
|
||||
<Content Include="Views\Shared\DisplayTemplates\PreReadMore.cshtml" />
|
||||
<Content Include="Views\Contact\Index.cshtml" />
|
||||
<Content Include="Views\MacroPartials\Contact.cshtml" />
|
||||
<None Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</None>
|
||||
@@ -923,11 +925,13 @@
|
||||
<Compile Include="Controllers\BaseController.cs" />
|
||||
<Compile Include="Controllers\ChartController.cs" />
|
||||
<Compile Include="Controllers\FluxnetSiteController.cs" />
|
||||
<Compile Include="Controllers\ContactController.cs" />
|
||||
<Compile Include="Controllers\LeafInputController.cs" />
|
||||
<Compile Include="Controllers\LeafWebPageIds.cs" />
|
||||
<Compile Include="Controllers\QueueController.cs" />
|
||||
<Compile Include="Controllers\ResultsController.cs" />
|
||||
<Compile Include="Models\ChartViewModel.cs" />
|
||||
<Compile Include="Models\ContactForm.cs" />
|
||||
<Compile Include="Models\LeafInputDetails.cs" />
|
||||
<Compile Include="Models\LeafInputCreate.cs" />
|
||||
<Compile Include="Models\LeafInputStatusViewModel.cs" />
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
var identifier = $(form).find("input[name='Identifier']").val();
|
||||
$("<div id='confirmCreate'>" + "Please confirm submitting '" + identifier + "'</div>")
|
||||
.dialog({
|
||||
text: "Confirm",
|
||||
buttons: {
|
||||
"Confirm": function () {
|
||||
$("#confirmCreate")
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
text = confirmMsg;
|
||||
}
|
||||
$("<div>" + text + "</div>")
|
||||
.dialog({
|
||||
.dialog({
|
||||
title: "Confirm",
|
||||
buttons: {
|
||||
"Confirm": function () {
|
||||
form.submit();
|
||||
|
||||
Reference in New Issue
Block a user