Feature: Job Queues

Also UI style, theme and element changes
This commit is contained in:
Gary Sharp
2014-02-03 14:50:08 +11:00
parent bdb3e1e6b4
commit 3f63281dc4
212 changed files with 17334 additions and 5441 deletions
@@ -1,5 +1,5 @@
@model Disco.Web.Areas.Config.Models.AuthorizationRole.ShowModel
@using Disco.Models.Authorization;
@using Disco.Models.Services.Authorization;
@{
Authorization.Require(Claims.DiscoAdminAccount);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Authorization Roles", MVC.Config.AuthorizationRole.Index(null), Model.Token.Role.Name);
@@ -28,13 +28,13 @@ namespace Disco.Web.Areas.Config.Views.AuthorizationRole
using System.Web.WebPages;
using Disco;
using Disco.BI.Extensions;
using Disco.Models.Repository;
#line 2 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
using Disco.Models.Authorization;
using Disco.Models.Services.Authorization;
#line default
#line hidden
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
@@ -190,14 +190,14 @@ WriteLiteral(">\r\n");
#line hidden
WriteLiteral(" <li");
WriteAttribute("class", Tuple.Create(" class=\"", 2187), Tuple.Create("\"", 2227)
WriteAttribute("class", Tuple.Create(" class=\"", 2196), Tuple.Create("\"", 2236)
#line 51 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
, Tuple.Create(Tuple.Create("", 2195), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
, Tuple.Create(Tuple.Create("", 2204), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
#line default
#line hidden
, 2195), false)
, 2204), false)
);
WriteLiteral(">");
@@ -241,15 +241,15 @@ WriteLiteral("></i>");
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 2757), Tuple.Create("\"", 2827)
WriteAttribute("href", Tuple.Create(" href=\"", 2766), Tuple.Create("\"", 2836)
#line 57 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
, Tuple.Create(Tuple.Create("", 2764), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.User.Show(sg.Id))
, Tuple.Create(Tuple.Create("", 2773), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.User.Show(sg.Id))
#line default
#line hidden
, 2764), false)
, Tuple.Create(Tuple.Create("", 2799), Tuple.Create("#UserDetailTab-Authorization", 2799), true)
, 2773), false)
, Tuple.Create(Tuple.Create("", 2808), Tuple.Create("#UserDetailTab-Authorization", 2808), true)
);
WriteLiteral("><i");
@@ -342,14 +342,14 @@ WriteLiteral(">\r\n");
#line hidden
WriteLiteral(" <li");
WriteAttribute("class", Tuple.Create(" class=\"", 3878), Tuple.Create("\"", 3918)
WriteAttribute("class", Tuple.Create(" class=\"", 3887), Tuple.Create("\"", 3927)
#line 71 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
, Tuple.Create(Tuple.Create("", 3886), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
, Tuple.Create(Tuple.Create("", 3895), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
#line default
#line hidden
, 3886), false)
, 3895), false)
);
WriteLiteral(" data-subjectid=\"");
@@ -464,14 +464,14 @@ WriteLiteral(">Add</a>\r\n </div>\r\n
WriteLiteral(" id=\"Config_AuthRoles_Subjects_Update_Dialog_Form\"");
WriteAttribute("action", Tuple.Create(" action=\"", 5163), Tuple.Create("\"", 5260)
WriteAttribute("action", Tuple.Create(" action=\"", 5172), Tuple.Create("\"", 5269)
#line 86 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
, Tuple.Create(Tuple.Create("", 5172), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.AuthorizationRole.UpdateSubjects(Model.Token.Role.Id, null, true))
, Tuple.Create(Tuple.Create("", 5181), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.AuthorizationRole.UpdateSubjects(Model.Token.Role.Id, null, true))
#line default
#line hidden
, 5172), false)
, 5181), false)
);
WriteLiteral(" method=\"post\"");
@@ -78,10 +78,10 @@
</div>
</td>
}
@if (Authorization.HasAny(Claims.Config.JobPreferences.Show, Claims.Config.DocumentTemplate.Show, Claims.Config.Plugin.Show))
@if (Authorization.HasAny(Claims.Config.JobPreferences.Show, Claims.Config.JobQueue.Show, Claims.Config.DocumentTemplate.Show, Claims.Config.Plugin.Show))
{
<td>
@if (Authorization.HasAny(Claims.Config.JobPreferences.Show))
@if (Authorization.HasAny(Claims.Config.JobPreferences.Show, Claims.Config.JobQueue.Show))
{
<div class="pageMenuArea noSeperator">
<h2>Jobs</h2>
@@ -92,6 +92,13 @@
Configure general preferences related to jobs.
</div>
}
@if (Authorization.Has(Claims.Config.JobQueue.Show))
{
<i class="fa fa-cog"></i>@Html.ActionLinkClass("Job Queues", MVC.Config.JobQueue.Index(), "config")
<div class="pageMenuBlurb">
Create and manage job queues including priorities and queue members.
</div>
}
</div>
}
@@ -525,7 +525,7 @@ WriteLiteral(" ");
#line 81 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.HasAny(Claims.Config.JobPreferences.Show, Claims.Config.DocumentTemplate.Show, Claims.Config.Plugin.Show))
if (Authorization.HasAny(Claims.Config.JobPreferences.Show, Claims.Config.JobQueue.Show, Claims.Config.DocumentTemplate.Show, Claims.Config.Plugin.Show))
{
@@ -541,7 +541,7 @@ WriteLiteral(" <td>\r\n");
#line hidden
#line 84 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.HasAny(Claims.Config.JobPreferences.Show))
if (Authorization.HasAny(Claims.Config.JobPreferences.Show, Claims.Config.JobQueue.Show))
{
@@ -605,12 +605,62 @@ WriteLiteral(">\r\n Configure general preferences
}
#line default
#line hidden
WriteLiteral(" ");
#line 95 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.Has(Claims.Config.JobQueue.Show))
{
#line default
#line hidden
WriteLiteral(" <i");
WriteLiteral(" class=\"fa fa-cog\"");
WriteLiteral("></i>");
#line 97 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
#line 97 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Job Queues", MVC.Config.JobQueue.Index(), "config"));
#line default
#line hidden
#line 97 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
WriteLiteral(">\r\n Create and manage job queues including priorit" +
"ies and queue members.\r\n </div>\r\n");
#line 101 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
#line 96 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 103 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
@@ -619,13 +669,13 @@ WriteLiteral(" </div>\r\n");
WriteLiteral("\r\n");
#line 98 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 105 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
#line 98 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 105 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.HasAny(Claims.Config.DocumentTemplate.Show, Claims.Config.Plugin.Show))
{
@@ -639,13 +689,13 @@ WriteLiteral(" class=\"pageMenuArea\"");
WriteLiteral(">\r\n <h2>Features</h2>\r\n");
#line 102 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 109 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
#line 102 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 109 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.Has(Claims.Config.DocumentTemplate.Show))
{
@@ -659,20 +709,20 @@ WriteLiteral(" class=\"fa fa-cog\"");
WriteLiteral("></i>");
#line 104 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 111 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
#line 104 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 111 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Document Templates", MVC.Config.DocumentTemplate.Index(), "config"));
#line default
#line hidden
#line 104 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 111 "..\..\Areas\Config\Views\Config\Index.cshtml"
@@ -687,7 +737,7 @@ WriteLiteral(">\r\n Create, Update and Bulk Gener
" </div>\r\n");
#line 109 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 116 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
@@ -696,7 +746,7 @@ WriteLiteral(">\r\n Create, Update and Bulk Gener
WriteLiteral(" ");
#line 110 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 117 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.Has(Claims.Config.Plugin.Show))
{
@@ -710,20 +760,20 @@ WriteLiteral(" class=\"fa fa-cog\"");
WriteLiteral("></i>");
#line 112 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 119 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
#line 112 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 119 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Plugins", MVC.Config.Plugins.Index(), "config"));
#line default
#line hidden
#line 112 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 119 "..\..\Areas\Config\Views\Config\Index.cshtml"
@@ -737,7 +787,7 @@ WriteLiteral(">\r\n Manage extensions to the Disc
" </div>\r\n");
#line 116 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 123 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
@@ -746,7 +796,7 @@ WriteLiteral(">\r\n Manage extensions to the Disc
WriteLiteral(" </div>\r\n");
#line 118 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 125 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
@@ -755,7 +805,7 @@ WriteLiteral(" </div>\r\n");
WriteLiteral(" </td>\r\n");
#line 120 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 127 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
@@ -764,7 +814,7 @@ WriteLiteral(" </td>\r\n");
WriteLiteral(" </tr>\r\n</table>\r\n");
#line 123 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 130 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Model.UpdateAvailable)
{
@@ -782,14 +832,14 @@ WriteLiteral(" class=\"fa fa-cloud-download info\"");
WriteLiteral("></i>\r\n <div>An updated version of Disco is available</div>\r\n <a");
WriteAttribute("href", Tuple.Create(" href=\"", 6652), Tuple.Create("\"", 6688)
WriteAttribute("href", Tuple.Create(" href=\"", 7166), Tuple.Create("\"", 7202)
#line 129 "..\..\Areas\Config\Views\Config\Index.cshtml"
, Tuple.Create(Tuple.Create("", 6659), Tuple.Create<System.Object, System.Int32>(Model.UpdateResponse.UrlLink
#line 136 "..\..\Areas\Config\Views\Config\Index.cshtml"
, Tuple.Create(Tuple.Create("", 7173), Tuple.Create<System.Object, System.Int32>(Model.UpdateResponse.UrlLink
#line default
#line hidden
, 6659), false)
, 7173), false)
);
WriteLiteral(" class=\"button small alert\"");
@@ -799,7 +849,7 @@ WriteLiteral(" target=\"_blank\"");
WriteLiteral(">Download v");
#line 129 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 136 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Model.UpdateResponse.Version);
@@ -816,13 +866,13 @@ WriteLiteral(@" <script>
");
#line 137 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 144 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
#line 137 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 144 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Model.UpdateResponse.VersionReleasedTimestamp < DateTime.Now.AddDays(-14))
{
@@ -838,7 +888,7 @@ WriteLiteral("\r\n updateAvailableContainer.effect(\"shake\", { t
WriteLiteral("\r\n");
#line 143 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 150 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
@@ -847,7 +897,7 @@ WriteLiteral("\r\n");
WriteLiteral("\r\n });\r\n })();\r\n </script>\r\n");
#line 148 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 155 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
@@ -166,125 +166,143 @@
});
});
var $trJobTypes = $('#trJobTypes');
var $trJobTypeActions = $('#trJobTypeActions');
var $jobTypes = $trJobTypes.find('input[type="checkbox"]');
$jobTypes.change(jobTypesChange);
var $JobSubTypes = $('#Config_DocumentTemplates_JobSubTypes');
function scopeChange() {
if ($scope.val() == 'Job') {
$trJobTypes.show();
$trJobTypeActions.show();
jobTypesChange();
$JobSubTypes.slideDown('fast');
} else {
$trJobTypes.hide();
$trJobTypeActions.hide();
$jobTypes.filter(':checked').each(function () {
$(this).prop('checked', false);
});
$('.jobSubTypes').hide().find('input[type="checkbox"]:checked').each(function () {
$(this).prop('checked', false);
});
$JobSubTypes.slideUp('fast');
}
}
function jobTypesChange() {
$('.jobSubTypes').hide();
$jobTypes.filter(':checked').each(function () {
$('#trJobSubType' + $(this).val()).show();
});
}
$('#TypeAction_Save').click(function () {
var data = { SubTypes: [] };
var $ajaxLoading = $('#TypeAction_Save').next('.ajaxLoading').show();
$jobTypes.filter(':checked').each(function () {
var $this = $(this);
$('#trJobSubType' + $this.val()).find('input[type="checkbox"]:checked').each(function () {
data.SubTypes.push($(this).val());
});
});
$.ajax({
url: '@Url.Action(MVC.API.DocumentTemplate.UpdateSubTypes(Model.DocumentTemplate.Id))',
dataType: 'json',
type: 'POST',
traditional: true,
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
scopeChange();
} else {
$ajaxLoading.hide();
alert('Unable to update job types: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update job types: ' + textStatus);
$ajaxLoading.hide();
}
});
return false;
});
scopeChange();
});
</script>
}
else
{
@Model.DocumentTemplate.Scope
<div>@Model.DocumentTemplate.Scope</div>
}
@if (canConfig || (Model.DocumentTemplate.Scope == DocumentTemplate.DocumentTemplateScopes.Job))
{
<div id="Config_DocumentTemplates_JobSubTypes" @(Model.DocumentTemplate.Scope != DocumentTemplate.DocumentTemplateScopes.Job ? "style=\"display: none;\" " : null)>
<h4>Filter:</h4>
<div>
@if (Model.DocumentTemplate.JobSubTypes.Count > 0)
{
<ul>
@foreach (var jobType in Model.DocumentTemplate.JobSubTypes.GroupBy(jst => jst.JobType).OrderBy(jtg => jtg.Key.Description))
{
<li>
@jobType.Key.Description
<ul>
@if (jobType.Count() == Model.JobTypes.FirstOrDefault(jt => jt.Id == jobType.Key.Id).JobSubTypes.Count)
{
<li><span class="smallMessage">[All Sub Types]</span></li>
}
else
{
foreach (var jobSubType in jobType)
{
<li>@jobSubType.Description</li>
}
}
</ul>
</li>
}
</ul>
}
else
{
<span class="smallMessage">&lt;No Filter&gt;</span>
}
</div>
@if (canConfig)
{
<a id="Config_DocumentTemplates_JobSubTypes_Update" href="#" class="button small">Update</a>
<div id="Config_DocumentTemplates_JobSubTypes_Update_Dialog" class="dialog" title="Job Type Filter">
@using (Html.BeginForm(MVC.API.DocumentTemplate.UpdateJobSubTypes(Model.DocumentTemplate.Id, null, true)))
{
var selectedTypes = Model.DocumentTemplate.JobSubTypes.Select(jst => jst.JobType).Distinct().ToList();
foreach (var jt in Model.JobTypes)
{
<div class="jobTypes">
<h4>
<input id="Types_@(jt.Id)" class="jobType" type="checkbox" value="@(jt.Id)" @(selectedTypes.Contains(jt) ? "checked=\"checked\"" : null) /><label for="Types_@(jt.Id)">@jt.Description</label></h4>
<div id="SubTypes_@(jt.Id)" class="jobSubTypes">
@CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id), "div")
@CommonHelpers.CheckBoxList("JobSubTypes", jt.JobSubTypes.OrderBy(jst => jst.Description).ToSelectListItems(Model.DocumentTemplate.JobSubTypes), 2)
</div>
</div>
}
}
</div>
<script>
(function () {
var dialog;
function showDialog() {
if (!dialog) {
dialog = $('#Config_DocumentTemplates_JobSubTypes_Update_Dialog').dialog({
resizable: false,
modal: true,
autoOpen: false,
width: 750,
height: 620,
buttons: {
"Save Changes": saveChanges,
Cancel: cancel
}
});
dialog.find('.jobSubTypes').hide();
dialog.on('change', 'input.jobType', function () {
var $this = $(this);
if ($this.is(':checked'))
$('#SubTypes_' + $this.val()).slideDown('fast');
else
$('#SubTypes_' + $this.val()).slideUp('fast');
}).find('input.jobType:checked').each(function () {
$('#SubTypes_' + $(this).val()).show();
});
}
dialog.dialog('open');
return false;
}
function cancel() {
dialog.dialog("disable");
dialog.dialog("option", "buttons", null);
// Refresh Page
window.location.href = window.location.href;
}
function saveChanges() {
var form = dialog.find('form');
$('input.jobType:unchecked').each(function () {
$('#SubTypes_' + $(this).val()).find('input').prop('checked', false);
});
form.submit();
dialog.dialog("disable");
dialog.dialog("option", "buttons", null);
}
$(function () {
$('#Config_DocumentTemplates_JobSubTypes_Update').click(showDialog);
});
})();
</script>
}
</div>
}
</td>
</tr>
@if (canConfig || (Model.DocumentTemplate.Scope == DocumentTemplate.DocumentTemplateScopes.Job))
{
<tr id="trJobTypes">
<th class="name">Types:
</th>
<td class="value">
@CommonHelpers.CheckBoxList("Types", Model.JobTypes.ToSelectListItems(Model.Types), 2)
</td>
</tr>
foreach (var jt in Model.JobTypes)
{
<tr id="trJobSubType@(jt.Id)" class="jobSubTypes">
<th class="name">
@jt.Description<br />
Sub Types<br />
@if (canConfig)
{
@CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id))
}
</th>
<td class="value">
@CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.Where(jst => jst.JobTypeId == jt.Id).ToList().ToSelectListItems(Model.SubTypes), 2)
</td>
</tr>
}
if (canConfig)
{
<tr id="trJobTypeActions">
<th class="name"></th>
<td class="value">
<a id="TypeAction_Save" href="#" class="button">Save Job Types</a>@AjaxHelpers.AjaxLoader()
</td>
</tr>
}
else if (Model.DocumentTemplate.Scope == DocumentTemplate.DocumentTemplateScopes.Job)
{
<script>
$(function () {
$('.jobSubTypes').hide().find('input[type="checkbox"]').prop('disabled', true);
$('#trJobTypes').find('input[type="checkbox"]').prop('disabled', true).filter(':checked').each(function () {
$('#trJobSubType' + $(this).val()).show();
});
});
</script>
}
}
<tr>
<th>Template PDF
</th>
@@ -29,6 +29,7 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
using Disco;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
@@ -421,60 +422,10 @@ WriteLiteral(@">
Write(Url.Action(MVC.API.DocumentTemplate.UpdateScope(Model.DocumentTemplate.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" data: data,\r\n success: function (d) {\r\n " +
" if (d == \'OK\') {\r\n " +
" $ajaxLoading.hide().next(\'.ajaxOk\').show().delay(\'fast\').fadeOut(\'slow" +
"\');\r\n scopeChange();\r\n " +
" } else {\r\n $ajaxLoading." +
"hide();\r\n alert(\'Unable to update scope: " +
"\' + d);\r\n }\r\n " +
"},\r\n error: function (jqXHR, textStatus, errorThr" +
"own) {\r\n alert(\'Unable to update scope: \' + t" +
"extStatus);\r\n $ajaxLoading.hide();\r\n " +
" }\r\n });\r\n " +
" });\r\n\r\n var $trJobTypes = $(\'#trJobTypes\');\r\n " +
" var $trJobTypeActions = $(\'#trJobTypeActions\');\r\n " +
" var $jobTypes = $trJobTypes.find(\'input[type=\"checkbox\"]\');\r\n " +
" $jobTypes.change(jobTypesChange);\r\n\r\n functi" +
"on scopeChange() {\r\n if ($scope.val() == \'Job\') {\r\n " +
" $trJobTypes.show();\r\n " +
" $trJobTypeActions.show();\r\n jobTypesChange();\r" +
"\n } else {\r\n $trJobTyp" +
"es.hide();\r\n $trJobTypeActions.hide();\r\n " +
" $jobTypes.filter(\':checked\').each(function () {\r\n " +
" $(this).prop(\'checked\', false);\r\n " +
" });\r\n $(\'.jobSubTypes\').hide().find(" +
"\'input[type=\"checkbox\"]:checked\').each(function () {\r\n " +
" $(this).prop(\'checked\', false);\r\n });\r\n" +
" }\r\n }\r\n\r\n " +
" function jobTypesChange() {\r\n $(\'.jobSubTypes\').h" +
"ide();\r\n $jobTypes.filter(\':checked\').each(function (" +
") {\r\n $(\'#trJobSubType\' + $(this).val()).show();\r" +
"\n });\r\n }\r\n\r\n " +
" $(\'#TypeAction_Save\').click(function () {\r\n va" +
"r data = { SubTypes: [] };\r\n var $ajaxLoading = $(\'#T" +
"ypeAction_Save\').next(\'.ajaxLoading\').show();\r\n\r\n $jo" +
"bTypes.filter(\':checked\').each(function () {\r\n va" +
"r $this = $(this);\r\n $(\'#trJobSubType\' + $this.va" +
"l()).find(\'input[type=\"checkbox\"]:checked\').each(function () {\r\n " +
" data.SubTypes.push($(this).val());\r\n " +
" });\r\n });\r\n\r\n $.aj" +
"ax({\r\n url: \'");
#line 210 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(Url.Action(MVC.API.DocumentTemplate.UpdateSubTypes(Model.DocumentTemplate.Id)));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
type: 'POST',
traditional: true,
data: data,
success: function (d) {
if (d == 'OK') {
@@ -482,247 +433,440 @@ WriteLiteral(@"',
scopeChange();
} else {
$ajaxLoading.hide();
alert('Unable to update job types: ' + d);
alert('Unable to update scope: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update job types: ' + textStatus);
alert('Unable to update scope: ' + textStatus);
$ajaxLoading.hide();
}
});
return false;
});
scopeChange();
var $JobSubTypes = $('#Config_DocumentTemplates_JobSubTypes');
function scopeChange() {
if ($scope.val() == 'Job') {
$JobSubTypes.slideDown('fast');
} else {
$JobSubTypes.slideUp('fast');
}
}
});
</script>
");
#line 235 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 180 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
else
{
#line default
#line hidden
#line 238 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(Model.DocumentTemplate.Scope);
#line default
#line hidden
WriteLiteral(" <div>");
#line 238 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 183 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(Model.DocumentTemplate.Scope);
#line default
#line hidden
WriteLiteral("</div>\r\n");
#line 184 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
WriteLiteral(" ");
#line 242 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line default
#line hidden
#line 242 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
if (canConfig || (Model.DocumentTemplate.Scope == DocumentTemplate.DocumentTemplateScopes.Job))
{
#line 185 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
if (canConfig || (Model.DocumentTemplate.Scope == DocumentTemplate.DocumentTemplateScopes.Job))
{
#line default
#line hidden
WriteLiteral(" <tr");
WriteLiteral(" <div");
WriteLiteral(" id=\"trJobTypes\"");
WriteLiteral(" id=\"Config_DocumentTemplates_JobSubTypes\"");
WriteLiteral(">\r\n <th");
WriteLiteral(" class=\"name\"");
WriteLiteral(">Types:\r\n </th>\r\n <td");
WriteLiteral(" class=\"value\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
WriteLiteral(" ");
#line 248 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(CommonHelpers.CheckBoxList("Types", Model.JobTypes.ToSelectListItems(Model.Types), 2));
#line 187 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(Model.DocumentTemplate.Scope != DocumentTemplate.DocumentTemplateScopes.Job ? "style=\"display: none;\" " : null);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
WriteLiteral(">\r\n <h4>Filter:</h4>\r\n <div>\r\n");
#line 251 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
foreach (var jt in Model.JobTypes)
{
#line default
#line hidden
WriteLiteral(" <tr");
WriteAttribute("id", Tuple.Create(" id=\"", 12488), Tuple.Create("\"", 12513)
, Tuple.Create(Tuple.Create("", 12493), Tuple.Create("trJobSubType", 12493), true)
#line 253 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 12505), Tuple.Create<System.Object, System.Int32>(jt.Id
#line default
#line hidden
, 12505), false)
);
WriteLiteral(" class=\"jobSubTypes\"");
WriteLiteral(">\r\n <th");
WriteLiteral(" class=\"name\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 255 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(jt.Description);
#line default
#line hidden
WriteLiteral("<br />\r\n Sub Types<br />\r\n");
#line 257 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 190 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line default
#line hidden
#line 257 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
if (canConfig)
{
#line 190 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
if (Model.DocumentTemplate.JobSubTypes.Count > 0)
{
#line default
#line hidden
WriteLiteral(" <ul>\r\n");
#line 193 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line default
#line hidden
#line 193 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
foreach (var jobType in Model.DocumentTemplate.JobSubTypes.GroupBy(jst => jst.JobType).OrderBy(jtg => jtg.Key.Description))
{
#line default
#line hidden
WriteLiteral(" <li>\r\n");
WriteLiteral(" ");
#line 196 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(jobType.Key.Description);
#line default
#line hidden
WriteLiteral("\r\n <ul>\r\n");
#line 198 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line default
#line hidden
#line 198 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
if (jobType.Count() == Model.JobTypes.FirstOrDefault(jt => jt.Id == jobType.Key.Id).JobSubTypes.Count)
{
#line default
#line hidden
WriteLiteral(" <li><span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">[All Sub Types]</span></li>\r\n");
#line 201 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
else
{
foreach (var jobSubType in jobType)
{
#line default
#line hidden
WriteLiteral(" <li>");
#line 206 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(jobSubType.Description);
#line default
#line hidden
WriteLiteral("</li>\r\n");
#line 207 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </ul>\r\n " +
" </li>\r\n");
#line 211 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ul>\r\n");
#line 213 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;No Filter&gt;</span>\r\n");
#line 217 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
#line 219 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line default
#line hidden
#line 259 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id)));
#line 219 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 259 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
WriteLiteral(" <a");
#line default
#line hidden
WriteLiteral(" </th>\r\n <td");
WriteLiteral(" class=\"value\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 263 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.Where(jst => jst.JobTypeId == jt.Id).ToList().ToSelectListItems(Model.SubTypes), 2));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr> \r\n");
#line 266 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
if (canConfig)
{
#line default
#line hidden
WriteLiteral(" <tr");
WriteLiteral(" id=\"trJobTypeActions\"");
WriteLiteral(">\r\n <th");
WriteLiteral(" class=\"name\"");
WriteLiteral("></th>\r\n <td");
WriteLiteral(" class=\"value\"");
WriteLiteral(">\r\n <a");
WriteLiteral(" id=\"TypeAction_Save\"");
WriteLiteral(" id=\"Config_DocumentTemplates_JobSubTypes_Update\"");
WriteLiteral(" href=\"#\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(" class=\"button small\"");
WriteLiteral(">Save Job Types</a>");
WriteLiteral(">Update</a>\r\n");
WriteLiteral(" <div");
WriteLiteral(" id=\"Config_DocumentTemplates_JobSubTypes_Update_Dialog\"");
WriteLiteral(" class=\"dialog\"");
WriteLiteral(" title=\"Job Type Filter\"");
WriteLiteral(">\r\n");
#line 272 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line 223 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line default
#line hidden
#line 223 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
using (Html.BeginForm(MVC.API.DocumentTemplate.UpdateJobSubTypes(Model.DocumentTemplate.Id, null, true)))
{
var selectedTypes = Model.DocumentTemplate.JobSubTypes.Select(jst => jst.JobType).Distinct().ToList();
foreach (var jt in Model.JobTypes)
{
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
WriteLiteral(" <div");
WriteLiteral(" class=\"jobTypes\"");
WriteLiteral(">\r\n <h4>\r\n " +
" <input");
WriteAttribute("id", Tuple.Create(" id=\"", 12011), Tuple.Create("\"", 12030)
, Tuple.Create(Tuple.Create("", 12016), Tuple.Create("Types_", 12016), true)
#line 230 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 12022), Tuple.Create<System.Object, System.Int32>(jt.Id
#line default
#line hidden
, 12022), false)
);
WriteLiteral(" class=\"jobType\"");
WriteLiteral(" type=\"checkbox\"");
WriteAttribute("value", Tuple.Create(" value=\"", 12063), Tuple.Create("\"", 12079)
#line 230 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 12071), Tuple.Create<System.Object, System.Int32>(jt.Id
#line default
#line hidden
, 12071), false)
);
WriteLiteral(" ");
#line 275 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
else if (Model.DocumentTemplate.Scope == DocumentTemplate.DocumentTemplateScopes.Job)
{
#line 230 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(selectedTypes.Contains(jt) ? "checked=\"checked\"" : null);
#line default
#line hidden
WriteLiteral(@" <script>
$(function () {
$('.jobSubTypes').hide().find('input[type=""checkbox""]').prop('disabled', true);
$('#trJobTypes').find('input[type=""checkbox""]').prop('disabled', true).filter(':checked').each(function () {
$('#trJobSubType' + $(this).val()).show();
});
});
</script>
");
WriteLiteral(" /><label");
WriteAttribute("for", Tuple.Create(" for=\"", 12150), Tuple.Create("\"", 12170)
, Tuple.Create(Tuple.Create("", 12156), Tuple.Create("Types_", 12156), true)
#line 230 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 12162), Tuple.Create<System.Object, System.Int32>(jt.Id
#line default
#line hidden
, 12162), false)
);
WriteLiteral(">");
#line 286 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
}
#line 230 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(jt.Description);
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>Template PDF\r\n </th>\r\n <td>\r\n" +
"");
WriteLiteral("</label></h4>\r\n <div");
WriteAttribute("id", Tuple.Create(" id=\"", 12246), Tuple.Create("\"", 12268)
, Tuple.Create(Tuple.Create("", 12251), Tuple.Create("SubTypes_", 12251), true)
#line 231 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create("", 12260), Tuple.Create<System.Object, System.Int32>(jt.Id
#line default
#line hidden
, 12260), false)
);
WriteLiteral(" class=\"jobSubTypes\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 232 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id), "div"));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 233 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(CommonHelpers.CheckBoxList("JobSubTypes", jt.JobSubTypes.OrderBy(jst => jst.Description).ToSelectListItems(Model.DocumentTemplate.JobSubTypes), 2));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n " +
" </div> \r\n");
#line 236 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
WriteLiteral(" <script>\r\n (function (" +
") {\r\n var dialog;\r\n\r\n " +
" function showDialog() {\r\n if " +
"(!dialog) {\r\n dialog = $(\'#Config_Doc" +
"umentTemplates_JobSubTypes_Update_Dialog\').dialog({\r\n " +
" resizable: false,\r\n " +
" modal: true,\r\n autoOpen: " +
"false,\r\n width: 750,\r\n " +
" height: 620,\r\n " +
" buttons: {\r\n " +
" \"Save Changes\": saveChanges,\r\n " +
" Cancel: cancel\r\n }\r\n " +
" });\r\n\r\n " +
" dialog.find(\'.jobSubTypes\').hide();\r\n " +
" dialog.on(\'change\', \'input.jobType\', function () {\r\n " +
" var $this = $(this);\r\n " +
" if ($this.is(\':checked\'))\r\n " +
" $(\'#SubTypes_\' + $this.val()).slideDown(\'fast\');\r\n " +
" else\r\n " +
" $(\'#SubTypes_\' + $this.val()).slideUp(\'fast\');\r\n " +
" }).find(\'input.jobType:checked\').each(function () {\r\n " +
" $(\'#SubTypes_\' + $(this).val()).sh" +
"ow();\r\n });\r\n " +
" }\r\n\r\n dialog.dialog(\'open" +
"\');\r\n\r\n return false;\r\n " +
" }\r\n\r\n function cancel() {\r\n" +
" dialog.dialog(\"disable\");\r\n " +
" dialog.dialog(\"option\", \"buttons\", null);\r\n\r\n " +
" // Refresh Page\r\n " +
" window.location.href = window.location.href;\r\n " +
" }\r\n\r\n function saveChanges() {\r\n " +
" var form = dialog.find(\'form\');\r\n\r\n " +
" $(\'input.jobType:unchecked\').each(function () {" +
"\r\n $(\'#SubTypes_\' + $(this).val()).fi" +
"nd(\'input\').prop(\'checked\', false);\r\n });" +
"\r\n\r\n form.submit();\r\n\r\n " +
" dialog.dialog(\"disable\");\r\n " +
" dialog.dialog(\"option\", \"buttons\", null);\r\n " +
" }\r\n\r\n $(function () {\r\n " +
" $(\'#Config_DocumentTemplates_JobSubTypes_Update\').clic" +
"k(showDialog);\r\n });\r\n\r\n " +
" })();\r\n </script>\r\n");
#line 301 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
#line 303 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>Template PDF\r\n " +
" </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 292 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 310 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(Html.ActionLink("Download Template", MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id)));
@@ -731,13 +875,13 @@ WriteLiteral(" ");
WriteLiteral("\r\n");
#line 293 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 311 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line default
#line hidden
#line 293 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 311 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.Upload))
{
@@ -747,7 +891,7 @@ WriteLiteral("\r\n");
WriteLiteral(" <br />\r\n");
#line 296 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 314 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
using (Html.BeginForm(MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
@@ -777,7 +921,7 @@ WriteLiteral(" value=\"Upload\"");
WriteLiteral(" />\r\n");
#line 300 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 318 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
@@ -801,7 +945,7 @@ WriteLiteral(@">
");
#line 312 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 330 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
@@ -811,7 +955,7 @@ WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n
":\r\n </th>\r\n <td>");
#line 318 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 336 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.ConfigureFilterExpression))
{
@@ -819,42 +963,42 @@ WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n
#line default
#line hidden
#line 320 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 338 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(Html.TextBoxFor(model => model.DocumentTemplate.FilterExpression));
#line default
#line hidden
#line 320 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 338 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line default
#line hidden
#line 321 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 339 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(AjaxHelpers.AjaxRemove());
#line default
#line hidden
#line 321 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 339 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line default
#line hidden
#line 322 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 340 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 322 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 340 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
@@ -886,7 +1030,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" url: \'");
#line 349 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 367 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(Url.Action(MVC.API.DocumentTemplate.UpdateFilterExpression(Model.DocumentTemplate.Id)));
@@ -916,7 +1060,7 @@ WriteLiteral(@"',
");
#line 370 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 388 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
else
{
@@ -933,7 +1077,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>\r\n");
#line 376 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 394 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
else
{
@@ -950,7 +1094,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 380 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 398 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(Model.DocumentTemplate.FilterExpression);
@@ -959,7 +1103,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n");
#line 382 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 400 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
}
@@ -970,7 +1114,7 @@ WriteLiteral(" </td>\r\n </tr>\r\n </table>\r\n</div>\r\n<h
"/h2>\r\n");
#line 389 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 407 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(Html.Partial(MVC.Config.DocumentTemplate.Views._ExpressionsTable, Model.TemplateExpressions));
@@ -1032,13 +1176,13 @@ WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
#line 428 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 446 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line default
#line hidden
#line 428 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 446 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
if (Authorization.Has(Claims.Config.Show))
{
@@ -1046,14 +1190,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 430 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 448 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser()));
#line default
#line hidden
#line 430 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 448 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
@@ -1063,7 +1207,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 432 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 450 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
if (canBulkGenerate)
{
@@ -1086,16 +1230,16 @@ WriteLiteral(" id=\"dialogBulkGenerate\"");
WriteLiteral(" class=\"hiddenDialog\"");
WriteAttribute("title", Tuple.Create(" title=\"", 20927), Tuple.Create("\"", 20978)
, Tuple.Create(Tuple.Create("", 20935), Tuple.Create("Bulk", 20935), true)
, Tuple.Create(Tuple.Create(" ", 20939), Tuple.Create("Generate:", 20940), true)
WriteAttribute("title", Tuple.Create(" title=\"", 23181), Tuple.Create("\"", 23232)
, Tuple.Create(Tuple.Create("", 23189), Tuple.Create("Bulk", 23189), true)
, Tuple.Create(Tuple.Create(" ", 23193), Tuple.Create("Generate:", 23194), true)
#line 435 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create(" ", 20949), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Id
#line 453 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
, Tuple.Create(Tuple.Create(" ", 23203), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Id
#line default
#line hidden
, 20950), false)
, 23204), false)
);
WriteLiteral(">\r\n <div");
@@ -1126,13 +1270,13 @@ WriteLiteral(" class=\"example3 code\"");
WriteLiteral("></div>\r\n </div>\r\n </div>\r\n");
#line 447 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 465 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line default
#line hidden
#line 447 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 465 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id), FormMethod.Post))
{
@@ -1162,7 +1306,7 @@ WriteLiteral(" data-val-required=\"Identifiers are required\"");
WriteLiteral("></textarea>\r\n");
#line 451 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 469 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
@@ -1171,7 +1315,7 @@ WriteLiteral("></textarea>\r\n");
WriteLiteral(" </div>\r\n");
#line 453 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 471 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
@@ -1211,7 +1355,7 @@ WriteLiteral(" <script>\r\n $(function () {\r\n
" </script>\r\n");
#line 505 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 523 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
@@ -1220,7 +1364,7 @@ WriteLiteral(" <script>\r\n $(function () {\r\n
WriteLiteral(" ");
#line 506 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 524 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
if (Authorization.Has(Claims.Config.DocumentTemplate.Delete))
{
@@ -1228,14 +1372,14 @@ WriteLiteral(" ");
#line default
#line hidden
#line 508 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 526 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
Write(Html.ActionLinkButton("Delete", MVC.API.DocumentTemplate.Delete(Model.DocumentTemplate.Id, true), "buttonDelete"));
#line default
#line hidden
#line 508 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
#line 526 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
@@ -0,0 +1,39 @@
@model Disco.Web.Areas.Config.Models.JobQueue.CreateModel
@{
Authorization.RequireAll(Claims.Config.JobQueue.Create, Claims.Config.JobQueue.Configure);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Job Queues", MVC.Config.JobQueue.Index(null), "Create");
}
@using (Html.BeginForm())
{
@Html.HiddenFor(m => m.JobQueue.Icon)
@Html.HiddenFor(m => m.JobQueue.IconColour)
@Html.HiddenFor(m => m.JobQueue.Priority)
<div class="form" style="width: 450px">
<table>
<tr>
<th>
Name:
</th>
<td>
@Html.EditorFor(model => model.JobQueue.Name)<br />@Html.ValidationMessageFor(model => model.JobQueue.Name)
</td>
</tr>
<tr>
<th>
Description:
</th>
<td>
@Html.EditorFor(model => model.JobQueue.Description)<br />@Html.ValidationMessageFor(model => model.JobQueue.Description)
</td>
</tr>
</table>
<p class="actions">
<input type="submit" class="button" value="Create" />
</p>
</div>
<script type="text/javascript">
$(function () {
$('#JobQueue_Name').focus().select();
});
</script>
}
@@ -0,0 +1,186 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34003
//
// 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.JobQueue
{
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.BI.Extensions;
using Disco.Models.Repository;
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/JobQueue/Create.cshtml")]
public partial class Create : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.JobQueue.CreateModel>
{
public Create()
{
}
public override void Execute()
{
#line 2 "..\..\Areas\Config\Views\JobQueue\Create.cshtml"
Authorization.RequireAll(Claims.Config.JobQueue.Create, Claims.Config.JobQueue.Configure);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Job Queues", MVC.Config.JobQueue.Index(null), "Create");
#line default
#line hidden
WriteLiteral("\r\n");
#line 6 "..\..\Areas\Config\Views\JobQueue\Create.cshtml"
using (Html.BeginForm())
{
#line default
#line hidden
#line 8 "..\..\Areas\Config\Views\JobQueue\Create.cshtml"
Write(Html.HiddenFor(m => m.JobQueue.Icon));
#line default
#line hidden
#line 8 "..\..\Areas\Config\Views\JobQueue\Create.cshtml"
#line default
#line hidden
#line 9 "..\..\Areas\Config\Views\JobQueue\Create.cshtml"
Write(Html.HiddenFor(m => m.JobQueue.IconColour));
#line default
#line hidden
#line 9 "..\..\Areas\Config\Views\JobQueue\Create.cshtml"
#line default
#line hidden
#line 10 "..\..\Areas\Config\Views\JobQueue\Create.cshtml"
Write(Html.HiddenFor(m => m.JobQueue.Priority));
#line default
#line hidden
#line 10 "..\..\Areas\Config\Views\JobQueue\Create.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 450px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n N" +
"ame:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 18 "..\..\Areas\Config\Views\JobQueue\Create.cshtml"
Write(Html.EditorFor(model => model.JobQueue.Name));
#line default
#line hidden
WriteLiteral("<br />");
#line 18 "..\..\Areas\Config\Views\JobQueue\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.JobQueue.Name));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Description:\r\n </th>\r\n <td>" +
"\r\n");
WriteLiteral(" ");
#line 26 "..\..\Areas\Config\Views\JobQueue\Create.cshtml"
Write(Html.EditorFor(model => model.JobQueue.Description));
#line default
#line hidden
WriteLiteral("<br />");
#line 26 "..\..\Areas\Config\Views\JobQueue\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.JobQueue.Description));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n <p");
WriteLiteral(" class=\"actions\"");
WriteLiteral(">\r\n <input");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Create\"");
WriteLiteral(" />\r\n </p>\r\n </div>\r\n");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n $(\'#JobQueue_Name\').focus().select();\r\n " +
" });\r\n </script>\r\n");
#line 39 "..\..\Areas\Config\Views\JobQueue\Create.cshtml"
}
#line default
#line hidden
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,50 @@
@model Disco.Web.Areas.Config.Models.JobQueue.IndexModel
@{
Authorization.RequireAll(Claims.Config.JobQueue.Create, Claims.Config.JobQueue.Configure);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Job Queues", MVC.Config.JobQueue.Index(null));
}
<div id="Config_JobQueues_Index">
@if (Model.Tokens.Count == 0)
{
<div class="form" style="width: 450px; padding: 100px 0;">
<h2>No job queues are configured</h2>
</div>
}
else
{
<table class="tableData">
<tr>
<th>Name</th>
<th>Priority</th>
<th>Linked Groups/Users</th>
</tr>
@foreach (var item in Model.Tokens)
{
<tr>
<td>
<a href="@Url.Action(MVC.Config.JobQueue.Index(item.JobQueue.Id))">
<i class="fa fa-@(item.JobQueue.Icon) fa-lg d-@(item.JobQueue.IconColour)"></i>
@item.JobQueue.Name
</a>
</td>
<td>
<i class="fa d-priority-@(item.JobQueue.Priority.ToString().ToLower())" title="@(item.JobQueue.Priority.ToString()) Priority"></i>
</td>
<td>
@if (item.SubjectIds.Count == 0)
{
<span class="smallMessage">&lt;None&gt;</span>
}
else
{
@(string.Join(", ", item.SubjectIds.OrderBy(i => i)))
}
</td>
</tr>
}
</table>
}
<div class="actionBar">
@Html.ActionLinkButton("Create Job Queue", MVC.Config.JobQueue.Create())
</div>
</div>
@@ -0,0 +1,269 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34003
//
// 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.JobQueue
{
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.BI.Extensions;
using Disco.Models.Repository;
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/JobQueue/Index.cshtml")]
public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.JobQueue.IndexModel>
{
public Index()
{
}
public override void Execute()
{
#line 2 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
Authorization.RequireAll(Claims.Config.JobQueue.Create, Claims.Config.JobQueue.Configure);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Job Queues", MVC.Config.JobQueue.Index(null));
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" id=\"Config_JobQueues_Index\"");
WriteLiteral(">\r\n");
#line 7 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
#line default
#line hidden
#line 7 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
if (Model.Tokens.Count == 0)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 450px; padding: 100px 0;\"");
WriteLiteral(">\r\n <h2>No job queues are configured</h2>\r\n </div> \r\n");
#line 12 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <table");
WriteLiteral(" class=\"tableData\"");
WriteLiteral(">\r\n <tr>\r\n <th>Name</th>\r\n <th>Priority<" +
"/th>\r\n <th>Linked Groups/Users</th>\r\n </tr>\r\n");
#line 21 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
#line default
#line hidden
#line 21 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
foreach (var item in Model.Tokens)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td>\r\n <a");
WriteAttribute("href", Tuple.Create(" href=\"", 852), Tuple.Create("\"", 915)
#line 25 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
, Tuple.Create(Tuple.Create("", 859), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.JobQueue.Index(item.JobQueue.Id))
#line default
#line hidden
, 859), false)
);
WriteLiteral(">\r\n <i");
WriteAttribute("class", Tuple.Create(" class=\"", 949), Tuple.Create("\"", 1020)
, Tuple.Create(Tuple.Create("", 957), Tuple.Create("fa", 957), true)
, Tuple.Create(Tuple.Create(" ", 959), Tuple.Create("fa-", 960), true)
#line 26 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
, Tuple.Create(Tuple.Create("", 963), Tuple.Create<System.Object, System.Int32>(item.JobQueue.Icon
#line default
#line hidden
, 963), false)
, Tuple.Create(Tuple.Create(" ", 984), Tuple.Create("fa-lg", 985), true)
, Tuple.Create(Tuple.Create(" ", 990), Tuple.Create("d-", 991), true)
#line 26 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
, Tuple.Create(Tuple.Create("", 993), Tuple.Create<System.Object, System.Int32>(item.JobQueue.IconColour
#line default
#line hidden
, 993), false)
);
WriteLiteral("></i>\r\n");
WriteLiteral(" ");
#line 27 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
Write(item.JobQueue.Name);
#line default
#line hidden
WriteLiteral("\r\n </a>\r\n </td>\r\n <t" +
"d>\r\n <i");
WriteAttribute("class", Tuple.Create(" class=\"", 1186), Tuple.Create("\"", 1254)
, Tuple.Create(Tuple.Create("", 1194), Tuple.Create("fa", 1194), true)
, Tuple.Create(Tuple.Create(" ", 1196), Tuple.Create("d-priority-", 1197), true)
#line 31 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
, Tuple.Create(Tuple.Create("", 1208), Tuple.Create<System.Object, System.Int32>(item.JobQueue.Priority.ToString().ToLower()
#line default
#line hidden
, 1208), false)
);
WriteAttribute("title", Tuple.Create(" title=\"", 1255), Tuple.Create("\"", 1308)
#line 31 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
, Tuple.Create(Tuple.Create("", 1263), Tuple.Create<System.Object, System.Int32>(item.JobQueue.Priority.ToString()
#line default
#line hidden
, 1263), false)
, Tuple.Create(Tuple.Create(" ", 1299), Tuple.Create("Priority", 1300), true)
);
WriteLiteral("></i>\r\n </td>\r\n <td>\r\n");
#line 34 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
#line default
#line hidden
#line 34 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
if (item.SubjectIds.Count == 0)
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None&gt;</span>\r\n");
#line 37 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
}
else
{
#line default
#line hidden
#line 40 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
Write(string.Join(", ", item.SubjectIds.OrderBy(i => i)));
#line default
#line hidden
#line 40 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 44 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n");
#line 46 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 48 "..\..\Areas\Config\Views\JobQueue\Index.cshtml"
Write(Html.ActionLinkButton("Create Job Queue", MVC.Config.JobQueue.Create()));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n</div>\r\n");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,657 @@
@model Disco.Web.Areas.Config.Models.JobQueue.ShowModel
@using Disco.Services.Jobs.JobQueues;
@{
Authorization.Require(Claims.Config.JobQueue.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Job Queues", MVC.Config.JobQueue.Index(null), Model.Token.JobQueue.ToString());
var canConfig = Authorization.Has(Claims.Config.JobQueue.Configure);
var canDelete = (Authorization.Has(Claims.Config.JobQueue.Delete) && Model.CanDelete);
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
}
<div id="Config_JobQueues_Show" class="form" style="width: 550px">
<table>
<tr>
<th style="width: 150px">Id:
</th>
<td>
@Html.DisplayFor(model => model.Token.JobQueue.Id)
</td>
</tr>
<tr>
<th>Name:
</th>
<td>@if (canConfig)
{@Html.EditorFor(model => model.Token.JobQueue.Name)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Token_JobQueue_Name'),
'Invalid Name',
'@(Url.Action(MVC.API.JobQueue.UpdateName(Model.Token.JobQueue.Id)))',
'QueueName'
);
});
</script>
}
else
{
@Model.Token.JobQueue.Name
}
</td>
</tr>
<tr>
<th>Description:
</th>
<td>@if (canConfig)
{@Html.EditorFor(model => model.Token.JobQueue.Description)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Token_JobQueue_Description'),
'Invalid Description',
'@(Url.Action(MVC.API.JobQueue.UpdateDescription(Model.Token.JobQueue.Id)))',
'Description'
);
});
</script>
}
else
{
<pre>
@Model.Token.JobQueue.Description
</pre>
}
</td>
</tr>
<tr>
<th>Statistics:
</th>
<td>
<div><strong>@Model.OpenJobCount job@(Model.OpenJobCount != 1 ? "s" : null) open</strong></div>
<div>@Model.TotalJobCount total job@(Model.TotalJobCount != 1 ? "s" : null)</div>
</td>
</tr>
<tr>
<th>Icon:
</th>
<td>
<i id="Config_JobQueues_Icon" data-icon="@(Model.Token.JobQueue.Icon)" data-colour="@(Model.Token.JobQueue.IconColour)" class="fa fa-@(Model.Token.JobQueue.Icon) fa-4x d-@(Model.Token.JobQueue.IconColour)"></i>
@if (canConfig)
{
<div>
<a id="Config_JobQueues_Icon_Update" href="#" class="button small">Update</a>
<div id="Config_JobQueues_Icon_Update_Dialog" class="dialog" title="Job Queue Icon">
<div>
<div class="icons">
@foreach (var icon in JobQueueService.Icons)
{
<i data-icon="@(icon.Key)" class="fa fa-@(icon.Key)" title="@icon.Value"></i>
}
</div>
<div class="colours">
@foreach (var colour in JobQueueService.IconColours)
{
<i data-colour="@(colour.Key)" class="fa fa-square d-@(colour.Key)" title="@colour.Value"></i>
}
</div>
</div>
</div>
<script>
(function () {
var dialog, icon, colours, icons;
function showDialog() {
if (!dialog) {
dialog = $('#Config_JobQueues_Icon_Update_Dialog').dialog({
resizable: false,
modal: true,
autoOpen: false,
width: 750,
height: 600,
buttons: {
"Save": save,
Cancel: cancel
}
});
colours = dialog.find('.colours');
icons = dialog.find('.icons');
colours.on('click', 'i', selectColour);
icons.on('click', 'i', selectIcon);
}
colours.find('i[data-colour="' + icon.attr('data-colour') + '"]').each(selectColour);
icons.find('i[data-icon="' + icon.attr('data-icon') + '"]').each(selectIcon);
dialog.dialog('open');
return false;
}
function selectColour() {
var $this = $(this),
colourCode = $this.attr('data-colour'),
previousColourCode = icons.attr('data-colour');
colours.find('i').removeClass('selected fa-check-square').addClass('fa-square');
$this.removeClass('fa-square').addClass('fa-check-square selected');
if (previousColourCode)
icons.removeClass('d-' + previousColourCode);
icons.attr('data-colour', colourCode)
icons.addClass('d-' + colourCode);
}
function selectIcon() {
var $this = $(this),
iconCode = $this.attr('data-icon');
icons.find('i').removeClass('selected');
$this.addClass('selected');
}
function save() {
var url = '@(Url.Action(MVC.API.JobQueue.UpdateIconAndColour(id: Model.Token.JobQueue.Id, redirect: true)))',
data = {
Icon: icons.find('i.selected').attr('data-icon'),
IconColour: colours.find('i.selected').attr('data-colour')
};
window.location.href = url + '&' + $.param(data);
dialog.dialog("disable");
dialog.dialog("option", "buttons", null);
}
function cancel() {
$(this).dialog("close");
}
$(function () {
icon = $('#Config_JobQueues_Icon');
$('#Config_JobQueues_Icon_Update').click(showDialog);
});
}());
</script>
</div>
}
</td>
</tr>
<tr>
<th>Priority:
</th>
<td>@if (canConfig)
{
var priorityValue = Model.Token.JobQueue.Priority.ToString();
var priorityItems = Enum.GetNames(typeof(JobQueuePriority)).Select(i => new SelectListItem() { Text = i, Value = i, Selected = (i == priorityValue) }).ToList();
<i class="fa d-priority-@(priorityValue.ToLower())" title="@(priorityValue) Priority"></i>
@Html.DropDownListFor(m => m.Token.JobQueue.Priority, priorityItems)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var element = $('#Token_JobQueue_Priority');
document.DiscoFunctions.PropertyChangeHelper(
element,
'Invalid Priority',
'@(Url.Action(MVC.API.JobQueue.UpdatePriority(Model.Token.JobQueue.Id)))',
'Priority'
);
element.change(function () {
var icon = element.closest('td').find('i').first();
icon[0].className = '';
icon.addClass('fa d-priority-' + element.val().toLowerCase()).attr('title', element.val() + ' Priority');
});
});
</script>
}
else
{
@Model.Token.JobQueue.Priority.ToString()
}
</td>
</tr>
<tr>
<th>Default SLA:
</th>
<td>@if (canConfig)
{
var slaOptions = JobQueueService.SlaOptions.Select(o => new SelectListItem() { Text = o.Value, Value = o.Key.ToString() }).ToList();
if (this.Model.Token.JobQueue.DefaultSLAExpiry.HasValue)
{
var slaValue = this.Model.Token.JobQueue.DefaultSLAExpiry.Value;
if (JobQueueService.SlaOptions.Where(o => o.Key == slaValue).Count() == 0)
{
string slaValueText;
if (slaValue % (60 * 24 * 7 * 4) == 0)
{ slaValueText = string.Format("{0} months", slaValue / (60 * 24 * 7 * 4)); }
else if (slaValue % (60 * 24 * 7) == 0)
{ slaValueText = string.Format("{0} weeks", slaValue / (60 * 24 * 7)); }
else if (slaValue % (60 * 24) == 0)
{ slaValueText = string.Format("{0} days", slaValue / (60 * 24)); }
else if (slaValue % (60) == 0)
{ slaValueText = string.Format("{0} hours", slaValue / 60); }
else
{ slaValueText = string.Format("{0} minutes", slaValue); }
slaOptions.Insert(0, new SelectListItem() { Text = string.Format("{0} <Custom>", slaValueText), Value = slaValue.ToString() });
}
}
@Html.DropDownListFor(m => m.Token.JobQueue.DefaultSLAExpiry, slaOptions)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Token_JobQueue_DefaultSLAExpiry'),
'Invalid Default SLA',
'@(Url.Action(MVC.API.JobQueue.UpdateDefaultSLAExpiry(Model.Token.JobQueue.Id)))',
'DefaultSLAExpiry'
);
});
</script>
}
else
{
if (this.Model.Token.JobQueue.DefaultSLAExpiry.HasValue)
{
var slaValue = this.Model.Token.JobQueue.DefaultSLAExpiry.Value;
var slaOption = JobQueueService.SlaOptions.Where(o => o.Key == slaValue).ToArray();
if (slaOption.Length > 0)
{
@slaOption[0].Value
}
else
{
<text>&lt;None&gt;</text>
}
}
else
{
<text>&lt;None&gt;</text>
}
}
</td>
</tr>
<tr>
<th>Member Groups/Users:</th>
<td>
@if (Model.Token.SubjectIds.Count == 0)
{
<span class="smallMessage">None Associated</span>
}
else
{
<ul id="Config_JobQueues_Subjects" class="none">
@foreach (var sg in Model.Subjects)
{
var displayName = sg.Id == sg.Name ? sg.Id : string.Format("{0} [{1}]", sg.Name, sg.Id);
<li class="@(sg.IsGroup ? "group" : "user")">@if (sg.IsGroup)
{
<i class="fa fa-users fa-lg"></i>@displayName
}
else
{
<a href="@(Url.Action(MVC.User.Show(sg.Id)))"><i class="fa fa-user fa-lg"></i>@displayName</a>
}</li>
}
</ul>
}
@if (canConfig)
{
<div>
<a id="Config_JobQueues_Subjects_Update" href="#" class="button small">Update</a>
<div id="Config_JobQueues_Subjects_Update_Dialog" class="dialog" title="Job Queue Member Groups/Users">
<div id="Config_JobQueues_Subjects_Update_Dialog_ListContainer">
<span id="Config_JobQueues_Subjects_Update_Dialog_None" class="smallMessage">None Associated</span>
<ul id="Config_JobQueues_Subjects_Update_Dialog_List" class="none">
@foreach (var sg in Model.Subjects)
{
var displayName = sg.Id == sg.Name ? sg.Id : string.Format("{0} [{1}]", sg.Name, sg.Id);
<li class="@(sg.IsGroup ? "group" : "user")" data-subjectid="@sg.Id">@if (sg.IsGroup)
{
<i class="fa fa-users fa-lg"></i>@displayName
}
else
{
<i class="fa fa-user fa-lg"></i>@displayName
}<i class="fa fa-times-circle remove"></i></li>
}
</ul>
</div>
<div id="Config_JobQueues_Subjects_Update_Dialog_AddContainer">
<input type="text" id="Config_JobQueues_Subjects_Update_Dialog_TextAdd" />
<a id="Config_JobQueues_Subjects_Update_Dialog_Add" href="#" class="button small">Add</a>
</div>
<form id="Config_JobQueues_Subjects_Update_Dialog_Form" action="@(Url.Action(MVC.API.JobQueue.UpdateSubjects(Model.Token.JobQueue.Id, null, true)))" method="post"></form>
</div>
<script>
(function () {
var dialog, textAdd, list, noSubjects, form;
function showDialog() {
if (!dialog) {
dialog = $('#Config_JobQueues_Subjects_Update_Dialog').dialog({
resizable: false,
modal: true,
autoOpen: false,
width: 350,
height: 420,
buttons: {
"Save Changes": saveChanges,
Cancel: cancel
}
});
dialog.on('click', '.remove', remove);
list = $('#Config_JobQueues_Subjects_Update_Dialog_List');
noSubjects = $('#Config_JobQueues_Subjects_Update_Dialog_None');
textAdd = $('#Config_JobQueues_Subjects_Update_Dialog_TextAdd');
textAdd.watermark('Search Subjects')
.autocomplete({
source: '@(Url.Action(MVC.API.JobQueue.SearchSubjects()))',
minLength: 2,
focus: function (e, ui) {
textAdd.val(ui.item.Id);
return false;
},
select: function (e, ui) {
textAdd.val(ui.item.Id).blur();
return false;
}
}).data('ui-autocomplete')._renderItem = function (ul, item) {
return $("<li></li>")
.data("item.autocomplete", item)
.append("<a><strong>" + item.Name + "</strong><br>" + item.Id + " (" + item.Type + ")</a>")
.appendTo(ul);
};
$('#Config_JobQueues_Subjects_Update_Dialog_Add').click(add);
}
dialog.dialog('open');
updateNoSubjects();
return false;
}
function cancel() {
$(this).dialog("close");
list.find('li').each(function () {
$this = $(this);
if ($this.is('[data-subjectstatus="new"]')) {
$this.remove();
} else {
if ($this.is('[data-subjectstatus="removed"]')) {
$this.show();
}
}
});
}
function remove() {
$this = $(this).closest('li');
if ($this.is('[data-subjectstatus="new"]')) {
$this.remove();
} else {
$this.attr('data-subjectstatus', 'removed').hide();
}
updateNoSubjects();
}
function add() {
var id = textAdd.val();
$.ajax({
url: '@Url.Action(MVC.API.JobQueue.Subject())',
method: 'get',
data: { Id: id }
}).done(function (response) {
if (response) {
if (list.find('li[data-subjectid="' + response.Id + '"]').length == 0) {
var liIcon = $('<i>').addClass('fa fa-lg');
if (response.Type === 'user')
liIcon.addClass('fa-user');
else
liIcon.addClass('fa-users');
var li = $('<li>')
.append(liIcon)
.append($('<span>').text(response.Id == response.Name ? response.Id : response.Name + ' [' + response.Id + ']'))
.append($('<i>').addClass('fa fa-times-circle remove'))
.addClass(response.Type)
.attr('data-subjectid', response.Id)
.attr('data-subjectstatus', 'new');
list.append(li);
updateNoSubjects();
} else {
alert('That subject has already been added');
}
} else {
alert('Unknown Id');
}
}).fail(function (jqXHR, textStatus, errorThrown) {
alert('Error: ' + errorThrown);
});
}
function updateNoSubjects() {
if (list.find('li:visible').length > 0)
noSubjects.hide();
else
noSubjects.show();
}
function saveChanges() {
var form = $('#Config_JobQueues_Subjects_Update_Dialog_Form').empty();
list.find('li[data-subjectstatus!="removed"]').each(function () {
var subjectId = $(this).attr('data-subjectid');
form.append($('<input>').attr({
'name': 'Subjects',
'type': 'hidden'
}).val(subjectId));
}).get();
form.submit();
dialog.dialog("disable");
dialog.dialog("option", "buttons", null);
}
$(function () {
$('#Config_JobQueues_Subjects_Update').click(showDialog);
});
})();
</script>
</div>
}
</td>
</tr>
<tr>
<th>Automatically Add Jobs:</th>
<td>
<div>
@if (Model.Token.JobQueue.JobSubTypes.Count > 0)
{
<ul>
@foreach (var jobType in Model.Token.JobQueue.JobSubTypes.GroupBy(jst => jst.JobType).OrderBy(jtg => jtg.Key.Description))
{
<li>
@jobType.Key.Description
<ul>
@if (jobType.Count() == Model.JobTypes.FirstOrDefault(jt => jt.Id == jobType.Key.Id).JobSubTypes.Count)
{
<li><span class="smallMessage">[All Sub Types]</span></li>
}
else
{
foreach (var jobSubType in jobType)
{
<li>@jobSubType.Description</li>
}
}
</ul>
</li>
}
</ul>
}
else
{
<text>&lt;None&gt;</text>
}
</div>
@if (canConfig)
{
<a id="Config_JobQueues_JobSubTypes_Update" href="#" class="button small">Update</a>
<div id="Config_JobQueues_JobSubTypes_Update_Dialog" class="dialog" title="Job Queue Automatic Types">
@using (Html.BeginForm(MVC.API.JobQueue.UpdateJobSubTypes(Model.Token.JobQueue.Id, null, true)))
{
var selectedTypes = Model.Token.JobQueue.JobSubTypes.Select(jst => jst.JobType).Distinct().ToList();
foreach (var jt in Model.JobTypes)
{
<div id="trJobType@(jt.Id)" class="jobTypes">
<h4>
<input id="Types_@(jt.Id)" class="jobType" type="checkbox" value="@(jt.Id)" @(selectedTypes.Contains(jt) ? "checked=\"checked\"" : null) /><label for="Types_@(jt.Id)">@jt.Description</label></h4>
<div id="SubTypes_@(jt.Id)" class="jobSubTypes">
@CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id), "div")
@CommonHelpers.CheckBoxList("JobSubTypes", jt.JobSubTypes.OrderBy(jst => jst.Description).ToSelectListItems(Model.Token.JobQueue.JobSubTypes), 2)
</div>
</div>
}
}
</div>
<script>
(function () {
var dialog;
function showDialog() {
if (!dialog) {
dialog = $('#Config_JobQueues_JobSubTypes_Update_Dialog').dialog({
resizable: false,
modal: true,
autoOpen: false,
width: 750,
height: 620,
buttons: {
"Save Changes": saveChanges,
Cancel: cancel
}
});
dialog.find('.jobSubTypes').hide();
dialog.on('change', 'input.jobType', function () {
var $this = $(this);
if ($this.is(':checked'))
$('#SubTypes_' + $this.val()).slideDown('fast');
else
$('#SubTypes_' + $this.val()).slideUp('fast');
}).find('input.jobType:checked').each(function () {
$('#SubTypes_' + $(this).val()).show();
});
}
dialog.dialog('open');
return false;
}
function cancel() {
dialog.dialog("disable");
dialog.dialog("option", "buttons", null);
// Refresh Page
window.location.href = window.location.href;
}
function saveChanges() {
var form = dialog.find('form');
$('input.jobType:unchecked').each(function () {
$('#SubTypes_' + $(this).val()).find('input').prop('checked', false);
});
form.submit();
dialog.dialog("disable");
dialog.dialog("option", "buttons", null);
}
$(function () {
$('#Config_JobQueues_JobSubTypes_Update').click(showDialog);
});
})();
</script>
}
<div style="padding: 0.7em 0.7em;" class="ui-state-highlight ui-corner-all">
<i class="fa fa-info-circle information"></i>&nbsp;When jobs of these types are created, they will automatically be added into this queue.
</div>
</td>
</tr>
</table>
</div>
@if (canDelete)
{
<div class="actionBar">
@Html.ActionLinkButton("Delete", MVC.API.JobQueue.Delete(Model.Token.JobQueue.Id, true), "Config_JobQueues_Actions_Delete_Button")
<div id="Config_JobQueues_Actions_Delete_Dialog" title="Delete this Job Queue?">
<p>
<i class="fa fa-exclamation-triangle fa-lg warning"></i>
This item will be permanently deleted and cannot be recovered.<br />
<br />
Are you sure?
</p>
</div>
<script type="text/javascript">
$(function () {
var button = $('#Config_JobQueues_Actions_Delete_Button');
var buttonDialog = $('#Config_JobQueues_Actions_Delete_Dialog');
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
buttonDialog.dialog('open');
return false;
});
buttonDialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Delete": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog("close");
}
}
});
});
</script>
</div>
}
File diff suppressed because it is too large Load Diff
+1
View File
@@ -15,6 +15,7 @@
<add namespace="Disco" />
<add namespace="Disco.BI.Extensions" />
<add namespace="Disco.Models.Repository" />
<add namespace="Disco.Services" />
<add namespace="Disco.Services.Authorization" />
<add namespace="Disco.Services.Web" />
<add namespace="Disco.Web" />
@@ -1,4 +1,5 @@
@{
Layout = MVC.Shared.Views._Layout;
Html.BundleDeferred("~/Style/Config");
ViewContext.ViewData["MenuArea"] = MVC.Config.Name;
}
@@ -48,6 +48,7 @@ namespace Disco.Web.Areas.Config.Views
Layout = MVC.Shared.Views._Layout;
Html.BundleDeferred("~/Style/Config");
ViewContext.ViewData["MenuArea"] = MVC.Config.Name;
#line default