Job Expressions
Expressions can be triggered when jobs are created and closed
This commit is contained in:
@@ -1684,7 +1684,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
if (j.CanCloseForced())
|
||||
{
|
||||
j.OnCloseForced(Database, CurrentUser, Reason);
|
||||
j.OnCloseForced(Database, Database.Users.Find(CurrentUser.UserId), Reason);
|
||||
|
||||
Database.SaveChanges();
|
||||
if (redirect.HasValue && redirect.Value)
|
||||
@@ -1709,7 +1709,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
if (j.CanCloseNormally())
|
||||
{
|
||||
j.OnCloseNormally(CurrentUser);
|
||||
j.OnCloseNormally(Database, Database.Users.Find(CurrentUser.UserId));
|
||||
|
||||
Database.SaveChanges();
|
||||
if (redirect)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Disco.Models.Services.Job;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Jobs;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -117,5 +118,53 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
else
|
||||
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.JobPreferences.Configure)]
|
||||
public virtual ActionResult UpdateOnCreateExpression(string OnCreateExpression, bool redirect = false)
|
||||
{
|
||||
string expression = null;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(OnCreateExpression))
|
||||
{
|
||||
expression = OnCreateExpression.Trim();
|
||||
}
|
||||
|
||||
if (Database.DiscoConfiguration.JobPreferences.OnCreateExpression != expression)
|
||||
{
|
||||
Database.DiscoConfiguration.JobPreferences.OnCreateExpression = expression;
|
||||
Database.SaveChanges();
|
||||
|
||||
Jobs.OnCreateExpressionInvalidateCache();
|
||||
}
|
||||
|
||||
if (redirect)
|
||||
return RedirectToAction(MVC.Config.JobPreferences.Index());
|
||||
else
|
||||
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.JobPreferences.Configure)]
|
||||
public virtual ActionResult UpdateOnCloseExpression(string OnCloseExpression, bool redirect = false)
|
||||
{
|
||||
string expression = null;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(OnCloseExpression))
|
||||
{
|
||||
expression = OnCloseExpression.Trim();
|
||||
}
|
||||
|
||||
if (Database.DiscoConfiguration.JobPreferences.OnCloseExpression != expression)
|
||||
{
|
||||
Database.DiscoConfiguration.JobPreferences.OnCloseExpression = expression;
|
||||
Database.SaveChanges();
|
||||
|
||||
Jobs.OnCloseExpressionInvalidateCache();
|
||||
}
|
||||
|
||||
if (redirect)
|
||||
return RedirectToAction(MVC.Config.JobPreferences.Index());
|
||||
else
|
||||
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -219,7 +219,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
if (CloseJob.HasValue && CloseJob.Value && job.CanCloseNormally())
|
||||
{
|
||||
job.OnCloseNormally(CurrentUser);
|
||||
job.OnCloseNormally(Database, Database.Users.Find(CurrentUser.UserId));
|
||||
Database.SaveChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Plugins.Features.UIExtension;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
@@ -21,7 +17,9 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
StaleJobMinutesThreshold = Database.DiscoConfiguration.JobPreferences.StaleJobMinutesThreshold,
|
||||
DefaultNoticeboardTheme = Database.DiscoConfiguration.JobPreferences.DefaultNoticeboardTheme,
|
||||
LocationMode = Database.DiscoConfiguration.JobPreferences.LocationMode,
|
||||
LocationList = Database.DiscoConfiguration.JobPreferences.LocationList
|
||||
LocationList = Database.DiscoConfiguration.JobPreferences.LocationList,
|
||||
OnCreateExpression = Database.DiscoConfiguration.JobPreferences.OnCreateExpression,
|
||||
OnCloseExpression = Database.DiscoConfiguration.JobPreferences.OnCloseExpression
|
||||
};
|
||||
|
||||
// UI Extensions
|
||||
|
||||
@@ -17,6 +17,11 @@ namespace Disco.Web.Areas.Config.Models.JobPreferences
|
||||
public LocationModes LocationMode { get; set; }
|
||||
public List<string> LocationList { get; set; }
|
||||
|
||||
[DataType(DataType.MultilineText)]
|
||||
public string OnCreateExpression { get; set; }
|
||||
[DataType(DataType.MultilineText)]
|
||||
public string OnCloseExpression { get; set; }
|
||||
|
||||
public List<KeyValuePair<string, string>> DefaultNoticeboardThemeOptions()
|
||||
{
|
||||
return UIHelpers.NoticeboardThemes.ToList();
|
||||
|
||||
@@ -14,4 +14,5 @@
|
||||
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.General);
|
||||
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Reports);
|
||||
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Locations);
|
||||
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Expressions);
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34014
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -27,7 +27,6 @@ namespace Disco.Web.Areas.Config.Views.JobPreferences
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
@@ -61,6 +60,7 @@ namespace Disco.Web.Areas.Config.Views.JobPreferences
|
||||
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.General);
|
||||
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Reports);
|
||||
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Locations);
|
||||
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Expressions);
|
||||
|
||||
|
||||
#line default
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
@model Disco.Web.Areas.Config.Models.JobPreferences.IndexModel
|
||||
@{
|
||||
Authorization.Require(Claims.Config.JobPreferences.Show);
|
||||
|
||||
var canConfig = Authorization.Has(Claims.Config.JobPreferences.Configure);
|
||||
}
|
||||
<div id="Config_JobPref_Expressions" class="form" style="width: 530px;">
|
||||
<h2>Expressions</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 200px">On Create:</th>
|
||||
<td>
|
||||
@if (canConfig)
|
||||
{
|
||||
@Html.EditorFor(model => model.OnCreateExpression)
|
||||
@AjaxHelpers.AjaxRemove()
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var field = $('#OnCreateExpression');
|
||||
var fieldRemove = field.next('.ajaxRemove');
|
||||
var fieldOriginalWidth, fieldOriginalHeight;
|
||||
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
field,
|
||||
'None',
|
||||
'@Url.Action(MVC.API.JobPreferences.UpdateOnCreateExpression())',
|
||||
'OnCreateExpression'
|
||||
);
|
||||
|
||||
field.focus(function () {
|
||||
fieldOriginalWidth = field.width();
|
||||
fieldOriginalHeight = field.height();
|
||||
field.css('overflow', 'visible').animate({ width: field.parent().width() - 42, height: 75 }, 200);
|
||||
}).blur(function () {
|
||||
field.css('overflow', 'hidden').animate({ width: fieldOriginalWidth, height: fieldOriginalHeight }, 200);
|
||||
}).change(function () {
|
||||
if (!!field.val()) {
|
||||
fieldRemove.show();
|
||||
} else {
|
||||
fieldRemove.hide();
|
||||
}
|
||||
}).attr('placeholder', 'None').attr('spellcheck', 'false');
|
||||
|
||||
fieldRemove.click(function () {
|
||||
field.val('').change();
|
||||
});
|
||||
|
||||
if (!!field.val()) {
|
||||
fieldRemove.show();
|
||||
} else {
|
||||
fieldRemove.hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Model.OnCreateExpression))
|
||||
{
|
||||
<span class="smallMessage"><None Specified></span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="code">
|
||||
@Model.OnCreateExpression
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<div class="info-box">
|
||||
<p class="fa-p">
|
||||
<i class="fa fa-fw fa-info-circle"></i>This expression will be evaluated whenever a job is created. If the expression has any output it will be added to the job log.
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 200px">On Close:</th>
|
||||
<td>
|
||||
@if (canConfig)
|
||||
{
|
||||
@Html.EditorFor(model => model.OnCloseExpression)
|
||||
@AjaxHelpers.AjaxRemove()
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var field = $('#OnCloseExpression');
|
||||
var fieldRemove = field.next('.ajaxRemove');
|
||||
var fieldOriginalWidth, fieldOriginalHeight;
|
||||
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
field,
|
||||
'None',
|
||||
'@Url.Action(MVC.API.JobPreferences.UpdateOnCloseExpression())',
|
||||
'OnCloseExpression'
|
||||
);
|
||||
|
||||
field.focus(function () {
|
||||
fieldOriginalWidth = field.width();
|
||||
fieldOriginalHeight = field.height();
|
||||
field.css('overflow', 'visible').animate({ width: field.parent().width() - 42, height: 75 }, 200);
|
||||
}).blur(function () {
|
||||
field.css('overflow', 'hidden').animate({ width: fieldOriginalWidth, height: fieldOriginalHeight }, 200);
|
||||
}).change(function () {
|
||||
if (!!field.val()) {
|
||||
fieldRemove.show();
|
||||
} else {
|
||||
fieldRemove.hide();
|
||||
}
|
||||
}).attr('placeholder', 'None').attr('spellcheck', 'false');
|
||||
|
||||
fieldRemove.click(function () {
|
||||
field.val('').change();
|
||||
});
|
||||
|
||||
if (!!field.val()) {
|
||||
fieldRemove.show();
|
||||
} else {
|
||||
fieldRemove.hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Model.OnCloseExpression))
|
||||
{
|
||||
<span class="smallMessage"><None Specified></span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="code">
|
||||
@Model.OnCloseExpression
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<div class="info-box">
|
||||
<p class="fa-p">
|
||||
<i class="fa fa-fw fa-info-circle"></i>This expression will be evaluated whenever a job is closed. If the expression has any output it will be added to the job log.
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,438 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.Config.Views.JobPreferences.Parts
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/JobPreferences/Parts/Expressions.cshtml")]
|
||||
public partial class Expressions : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.JobPreferences.IndexModel>
|
||||
{
|
||||
public Expressions()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
|
||||
Authorization.Require(Claims.Config.JobPreferences.Show);
|
||||
|
||||
var canConfig = Authorization.Has(Claims.Config.JobPreferences.Configure);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"Config_JobPref_Expressions\"");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 530px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Expressions</h2>\r\n <table>\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 200px\"");
|
||||
|
||||
WriteLiteral(">On Create:</th>\r\n <td>\r\n");
|
||||
|
||||
|
||||
#line 13 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 13 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
if (canConfig)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 15 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
Write(Html.EditorFor(model => model.OnCreateExpression));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 15 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 16 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
Write(AjaxHelpers.AjaxRemove());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 16 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 17 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
Write(AjaxHelpers.AjaxSave());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 17 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 18 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 18 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var field = $('#OnCreateExpression');
|
||||
var fieldRemove = field.next('.ajaxRemove');
|
||||
var fieldOriginalWidth, fieldOriginalHeight;
|
||||
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
field,
|
||||
'None',
|
||||
'");
|
||||
|
||||
|
||||
#line 28 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
Write(Url.Action(MVC.API.JobPreferences.UpdateOnCreateExpression()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n \'OnCreateExpression\'\r\n " +
|
||||
" );\r\n\r\n field.focus(function () {\r\n " +
|
||||
" fieldOriginalWidth = field.width();\r\n " +
|
||||
" fieldOriginalHeight = field.height();\r\n " +
|
||||
" field.css(\'overflow\', \'visible\').animate({ width: field.pa" +
|
||||
"rent().width() - 42, height: 75 }, 200);\r\n }).blu" +
|
||||
"r(function () {\r\n field.css(\'overflow\', \'hidd" +
|
||||
"en\').animate({ width: fieldOriginalWidth, height: fieldOriginalHeight }, 200);\r\n" +
|
||||
" }).change(function () {\r\n " +
|
||||
" if (!!field.val()) {\r\n field" +
|
||||
"Remove.show();\r\n } else {\r\n " +
|
||||
" fieldRemove.hide();\r\n }" +
|
||||
"\r\n }).attr(\'placeholder\', \'None\').attr(\'spellchec" +
|
||||
"k\', \'false\');\r\n\r\n fieldRemove.click(function () {" +
|
||||
"\r\n field.val(\'\').change();\r\n " +
|
||||
" });\r\n\r\n if (!!field.val()) {\r\n " +
|
||||
" fieldRemove.show();\r\n " +
|
||||
" } else {\r\n fieldRemove.hide();\r\n " +
|
||||
" }\r\n });\r\n " +
|
||||
"</script>\r\n");
|
||||
|
||||
|
||||
#line 57 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Model.OnCreateExpression))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral("><None Specified></span>\r\n");
|
||||
|
||||
|
||||
#line 63 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 67 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
Write(Model.OnCreateExpression);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 69 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"info-box\"");
|
||||
|
||||
WriteLiteral(">\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"fa-p\"");
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-fw fa-info-circle\"");
|
||||
|
||||
WriteLiteral("></i>This expression will be evaluated whenever a job is created. If the expressi" +
|
||||
"on has any output it will be added to the job log.\r\n </p>\r\n " +
|
||||
" </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 200px\"");
|
||||
|
||||
WriteLiteral(">On Close:</th>\r\n <td>\r\n");
|
||||
|
||||
|
||||
#line 81 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 81 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
if (canConfig)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 83 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
Write(Html.EditorFor(model => model.OnCloseExpression));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 83 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 84 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
Write(AjaxHelpers.AjaxRemove());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 84 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 85 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
Write(AjaxHelpers.AjaxSave());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 85 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 86 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 86 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var field = $('#OnCloseExpression');
|
||||
var fieldRemove = field.next('.ajaxRemove');
|
||||
var fieldOriginalWidth, fieldOriginalHeight;
|
||||
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
field,
|
||||
'None',
|
||||
'");
|
||||
|
||||
|
||||
#line 96 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
Write(Url.Action(MVC.API.JobPreferences.UpdateOnCloseExpression()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n \'OnCloseExpression\'\r\n " +
|
||||
" );\r\n\r\n field.focus(function () {\r\n " +
|
||||
" fieldOriginalWidth = field.width();\r\n " +
|
||||
" fieldOriginalHeight = field.height();\r\n " +
|
||||
" field.css(\'overflow\', \'visible\').animate({ width: field.par" +
|
||||
"ent().width() - 42, height: 75 }, 200);\r\n }).blur" +
|
||||
"(function () {\r\n field.css(\'overflow\', \'hidde" +
|
||||
"n\').animate({ width: fieldOriginalWidth, height: fieldOriginalHeight }, 200);\r\n " +
|
||||
" }).change(function () {\r\n " +
|
||||
" if (!!field.val()) {\r\n fieldR" +
|
||||
"emove.show();\r\n } else {\r\n " +
|
||||
" fieldRemove.hide();\r\n }\r" +
|
||||
"\n }).attr(\'placeholder\', \'None\').attr(\'spellcheck" +
|
||||
"\', \'false\');\r\n\r\n fieldRemove.click(function () {\r" +
|
||||
"\n field.val(\'\').change();\r\n " +
|
||||
" });\r\n\r\n if (!!field.val()) {\r\n " +
|
||||
" fieldRemove.show();\r\n " +
|
||||
" } else {\r\n fieldRemove.hide();\r\n " +
|
||||
" }\r\n });\r\n <" +
|
||||
"/script>\r\n");
|
||||
|
||||
|
||||
#line 125 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Model.OnCloseExpression))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral("><None Specified></span>\r\n");
|
||||
|
||||
|
||||
#line 131 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 135 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
Write(Model.OnCloseExpression);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 137 "..\..\Areas\Config\Views\JobPreferences\Parts\Expressions.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"info-box\"");
|
||||
|
||||
WriteLiteral(">\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"fa-p\"");
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-fw fa-info-circle\"");
|
||||
|
||||
WriteLiteral("></i>This expression will be evaluated whenever a job is closed. If the expressio" +
|
||||
"n has any output it will be added to the job log.\r\n </p>\r\n " +
|
||||
" </div>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
Reference in New Issue
Block a user