@@ -35,6 +35,20 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.JobPreferences.Configure)]
|
||||
public virtual ActionResult UpdateDefaultNoticeboardTheme(string DefaultNoticeboardTheme, bool redirect = false)
|
||||
{
|
||||
Database.DiscoConfiguration.JobPreferences.DefaultNoticeboardTheme = DefaultNoticeboardTheme;
|
||||
Database.SaveChanges();
|
||||
|
||||
Disco.Services.Jobs.Noticeboards.NoticeboardUpdatesHub.SetTheme(DefaultNoticeboardTheme);
|
||||
|
||||
if (redirect)
|
||||
return RedirectToAction(MVC.Config.JobPreferences.Index());
|
||||
else
|
||||
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.JobPreferences.Configure)]
|
||||
public virtual ActionResult UpdateLocationMode(LocationModes LocationMode, bool redirect = false)
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
LongRunningJobDaysThreshold = Database.DiscoConfiguration.JobPreferences.LongRunningJobDaysThreshold,
|
||||
StaleJobMinutesThreshold = Database.DiscoConfiguration.JobPreferences.StaleJobMinutesThreshold,
|
||||
DefaultNoticeboardTheme = Database.DiscoConfiguration.JobPreferences.DefaultNoticeboardTheme,
|
||||
LocationMode = Database.DiscoConfiguration.JobPreferences.LocationMode,
|
||||
LocationList = Database.DiscoConfiguration.JobPreferences.LocationList
|
||||
};
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using Disco.Models.BI.Job;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.BI.Job;
|
||||
using Disco.Models.UI.Config.JobPreferences;
|
||||
using Disco.Services.Extensions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.JobPreferences
|
||||
{
|
||||
@@ -13,9 +13,31 @@ namespace Disco.Web.Areas.Config.Models.JobPreferences
|
||||
{
|
||||
public int LongRunningJobDaysThreshold { get; set; }
|
||||
public int StaleJobMinutesThreshold { get; set; }
|
||||
public string DefaultNoticeboardTheme { get; set; }
|
||||
public LocationModes LocationMode { get; set; }
|
||||
public List<string> LocationList { get; set; }
|
||||
|
||||
public List<KeyValuePair<string, string>> DefaultNoticeboardThemeOptions()
|
||||
{
|
||||
return UIHelpers.NoticeboardThemes.ToList();
|
||||
}
|
||||
|
||||
public Lazy<List<Disco.Models.Repository.DeviceProfile>> DeviceProfiles = new Lazy<List<Disco.Models.Repository.DeviceProfile>>(() =>
|
||||
{
|
||||
using (var database = new DiscoDataContext())
|
||||
{
|
||||
return database.DeviceProfiles.OrderBy(a => a.Description).ToList();
|
||||
}
|
||||
});
|
||||
|
||||
public Lazy<List<Disco.Models.BI.Config.OrganisationAddress>> OrganisationAddresses = new Lazy<List<Disco.Models.BI.Config.OrganisationAddress>>(() =>
|
||||
{
|
||||
using (var database = new DiscoDataContext())
|
||||
{
|
||||
return database.DiscoConfiguration.OrganisationAddresses.Addresses.OrderBy(a => a.Name).ToList();
|
||||
}
|
||||
});
|
||||
|
||||
public List<KeyValuePair<int, string>> LongRunningJobDaysThresholdOptions()
|
||||
{
|
||||
var options = new List<KeyValuePair<int, string>>() {
|
||||
|
||||
@@ -12,5 +12,6 @@
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
|
||||
}
|
||||
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.General);
|
||||
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Reports);
|
||||
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Locations);
|
||||
}
|
||||
@@ -59,6 +59,7 @@ namespace Disco.Web.Areas.Config.Views.JobPreferences
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
|
||||
}
|
||||
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.General);
|
||||
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Reports);
|
||||
Html.RenderPartial(MVC.Config.JobPreferences.Views.Parts.Locations);
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
@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_ReportPrefs" class="form" style="width: 530px;">
|
||||
<h2>Report Preferences</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 200px">Noticeboard Default Theme:
|
||||
</th>
|
||||
<td>@if (canConfig)
|
||||
{
|
||||
@Html.DropDownListFor(model => model.DefaultNoticeboardTheme, Model.DefaultNoticeboardThemeOptions().Select(o => new SelectListItem() { Value = o.Key, Text = o.Value }))
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$element = $('#DefaultNoticeboardTheme');
|
||||
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
$element,
|
||||
null,
|
||||
'@(Url.Action(MVC.API.JobPreferences.UpdateDefaultNoticeboardTheme()))',
|
||||
'DefaultNoticeboardTheme');
|
||||
|
||||
$element.change(function () {
|
||||
$('#Config_ReportPrefs_Preview').attr('class', 'theme-' + $(this).val());
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
else
|
||||
{
|
||||
@Model.DefaultNoticeboardThemeOptions().First(o => o.Key == Model.DefaultNoticeboardTheme).Value
|
||||
}
|
||||
<div id="Config_ReportPrefs_Preview" class="theme-@(Model.DefaultNoticeboardTheme)">
|
||||
<div class="heading">Noticeboard Heading</div>
|
||||
<div class="column-heading">Column One</div>
|
||||
<div class="column-heading">Column Two</div>
|
||||
<div class="column-heading">Column Three</div>
|
||||
<div class="column"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></div>
|
||||
<div class="column"><span></span><span class="alert"></span><span></span><span></span></div>
|
||||
<div class="column"><span></span><span></span><span class="alert"></span><span></span><span class="alert"></span><span></span><span></span><span></span><span></span><span></span></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<td>
|
||||
<button id="Config_ReportPrefs_Builder_Button" class="button small">Link Builder</button>
|
||||
<div class="info-box">
|
||||
<p class="fa-p">
|
||||
<i class="fa fa-info-circle"></i>Report Links can be created which override the default theme and filter the data shown.
|
||||
</p>
|
||||
</div>
|
||||
<div id="Config_ReportPrefs_Builder" title="Report Link Builder" class="dialog">
|
||||
<form>
|
||||
<div class="report">
|
||||
<h3>Report</h3>
|
||||
<ul class="none">
|
||||
<li>
|
||||
<input type="radio" id="Config_ReportPrefs_Builder_NTHDU" name="Report" class="themeable" data-url="@(Url.ActionAbsolute(MVC.Public.UserHeldDevices.Noticeboard()))" checked="checked" /><label for="Config_ReportPrefs_Builder_NTHDU">Technician Held Devices for Users (Noticeboard)</label>
|
||||
</li>
|
||||
<li>
|
||||
<input type="radio" id="Config_ReportPrefs_Builder_THDU" name="Report" data-url="@(Url.ActionAbsolute(MVC.Public.UserHeldDevices.Index()))" /><label for="Config_ReportPrefs_Builder_THDU">Technician Held Devices for Users (Report)</label>
|
||||
</li>
|
||||
<li>
|
||||
<input type="radio" id="Config_ReportPrefs_Builder_NTHD" name="Report" class="themeable" data-url="@(Url.ActionAbsolute(MVC.Public.HeldDevices.Noticeboard()))" /><label for="Config_ReportPrefs_Builder_NTHD">Technician Held Devices (Noticeboard)</label>
|
||||
</li>
|
||||
<li>
|
||||
<input type="radio" id="Config_ReportPrefs_Builder_THD" name="Report" data-url="@(Url.ActionAbsolute(MVC.Public.HeldDevices.Index()))" /><label for="Config_ReportPrefs_Builder_THD">Technician Held Devices (Report)</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="theme">
|
||||
<h3>Noticeboard Theme</h3>
|
||||
@Html.DropDownList("Config_ReportPrefs_Builder_Theme", new SelectListItem[] { new SelectListItem() { Value = "", Text = "<Default>", Selected = true } }.Concat(Model.DefaultNoticeboardThemeOptions().Select(o => new SelectListItem() { Value = o.Key, Text = o.Value })))
|
||||
</div>
|
||||
<div class="filter">
|
||||
<h3>Filter</h3>
|
||||
<select id="Config_ReportPrefs_Builder_Filter">
|
||||
<option value=""><None></option>
|
||||
<option value="DeviceProfile">Device Profile</option>
|
||||
<option value="DeviceAddress">Device Profile Address</option>
|
||||
</select>
|
||||
<div class="options">
|
||||
<div class="method">
|
||||
<input type="radio" id="Config_ReportPrefs_Builder_I" name="FilterAction" value="Include" checked="checked" /><label for="Config_ReportPrefs_Builder_I">Include</label>
|
||||
<input type="radio" id="Config_ReportPrefs_Builder_E" name="FilterAction" value="Exclude" /><label for="Config_ReportPrefs_Builder_E">Exclude</label>
|
||||
</div>
|
||||
<div class="filter-option filter-DeviceProfile">
|
||||
<ul class="none">
|
||||
@foreach (var deviceProfile in Model.DeviceProfiles.Value)
|
||||
{
|
||||
<li>
|
||||
<input id="Config_ReportPrefs_Builder_DP_@(deviceProfile.Id)" type="checkbox" value="@deviceProfile.Id" /><label for="Config_ReportPrefs_Builder_DP_@(deviceProfile.Id)">@deviceProfile.Description</label></li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="filter-option filter-DeviceAddress">
|
||||
<ul class="none">
|
||||
@foreach (var address in Model.OrganisationAddresses.Value)
|
||||
{
|
||||
<li>
|
||||
<input id="Config_ReportPrefs_Builder_OA_@(address.Id)" type="checkbox" value="@address.ShortName" /><label for="Config_ReportPrefs_Builder_OA_@(address.Id)">@address.Name (@address.ShortName)</label></li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="output">
|
||||
<textarea readonly></textarea>
|
||||
<a href="#" target="_blank"><i class="fa fa-external-link" title="Open Link"></i></a>
|
||||
<i class="fa fa-clipboard" title="Copy Link to Clipboard"></i>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
var dialog, url;
|
||||
|
||||
function updateUrl() {
|
||||
var theme = null;
|
||||
var filter = null;
|
||||
var filterMethod = null;
|
||||
var filterValue = null;
|
||||
|
||||
var report = dialog.find('.report input:checked');
|
||||
if (report.length > 0) {
|
||||
url = report.attr('data-url');
|
||||
|
||||
if (report.hasClass('themeable')) {
|
||||
theme = dialog.find('.theme > select').val();
|
||||
}
|
||||
|
||||
filter = dialog.find('.filter > select').val();
|
||||
|
||||
if (!!filter) {
|
||||
filterMethod = dialog.find('.filter .method input:checked').val();
|
||||
|
||||
filterValue = dialog
|
||||
.find('.filter .filter-' + filter)
|
||||
.find('input:checked')
|
||||
.map(function (index, element) { return $(element).val(); })
|
||||
.toArray().join(',');
|
||||
}
|
||||
|
||||
if (!!theme || !!filter) {
|
||||
url += '?';
|
||||
|
||||
if (!!theme)
|
||||
url += 'theme=' + theme;
|
||||
|
||||
if (!!theme && !!filter)
|
||||
url += '&';
|
||||
|
||||
if (!!filter)
|
||||
url += filter + filterMethod + '=' + filterValue;
|
||||
}
|
||||
}
|
||||
|
||||
$('#Config_ReportPrefs_Builder_Buttonpane').find('textarea').val(url);
|
||||
$('#Config_ReportPrefs_Builder_Buttonpane').find('.fa-external-link').closest('a').attr('href', url);
|
||||
}
|
||||
|
||||
$('#Config_ReportPrefs_Builder_Button').click(function () {
|
||||
|
||||
if (!dialog) {
|
||||
dialog = $('#Config_ReportPrefs_Builder').dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
width: 550,
|
||||
maxHeight: 520,
|
||||
buttons: {
|
||||
Close: function () {
|
||||
dialog.dialog('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
dialog.find('.report').on('change', 'input', function () {
|
||||
var $this = $(this);
|
||||
var $theme = dialog.find('.theme');
|
||||
|
||||
if ($this.hasClass('themeable'))
|
||||
$theme.slideDown();
|
||||
else
|
||||
$theme.slideUp();
|
||||
|
||||
updateUrl();
|
||||
});
|
||||
|
||||
dialog.find('#Config_ReportPrefs_Builder_Theme').change(updateUrl);
|
||||
|
||||
dialog.find('#Config_ReportPrefs_Builder_Filter').change(function () {
|
||||
var $this = $(this);
|
||||
var $filter = dialog.find('.options');
|
||||
|
||||
if (!$this.val())
|
||||
$filter.slideUp();
|
||||
else {
|
||||
$filter.find('.filter-option').hide();
|
||||
$filter.show();
|
||||
$filter.find('.filter-' + $this.val()).slideDown();
|
||||
}
|
||||
|
||||
updateUrl();
|
||||
});
|
||||
|
||||
dialog.find('.filter .options').on('click', 'input', updateUrl);
|
||||
|
||||
var $buttonpane = dialog.closest('.ui-dialog').children('.ui-dialog-buttonpane');
|
||||
$buttonpane.attr('id', 'Config_ReportPrefs_Builder_Buttonpane').append(dialog.children('.output'));
|
||||
|
||||
$buttonpane.find('textarea').focus(function () {
|
||||
$(this).select();
|
||||
});
|
||||
|
||||
|
||||
var $clipboard = $buttonpane.find('.fa-clipboard');
|
||||
|
||||
if (!!window.clipboardData) {
|
||||
$clipboard.click(function () {
|
||||
window.clipboardData.setData('Text', url);
|
||||
alert('Link copied to Clipboard');
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
$clipboard.hide();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dialog.dialog('open');
|
||||
|
||||
updateUrl();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,728 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34014
|
||||
//
|
||||
// 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.BI.Extensions;
|
||||
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/Reports.cshtml")]
|
||||
public partial class Reports : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.JobPreferences.IndexModel>
|
||||
{
|
||||
public Reports()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.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_ReportPrefs\"");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 530px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Report Preferences</h2>\r\n <table>\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 200px\"");
|
||||
|
||||
WriteLiteral(">Noticeboard Default Theme:\r\n </th>\r\n <td>");
|
||||
|
||||
|
||||
#line 13 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
if (canConfig)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 15 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
Write(Html.DropDownListFor(model => model.DefaultNoticeboardTheme, Model.DefaultNoticeboardThemeOptions().Select(o => new SelectListItem() { Value = o.Key, Text = o.Value })));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 15 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 16 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
Write(AjaxHelpers.AjaxSave());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 16 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 17 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 17 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
$element = $('#DefaultNoticeboardTheme');
|
||||
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
$element,
|
||||
null,
|
||||
'");
|
||||
|
||||
|
||||
#line 25 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
Write(Url.Action(MVC.API.JobPreferences.UpdateDefaultNoticeboardTheme()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
'DefaultNoticeboardTheme');
|
||||
|
||||
$element.change(function () {
|
||||
$('#Config_ReportPrefs_Preview').attr('class', 'theme-' + $(this).val());
|
||||
});
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
Write(Model.DefaultNoticeboardThemeOptions().First(o => o.Key == Model.DefaultNoticeboardTheme).Value);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"Config_ReportPrefs_Preview\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1694), Tuple.Create("\"", 1740)
|
||||
, Tuple.Create(Tuple.Create("", 1702), Tuple.Create("theme-", 1702), true)
|
||||
|
||||
#line 38 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1708), Tuple.Create<System.Object, System.Int32>(Model.DefaultNoticeboardTheme
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1708), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"heading\"");
|
||||
|
||||
WriteLiteral(">Noticeboard Heading</div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"column-heading\"");
|
||||
|
||||
WriteLiteral(">Column One</div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"column-heading\"");
|
||||
|
||||
WriteLiteral(">Column Two</div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"column-heading\"");
|
||||
|
||||
WriteLiteral(">Column Three</div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"column\"");
|
||||
|
||||
WriteLiteral("><span></span><span></span><span></span><span></span><span></span><span></span><s" +
|
||||
"pan></span><span></span></div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"column\"");
|
||||
|
||||
WriteLiteral("><span></span><span");
|
||||
|
||||
WriteLiteral(" class=\"alert\"");
|
||||
|
||||
WriteLiteral("></span><span></span><span></span></div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"column\"");
|
||||
|
||||
WriteLiteral("><span></span><span></span><span");
|
||||
|
||||
WriteLiteral(" class=\"alert\"");
|
||||
|
||||
WriteLiteral("></span><span></span><span");
|
||||
|
||||
WriteLiteral(" class=\"alert\"");
|
||||
|
||||
WriteLiteral("></span><span></span><span></span><span></span><span></span><span></span></div>\r\n" +
|
||||
" </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th> </th>\r\n <td>\r\n <button");
|
||||
|
||||
WriteLiteral(" id=\"Config_ReportPrefs_Builder_Button\"");
|
||||
|
||||
WriteLiteral(" class=\"button small\"");
|
||||
|
||||
WriteLiteral(">Link Builder</button>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"info-box\"");
|
||||
|
||||
WriteLiteral(">\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"fa-p\"");
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-info-circle\"");
|
||||
|
||||
WriteLiteral("></i>Report Links can be created which override the default theme and filter the " +
|
||||
"data shown.\r\n </p>\r\n </div>\r\n <" +
|
||||
"div");
|
||||
|
||||
WriteLiteral(" id=\"Config_ReportPrefs_Builder\"");
|
||||
|
||||
WriteLiteral(" title=\"Report Link Builder\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteLiteral(">\r\n <form>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"report\"");
|
||||
|
||||
WriteLiteral(">\r\n <h3>Report</h3>\r\n <ul");
|
||||
|
||||
WriteLiteral(" class=\"none\"");
|
||||
|
||||
WriteLiteral(">\r\n <li>\r\n <inp" +
|
||||
"ut");
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
WriteLiteral(" id=\"Config_ReportPrefs_Builder_NTHDU\"");
|
||||
|
||||
WriteLiteral(" name=\"Report\"");
|
||||
|
||||
WriteLiteral(" class=\"themeable\"");
|
||||
|
||||
WriteLiteral(" data-url=\"");
|
||||
|
||||
|
||||
#line 64 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
Write(Url.ActionAbsolute(MVC.Public.UserHeldDevices.Noticeboard()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" checked=\"checked\"");
|
||||
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteLiteral(" for=\"Config_ReportPrefs_Builder_NTHDU\"");
|
||||
|
||||
WriteLiteral(">Technician Held Devices for Users (Noticeboard)</label>\r\n " +
|
||||
" </li>\r\n <li>\r\n " +
|
||||
" <input");
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
WriteLiteral(" id=\"Config_ReportPrefs_Builder_THDU\"");
|
||||
|
||||
WriteLiteral(" name=\"Report\"");
|
||||
|
||||
WriteLiteral(" data-url=\"");
|
||||
|
||||
|
||||
#line 67 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
Write(Url.ActionAbsolute(MVC.Public.UserHeldDevices.Index()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteLiteral(" for=\"Config_ReportPrefs_Builder_THDU\"");
|
||||
|
||||
WriteLiteral(">Technician Held Devices for Users (Report)</label>\r\n " +
|
||||
" </li>\r\n <li>\r\n " +
|
||||
" <input");
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
WriteLiteral(" id=\"Config_ReportPrefs_Builder_NTHD\"");
|
||||
|
||||
WriteLiteral(" name=\"Report\"");
|
||||
|
||||
WriteLiteral(" class=\"themeable\"");
|
||||
|
||||
WriteLiteral(" data-url=\"");
|
||||
|
||||
|
||||
#line 70 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
Write(Url.ActionAbsolute(MVC.Public.HeldDevices.Noticeboard()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteLiteral(" for=\"Config_ReportPrefs_Builder_NTHD\"");
|
||||
|
||||
WriteLiteral(">Technician Held Devices (Noticeboard)</label>\r\n <" +
|
||||
"/li>\r\n <li>\r\n " +
|
||||
"<input");
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
WriteLiteral(" id=\"Config_ReportPrefs_Builder_THD\"");
|
||||
|
||||
WriteLiteral(" name=\"Report\"");
|
||||
|
||||
WriteLiteral(" data-url=\"");
|
||||
|
||||
|
||||
#line 73 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
Write(Url.ActionAbsolute(MVC.Public.HeldDevices.Index()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteLiteral(" for=\"Config_ReportPrefs_Builder_THD\"");
|
||||
|
||||
WriteLiteral(">Technician Held Devices (Report)</label>\r\n </li>\r" +
|
||||
"\n </ul>\r\n </div>\r\n " +
|
||||
" <div");
|
||||
|
||||
WriteLiteral(" class=\"theme\"");
|
||||
|
||||
WriteLiteral(">\r\n <h3>Noticeboard Theme</h3>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 79 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
Write(Html.DropDownList("Config_ReportPrefs_Builder_Theme", new SelectListItem[] { new SelectListItem() { Value = "", Text = "<Default>", Selected = true } }.Concat(Model.DefaultNoticeboardThemeOptions().Select(o => new SelectListItem() { Value = o.Key, Text = o.Value }))));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"filter\"");
|
||||
|
||||
WriteLiteral(">\r\n <h3>Filter</h3>\r\n <sele" +
|
||||
"ct");
|
||||
|
||||
WriteLiteral(" id=\"Config_ReportPrefs_Builder_Filter\"");
|
||||
|
||||
WriteLiteral(">\r\n <option");
|
||||
|
||||
WriteLiteral(" value=\"\"");
|
||||
|
||||
WriteLiteral("><None></option>\r\n <option");
|
||||
|
||||
WriteLiteral(" value=\"DeviceProfile\"");
|
||||
|
||||
WriteLiteral(">Device Profile</option>\r\n <option");
|
||||
|
||||
WriteLiteral(" value=\"DeviceAddress\"");
|
||||
|
||||
WriteLiteral(">Device Profile Address</option>\r\n </select>\r\n " +
|
||||
" <div");
|
||||
|
||||
WriteLiteral(" class=\"options\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"method\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
WriteLiteral(" id=\"Config_ReportPrefs_Builder_I\"");
|
||||
|
||||
WriteLiteral(" name=\"FilterAction\"");
|
||||
|
||||
WriteLiteral(" value=\"Include\"");
|
||||
|
||||
WriteLiteral(" checked=\"checked\"");
|
||||
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteLiteral(" for=\"Config_ReportPrefs_Builder_I\"");
|
||||
|
||||
WriteLiteral(">Include</label>\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
WriteLiteral(" id=\"Config_ReportPrefs_Builder_E\"");
|
||||
|
||||
WriteLiteral(" name=\"FilterAction\"");
|
||||
|
||||
WriteLiteral(" value=\"Exclude\"");
|
||||
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteLiteral(" for=\"Config_ReportPrefs_Builder_E\"");
|
||||
|
||||
WriteLiteral(">Exclude</label>\r\n </div>\r\n " +
|
||||
" <div");
|
||||
|
||||
WriteLiteral(" class=\"filter-option filter-DeviceProfile\"");
|
||||
|
||||
WriteLiteral(">\r\n <ul");
|
||||
|
||||
WriteLiteral(" class=\"none\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 95 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 95 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
foreach (var deviceProfile in Model.DeviceProfiles.Value)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <li>\r\n " +
|
||||
" <input");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 6584), Tuple.Create("\"", 6638)
|
||||
, Tuple.Create(Tuple.Create("", 6589), Tuple.Create("Config_ReportPrefs_Builder_DP_", 6589), true)
|
||||
|
||||
#line 98 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6619), Tuple.Create<System.Object, System.Int32>(deviceProfile.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 6619), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 6655), Tuple.Create("\"", 6680)
|
||||
|
||||
#line 98 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6663), Tuple.Create<System.Object, System.Int32>(deviceProfile.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 6663), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 6690), Tuple.Create("\"", 6745)
|
||||
, Tuple.Create(Tuple.Create("", 6696), Tuple.Create("Config_ReportPrefs_Builder_DP_", 6696), true)
|
||||
|
||||
#line 98 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6726), Tuple.Create<System.Object, System.Int32>(deviceProfile.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 6726), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 98 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
Write(deviceProfile.Description);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</label></li>\r\n");
|
||||
|
||||
|
||||
#line 99 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </ul>\r\n </div>" +
|
||||
"\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"filter-option filter-DeviceAddress\"");
|
||||
|
||||
WriteLiteral(">\r\n <ul");
|
||||
|
||||
WriteLiteral(" class=\"none\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 104 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 104 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
foreach (var address in Model.OrganisationAddresses.Value)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <li>\r\n " +
|
||||
" <input");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 7299), Tuple.Create("\"", 7347)
|
||||
, Tuple.Create(Tuple.Create("", 7304), Tuple.Create("Config_ReportPrefs_Builder_OA_", 7304), true)
|
||||
|
||||
#line 107 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 7334), Tuple.Create<System.Object, System.Int32>(address.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 7334), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 7364), Tuple.Create("\"", 7390)
|
||||
|
||||
#line 107 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 7372), Tuple.Create<System.Object, System.Int32>(address.ShortName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 7372), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 7400), Tuple.Create("\"", 7449)
|
||||
, Tuple.Create(Tuple.Create("", 7406), Tuple.Create("Config_ReportPrefs_Builder_OA_", 7406), true)
|
||||
|
||||
#line 107 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 7436), Tuple.Create<System.Object, System.Int32>(address.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 7436), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 107 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
Write(address.Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" (");
|
||||
|
||||
|
||||
#line 107 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
Write(address.ShortName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(")</label></li>\r\n");
|
||||
|
||||
|
||||
#line 108 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </ul>\r\n </div>" +
|
||||
"\r\n </div>\r\n </div>\r\n " +
|
||||
" </form>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"output\"");
|
||||
|
||||
WriteLiteral(">\r\n <textarea readonly></textarea>\r\n " +
|
||||
" <a");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" target=\"_blank\"");
|
||||
|
||||
WriteLiteral("><i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-external-link\"");
|
||||
|
||||
WriteLiteral(" title=\"Open Link\"");
|
||||
|
||||
WriteLiteral("></i></a>\r\n <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-clipboard\"");
|
||||
|
||||
WriteLiteral(" title=\"Copy Link to Clipboard\"");
|
||||
|
||||
WriteLiteral("></i>\r\n </div>\r\n </div>\r\n <scrip" +
|
||||
"t>\r\n $(function () {\r\n var dialog, url" +
|
||||
";\r\n\r\n function updateUrl() {\r\n " +
|
||||
" var theme = null;\r\n var filter = null;\r\n " +
|
||||
" var filterMethod = null;\r\n var filter" +
|
||||
"Value = null;\r\n\r\n var report = dialog.find(\'.report i" +
|
||||
"nput:checked\');\r\n if (report.length > 0) {\r\n " +
|
||||
" url = report.attr(\'data-url\');\r\n\r\n " +
|
||||
" if (report.hasClass(\'themeable\')) {\r\n " +
|
||||
" theme = dialog.find(\'.theme > select\').val();\r\n " +
|
||||
" }\r\n\r\n filter = dialog.find(\'.filter > select\').v" +
|
||||
"al();\r\n\r\n if (!!filter) {\r\n " +
|
||||
" filterMethod = dialog.find(\'.filter .method input:checked\').val();" +
|
||||
"\r\n\r\n filterValue = dialog\r\n " +
|
||||
" .find(\'.filter .filter-\' + filter)\r\n " +
|
||||
" .find(\'input:checked\')\r\n " +
|
||||
" .map(function (index, element) { return $(element).val(); })\r\n " +
|
||||
" .toArray().join(\',\');\r\n }" +
|
||||
"\r\n\r\n if (!!theme || !!filter) {\r\n " +
|
||||
" url += \'?\';\r\n\r\n if (!!the" +
|
||||
"me)\r\n url += \'theme=\' + theme;\r\n\r\n " +
|
||||
" if (!!theme && !!filter)\r\n " +
|
||||
" url += \'&\';\r\n\r\n if (!!filter)\r" +
|
||||
"\n url += filter + filterMethod + \'=\' + fi" +
|
||||
"lterValue;\r\n }\r\n }\r\n\r\n" +
|
||||
" $(\'#Config_ReportPrefs_Builder_Buttonpane\').find(\'te" +
|
||||
"xtarea\').val(url);\r\n $(\'#Config_ReportPrefs_Builder_B" +
|
||||
"uttonpane\').find(\'.fa-external-link\').closest(\'a\').attr(\'href\', url);\r\n " +
|
||||
" }\r\n\r\n $(\'#Config_ReportPrefs_Builder_Butto" +
|
||||
"n\').click(function () {\r\n\r\n if (!dialog) {\r\n " +
|
||||
" dialog = $(\'#Config_ReportPrefs_Builder\').dialog({\r\n " +
|
||||
" resizable: false,\r\n " +
|
||||
" modal: true,\r\n autoOpen: false,\r\n " +
|
||||
" width: 550,\r\n m" +
|
||||
"axHeight: 520,\r\n buttons: {\r\n " +
|
||||
" Close: function () {\r\n " +
|
||||
" dialog.dialog(\'close\');\r\n }\r\n " +
|
||||
" }\r\n });\r\n\r\n " +
|
||||
" dialog.find(\'.report\').on(\'change\', \'input\', functio" +
|
||||
"n () {\r\n var $this = $(this);\r\n " +
|
||||
" var $theme = dialog.find(\'.theme\');\r\n\r\n " +
|
||||
" if ($this.hasClass(\'themeable\'))\r\n " +
|
||||
" $theme.slideDown();\r\n else\r\n " +
|
||||
" $theme.slideUp();\r\n\r\n " +
|
||||
" updateUrl();\r\n });\r\n\r\n " +
|
||||
" dialog.find(\'#Config_ReportPrefs_Builder_Theme\').change(updateUr" +
|
||||
"l);\r\n\r\n dialog.find(\'#Config_ReportPrefs_Builder_" +
|
||||
"Filter\').change(function () {\r\n var $this = $" +
|
||||
"(this);\r\n var $filter = dialog.find(\'.options" +
|
||||
"\');\r\n\r\n if (!$this.val())\r\n " +
|
||||
" $filter.slideUp();\r\n el" +
|
||||
"se {\r\n $filter.find(\'.filter-option\').hid" +
|
||||
"e();\r\n $filter.show();\r\n " +
|
||||
" $filter.find(\'.filter-\' + $this.val()).slideDown();\r\n " +
|
||||
" }\r\n\r\n updateU" +
|
||||
"rl();\r\n });\r\n\r\n di" +
|
||||
"alog.find(\'.filter .options\').on(\'click\', \'input\', updateUrl);\r\n\r\n " +
|
||||
" var $buttonpane = dialog.closest(\'.ui-dialog\').children(\'.ui-d" +
|
||||
"ialog-buttonpane\');\r\n $buttonpane.attr(\'id\', \'Con" +
|
||||
"fig_ReportPrefs_Builder_Buttonpane\').append(dialog.children(\'.output\'));\r\n\r\n " +
|
||||
" $buttonpane.find(\'textarea\').focus(function () {\r\n " +
|
||||
" $(this).select();\r\n " +
|
||||
" });\r\n\r\n\r\n var $clipboard = $buttonpane.find(" +
|
||||
"\'.fa-clipboard\');\r\n \r\n " +
|
||||
" if (!!window.clipboardData) {\r\n $clipboa" +
|
||||
"rd.click(function () {\r\n window.clipboard" +
|
||||
"Data.setData(\'Text\', url);\r\n alert(\'Link " +
|
||||
"copied to Clipboard\');\r\n return false;\r\n " +
|
||||
" });\r\n } else {" +
|
||||
"\r\n $clipboard.hide();\r\n " +
|
||||
" }\r\n\r\n }\r\n\r\n dial" +
|
||||
"og.dialog(\'open\');\r\n\r\n updateUrl();\r\n\r\n " +
|
||||
" return false;\r\n });\r\n\r\n " +
|
||||
"});\r\n </script>\r\n </td>\r\n </tr>\r\n </table>\r\n" +
|
||||
"</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -1,5 +1,8 @@
|
||||
using Disco.Services.Jobs.Noticeboards;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Jobs.Noticeboards;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web.Areas.Public.Models.UserHeldDevices;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
|
||||
@@ -7,9 +10,26 @@ namespace Disco.Web.Areas.Public.Controllers
|
||||
{
|
||||
public partial class HeldDevicesController : DatabaseController
|
||||
{
|
||||
public virtual ActionResult Index()
|
||||
public virtual ActionResult Index(List<int?> DeviceProfileInclude, List<int?> DeviceProfileExclude, List<string> DeviceAddressInclude, List<string> DeviceAddressExclude)
|
||||
{
|
||||
var m = Disco.Services.Jobs.Noticeboards.HeldDevices.GetHeldDevices(Database);
|
||||
IQueryable<Job> query = Database.Jobs;
|
||||
|
||||
if (DeviceProfileInclude != null)
|
||||
query = query.Where(j => DeviceProfileInclude.Contains(j.Device.DeviceProfileId));
|
||||
if (DeviceProfileExclude != null)
|
||||
query = query.Where(j => !DeviceProfileExclude.Contains(j.Device.DeviceProfileId));
|
||||
if (DeviceAddressInclude != null && DeviceAddressInclude.Count > 0)
|
||||
{
|
||||
var addressIds = Database.DiscoConfiguration.OrganisationAddresses.Addresses.Where(a => DeviceAddressInclude.Contains(a.ShortName)).Select(a => a.Id).ToList();
|
||||
query = query.Where(j => addressIds.Contains(j.Device.DeviceProfile.DefaultOrganisationAddress));
|
||||
}
|
||||
if (DeviceAddressExclude != null && DeviceAddressExclude.Count > 0)
|
||||
{
|
||||
var addressIds = Database.DiscoConfiguration.OrganisationAddresses.Addresses.Where(a => DeviceAddressExclude.Contains(a.ShortName)).Select(a => (int?)a.Id).ToList();
|
||||
query = query.Where(j => j.Device.DeviceProfile.DefaultOrganisationAddress == null || !addressIds.Contains(j.Device.DeviceProfile.DefaultOrganisationAddress));
|
||||
}
|
||||
|
||||
var m = Disco.Services.Jobs.Noticeboards.HeldDevices.GetHeldDevices(query);
|
||||
|
||||
return View(m);
|
||||
}
|
||||
@@ -38,7 +58,12 @@ namespace Disco.Web.Areas.Public.Controllers
|
||||
|
||||
public virtual ActionResult Noticeboard()
|
||||
{
|
||||
return View();
|
||||
var model = new NoticeboardModel()
|
||||
{
|
||||
DefaultTheme = Database.DiscoConfiguration.JobPreferences.DefaultNoticeboardTheme
|
||||
};
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
public virtual ActionResult HeldDevice(string id)
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
using Disco.Services.Jobs.Noticeboards;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Jobs.Noticeboards;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web.Areas.Public.Models.UserHeldDevices;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
|
||||
@@ -7,9 +10,26 @@ namespace Disco.Web.Areas.Public.Controllers
|
||||
{
|
||||
public partial class UserHeldDevicesController : DatabaseController
|
||||
{
|
||||
public virtual ActionResult Index()
|
||||
public virtual ActionResult Index(List<int?> DeviceProfileInclude, List<int?> DeviceProfileExclude, List<string> DeviceAddressInclude, List<string> DeviceAddressExclude)
|
||||
{
|
||||
var m = Disco.Services.Jobs.Noticeboards.HeldDevicesForUsers.GetHeldDevicesForUsers(Database);
|
||||
IQueryable<Job> query = Database.Jobs;
|
||||
|
||||
if (DeviceProfileInclude != null)
|
||||
query = query.Where(j => DeviceProfileInclude.Contains(j.Device.DeviceProfileId));
|
||||
if (DeviceProfileExclude != null)
|
||||
query = query.Where(j => !DeviceProfileExclude.Contains(j.Device.DeviceProfileId));
|
||||
if (DeviceAddressInclude != null && DeviceAddressInclude.Count > 0)
|
||||
{
|
||||
var addressIds = Database.DiscoConfiguration.OrganisationAddresses.Addresses.Where(a => DeviceAddressInclude.Contains(a.ShortName)).Select(a => a.Id).ToList();
|
||||
query = query.Where(j => addressIds.Contains(j.Device.DeviceProfile.DefaultOrganisationAddress));
|
||||
}
|
||||
if (DeviceAddressExclude != null && DeviceAddressExclude.Count > 0)
|
||||
{
|
||||
var addressIds = Database.DiscoConfiguration.OrganisationAddresses.Addresses.Where(a => DeviceAddressExclude.Contains(a.ShortName)).Select(a => (int?)a.Id).ToList();
|
||||
query = query.Where(j => j.Device.DeviceProfile.DefaultOrganisationAddress == null || !addressIds.Contains(j.Device.DeviceProfile.DefaultOrganisationAddress));
|
||||
}
|
||||
|
||||
var m = Disco.Services.Jobs.Noticeboards.HeldDevicesForUsers.GetHeldDevicesForUsers(query);
|
||||
|
||||
return View(m);
|
||||
}
|
||||
@@ -38,7 +58,12 @@ namespace Disco.Web.Areas.Public.Controllers
|
||||
|
||||
public virtual ActionResult Noticeboard()
|
||||
{
|
||||
return View();
|
||||
var model = new NoticeboardModel()
|
||||
{
|
||||
DefaultTheme = Database.DiscoConfiguration.JobPreferences.DefaultNoticeboardTheme
|
||||
};
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
public virtual ActionResult UserHeldDevice(string id)
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
namespace Disco.Web.Areas.Public.Models.UserHeldDevices
|
||||
{
|
||||
public class NoticeboardModel
|
||||
{
|
||||
public string DefaultTheme { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
@{
|
||||
@model Disco.Web.Areas.Public.Models.UserHeldDevices.NoticeboardModel
|
||||
@{
|
||||
Layout = null;
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
@@ -13,7 +14,7 @@
|
||||
<title>Disco ICT - Held Devices</title>
|
||||
@Html.BundleRenderDeferred()
|
||||
</head>
|
||||
<body class="status-connecting">
|
||||
<body class="theme-@(Model.DefaultTheme) status-connecting">
|
||||
<div id="page">
|
||||
<header id="header">
|
||||
<div id="heading">Held Devices</div>
|
||||
@@ -92,6 +93,7 @@
|
||||
|
||||
var rotateSpeed = 3000;
|
||||
var itemFilters;
|
||||
var fixedTheme = null;
|
||||
|
||||
var $inProcessList = $('#inProcess').find('ul');
|
||||
var $readyForReturnList = $('#readyForReturn').find('ul');
|
||||
@@ -118,11 +120,15 @@
|
||||
}
|
||||
|
||||
function init() {
|
||||
monitorMouseMove();
|
||||
applyQueryString();
|
||||
|
||||
// Connect to Hub
|
||||
hub = $.connection.noticeboardUpdates;
|
||||
|
||||
// Map Functions
|
||||
hub.client.updateHeldDevice = updateHeldDevice;
|
||||
hub.client.setTheme = setTheme;
|
||||
|
||||
$.connection.hub.qs = { Noticeboard: '@(Disco.Services.Jobs.Noticeboards.HeldDevices.Name)' };
|
||||
$.connection.hub.error(connectionError);
|
||||
@@ -165,7 +171,6 @@
|
||||
|
||||
window.setTimeout(scheduleRotation, rotateSpeed);
|
||||
});
|
||||
buildFilters();
|
||||
}
|
||||
|
||||
// Called by SignalR
|
||||
@@ -237,14 +242,53 @@
|
||||
}, true);
|
||||
}
|
||||
|
||||
function buildFilters() {
|
||||
var filters = [];
|
||||
function setTheme(theme) {
|
||||
if (!!fixedTheme)
|
||||
return;
|
||||
|
||||
var $body = $(document.body);
|
||||
|
||||
// Existing classes
|
||||
var c = $body.attr('class').split(' ');
|
||||
// Remove existing theme
|
||||
c = $.grep(c, function (i) { return (i.indexOf('theme-') !== 0) });
|
||||
|
||||
c.push('theme-' + theme);
|
||||
|
||||
$body.attr('class', c.join(' '));
|
||||
}
|
||||
|
||||
function monitorMouseMove() {
|
||||
var token = null,
|
||||
$body = $(document.body);
|
||||
|
||||
$body.mousemove(function () {
|
||||
if (!!token)
|
||||
window.clearTimeout(token);
|
||||
else if ($body.css('cursor') == 'none')
|
||||
$body.css('cursor', 'auto');
|
||||
|
||||
token = window.setTimeout(function () {
|
||||
$body.css('cursor', 'none');
|
||||
token = null;
|
||||
}, 3500);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function applyQueryString() {
|
||||
var queryStringParameters = getQueryStringParameters();
|
||||
|
||||
if (queryStringParameters !== null) {
|
||||
var filters = [];
|
||||
|
||||
$.each(queryStringParameters, function (key, value) {
|
||||
switch (key.toLowerCase()) {
|
||||
case 'deviceaddressinclude':
|
||||
case 'theme': // THEME
|
||||
setTheme(value);
|
||||
fixedTheme = value;
|
||||
break;
|
||||
case 'deviceaddressinclude': // FILTER: Device Address Include
|
||||
var deviceAddresses = value.split(",").map(function (v) { return v.toLowerCase(); });
|
||||
if (deviceAddresses.length > 0) {
|
||||
filters.push(function (heldDeviceItem) {
|
||||
@@ -257,7 +301,7 @@
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 'deviceaddressexclude':
|
||||
case 'deviceaddressexclude': // FILTER: Device Address Exclude
|
||||
var deviceAddresses = value.split(",").map(function (v) { return v.toLowerCase(); });
|
||||
if (deviceAddresses.length > 0) {
|
||||
filters.push(function (heldDeviceItem) {
|
||||
@@ -270,7 +314,7 @@
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 'deviceprofileinclude':
|
||||
case 'deviceprofileinclude': // FILTER: Device Profile Include
|
||||
var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); });
|
||||
if (deviceProfiles.length > 0) {
|
||||
filters.push(function (heldDeviceItem) {
|
||||
@@ -279,7 +323,7 @@
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 'deviceprofileexclude':
|
||||
case 'deviceprofileexclude': // FILTER: Device Profile Exclude
|
||||
var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); });
|
||||
if (deviceProfiles.length > 0) {
|
||||
filters.push(function (heldDeviceItem) {
|
||||
@@ -290,12 +334,12 @@
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (filters.length > 0)
|
||||
itemFilters = filters;
|
||||
else
|
||||
itemFilters = null;
|
||||
if (filters.length > 0)
|
||||
itemFilters = filters;
|
||||
else
|
||||
itemFilters = null;
|
||||
}
|
||||
}
|
||||
|
||||
function connectionError() {
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Disco.Web.Areas.Public.Views.HeldDevices
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Public/Views/HeldDevices/Noticeboard.cshtml")]
|
||||
public partial class Noticeboard : Disco.Services.Web.WebViewPage<dynamic>
|
||||
public partial class Noticeboard : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Public.Models.UserHeldDevices.NoticeboardModel>
|
||||
{
|
||||
public Noticeboard()
|
||||
{
|
||||
@@ -44,7 +44,7 @@ namespace Disco.Web.Areas.Public.Views.HeldDevices
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 1 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
|
||||
#line 2 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
|
||||
|
||||
Layout = null;
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
@@ -70,7 +70,7 @@ WriteLiteral(" />\r\n <title>Disco ICT - Held Devices</title>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 14 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
|
||||
#line 15 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
|
||||
Write(Html.BundleRenderDeferred());
|
||||
|
||||
|
||||
@@ -78,7 +78,17 @@ Write(Html.BundleRenderDeferred());
|
||||
#line hidden
|
||||
WriteLiteral("\r\n</head>\r\n<body");
|
||||
|
||||
WriteLiteral(" class=\"status-connecting\"");
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 562), Tuple.Create("\"", 615)
|
||||
, Tuple.Create(Tuple.Create("", 570), Tuple.Create("theme-", 570), true)
|
||||
|
||||
#line 17 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 576), Tuple.Create<System.Object, System.Int32>(Model.DefaultTheme
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 576), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 597), Tuple.Create("status-connecting", 598), true)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
@@ -219,26 +229,28 @@ WriteLiteral(">\r\n <li data-bind=\"css: { alert: IsAlert }\">\r\n
|
||||
" else\r\n $(element).livestamp(\'destroy\');\r\n " +
|
||||
" }\r\n };\r\n </script>\r\n <script>\r\n $(function () {\r\n " +
|
||||
" var hub;\r\n var viewModel;\r\n\r\n var rotateSpeed = 3000" +
|
||||
";\r\n var itemFilters;\r\n\r\n var $inProcessList = $(\'#inProces" +
|
||||
"s\').find(\'ul\');\r\n var $readyForReturnList = $(\'#readyForReturn\').find" +
|
||||
"(\'ul\');\r\n var $waitingForUserActionList = $(\'#waitingForUserAction\')." +
|
||||
"find(\'ul\');\r\n\r\n function noticeboardViewModel(inProcess, readyForRetu" +
|
||||
"rn, waitingForUserAction) {\r\n var self = this;\r\n\r\n " +
|
||||
" self.initialized = false;\r\n\r\n self.inProcess = ko.observableArra" +
|
||||
"y(inProcess);\r\n self.readyForReturn = ko.observableArray(readyFor" +
|
||||
"Return);\r\n self.waitingForUserAction = ko.observableArray(waiting" +
|
||||
"ForUserAction);\r\n\r\n self.onRemove = function (element, index, dat" +
|
||||
"a) {\r\n $(element).slideUp(400, function () {\r\n " +
|
||||
" $(this).remove();\r\n });\r\n }\r\n " +
|
||||
" self.onAdd = function (element, index, data) {\r\n if (" +
|
||||
"self.initialized)\r\n $(element).hide().slideDown(400);\r\n " +
|
||||
" }\r\n }\r\n\r\n function init() {\r\n " +
|
||||
" // Connect to Hub\r\n hub = $.connection.noticeboardUpdates;\r\n\r\n " +
|
||||
" // Map Functions\r\n hub.client.updateHeldDevice = up" +
|
||||
"dateHeldDevice;\r\n\r\n $.connection.hub.qs = { Noticeboard: \'");
|
||||
";\r\n var itemFilters;\r\n var fixedTheme = null;\r\n\r\n " +
|
||||
" var $inProcessList = $(\'#inProcess\').find(\'ul\');\r\n var $readyForRe" +
|
||||
"turnList = $(\'#readyForReturn\').find(\'ul\');\r\n var $waitingForUserActi" +
|
||||
"onList = $(\'#waitingForUserAction\').find(\'ul\');\r\n\r\n function noticebo" +
|
||||
"ardViewModel(inProcess, readyForReturn, waitingForUserAction) {\r\n " +
|
||||
" var self = this;\r\n\r\n self.initialized = false;\r\n\r\n " +
|
||||
" self.inProcess = ko.observableArray(inProcess);\r\n self.readyFor" +
|
||||
"Return = ko.observableArray(readyForReturn);\r\n self.waitingForUse" +
|
||||
"rAction = ko.observableArray(waitingForUserAction);\r\n\r\n self.onRe" +
|
||||
"move = function (element, index, data) {\r\n $(element).slideUp" +
|
||||
"(400, function () {\r\n $(this).remove();\r\n " +
|
||||
" });\r\n }\r\n self.onAdd = function (element, inde" +
|
||||
"x, data) {\r\n if (self.initialized)\r\n $" +
|
||||
"(element).hide().slideDown(400);\r\n }\r\n }\r\n\r\n " +
|
||||
" function init() {\r\n monitorMouseMove();\r\n applyQ" +
|
||||
"ueryString();\r\n\r\n // Connect to Hub\r\n hub = $.conn" +
|
||||
"ection.noticeboardUpdates;\r\n\r\n // Map Functions\r\n " +
|
||||
"hub.client.updateHeldDevice = updateHeldDevice;\r\n hub.client.setT" +
|
||||
"heme = setTheme;\r\n\r\n $.connection.hub.qs = { Noticeboard: \'");
|
||||
|
||||
|
||||
#line 127 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
|
||||
#line 133 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
|
||||
Write(Disco.Services.Jobs.Noticeboards.HeldDevices.Name);
|
||||
|
||||
|
||||
@@ -258,7 +270,7 @@ WriteLiteral(@"' };
|
||||
$.getJSON('");
|
||||
|
||||
|
||||
#line 138 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
|
||||
#line 144 "..\..\Areas\Public\Views\HeldDevices\Noticeboard.cshtml"
|
||||
Write(Url.Action(MVC.Public.HeldDevices.HeldDevices()));
|
||||
|
||||
|
||||
@@ -280,136 +292,154 @@ WriteLiteral("\', null, function (data) {\r\n\r\n var inProce
|
||||
"orUserAction);\r\n\r\n ko.applyBindings(viewModel);\r\n " +
|
||||
" viewModel.initialized = true;\r\n\r\n $(\'body\').removeCla" +
|
||||
"ss(\'status-connecting\');\r\n\r\n window.setTimeout(scheduleRotati" +
|
||||
"on, rotateSpeed);\r\n });\r\n buildFilters();\r\n " +
|
||||
" }\r\n\r\n // Called by SignalR\r\n function updateHeldDevic" +
|
||||
"e(updates) {\r\n if (viewModel) {\r\n\r\n $.each(upd" +
|
||||
"ates, function (deviceSerialNumber, heldDeviceItem) {\r\n /" +
|
||||
"/ Remove Existing\r\n removeItem(deviceSerialNumber);\r\n\r\n " +
|
||||
" // Add Item\r\n addItem(heldDeviceIte" +
|
||||
"m);\r\n });\r\n }\r\n }\r\n\r\n fu" +
|
||||
"nction removeItem(deviceSerialNumber) {\r\n removeItemFromArray(vie" +
|
||||
"wModel.inProcess, deviceSerialNumber);\r\n removeItemFromArray(view" +
|
||||
"Model.readyForReturn, deviceSerialNumber);\r\n removeItemFromArray(" +
|
||||
"viewModel.waitingForUserAction, deviceSerialNumber);\r\n }\r\n\r\n " +
|
||||
" function addItem(heldDeviceItem) {\r\n if (heldDeviceItem !== nu" +
|
||||
"ll &&\r\n heldDeviceItem !== undefined &&\r\n " +
|
||||
"includeItem(heldDeviceItem)) {\r\n\r\n var array;\r\n\r\n " +
|
||||
" if (isWaitingForUserAction(heldDeviceItem))\r\n arr" +
|
||||
"ay = viewModel.waitingForUserAction;\r\n else if (isReadyForRet" +
|
||||
"urn(heldDeviceItem))\r\n array = viewModel.readyForReturn;\r" +
|
||||
"\n else if (isInProcess(heldDeviceItem))\r\n " +
|
||||
" array = viewModel.inProcess;\r\n\r\n if (array().length === 0" +
|
||||
") {\r\n array.push(heldDeviceItem);\r\n } " +
|
||||
"else {\r\n var index = findSortedInsertIndex(array, heldDev" +
|
||||
"iceItem);\r\n if (index === -1)\r\n " +
|
||||
" array.push(heldDeviceItem);\r\n else\r\n " +
|
||||
" array.splice(index, 0, heldDeviceItem);\r\n }\r\n " +
|
||||
" }\r\n }\r\n\r\n function rotateArrays() {\r\n " +
|
||||
" rotateArray(viewModel.inProcess, $inProcessList);\r\n rotateArr" +
|
||||
"ay(viewModel.readyForReturn, $readyForReturnList);\r\n rotateArray(" +
|
||||
"viewModel.waitingForUserAction, $waitingForUserActionList);\r\n }\r\n\r\n " +
|
||||
" function scheduleRotation() {\r\n rotateArrays();\r\n\r\n " +
|
||||
" window.setTimeout(scheduleRotation, rotateSpeed);\r\n }\r\n\r\n" +
|
||||
" function includeItem(heldDeviceItem) {\r\n if (itemFilt" +
|
||||
"ers == null || itemFilters.length == 0)\r\n return true;\r\n\r\n " +
|
||||
" return itemFilters.reduce(function (previousValue, currentValue, in" +
|
||||
"dex, array) {\r\n if (previousValue === false)\r\n " +
|
||||
" return false;\r\n return currentValue(heldDeviceItem);" +
|
||||
"\r\n }, true);\r\n }\r\n\r\n function buildFilters(" +
|
||||
") {\r\n var filters = [];\r\n var queryStringParameter" +
|
||||
"s = getQueryStringParameters();\r\n\r\n if (queryStringParameters !==" +
|
||||
" null) {\r\n $.each(queryStringParameters, function (key, value" +
|
||||
") {\r\n switch (key.toLowerCase()) {\r\n " +
|
||||
" case \'deviceaddressinclude\':\r\n var deviceA" +
|
||||
"ddresses = value.split(\",\").map(function (v) { return v.toLowerCase(); });\r\n " +
|
||||
" if (deviceAddresses.length > 0) {\r\n " +
|
||||
" filters.push(function (heldDeviceItem) {\r\n " +
|
||||
" // false if DeviceAddressShortName is null\r\n " +
|
||||
" if (!heldDeviceItem.DeviceAddressShortName)\r\n " +
|
||||
" return false;\r\n\r\n " +
|
||||
" // true if DeviceAddressShortName is included\r\n " +
|
||||
" return $.inArray(heldDeviceItem.DeviceAddressShortName.toLower" +
|
||||
"Case(), deviceAddresses) >= 0;\r\n });\r\n " +
|
||||
" }\r\n break;\r\n " +
|
||||
" case \'deviceaddressexclude\':\r\n va" +
|
||||
"r deviceAddresses = value.split(\",\").map(function (v) { return v.toLowerCase(); " +
|
||||
"});\r\n if (deviceAddresses.length > 0) {\r\n " +
|
||||
" filters.push(function (heldDeviceItem) {\r\n " +
|
||||
" // true if DeviceAddressShortName is null\r\n " +
|
||||
" if (!heldDeviceItem.DeviceAddressShortName)\r\n " +
|
||||
" return true;\r\n\r\n " +
|
||||
" // true if DeviceAddressShortName is excluded\r\n " +
|
||||
" return $.inArray(heldDeviceItem.DeviceAddressShortName." +
|
||||
"toLowerCase(), deviceAddresses) < 0;\r\n });\r\n " +
|
||||
" }\r\n break;\r\n " +
|
||||
" case \'deviceprofileinclude\':\r\n " +
|
||||
" var deviceProfiles = value.split(\",\").map(function (v) { return parseInt(v);" +
|
||||
" });\r\n if (deviceProfiles.length > 0) {\r\n " +
|
||||
" filters.push(function (heldDeviceItem) {\r\n " +
|
||||
" // true if DeviceProfileId is included\r\n " +
|
||||
" return $.inArray(heldDeviceItem.DeviceProfileId, d" +
|
||||
"eviceProfiles) >= 0;\r\n });\r\n " +
|
||||
" }\r\n break;\r\n " +
|
||||
" case \'deviceprofileexclude\':\r\n var devicePr" +
|
||||
"ofiles = value.split(\",\").map(function (v) { return parseInt(v); });\r\n " +
|
||||
" if (deviceProfiles.length > 0) {\r\n " +
|
||||
" filters.push(function (heldDeviceItem) {\r\n " +
|
||||
" // true if DeviceProfileId is excluded\r\n " +
|
||||
" return $.inArray(heldDeviceItem.DeviceProfileId, deviceProfiles) <" +
|
||||
" 0;\r\n });\r\n }\r" +
|
||||
"\n break;\r\n }\r\n " +
|
||||
" });\r\n }\r\n\r\n if (filters.length > 0)\r\n " +
|
||||
" itemFilters = filters;\r\n else\r\n " +
|
||||
" itemFilters = null;\r\n }\r\n\r\n function connectionError() {\r" +
|
||||
"\n try {\r\n $(\'body\').addClass(\'status-error\');\r" +
|
||||
"\n $.connection.hub.stop();\r\n } catch (e) {\r\n " +
|
||||
" // Ignore\r\n }\r\n\r\n window.setTime" +
|
||||
"out(function () {\r\n window.location.href = window.location.hr" +
|
||||
"ef;\r\n }, 10000);\r\n }\r\n\r\n // Helpers\r\n " +
|
||||
" function rotateArray(koArray, element) {\r\n var items = koAr" +
|
||||
"ray();\r\n\r\n if (items.length <= 1)\r\n return 0;\r" +
|
||||
"\n\r\n if (element.height() < (element.parent().height() - 30)) {\r\n\r" +
|
||||
"\n if (findUnsortedArrayTopIndex(items) !== 0)\r\n " +
|
||||
" koArray.sort(sortFunction);\r\n\r\n // Don\'t rotate if " +
|
||||
"small & sorted correctly\r\n return;\r\n }\r\n\r\n " +
|
||||
" // Move Last Item to Top\r\n var item = koArray.pop();\r" +
|
||||
"\n koArray.unshift(item);\r\n }\r\n function rem" +
|
||||
"oveItemFromArray(koArray, deviceSerialNumber) {\r\n var items = koA" +
|
||||
"rray();\r\n for (var i = 0; i < items.length; i++) {\r\n " +
|
||||
" if (items[i].DeviceSerialNumber == deviceSerialNumber) {\r\n " +
|
||||
" koArray.splice(i, 1);\r\n items = koArray();\r\n " +
|
||||
" i--;\r\n }\r\n }\r\n " +
|
||||
"}\r\n function findUnsortedArrayTopIndex(items) {\r\n // O" +
|
||||
"nly one Item\r\n if (items.length <= 1)\r\n return" +
|
||||
" 0;\r\n\r\n for (var i = 1; i < items.length; i++) {\r\n " +
|
||||
" var s = sortFunction(items[i - 1], items[i]);\r\n if (s > " +
|
||||
"0)\r\n return i;\r\n }\r\n\r\n retu" +
|
||||
"rn 0;\r\n }\r\n function findSortedInsertIndex(koArray, heldDe" +
|
||||
"viceItem) {\r\n var items = koArray();\r\n var startIn" +
|
||||
"dex = findUnsortedArrayTopIndex(items);\r\n for (var i = startIndex" +
|
||||
"; i < items.length; i++) {\r\n var s = sortFunction(heldDeviceI" +
|
||||
"tem, items[i]);\r\n if (s <= 0)\r\n return" +
|
||||
" i;\r\n }\r\n if (startIndex !== 0) {\r\n " +
|
||||
" for (var i = 0; i < startIndex; i++) {\r\n var s = sor" +
|
||||
"tFunction(heldDeviceItem, items[i]);\r\n if (s <= 0)\r\n " +
|
||||
" return i;\r\n }\r\n ret" +
|
||||
"urn startIndex;\r\n } else {\r\n return -1;\r\n " +
|
||||
" }\r\n }\r\n function sortFunction(l, r) {\r\n " +
|
||||
" return l.DeviceDescription.toLowerCase() == r.DeviceDescription.toLowerC" +
|
||||
"ase() ? 0 : (l.DeviceDescription.toLowerCase() < r.DeviceDescription.toLowerCase" +
|
||||
"() ? -1 : 1)\r\n }\r\n function isInProcess(i) {\r\n " +
|
||||
" return !i.ReadyForReturn && !i.WaitingForUserAction;\r\n }\r\n " +
|
||||
" function isReadyForReturn(i) {\r\n return i.ReadyForReturn && " +
|
||||
"!i.WaitingForUserAction;\r\n }\r\n function isWaitingForUserAc" +
|
||||
"tion(i) {\r\n return i.WaitingForUserAction;\r\n }\r\n " +
|
||||
" function getQueryStringParameters() {\r\n\r\n if (window.locati" +
|
||||
"on.search.length === 0)\r\n return null;\r\n\r\n var" +
|
||||
" params = {};\r\n window.location.search.substr(1).split(\"&\").forEa" +
|
||||
"ch(function (pair) {\r\n if (pair === \"\") return;\r\n " +
|
||||
" var parts = pair.split(\"=\");\r\n params[parts[0]] = par" +
|
||||
"ts[1] && decodeURIComponent(parts[1].replace(/\\+/g, \" \"));\r\n });\r" +
|
||||
"\n return params;\r\n }\r\n\r\n init();\r\n }" +
|
||||
");\r\n </script>\r\n</body>\r\n</html>");
|
||||
"on, rotateSpeed);\r\n });\r\n }\r\n\r\n // Called b" +
|
||||
"y SignalR\r\n function updateHeldDevice(updates) {\r\n if " +
|
||||
"(viewModel) {\r\n\r\n $.each(updates, function (deviceSerialNumbe" +
|
||||
"r, heldDeviceItem) {\r\n // Remove Existing\r\n " +
|
||||
" removeItem(deviceSerialNumber);\r\n\r\n // Add Item" +
|
||||
"\r\n addItem(heldDeviceItem);\r\n });\r\n " +
|
||||
" }\r\n }\r\n\r\n function removeItem(deviceSerialNum" +
|
||||
"ber) {\r\n removeItemFromArray(viewModel.inProcess, deviceSerialNum" +
|
||||
"ber);\r\n removeItemFromArray(viewModel.readyForReturn, deviceSeria" +
|
||||
"lNumber);\r\n removeItemFromArray(viewModel.waitingForUserAction, d" +
|
||||
"eviceSerialNumber);\r\n }\r\n\r\n function addItem(heldDeviceIte" +
|
||||
"m) {\r\n if (heldDeviceItem !== null &&\r\n heldDe" +
|
||||
"viceItem !== undefined &&\r\n includeItem(heldDeviceItem)) {\r\n\r" +
|
||||
"\n var array;\r\n\r\n if (isWaitingForUserActio" +
|
||||
"n(heldDeviceItem))\r\n array = viewModel.waitingForUserActi" +
|
||||
"on;\r\n else if (isReadyForReturn(heldDeviceItem))\r\n " +
|
||||
" array = viewModel.readyForReturn;\r\n else if (isI" +
|
||||
"nProcess(heldDeviceItem))\r\n array = viewModel.inProcess;\r" +
|
||||
"\n\r\n if (array().length === 0) {\r\n arra" +
|
||||
"y.push(heldDeviceItem);\r\n } else {\r\n v" +
|
||||
"ar index = findSortedInsertIndex(array, heldDeviceItem);\r\n " +
|
||||
" if (index === -1)\r\n array.push(heldDeviceItem);\r\n " +
|
||||
" else\r\n array.splice(index, 0, h" +
|
||||
"eldDeviceItem);\r\n }\r\n }\r\n }\r\n\r\n " +
|
||||
" function rotateArrays() {\r\n rotateArray(viewModel.inProce" +
|
||||
"ss, $inProcessList);\r\n rotateArray(viewModel.readyForReturn, $rea" +
|
||||
"dyForReturnList);\r\n rotateArray(viewModel.waitingForUserAction, $" +
|
||||
"waitingForUserActionList);\r\n }\r\n\r\n function scheduleRotati" +
|
||||
"on() {\r\n rotateArrays();\r\n\r\n window.setTimeout(sch" +
|
||||
"eduleRotation, rotateSpeed);\r\n }\r\n\r\n function includeItem(" +
|
||||
"heldDeviceItem) {\r\n if (itemFilters == null || itemFilters.length" +
|
||||
" == 0)\r\n return true;\r\n\r\n return itemFilters.r" +
|
||||
"educe(function (previousValue, currentValue, index, array) {\r\n " +
|
||||
" if (previousValue === false)\r\n return false;\r\n " +
|
||||
" return currentValue(heldDeviceItem);\r\n }, true);\r\n " +
|
||||
" }\r\n\r\n function setTheme(theme) {\r\n if (!!fixed" +
|
||||
"Theme)\r\n return;\r\n\r\n var $body = $(document.bo" +
|
||||
"dy);\r\n\r\n // Existing classes\r\n var c = $body.attr(" +
|
||||
"\'class\').split(\' \');\r\n // Remove existing theme\r\n " +
|
||||
"c = $.grep(c, function (i) { return (i.indexOf(\'theme-\') !== 0) });\r\n\r\n " +
|
||||
" c.push(\'theme-\' + theme);\r\n\r\n $body.attr(\'class\', c.join(\'" +
|
||||
" \'));\r\n }\r\n\r\n function monitorMouseMove() {\r\n " +
|
||||
" var token = null,\r\n $body = $(document.body);\r\n\r\n " +
|
||||
" $body.mousemove(function () {\r\n if (!!token)\r\n " +
|
||||
" window.clearTimeout(token);\r\n else if ($body." +
|
||||
"css(\'cursor\') == \'none\')\r\n $body.css(\'cursor\', \'auto\');\r\n" +
|
||||
"\r\n token = window.setTimeout(function () {\r\n " +
|
||||
" $body.css(\'cursor\', \'none\');\r\n token = null;\r\n " +
|
||||
" }, 3500);\r\n });\r\n\r\n }\r\n\r\n f" +
|
||||
"unction applyQueryString() {\r\n var queryStringParameters = getQue" +
|
||||
"ryStringParameters();\r\n\r\n if (queryStringParameters !== null) {\r\n" +
|
||||
" var filters = [];\r\n\r\n $.each(queryStringP" +
|
||||
"arameters, function (key, value) {\r\n switch (key.toLowerC" +
|
||||
"ase()) {\r\n case \'theme\': // THEME\r\n " +
|
||||
" setTheme(value);\r\n fixedTheme = val" +
|
||||
"ue;\r\n break;\r\n case \'d" +
|
||||
"eviceaddressinclude\': // FILTER: Device Address Include\r\n " +
|
||||
" var deviceAddresses = value.split(\",\").map(function (v) { return v.toLo" +
|
||||
"werCase(); });\r\n if (deviceAddresses.length > 0) " +
|
||||
"{\r\n filters.push(function (heldDeviceItem) {\r" +
|
||||
"\n // false if DeviceAddressShortName is n" +
|
||||
"ull\r\n if (!heldDeviceItem.DeviceAddressSh" +
|
||||
"ortName)\r\n return false;\r\n\r\n " +
|
||||
" // true if DeviceAddressShortName is included\r\n " +
|
||||
" return $.inArray(heldDeviceItem.DeviceAddr" +
|
||||
"essShortName.toLowerCase(), deviceAddresses) >= 0;\r\n " +
|
||||
" });\r\n }\r\n " +
|
||||
"break;\r\n case \'deviceaddressexclude\': // FILTER: Devi" +
|
||||
"ce Address Exclude\r\n var deviceAddresses = value." +
|
||||
"split(\",\").map(function (v) { return v.toLowerCase(); });\r\n " +
|
||||
" if (deviceAddresses.length > 0) {\r\n " +
|
||||
" filters.push(function (heldDeviceItem) {\r\n " +
|
||||
" // true if DeviceAddressShortName is null\r\n " +
|
||||
" if (!heldDeviceItem.DeviceAddressShortName)\r\n " +
|
||||
" return true;\r\n\r\n // true " +
|
||||
"if DeviceAddressShortName is excluded\r\n r" +
|
||||
"eturn $.inArray(heldDeviceItem.DeviceAddressShortName.toLowerCase(), deviceAddre" +
|
||||
"sses) < 0;\r\n });\r\n " +
|
||||
" }\r\n break;\r\n case" +
|
||||
" \'deviceprofileinclude\': // FILTER: Device Profile Include\r\n " +
|
||||
" var deviceProfiles = value.split(\",\").map(function (v) { return pars" +
|
||||
"eInt(v); });\r\n if (deviceProfiles.length > 0) {\r\n" +
|
||||
" filters.push(function (heldDeviceItem) {\r\n " +
|
||||
" // true if DeviceProfileId is included\r\n " +
|
||||
" return $.inArray(heldDeviceItem.DeviceProf" +
|
||||
"ileId, deviceProfiles) >= 0;\r\n });\r\n " +
|
||||
" }\r\n break;\r\n " +
|
||||
" case \'deviceprofileexclude\': // FILTER: Device Profile Exclude\r\n " +
|
||||
" var deviceProfiles = value.split(\",\").map(function" +
|
||||
" (v) { return parseInt(v); });\r\n if (deviceProfil" +
|
||||
"es.length > 0) {\r\n filters.push(function (hel" +
|
||||
"dDeviceItem) {\r\n // true if DeviceProfile" +
|
||||
"Id is excluded\r\n return $.inArray(heldDev" +
|
||||
"iceItem.DeviceProfileId, deviceProfiles) < 0;\r\n " +
|
||||
" });\r\n }\r\n break" +
|
||||
";\r\n }\r\n });\r\n\r\n if " +
|
||||
"(filters.length > 0)\r\n itemFilters = filters;\r\n " +
|
||||
" else\r\n itemFilters = null;\r\n }\r\n" +
|
||||
" }\r\n\r\n function connectionError() {\r\n try {" +
|
||||
"\r\n $(\'body\').addClass(\'status-error\');\r\n $" +
|
||||
".connection.hub.stop();\r\n } catch (e) {\r\n // I" +
|
||||
"gnore\r\n }\r\n\r\n window.setTimeout(function () {\r\n " +
|
||||
" window.location.href = window.location.href;\r\n }" +
|
||||
", 10000);\r\n }\r\n\r\n // Helpers\r\n function rotateA" +
|
||||
"rray(koArray, element) {\r\n var items = koArray();\r\n\r\n " +
|
||||
" if (items.length <= 1)\r\n return 0;\r\n\r\n if " +
|
||||
"(element.height() < (element.parent().height() - 30)) {\r\n\r\n i" +
|
||||
"f (findUnsortedArrayTopIndex(items) !== 0)\r\n koArray.sort" +
|
||||
"(sortFunction);\r\n\r\n // Don\'t rotate if small & sorted correct" +
|
||||
"ly\r\n return;\r\n }\r\n\r\n // Move La" +
|
||||
"st Item to Top\r\n var item = koArray.pop();\r\n koArr" +
|
||||
"ay.unshift(item);\r\n }\r\n function removeItemFromArray(koArr" +
|
||||
"ay, deviceSerialNumber) {\r\n var items = koArray();\r\n " +
|
||||
" for (var i = 0; i < items.length; i++) {\r\n if (items[i].De" +
|
||||
"viceSerialNumber == deviceSerialNumber) {\r\n koArray.splic" +
|
||||
"e(i, 1);\r\n items = koArray();\r\n i-" +
|
||||
"-;\r\n }\r\n }\r\n }\r\n functio" +
|
||||
"n findUnsortedArrayTopIndex(items) {\r\n // Only one Item\r\n " +
|
||||
" if (items.length <= 1)\r\n return 0;\r\n\r\n " +
|
||||
" for (var i = 1; i < items.length; i++) {\r\n var s = sortFunct" +
|
||||
"ion(items[i - 1], items[i]);\r\n if (s > 0)\r\n " +
|
||||
" return i;\r\n }\r\n\r\n return 0;\r\n }\r\n" +
|
||||
" function findSortedInsertIndex(koArray, heldDeviceItem) {\r\n " +
|
||||
" var items = koArray();\r\n var startIndex = findUnsortedArra" +
|
||||
"yTopIndex(items);\r\n for (var i = startIndex; i < items.length; i+" +
|
||||
"+) {\r\n var s = sortFunction(heldDeviceItem, items[i]);\r\n " +
|
||||
" if (s <= 0)\r\n return i;\r\n }" +
|
||||
"\r\n if (startIndex !== 0) {\r\n for (var i = 0; i" +
|
||||
" < startIndex; i++) {\r\n var s = sortFunction(heldDeviceIt" +
|
||||
"em, items[i]);\r\n if (s <= 0)\r\n " +
|
||||
" return i;\r\n }\r\n return startIndex;\r\n " +
|
||||
" } else {\r\n return -1;\r\n }\r\n " +
|
||||
" }\r\n function sortFunction(l, r) {\r\n return l.Devic" +
|
||||
"eDescription.toLowerCase() == r.DeviceDescription.toLowerCase() ? 0 : (l.DeviceD" +
|
||||
"escription.toLowerCase() < r.DeviceDescription.toLowerCase() ? -1 : 1)\r\n " +
|
||||
" }\r\n function isInProcess(i) {\r\n return !i.ReadyFor" +
|
||||
"Return && !i.WaitingForUserAction;\r\n }\r\n function isReadyF" +
|
||||
"orReturn(i) {\r\n return i.ReadyForReturn && !i.WaitingForUserActio" +
|
||||
"n;\r\n }\r\n function isWaitingForUserAction(i) {\r\n " +
|
||||
" return i.WaitingForUserAction;\r\n }\r\n function getQuer" +
|
||||
"yStringParameters() {\r\n\r\n if (window.location.search.length === 0" +
|
||||
")\r\n return null;\r\n\r\n var params = {};\r\n " +
|
||||
" window.location.search.substr(1).split(\"&\").forEach(function (pair) {\r\n" +
|
||||
" if (pair === \"\") return;\r\n var parts = pa" +
|
||||
"ir.split(\"=\");\r\n params[parts[0]] = parts[1] && decodeURIComp" +
|
||||
"onent(parts[1].replace(/\\+/g, \" \"));\r\n });\r\n retur" +
|
||||
"n params;\r\n }\r\n\r\n init();\r\n });\r\n </script>\r\n</b" +
|
||||
"ody>\r\n</html>");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@{
|
||||
@model Disco.Web.Areas.Public.Models.UserHeldDevices.NoticeboardModel
|
||||
@{
|
||||
Layout = null;
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
@@ -13,7 +14,7 @@
|
||||
<title>Disco ICT - Held Devices for Users</title>
|
||||
@Html.BundleRenderDeferred()
|
||||
</head>
|
||||
<body class="status-connecting">
|
||||
<body class="theme-@(Model.DefaultTheme) status-connecting">
|
||||
<div id="page">
|
||||
<header id="header">
|
||||
<div id="heading">Held Devices for Users</div>
|
||||
@@ -92,6 +93,7 @@
|
||||
|
||||
var rotateSpeed = 3000;
|
||||
var itemFilters;
|
||||
var fixedTheme = null;
|
||||
|
||||
var $inProcessList = $('#inProcess').find('ul');
|
||||
var $readyForReturnList = $('#readyForReturn').find('ul');
|
||||
@@ -118,11 +120,15 @@
|
||||
}
|
||||
|
||||
function init() {
|
||||
monitorMouseMove();
|
||||
applyQueryString();
|
||||
|
||||
// Connect to Hub
|
||||
hub = $.connection.noticeboardUpdates;
|
||||
|
||||
// Map Functions
|
||||
hub.client.updateHeldDeviceForUser = updateHeldDevice;
|
||||
hub.client.setTheme = setTheme;
|
||||
|
||||
$.connection.hub.qs = { Noticeboard: '@(Disco.Services.Jobs.Noticeboards.HeldDevicesForUsers.Name)' };
|
||||
$.connection.hub.error(connectionError);
|
||||
@@ -165,7 +171,6 @@
|
||||
|
||||
window.setTimeout(scheduleRotation, rotateSpeed);
|
||||
});
|
||||
buildFilters();
|
||||
}
|
||||
|
||||
// Called by SignalR
|
||||
@@ -237,14 +242,53 @@
|
||||
}, true);
|
||||
}
|
||||
|
||||
function buildFilters() {
|
||||
var filters = [];
|
||||
function setTheme(theme) {
|
||||
if (!!fixedTheme)
|
||||
return;
|
||||
|
||||
var $body = $(document.body);
|
||||
|
||||
// Existing classes
|
||||
var c = $body.attr('class').split(' ');
|
||||
// Remove existing theme
|
||||
c = $.grep(c, function (i) { return (i.indexOf('theme-') !== 0) });
|
||||
|
||||
c.push('theme-' + theme);
|
||||
|
||||
$body.attr('class', c.join(' '));
|
||||
}
|
||||
|
||||
function monitorMouseMove() {
|
||||
var token = null,
|
||||
$body = $(document.body);
|
||||
|
||||
$body.mousemove(function () {
|
||||
if (!!token)
|
||||
window.clearTimeout(token);
|
||||
else if ($body.css('cursor') == 'none')
|
||||
$body.css('cursor', 'auto');
|
||||
|
||||
token = window.setTimeout(function () {
|
||||
$body.css('cursor', 'none');
|
||||
token = null;
|
||||
}, 3500);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function applyQueryString() {
|
||||
var queryStringParameters = getQueryStringParameters();
|
||||
|
||||
if (queryStringParameters !== null) {
|
||||
var filters = [];
|
||||
|
||||
$.each(queryStringParameters, function (key, value) {
|
||||
switch (key.toLowerCase()) {
|
||||
case 'deviceaddressinclude':
|
||||
case 'theme': // THEME
|
||||
setTheme(value);
|
||||
fixedTheme = value;
|
||||
break;
|
||||
case 'deviceaddressinclude': // FILTER: Device Address Include
|
||||
var deviceAddresses = value.split(",").map(function (v) { return v.toLowerCase(); });
|
||||
if (deviceAddresses.length > 0) {
|
||||
filters.push(function (heldDeviceItem) {
|
||||
@@ -257,7 +301,7 @@
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 'deviceaddressexclude':
|
||||
case 'deviceaddressexclude': // FILTER: Device Address Exclude
|
||||
var deviceAddresses = value.split(",").map(function (v) { return v.toLowerCase(); });
|
||||
if (deviceAddresses.length > 0) {
|
||||
filters.push(function (heldDeviceItem) {
|
||||
@@ -270,7 +314,7 @@
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 'deviceprofileinclude':
|
||||
case 'deviceprofileinclude': // FILTER: Device Profile Include
|
||||
var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); });
|
||||
if (deviceProfiles.length > 0) {
|
||||
filters.push(function (heldDeviceItem) {
|
||||
@@ -279,7 +323,7 @@
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 'deviceprofileexclude':
|
||||
case 'deviceprofileexclude': // FILTER: Device Profile Exclude
|
||||
var deviceProfiles = value.split(",").map(function (v) { return parseInt(v); });
|
||||
if (deviceProfiles.length > 0) {
|
||||
filters.push(function (heldDeviceItem) {
|
||||
@@ -290,12 +334,12 @@
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (filters.length > 0)
|
||||
itemFilters = filters;
|
||||
else
|
||||
itemFilters = null;
|
||||
if (filters.length > 0)
|
||||
itemFilters = filters;
|
||||
else
|
||||
itemFilters = null;
|
||||
}
|
||||
}
|
||||
|
||||
function connectionError() {
|
||||
@@ -403,4 +447,4 @@
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Disco.Web.Areas.Public.Views.UserHeldDevices
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Public/Views/UserHeldDevices/Noticeboard.cshtml")]
|
||||
public partial class Noticeboard : Disco.Services.Web.WebViewPage<dynamic>
|
||||
public partial class Noticeboard : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Public.Models.UserHeldDevices.NoticeboardModel>
|
||||
{
|
||||
public Noticeboard()
|
||||
{
|
||||
@@ -44,7 +44,7 @@ namespace Disco.Web.Areas.Public.Views.UserHeldDevices
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 1 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
|
||||
#line 2 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
|
||||
|
||||
Layout = null;
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
@@ -70,7 +70,7 @@ WriteLiteral(" />\r\n <title>Disco ICT - Held Devices for Users</title>\r\n")
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 14 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
|
||||
#line 15 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
|
||||
Write(Html.BundleRenderDeferred());
|
||||
|
||||
|
||||
@@ -78,7 +78,17 @@ Write(Html.BundleRenderDeferred());
|
||||
#line hidden
|
||||
WriteLiteral("\r\n</head>\r\n<body");
|
||||
|
||||
WriteLiteral(" class=\"status-connecting\"");
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 572), Tuple.Create("\"", 625)
|
||||
, Tuple.Create(Tuple.Create("", 580), Tuple.Create("theme-", 580), true)
|
||||
|
||||
#line 17 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 586), Tuple.Create<System.Object, System.Int32>(Model.DefaultTheme
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 586), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 607), Tuple.Create("status-connecting", 608), true)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
@@ -219,27 +229,29 @@ WriteLiteral(">\r\n <li data-bind=\"css: { alert: IsAlert }\">\r\n
|
||||
"p(valueUnwrapped);\r\n else\r\n $(element).livesta" +
|
||||
"mp(\'destroy\');\r\n }\r\n };\r\n </script>\r\n <script>\r\n " +
|
||||
"$(function () {\r\n var hub;\r\n var viewModel;\r\n\r\n " +
|
||||
" var rotateSpeed = 3000;\r\n var itemFilters;\r\n\r\n var $inPro" +
|
||||
"cessList = $(\'#inProcess\').find(\'ul\');\r\n var $readyForReturnList = $(" +
|
||||
"\'#readyForReturn\').find(\'ul\');\r\n var $waitingForUserActionList = $(\'#" +
|
||||
"waitingForUserAction\').find(\'ul\');\r\n\r\n function noticeboardViewModel(" +
|
||||
"inProcess, readyForReturn, waitingForUserAction) {\r\n var self = t" +
|
||||
"his;\r\n\r\n self.initialized = false;\r\n\r\n self.inProc" +
|
||||
"ess = ko.observableArray(inProcess);\r\n self.readyForReturn = ko.o" +
|
||||
"bservableArray(readyForReturn);\r\n self.waitingForUserAction = ko." +
|
||||
"observableArray(waitingForUserAction);\r\n\r\n self.onRemove = functi" +
|
||||
"on (element, index, data) {\r\n $(element).slideUp(400, functio" +
|
||||
"n () {\r\n $(this).remove();\r\n });\r\n " +
|
||||
" }\r\n self.onAdd = function (element, index, data) {\r\n " +
|
||||
" if (self.initialized)\r\n $(element).hid" +
|
||||
"e().slideDown(400);\r\n }\r\n }\r\n\r\n function in" +
|
||||
"it() {\r\n // Connect to Hub\r\n hub = $.connection.no" +
|
||||
"ticeboardUpdates;\r\n\r\n // Map Functions\r\n hub.clien" +
|
||||
"t.updateHeldDeviceForUser = updateHeldDevice;\r\n\r\n $.connection.hu" +
|
||||
"b.qs = { Noticeboard: \'");
|
||||
" var rotateSpeed = 3000;\r\n var itemFilters;\r\n var fixedThe" +
|
||||
"me = null;\r\n\r\n var $inProcessList = $(\'#inProcess\').find(\'ul\');\r\n " +
|
||||
" var $readyForReturnList = $(\'#readyForReturn\').find(\'ul\');\r\n " +
|
||||
"var $waitingForUserActionList = $(\'#waitingForUserAction\').find(\'ul\');\r\n\r\n " +
|
||||
" function noticeboardViewModel(inProcess, readyForReturn, waitingForUserAct" +
|
||||
"ion) {\r\n var self = this;\r\n\r\n self.initialized = f" +
|
||||
"alse;\r\n\r\n self.inProcess = ko.observableArray(inProcess);\r\n " +
|
||||
" self.readyForReturn = ko.observableArray(readyForReturn);\r\n " +
|
||||
" self.waitingForUserAction = ko.observableArray(waitingForUserAction);\r\n\r\n " +
|
||||
" self.onRemove = function (element, index, data) {\r\n " +
|
||||
" $(element).slideUp(400, function () {\r\n $(this).remo" +
|
||||
"ve();\r\n });\r\n }\r\n self.onAdd = " +
|
||||
"function (element, index, data) {\r\n if (self.initialized)\r\n " +
|
||||
" $(element).hide().slideDown(400);\r\n }\r\n " +
|
||||
" }\r\n\r\n function init() {\r\n monitorMouseMove();\r" +
|
||||
"\n applyQueryString();\r\n\r\n // Connect to Hub\r\n " +
|
||||
" hub = $.connection.noticeboardUpdates;\r\n\r\n // Map Func" +
|
||||
"tions\r\n hub.client.updateHeldDeviceForUser = updateHeldDevice;\r\n " +
|
||||
" hub.client.setTheme = setTheme;\r\n\r\n $.connection.h" +
|
||||
"ub.qs = { Noticeboard: \'");
|
||||
|
||||
|
||||
#line 127 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
|
||||
#line 133 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
|
||||
Write(Disco.Services.Jobs.Noticeboards.HeldDevicesForUsers.Name);
|
||||
|
||||
|
||||
@@ -259,7 +271,7 @@ WriteLiteral(@"' };
|
||||
$.getJSON('");
|
||||
|
||||
|
||||
#line 138 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
|
||||
#line 144 "..\..\Areas\Public\Views\UserHeldDevices\Noticeboard.cshtml"
|
||||
Write(Url.Action(MVC.Public.UserHeldDevices.UserHeldDevices()));
|
||||
|
||||
|
||||
@@ -281,134 +293,152 @@ WriteLiteral("\', null, function (data) {\r\n\r\n var inProce
|
||||
"orUserAction);\r\n\r\n ko.applyBindings(viewModel);\r\n " +
|
||||
" viewModel.initialized = true;\r\n\r\n $(\'body\').removeCla" +
|
||||
"ss(\'status-connecting\');\r\n\r\n window.setTimeout(scheduleRotati" +
|
||||
"on, rotateSpeed);\r\n });\r\n buildFilters();\r\n " +
|
||||
" }\r\n\r\n // Called by SignalR\r\n function updateHeldDevic" +
|
||||
"e(updates) {\r\n if (viewModel) {\r\n\r\n $.each(upd" +
|
||||
"ates, function (UserId, heldDeviceItem) {\r\n // Remove Exi" +
|
||||
"sting\r\n removeItem(UserId);\r\n\r\n //" +
|
||||
" Add Item\r\n addItem(heldDeviceItem);\r\n " +
|
||||
" });\r\n }\r\n }\r\n\r\n function removeItem(UserId" +
|
||||
") {\r\n removeItemFromArray(viewModel.inProcess, UserId);\r\n " +
|
||||
" removeItemFromArray(viewModel.readyForReturn, UserId);\r\n " +
|
||||
"removeItemFromArray(viewModel.waitingForUserAction, UserId);\r\n }\r\n\r\n " +
|
||||
" function addItem(heldDeviceItem) {\r\n if (heldDeviceIte" +
|
||||
"m !== null &&\r\n heldDeviceItem !== undefined &&\r\n " +
|
||||
" includeItem(heldDeviceItem)) {\r\n\r\n var array;\r\n\r\n " +
|
||||
" if (isWaitingForUserAction(heldDeviceItem))\r\n " +
|
||||
" array = viewModel.waitingForUserAction;\r\n else if (isRea" +
|
||||
"dyForReturn(heldDeviceItem))\r\n array = viewModel.readyFor" +
|
||||
"Return;\r\n else if (isInProcess(heldDeviceItem))\r\n " +
|
||||
" array = viewModel.inProcess;\r\n\r\n if (array().leng" +
|
||||
"th === 0) {\r\n array.push(heldDeviceItem);\r\n " +
|
||||
" } else {\r\n var index = findSortedInsertIndex(array," +
|
||||
" heldDeviceItem);\r\n if (index === -1)\r\n " +
|
||||
" array.push(heldDeviceItem);\r\n else\r\n " +
|
||||
" array.splice(index, 0, heldDeviceItem);\r\n }\r" +
|
||||
"\n }\r\n }\r\n\r\n function rotateArrays() {\r\n " +
|
||||
" rotateArray(viewModel.inProcess, $inProcessList);\r\n r" +
|
||||
"otateArray(viewModel.readyForReturn, $readyForReturnList);\r\n rota" +
|
||||
"teArray(viewModel.waitingForUserAction, $waitingForUserActionList);\r\n " +
|
||||
" }\r\n\r\n function scheduleRotation() {\r\n rotateArrays();" +
|
||||
"\r\n\r\n window.setTimeout(scheduleRotation, rotateSpeed);\r\n " +
|
||||
" }\r\n\r\n function includeItem(heldDeviceItem) {\r\n if (" +
|
||||
"itemFilters == null || itemFilters.length == 0)\r\n return true" +
|
||||
";\r\n\r\n return itemFilters.reduce(function (previousValue, currentV" +
|
||||
"alue, index, array) {\r\n if (previousValue === false)\r\n " +
|
||||
" return false;\r\n return currentValue(heldDevi" +
|
||||
"ceItem);\r\n }, true);\r\n }\r\n\r\n function build" +
|
||||
"Filters() {\r\n var filters = [];\r\n var queryStringP" +
|
||||
"arameters = getQueryStringParameters();\r\n\r\n if (queryStringParame" +
|
||||
"ters !== null) {\r\n $.each(queryStringParameters, function (ke" +
|
||||
"y, value) {\r\n switch (key.toLowerCase()) {\r\n " +
|
||||
" case \'deviceaddressinclude\':\r\n var" +
|
||||
" deviceAddresses = value.split(\",\").map(function (v) { return v.toLowerCase(); }" +
|
||||
");\r\n if (deviceAddresses.length > 0) {\r\n " +
|
||||
" filters.push(function (heldDeviceItem) {\r\n " +
|
||||
" // false if DeviceAddressShortName is null\r\n " +
|
||||
" if (!heldDeviceItem.DeviceAddressShortName)\r\n " +
|
||||
" return false;\r\n\r\n " +
|
||||
" // true if DeviceAddressShortName is included\r\n " +
|
||||
" return $.inArray(heldDeviceItem.DeviceAddressShortName" +
|
||||
".toLowerCase(), deviceAddresses) >= 0;\r\n });\r" +
|
||||
"\n }\r\n break;\r\n " +
|
||||
" case \'deviceaddressexclude\':\r\n " +
|
||||
" var deviceAddresses = value.split(\",\").map(function (v) { return v.toLower" +
|
||||
"Case(); });\r\n if (deviceAddresses.length > 0) {\r\n" +
|
||||
" filters.push(function (heldDeviceItem) {\r\n " +
|
||||
" // true if DeviceAddressShortName is null\r" +
|
||||
"\n if (!heldDeviceItem.DeviceAddressShortN" +
|
||||
"ame)\r\n return true;\r\n\r\n " +
|
||||
" // true if DeviceAddressShortName is excluded\r\n " +
|
||||
" return $.inArray(heldDeviceItem.DeviceAddressSh" +
|
||||
"ortName.toLowerCase(), deviceAddresses) < 0;\r\n " +
|
||||
" });\r\n }\r\n break;" +
|
||||
"\r\n case \'deviceprofileinclude\':\r\n " +
|
||||
" var deviceProfiles = value.split(\",\").map(function (v) { return pars" +
|
||||
"eInt(v); });\r\n if (deviceProfiles.length > 0) {\r\n" +
|
||||
" filters.push(function (heldDeviceItem) {\r\n " +
|
||||
" // true if DeviceProfileId is included\r\n " +
|
||||
" return $.inArray(heldDeviceItem.DeviceProf" +
|
||||
"ileId, deviceProfiles) >= 0;\r\n });\r\n " +
|
||||
" }\r\n break;\r\n " +
|
||||
" case \'deviceprofileexclude\':\r\n var " +
|
||||
"deviceProfiles = value.split(\",\").map(function (v) { return parseInt(v); });\r\n " +
|
||||
" if (deviceProfiles.length > 0) {\r\n " +
|
||||
" filters.push(function (heldDeviceItem) {\r\n " +
|
||||
" // true if DeviceProfileId is excluded\r\n " +
|
||||
" return $.inArray(heldDeviceItem.DeviceProfileId, devicePro" +
|
||||
"files) < 0;\r\n });\r\n " +
|
||||
" }\r\n break;\r\n }\r\n " +
|
||||
" });\r\n }\r\n\r\n if (filters.length > 0" +
|
||||
")\r\n itemFilters = filters;\r\n else\r\n " +
|
||||
" itemFilters = null;\r\n }\r\n\r\n function connectionEr" +
|
||||
"ror() {\r\n try {\r\n $(\'body\').addClass(\'status-e" +
|
||||
"rror\');\r\n $.connection.hub.stop();\r\n } catch (" +
|
||||
"e) {\r\n // Ignore\r\n }\r\n\r\n window" +
|
||||
".setTimeout(function () {\r\n window.location.href = window.loc" +
|
||||
"ation.href;\r\n }, 10000);\r\n }\r\n\r\n // Helpers" +
|
||||
"\r\n function rotateArray(koArray, element) {\r\n var item" +
|
||||
"s = koArray();\r\n\r\n if (items.length <= 1)\r\n re" +
|
||||
"turn 0;\r\n\r\n if (element.height() < (element.parent().height() - 3" +
|
||||
"0)) {\r\n\r\n if (findUnsortedArrayTopIndex(items) !== 0)\r\n " +
|
||||
" koArray.sort(sortFunction);\r\n\r\n // Don\'t ro" +
|
||||
"tate if small & sorted correctly\r\n return;\r\n }" +
|
||||
"\r\n\r\n // Move Last Item to Top\r\n var item = koArray" +
|
||||
".pop();\r\n koArray.unshift(item);\r\n }\r\n func" +
|
||||
"tion removeItemFromArray(koArray, UserId) {\r\n var items = koArray" +
|
||||
"();\r\n for (var i = 0; i < items.length; i++) {\r\n " +
|
||||
" if (items[i].UserId == UserId) {\r\n koArray.splice(i, 1" +
|
||||
");\r\n items = koArray();\r\n i--;\r\n " +
|
||||
" }\r\n }\r\n }\r\n function find" +
|
||||
"UnsortedArrayTopIndex(items) {\r\n // Only one Item\r\n " +
|
||||
" if (items.length <= 1)\r\n return 0;\r\n\r\n for (" +
|
||||
"var i = 1; i < items.length; i++) {\r\n var s = sortFunction(it" +
|
||||
"ems[i - 1], items[i]);\r\n if (s > 0)\r\n " +
|
||||
"return i;\r\n }\r\n\r\n return 0;\r\n }\r\n " +
|
||||
" function findSortedInsertIndex(koArray, heldDeviceItem) {\r\n " +
|
||||
" var items = koArray();\r\n var startIndex = findUnsortedArrayTopIn" +
|
||||
"dex(items);\r\n for (var i = startIndex; i < items.length; i++) {\r\n" +
|
||||
" var s = sortFunction(heldDeviceItem, items[i]);\r\n " +
|
||||
" if (s <= 0)\r\n return i;\r\n }\r\n " +
|
||||
" if (startIndex !== 0) {\r\n for (var i = 0; i < sta" +
|
||||
"rtIndex; i++) {\r\n var s = sortFunction(heldDeviceItem, it" +
|
||||
"ems[i]);\r\n if (s <= 0)\r\n retur" +
|
||||
"n i;\r\n }\r\n return startIndex;\r\n " +
|
||||
" } else {\r\n return -1;\r\n }\r\n }\r" +
|
||||
"\n function sortFunction(l, r) {\r\n return l.UserIdFrien" +
|
||||
"dly.toLowerCase() == r.UserIdFriendly.toLowerCase() ? 0 : (l.UserIdFriendly.toLo" +
|
||||
"werCase() < r.UserIdFriendly.toLowerCase() ? -1 : 1)\r\n }\r\n " +
|
||||
" function isInProcess(i) {\r\n return !i.ReadyForReturn && !i.Waiti" +
|
||||
"ngForUserAction;\r\n }\r\n function isReadyForReturn(i) {\r\n " +
|
||||
" return i.ReadyForReturn && !i.WaitingForUserAction;\r\n }\r" +
|
||||
"\n function isWaitingForUserAction(i) {\r\n return i.Wait" +
|
||||
"ingForUserAction;\r\n }\r\n function getQueryStringParameters(" +
|
||||
") {\r\n\r\n if (window.location.search.length === 0)\r\n " +
|
||||
" return null;\r\n\r\n var params = {};\r\n window.lo" +
|
||||
"cation.search.substr(1).split(\"&\").forEach(function (pair) {\r\n " +
|
||||
" if (pair === \"\") return;\r\n var parts = pair.split(\"=\");\r\n " +
|
||||
" params[parts[0]] = parts[1] && decodeURIComponent(parts[1].rep" +
|
||||
"lace(/\\+/g, \" \"));\r\n });\r\n return params;\r\n " +
|
||||
" }\r\n\r\n init();\r\n });\r\n </script>\r\n</body>\r\n</html>");
|
||||
"on, rotateSpeed);\r\n });\r\n }\r\n\r\n // Called b" +
|
||||
"y SignalR\r\n function updateHeldDevice(updates) {\r\n if " +
|
||||
"(viewModel) {\r\n\r\n $.each(updates, function (UserId, heldDevic" +
|
||||
"eItem) {\r\n // Remove Existing\r\n re" +
|
||||
"moveItem(UserId);\r\n\r\n // Add Item\r\n " +
|
||||
" addItem(heldDeviceItem);\r\n });\r\n }\r\n " +
|
||||
" }\r\n\r\n function removeItem(UserId) {\r\n removeItemFr" +
|
||||
"omArray(viewModel.inProcess, UserId);\r\n removeItemFromArray(viewM" +
|
||||
"odel.readyForReturn, UserId);\r\n removeItemFromArray(viewModel.wai" +
|
||||
"tingForUserAction, UserId);\r\n }\r\n\r\n function addItem(heldD" +
|
||||
"eviceItem) {\r\n if (heldDeviceItem !== null &&\r\n " +
|
||||
" heldDeviceItem !== undefined &&\r\n includeItem(heldDeviceIte" +
|
||||
"m)) {\r\n\r\n var array;\r\n\r\n if (isWaitingForU" +
|
||||
"serAction(heldDeviceItem))\r\n array = viewModel.waitingFor" +
|
||||
"UserAction;\r\n else if (isReadyForReturn(heldDeviceItem))\r\n " +
|
||||
" array = viewModel.readyForReturn;\r\n else" +
|
||||
" if (isInProcess(heldDeviceItem))\r\n array = viewModel.inP" +
|
||||
"rocess;\r\n\r\n if (array().length === 0) {\r\n " +
|
||||
" array.push(heldDeviceItem);\r\n } else {\r\n " +
|
||||
" var index = findSortedInsertIndex(array, heldDeviceItem);\r\n " +
|
||||
" if (index === -1)\r\n array.push(heldDeviceIt" +
|
||||
"em);\r\n else\r\n array.splice(ind" +
|
||||
"ex, 0, heldDeviceItem);\r\n }\r\n }\r\n }" +
|
||||
"\r\n\r\n function rotateArrays() {\r\n rotateArray(viewModel" +
|
||||
".inProcess, $inProcessList);\r\n rotateArray(viewModel.readyForRetu" +
|
||||
"rn, $readyForReturnList);\r\n rotateArray(viewModel.waitingForUserA" +
|
||||
"ction, $waitingForUserActionList);\r\n }\r\n\r\n function schedu" +
|
||||
"leRotation() {\r\n rotateArrays();\r\n\r\n window.setTim" +
|
||||
"eout(scheduleRotation, rotateSpeed);\r\n }\r\n\r\n function incl" +
|
||||
"udeItem(heldDeviceItem) {\r\n if (itemFilters == null || itemFilter" +
|
||||
"s.length == 0)\r\n return true;\r\n\r\n return itemF" +
|
||||
"ilters.reduce(function (previousValue, currentValue, index, array) {\r\n " +
|
||||
" if (previousValue === false)\r\n return false;\r\n " +
|
||||
" return currentValue(heldDeviceItem);\r\n }, true" +
|
||||
");\r\n }\r\n\r\n function setTheme(theme) {\r\n if " +
|
||||
"(!!fixedTheme)\r\n return;\r\n\r\n var $body = $(doc" +
|
||||
"ument.body);\r\n\r\n // Existing classes\r\n var c = $bo" +
|
||||
"dy.attr(\'class\').split(\' \');\r\n // Remove existing theme\r\n " +
|
||||
" c = $.grep(c, function (i) { return (i.indexOf(\'theme-\') !== 0) });\r\n\r\n " +
|
||||
" c.push(\'theme-\' + theme);\r\n\r\n $body.attr(\'class\', " +
|
||||
"c.join(\' \'));\r\n }\r\n\r\n function monitorMouseMove() {\r\n " +
|
||||
" var token = null,\r\n $body = $(document.body);\r\n\r\n " +
|
||||
" $body.mousemove(function () {\r\n if (!!token)\r\n" +
|
||||
" window.clearTimeout(token);\r\n else if" +
|
||||
" ($body.css(\'cursor\') == \'none\')\r\n $body.css(\'cursor\', \'a" +
|
||||
"uto\');\r\n\r\n token = window.setTimeout(function () {\r\n " +
|
||||
" $body.css(\'cursor\', \'none\');\r\n token = nul" +
|
||||
"l;\r\n }, 3500);\r\n });\r\n\r\n }\r\n\r\n " +
|
||||
" function applyQueryString() {\r\n var queryStringParameters " +
|
||||
"= getQueryStringParameters();\r\n\r\n if (queryStringParameters !== n" +
|
||||
"ull) {\r\n var filters = [];\r\n\r\n $.each(quer" +
|
||||
"yStringParameters, function (key, value) {\r\n switch (key." +
|
||||
"toLowerCase()) {\r\n case \'theme\': // THEME\r\n " +
|
||||
" setTheme(value);\r\n fixedThe" +
|
||||
"me = value;\r\n break;\r\n " +
|
||||
" case \'deviceaddressinclude\': // FILTER: Device Address Include\r\n " +
|
||||
" var deviceAddresses = value.split(\",\").map(function (v) { retur" +
|
||||
"n v.toLowerCase(); });\r\n if (deviceAddresses.leng" +
|
||||
"th > 0) {\r\n filters.push(function (heldDevice" +
|
||||
"Item) {\r\n // false if DeviceAddressShortN" +
|
||||
"ame is null\r\n if (!heldDeviceItem.DeviceA" +
|
||||
"ddressShortName)\r\n return false;\r\n\r\n " +
|
||||
" // true if DeviceAddressShortName is incl" +
|
||||
"uded\r\n return $.inArray(heldDeviceItem.De" +
|
||||
"viceAddressShortName.toLowerCase(), deviceAddresses) >= 0;\r\n " +
|
||||
" });\r\n }\r\n " +
|
||||
" break;\r\n case \'deviceaddressexclude\': // FILT" +
|
||||
"ER: Device Address Exclude\r\n var deviceAddresses " +
|
||||
"= value.split(\",\").map(function (v) { return v.toLowerCase(); });\r\n " +
|
||||
" if (deviceAddresses.length > 0) {\r\n " +
|
||||
" filters.push(function (heldDeviceItem) {\r\n " +
|
||||
" // true if DeviceAddressShortName is null\r\n " +
|
||||
" if (!heldDeviceItem.DeviceAddressShortName)\r\n " +
|
||||
" return true;\r\n\r\n " +
|
||||
"// true if DeviceAddressShortName is excluded\r\n " +
|
||||
" return $.inArray(heldDeviceItem.DeviceAddressShortName.toLowerCase(), dev" +
|
||||
"iceAddresses) < 0;\r\n });\r\n " +
|
||||
" }\r\n break;\r\n " +
|
||||
" case \'deviceprofileinclude\': // FILTER: Device Profile Include\r\n " +
|
||||
" var deviceProfiles = value.split(\",\").map(function (v) { ret" +
|
||||
"urn parseInt(v); });\r\n if (deviceProfiles.length " +
|
||||
"> 0) {\r\n filters.push(function (heldDeviceIte" +
|
||||
"m) {\r\n // true if DeviceProfileId is incl" +
|
||||
"uded\r\n return $.inArray(heldDeviceItem.De" +
|
||||
"viceProfileId, deviceProfiles) >= 0;\r\n });\r\n " +
|
||||
" }\r\n break;\r\n " +
|
||||
" case \'deviceprofileexclude\': // FILTER: Device Profile Exc" +
|
||||
"lude\r\n var deviceProfiles = value.split(\",\").map(" +
|
||||
"function (v) { return parseInt(v); });\r\n if (devi" +
|
||||
"ceProfiles.length > 0) {\r\n filters.push(funct" +
|
||||
"ion (heldDeviceItem) {\r\n // true if Devic" +
|
||||
"eProfileId is excluded\r\n return $.inArray" +
|
||||
"(heldDeviceItem.DeviceProfileId, deviceProfiles) < 0;\r\n " +
|
||||
" });\r\n }\r\n " +
|
||||
" break;\r\n }\r\n });\r\n\r\n " +
|
||||
" if (filters.length > 0)\r\n itemFilters = filters;\r\n " +
|
||||
" else\r\n itemFilters = null;\r\n " +
|
||||
" }\r\n }\r\n\r\n function connectionError() {\r\n " +
|
||||
" try {\r\n $(\'body\').addClass(\'status-error\');\r\n " +
|
||||
" $.connection.hub.stop();\r\n } catch (e) {\r\n " +
|
||||
" // Ignore\r\n }\r\n\r\n window.setTimeout(function (" +
|
||||
") {\r\n window.location.href = window.location.href;\r\n " +
|
||||
" }, 10000);\r\n }\r\n\r\n // Helpers\r\n function" +
|
||||
" rotateArray(koArray, element) {\r\n var items = koArray();\r\n\r\n " +
|
||||
" if (items.length <= 1)\r\n return 0;\r\n\r\n " +
|
||||
" if (element.height() < (element.parent().height() - 30)) {\r\n\r\n " +
|
||||
" if (findUnsortedArrayTopIndex(items) !== 0)\r\n koAr" +
|
||||
"ray.sort(sortFunction);\r\n\r\n // Don\'t rotate if small & sorted" +
|
||||
" correctly\r\n return;\r\n }\r\n\r\n //" +
|
||||
" Move Last Item to Top\r\n var item = koArray.pop();\r\n " +
|
||||
" koArray.unshift(item);\r\n }\r\n function removeItemFromArr" +
|
||||
"ay(koArray, UserId) {\r\n var items = koArray();\r\n f" +
|
||||
"or (var i = 0; i < items.length; i++) {\r\n if (items[i].UserId" +
|
||||
" == UserId) {\r\n koArray.splice(i, 1);\r\n " +
|
||||
" items = koArray();\r\n i--;\r\n }\r\n " +
|
||||
" }\r\n }\r\n function findUnsortedArrayTopIndex(" +
|
||||
"items) {\r\n // Only one Item\r\n if (items.length <= " +
|
||||
"1)\r\n return 0;\r\n\r\n for (var i = 1; i < items.l" +
|
||||
"ength; i++) {\r\n var s = sortFunction(items[i - 1], items[i]);" +
|
||||
"\r\n if (s > 0)\r\n return i;\r\n " +
|
||||
" }\r\n\r\n return 0;\r\n }\r\n function findSor" +
|
||||
"tedInsertIndex(koArray, heldDeviceItem) {\r\n var items = koArray()" +
|
||||
";\r\n var startIndex = findUnsortedArrayTopIndex(items);\r\n " +
|
||||
" for (var i = startIndex; i < items.length; i++) {\r\n va" +
|
||||
"r s = sortFunction(heldDeviceItem, items[i]);\r\n if (s <= 0)\r\n" +
|
||||
" return i;\r\n }\r\n if (startI" +
|
||||
"ndex !== 0) {\r\n for (var i = 0; i < startIndex; i++) {\r\n " +
|
||||
" var s = sortFunction(heldDeviceItem, items[i]);\r\n " +
|
||||
" if (s <= 0)\r\n return i;\r\n " +
|
||||
" }\r\n return startIndex;\r\n } else {\r\n " +
|
||||
" return -1;\r\n }\r\n }\r\n function " +
|
||||
"sortFunction(l, r) {\r\n return l.UserIdFriendly.toLowerCase() == r" +
|
||||
".UserIdFriendly.toLowerCase() ? 0 : (l.UserIdFriendly.toLowerCase() < r.UserIdFr" +
|
||||
"iendly.toLowerCase() ? -1 : 1)\r\n }\r\n function isInProcess(" +
|
||||
"i) {\r\n return !i.ReadyForReturn && !i.WaitingForUserAction;\r\n " +
|
||||
" }\r\n function isReadyForReturn(i) {\r\n return i." +
|
||||
"ReadyForReturn && !i.WaitingForUserAction;\r\n }\r\n function " +
|
||||
"isWaitingForUserAction(i) {\r\n return i.WaitingForUserAction;\r\n " +
|
||||
" }\r\n function getQueryStringParameters() {\r\n\r\n " +
|
||||
" if (window.location.search.length === 0)\r\n return null;\r\n\r\n " +
|
||||
" var params = {};\r\n window.location.search.substr(1" +
|
||||
").split(\"&\").forEach(function (pair) {\r\n if (pair === \"\") ret" +
|
||||
"urn;\r\n var parts = pair.split(\"=\");\r\n para" +
|
||||
"ms[parts[0]] = parts[1] && decodeURIComponent(parts[1].replace(/\\+/g, \" \"));\r\n " +
|
||||
" });\r\n return params;\r\n }\r\n\r\n " +
|
||||
"init();\r\n });\r\n </script>\r\n</body>\r\n</html>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1075,6 +1075,211 @@ div.logEventsViewport table.logEventsViewport > tbody > tr > td.eventType {
|
||||
#Config_AuthRoles_Subjects_Update_Dialog #Config_AuthRoles_Subjects_Update_Dialog_List li .remove:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
#Config_ReportPrefs {
|
||||
margin-top: 10px;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview {
|
||||
float: right;
|
||||
width: 150px;
|
||||
height: 80px;
|
||||
border: 1px solid #444;
|
||||
font-size: 4px;
|
||||
color: #ffffff;
|
||||
overflow: hidden;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview .heading {
|
||||
height: 6px;
|
||||
padding-left: 3px;
|
||||
overflow: hidden;
|
||||
background-color: #333333;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview .column-heading {
|
||||
float: left;
|
||||
width: calc(33% - 4px);
|
||||
padding-left: 2px;
|
||||
margin: 1px 0 0 2px;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview .column {
|
||||
height: 100%;
|
||||
float: left;
|
||||
width: calc(33% - 2px);
|
||||
margin-left: 2px;
|
||||
overflow: hidden;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview .column span {
|
||||
display: block;
|
||||
height: 4px;
|
||||
margin: 1px;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-default {
|
||||
background: linear-gradient(to bottom, #165180, #1e6dab) left top repeat-x #1e6dab;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-default .column span.alert {
|
||||
background-color: #e51400;
|
||||
color: #ffffff;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-default-soft {
|
||||
background: linear-gradient(to bottom, #165180, #1e6dab) left top repeat-x #1e6dab;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-default-soft .column span.alert {
|
||||
background-color: #f0e277;
|
||||
color: #000000;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-green {
|
||||
background: linear-gradient(to bottom, #477c11, #60a917) left top repeat-x #60a917;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-green .column span.alert {
|
||||
background-color: #e51400;
|
||||
color: #ffffff;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-green-soft {
|
||||
background: linear-gradient(to bottom, #477c11, #60a917) left top repeat-x #60a917;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-green-soft .column span.alert {
|
||||
background-color: #e5cc11;
|
||||
color: #000000;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-violet {
|
||||
background: linear-gradient(to bottom, #8800cc, #aa00ff) left top repeat-x #aa00ff;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-violet .column span.alert {
|
||||
background-color: #e51400;
|
||||
color: #ffffff;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-violet-soft {
|
||||
background: linear-gradient(to bottom, #8800cc, #aa00ff) left top repeat-x #aa00ff;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-violet-soft .column span.alert {
|
||||
background-color: #f0e277;
|
||||
color: #000000;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-magenta {
|
||||
background: linear-gradient(to bottom, #a50058, #d80073) left top repeat-x #d80073;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-magenta .column span.alert {
|
||||
background-color: #1681b4;
|
||||
color: #ffffff;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-magenta-soft {
|
||||
background: linear-gradient(to bottom, #a50058, #d80073) left top repeat-x #d80073;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-magenta-soft .column span.alert {
|
||||
background-color: #85cdf0;
|
||||
color: #000000;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-crimson {
|
||||
background: linear-gradient(to bottom, #6f0019, #a20025) left top repeat-x #a20025;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-crimson .column span.alert {
|
||||
background-color: #b0cc22;
|
||||
color: #000000;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-crimson-soft {
|
||||
background: linear-gradient(to bottom, #6f0019, #a20025) left top repeat-x #a20025;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-crimson-soft .column span.alert {
|
||||
background-color: #cee077;
|
||||
color: #000000;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-amber {
|
||||
background: linear-gradient(to bottom, #bf8208, #f0a30a) left top repeat-x #f0a30a;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-amber .column span.alert {
|
||||
background-color: #0050ef;
|
||||
color: #ffffff;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-amber-soft {
|
||||
background: linear-gradient(to bottom, #bf8208, #f0a30a) left top repeat-x #f0a30a;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-amber-soft .column span.alert {
|
||||
background-color: #bbd0fb;
|
||||
color: #000000;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-brown {
|
||||
background: linear-gradient(to bottom, #5c401f, #825a2c) left top repeat-x #825a2c;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-brown .column span.alert {
|
||||
background-color: #e3c800;
|
||||
color: #000000;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-brown-soft {
|
||||
background: linear-gradient(to bottom, #5c401f, #825a2c) left top repeat-x #825a2c;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-brown-soft .column span.alert {
|
||||
background-color: #f0e277;
|
||||
color: #000000;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-steel {
|
||||
background: linear-gradient(to bottom, #4e5d6c, #647689) left top repeat-x #647689;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-steel .column span.alert {
|
||||
background-color: #e51400;
|
||||
color: #ffffff;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-steel-soft {
|
||||
background: linear-gradient(to bottom, #4e5d6c, #647689) left top repeat-x #647689;
|
||||
}
|
||||
#Config_ReportPrefs #Config_ReportPrefs_Preview.theme-steel-soft .column span.alert {
|
||||
background-color: #f0e277;
|
||||
color: #000000;
|
||||
}
|
||||
#Config_ReportPrefs_Builder .report {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
#Config_ReportPrefs_Builder .report ul {
|
||||
margin-left: 10px;
|
||||
}
|
||||
#Config_ReportPrefs_Builder .theme {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
#Config_ReportPrefs_Builder .theme > select {
|
||||
margin-left: 10px;
|
||||
}
|
||||
#Config_ReportPrefs_Builder .filter > select {
|
||||
margin-left: 10px;
|
||||
}
|
||||
#Config_ReportPrefs_Builder .filter div.options {
|
||||
display: none;
|
||||
background-color: #ffffff;
|
||||
border: 1px dashed #cccccc;
|
||||
margin-top: 4px;
|
||||
margin-left: 15px;
|
||||
padding: 2px 6px;
|
||||
}
|
||||
#Config_ReportPrefs_Builder .filter div.options .method {
|
||||
margin-top: 4px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
#Config_ReportPrefs_Builder .filter div.options .method label {
|
||||
margin-right: 14px;
|
||||
}
|
||||
#Config_ReportPrefs_Builder_Buttonpane {
|
||||
padding-right: .3em;
|
||||
}
|
||||
#Config_ReportPrefs_Builder_Buttonpane textarea {
|
||||
float: left;
|
||||
font-family: Consolas, "Courier New", monospace;
|
||||
color: #333333;
|
||||
width: calc(100% - 1.2em - 10px);
|
||||
border: 1px solid #cccccc;
|
||||
white-space: pre;
|
||||
min-height: 0;
|
||||
}
|
||||
#Config_ReportPrefs_Builder_Buttonpane i {
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
margin: .3em .2em 0 0;
|
||||
color: #335a87;
|
||||
}
|
||||
#Config_ReportPrefs_Builder_Buttonpane i:hover {
|
||||
color: #5e8cc2;
|
||||
}
|
||||
#Config_ReportPrefs_Builder_Buttonpane .ui-dialog-buttonset {
|
||||
display: none;
|
||||
}
|
||||
#Config_Location {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
@@ -1097,7 +1097,6 @@ div.logEventsViewport {
|
||||
#pluginLibrary {
|
||||
|
||||
#pluginLibraryGroups {
|
||||
|
||||
width: 900px;
|
||||
margin: 0 auto;
|
||||
|
||||
@@ -1263,6 +1262,195 @@ div.logEventsViewport {
|
||||
}
|
||||
}
|
||||
|
||||
#Config_ReportPrefs {
|
||||
margin-top: 10px;
|
||||
|
||||
#Config_ReportPrefs_Preview {
|
||||
float: right;
|
||||
width: 150px;
|
||||
height: 80px;
|
||||
border: 1px solid #444;
|
||||
font-size: 4px;
|
||||
color: @white;
|
||||
overflow: hidden;
|
||||
text-transform: uppercase;
|
||||
|
||||
.heading {
|
||||
height: 6px;
|
||||
padding-left: 3px;
|
||||
overflow: hidden;
|
||||
background-color: @HeaderBackgroundColour;
|
||||
}
|
||||
|
||||
.column-heading {
|
||||
float: left;
|
||||
width: calc(~"33% - 4px");
|
||||
padding-left: 2px;
|
||||
margin: 1px 0 0 2px;
|
||||
}
|
||||
|
||||
.column {
|
||||
height: 100%;
|
||||
float: left;
|
||||
width: calc(~"33% - 2px");
|
||||
margin-left: 2px;
|
||||
overflow: hidden;
|
||||
background: fade(@white, 20%);
|
||||
|
||||
span {
|
||||
display: block;
|
||||
height: 4px;
|
||||
margin: 1px;
|
||||
background-color: @white;
|
||||
}
|
||||
}
|
||||
|
||||
.theme-builder(@main-colour, @alert-colour: difference(@main-colour, @white), @alert-text-colour: contrast(@alert-colour)) {
|
||||
background: linear-gradient(to bottom, darken(@main-colour, 10%), @main-colour) left top repeat-x @main-colour;
|
||||
|
||||
.column span.alert {
|
||||
background-color: @alert-colour;
|
||||
color: @alert-text-colour;
|
||||
}
|
||||
}
|
||||
|
||||
&.theme-default {
|
||||
.theme-builder(@ButtonColour, @ThemeRed);
|
||||
}
|
||||
|
||||
&.theme-default-soft {
|
||||
.theme-builder(@ButtonColour, hardlight(@ThemeYellow, #bbb));
|
||||
}
|
||||
|
||||
&.theme-green {
|
||||
.theme-builder(@ThemeGreen, @ThemeRed);
|
||||
}
|
||||
|
||||
&.theme-green-soft {
|
||||
.theme-builder(@ThemeGreen, screen(@ThemeYellow, #111));
|
||||
}
|
||||
|
||||
&.theme-violet {
|
||||
.theme-builder(@ThemeViolet, @ThemeRed);
|
||||
}
|
||||
|
||||
&.theme-violet-soft {
|
||||
.theme-builder(@ThemeViolet, hardlight(@ThemeYellow, #bbb));
|
||||
}
|
||||
|
||||
&.theme-magenta {
|
||||
.theme-builder(@ThemeMagenta, darken(@ThemeCyan, 10%), @white);
|
||||
}
|
||||
|
||||
&.theme-magenta-soft {
|
||||
.theme-builder(@ThemeMagenta, screen(@ThemeCyan, #777));
|
||||
}
|
||||
|
||||
&.theme-crimson {
|
||||
.theme-builder(@ThemeCrimson, screen(@ThemeLime, #222));
|
||||
}
|
||||
|
||||
&.theme-crimson-soft {
|
||||
.theme-builder(@ThemeCrimson, screen(@ThemeLime, #777));
|
||||
}
|
||||
|
||||
&.theme-amber {
|
||||
.theme-builder(@ThemeAmber, @ThemeCobalt);
|
||||
}
|
||||
|
||||
&.theme-amber-soft {
|
||||
.theme-builder(@ThemeAmber, hardlight(@ThemeCobalt, #ddd));
|
||||
}
|
||||
|
||||
&.theme-brown {
|
||||
.theme-builder(@ThemeBrown, @ThemeYellow);
|
||||
}
|
||||
|
||||
&.theme-brown-soft {
|
||||
.theme-builder(@ThemeBrown, hardlight(@ThemeYellow, #bbb));
|
||||
}
|
||||
|
||||
&.theme-steel {
|
||||
.theme-builder(@ThemeSteel, @ThemeRed);
|
||||
}
|
||||
|
||||
&.theme-steel-soft {
|
||||
.theme-builder(@ThemeSteel, hardlight(@ThemeYellow, #bbb));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Config_ReportPrefs_Builder {
|
||||
.report {
|
||||
margin-bottom: 10px;
|
||||
|
||||
ul {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.theme {
|
||||
margin-bottom: 10px;
|
||||
|
||||
& > select {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.filter {
|
||||
& > select {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
div.options {
|
||||
display: none;
|
||||
background-color: @white;
|
||||
border: 1px dashed @SubtleBorderColour;
|
||||
margin-top: 4px;
|
||||
margin-left: 15px;
|
||||
padding: 2px 6px;
|
||||
|
||||
.method {
|
||||
margin-top: 4px;
|
||||
margin-bottom: 8px;
|
||||
|
||||
label {
|
||||
margin-right: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Config_ReportPrefs_Builder_Buttonpane {
|
||||
padding-right: .3em;
|
||||
|
||||
textarea {
|
||||
float: left;
|
||||
font-family: @FontFamilyMono;
|
||||
color: @FontBodyColour;
|
||||
width: calc(~"100% - 1.2em - 10px");
|
||||
border: 1px solid @SubtleBorderColour;
|
||||
white-space: pre;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
i {
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
margin: .3em .2em 0 0;
|
||||
color: @HyperLinkColour;
|
||||
|
||||
&:hover {
|
||||
color: @HyperLinkHoverColour;
|
||||
}
|
||||
}
|
||||
|
||||
.ui-dialog-buttonset {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
#Config_Location {
|
||||
margin-top: 10px;
|
||||
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -1929,11 +1929,9 @@ body {
|
||||
overflow: hidden;
|
||||
}
|
||||
body {
|
||||
background: linear-gradient(to bottom, #165180, #1e6dab) left top repeat-x #1e6dab;
|
||||
font-size: 16px;
|
||||
font-family: "Segoe UI", Arial, Verdana, Tahoma, sans-serif;
|
||||
color: #ffffff;
|
||||
cursor: auto;
|
||||
cursor: none;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
@@ -1950,6 +1948,7 @@ div#page {
|
||||
header,
|
||||
#header {
|
||||
position: relative;
|
||||
color: #ffffff;
|
||||
background-color: #333333;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
@@ -2006,9 +2005,9 @@ header #credits i,
|
||||
margin-bottom: 10px;
|
||||
font-size: 1.4em;
|
||||
height: 30px;
|
||||
color: #ffffff;
|
||||
}
|
||||
#mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
height: calc(100% - 30px);
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -2020,7 +2019,6 @@ header #credits i,
|
||||
text-align: center;
|
||||
text-transform: lowercase;
|
||||
margin-top: 40px;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
#mainSection .list div.content ul {
|
||||
padding: 0;
|
||||
@@ -2030,16 +2028,15 @@ header #credits i,
|
||||
#mainSection .list div.content ul li {
|
||||
position: relative;
|
||||
margin: 4px 2px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #2689d6;
|
||||
padding: 6px 8px;
|
||||
color: #000000;
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
-ms-text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
#mainSection .list div.content ul li .small {
|
||||
display: inline-block;
|
||||
@@ -2047,10 +2044,6 @@ header #credits i,
|
||||
font-size: 0.8em;
|
||||
margin-top: 0.1em;
|
||||
}
|
||||
#mainSection .list div.content ul li.alert {
|
||||
background-color: #e51400;
|
||||
color: #ffffff;
|
||||
}
|
||||
#mainSection .list div.content ul li:after {
|
||||
clear: both;
|
||||
content: ".";
|
||||
@@ -2074,7 +2067,6 @@ footer,
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
background: linear-gradient(to bottom, rgba(30, 109, 171, 0), #1e6dab 90%) left top repeat-x;
|
||||
display: block;
|
||||
}
|
||||
body.status-connecting #statusConnecting {
|
||||
@@ -2103,3 +2095,292 @@ body.status-error #statusError span {
|
||||
body.status-error #mainSection {
|
||||
opacity: 0.3;
|
||||
}
|
||||
/* Themes */
|
||||
body.theme-default {
|
||||
background: linear-gradient(to bottom, #165180, #1e6dab) left top repeat-x #1e6dab;
|
||||
}
|
||||
body.theme-default #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-default #mainSection .list ul li {
|
||||
border: 1px solid #3080b8;
|
||||
}
|
||||
body.theme-default #mainSection .list ul li.alert {
|
||||
background-color: #e51400;
|
||||
border: 1px solid #ee6255;
|
||||
color: #ffffff;
|
||||
}
|
||||
body.theme-default footer,
|
||||
body.theme-default #footer {
|
||||
background: linear-gradient(to bottom, rgba(30, 109, 171, 0), #1e6dab 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-default-soft {
|
||||
background: linear-gradient(to bottom, #165180, #1e6dab) left top repeat-x #1e6dab;
|
||||
}
|
||||
body.theme-default-soft #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-default-soft #mainSection .list ul li {
|
||||
border: 1px solid #3080b8;
|
||||
}
|
||||
body.theme-default-soft #mainSection .list ul li.alert {
|
||||
background-color: #f0e277;
|
||||
border: 1px solid #f5eba4;
|
||||
color: #000000;
|
||||
}
|
||||
body.theme-default-soft footer,
|
||||
body.theme-default-soft #footer {
|
||||
background: linear-gradient(to bottom, rgba(30, 109, 171, 0), #1e6dab 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-green {
|
||||
background: linear-gradient(to bottom, #477c11, #60a917) left top repeat-x #60a917;
|
||||
}
|
||||
body.theme-green #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-green #mainSection .list ul li {
|
||||
border: 1px solid #74b627;
|
||||
}
|
||||
body.theme-green #mainSection .list ul li.alert {
|
||||
background-color: #e51400;
|
||||
border: 1px solid #ee6255;
|
||||
color: #ffffff;
|
||||
}
|
||||
body.theme-green footer,
|
||||
body.theme-green #footer {
|
||||
background: linear-gradient(to bottom, rgba(96, 169, 23, 0), #60a917 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-green-soft {
|
||||
background: linear-gradient(to bottom, #477c11, #60a917) left top repeat-x #60a917;
|
||||
}
|
||||
body.theme-green-soft #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-green-soft #mainSection .list ul li {
|
||||
border: 1px solid #74b627;
|
||||
}
|
||||
body.theme-green-soft #mainSection .list ul li.alert {
|
||||
background-color: #e5cc11;
|
||||
border: 1px solid #eedd60;
|
||||
color: #000000;
|
||||
}
|
||||
body.theme-green-soft footer,
|
||||
body.theme-green-soft #footer {
|
||||
background: linear-gradient(to bottom, rgba(96, 169, 23, 0), #60a917 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-violet {
|
||||
background: linear-gradient(to bottom, #8800cc, #aa00ff) left top repeat-x #aa00ff;
|
||||
}
|
||||
body.theme-violet #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-violet #mainSection .list ul li {
|
||||
border: 1px solid #b700ff;
|
||||
}
|
||||
body.theme-violet #mainSection .list ul li.alert {
|
||||
background-color: #e51400;
|
||||
border: 1px solid #ee6255;
|
||||
color: #ffffff;
|
||||
}
|
||||
body.theme-violet footer,
|
||||
body.theme-violet #footer {
|
||||
background: linear-gradient(to bottom, rgba(170, 0, 255, 0), #aa00ff 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-violet-soft {
|
||||
background: linear-gradient(to bottom, #8800cc, #aa00ff) left top repeat-x #aa00ff;
|
||||
}
|
||||
body.theme-violet-soft #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-violet-soft #mainSection .list ul li {
|
||||
border: 1px solid #b700ff;
|
||||
}
|
||||
body.theme-violet-soft #mainSection .list ul li.alert {
|
||||
background-color: #f0e277;
|
||||
border: 1px solid #f5eba4;
|
||||
color: #000000;
|
||||
}
|
||||
body.theme-violet-soft footer,
|
||||
body.theme-violet-soft #footer {
|
||||
background: linear-gradient(to bottom, rgba(170, 0, 255, 0), #aa00ff 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-magenta {
|
||||
background: linear-gradient(to bottom, #a50058, #d80073) left top repeat-x #d80073;
|
||||
}
|
||||
body.theme-magenta #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-magenta #mainSection .list ul li {
|
||||
border: 1px solid #de0086;
|
||||
}
|
||||
body.theme-magenta #mainSection .list ul li.alert {
|
||||
background-color: #1681b4;
|
||||
border: 1px solid #63abcd;
|
||||
color: #ffffff;
|
||||
}
|
||||
body.theme-magenta footer,
|
||||
body.theme-magenta #footer {
|
||||
background: linear-gradient(to bottom, rgba(216, 0, 115, 0), #d80073 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-magenta-soft {
|
||||
background: linear-gradient(to bottom, #a50058, #d80073) left top repeat-x #d80073;
|
||||
}
|
||||
body.theme-magenta-soft #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-magenta-soft #mainSection .list ul li {
|
||||
border: 1px solid #de0086;
|
||||
}
|
||||
body.theme-magenta-soft #mainSection .list ul li.alert {
|
||||
background-color: #85cdf0;
|
||||
border: 1px solid #aedef5;
|
||||
color: #000000;
|
||||
}
|
||||
body.theme-magenta-soft footer,
|
||||
body.theme-magenta-soft #footer {
|
||||
background: linear-gradient(to bottom, rgba(216, 0, 115, 0), #d80073 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-crimson {
|
||||
background: linear-gradient(to bottom, #6f0019, #a20025) left top repeat-x #a20025;
|
||||
}
|
||||
body.theme-crimson #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-crimson #mainSection .list ul li {
|
||||
border: 1px solid #b00039;
|
||||
}
|
||||
body.theme-crimson #mainSection .list ul li.alert {
|
||||
background-color: #b0cc22;
|
||||
border: 1px solid #cadd6c;
|
||||
color: #000000;
|
||||
}
|
||||
body.theme-crimson footer,
|
||||
body.theme-crimson #footer {
|
||||
background: linear-gradient(to bottom, rgba(162, 0, 37, 0), #a20025 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-crimson-soft {
|
||||
background: linear-gradient(to bottom, #6f0019, #a20025) left top repeat-x #a20025;
|
||||
}
|
||||
body.theme-crimson-soft #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-crimson-soft #mainSection .list ul li {
|
||||
border: 1px solid #b00039;
|
||||
}
|
||||
body.theme-crimson-soft #mainSection .list ul li.alert {
|
||||
background-color: #cee077;
|
||||
border: 1px solid #dfeaa4;
|
||||
color: #000000;
|
||||
}
|
||||
body.theme-crimson-soft footer,
|
||||
body.theme-crimson-soft #footer {
|
||||
background: linear-gradient(to bottom, rgba(162, 0, 37, 0), #a20025 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-amber {
|
||||
background: linear-gradient(to bottom, #bf8208, #f0a30a) left top repeat-x #f0a30a;
|
||||
}
|
||||
body.theme-amber #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-amber #mainSection .list ul li {
|
||||
border: 1px solid #f2b113;
|
||||
}
|
||||
body.theme-amber #mainSection .list ul li.alert {
|
||||
background-color: #0050ef;
|
||||
border: 1px solid #558af4;
|
||||
color: #ffffff;
|
||||
}
|
||||
body.theme-amber footer,
|
||||
body.theme-amber #footer {
|
||||
background: linear-gradient(to bottom, rgba(240, 163, 10, 0), #f0a30a 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-amber-soft {
|
||||
background: linear-gradient(to bottom, #bf8208, #f0a30a) left top repeat-x #f0a30a;
|
||||
}
|
||||
body.theme-amber-soft #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-amber-soft #mainSection .list ul li {
|
||||
border: 1px solid #f2b113;
|
||||
}
|
||||
body.theme-amber-soft #mainSection .list ul li.alert {
|
||||
background-color: #bbd0fb;
|
||||
border: 1px solid #d2e0fc;
|
||||
color: #000000;
|
||||
}
|
||||
body.theme-amber-soft footer,
|
||||
body.theme-amber-soft #footer {
|
||||
background: linear-gradient(to bottom, rgba(240, 163, 10, 0), #f0a30a 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-brown {
|
||||
background: linear-gradient(to bottom, #5c401f, #825a2c) left top repeat-x #825a2c;
|
||||
}
|
||||
body.theme-brown #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-brown #mainSection .list ul li {
|
||||
border: 1px solid #936e41;
|
||||
}
|
||||
body.theme-brown #mainSection .list ul li.alert {
|
||||
background-color: #e3c800;
|
||||
border: 1px solid #ecda55;
|
||||
color: #000000;
|
||||
}
|
||||
body.theme-brown footer,
|
||||
body.theme-brown #footer {
|
||||
background: linear-gradient(to bottom, rgba(130, 90, 44, 0), #825a2c 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-brown-soft {
|
||||
background: linear-gradient(to bottom, #5c401f, #825a2c) left top repeat-x #825a2c;
|
||||
}
|
||||
body.theme-brown-soft #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-brown-soft #mainSection .list ul li {
|
||||
border: 1px solid #936e41;
|
||||
}
|
||||
body.theme-brown-soft #mainSection .list ul li.alert {
|
||||
background-color: #f0e277;
|
||||
border: 1px solid #f5eba4;
|
||||
color: #000000;
|
||||
}
|
||||
body.theme-brown-soft footer,
|
||||
body.theme-brown-soft #footer {
|
||||
background: linear-gradient(to bottom, rgba(130, 90, 44, 0), #825a2c 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-steel {
|
||||
background: linear-gradient(to bottom, #4e5d6c, #647689) left top repeat-x #647689;
|
||||
}
|
||||
body.theme-steel #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-steel #mainSection .list ul li {
|
||||
border: 1px solid #78889a;
|
||||
}
|
||||
body.theme-steel #mainSection .list ul li.alert {
|
||||
background-color: #e51400;
|
||||
border: 1px solid #ee6255;
|
||||
color: #ffffff;
|
||||
}
|
||||
body.theme-steel footer,
|
||||
body.theme-steel #footer {
|
||||
background: linear-gradient(to bottom, rgba(100, 118, 137, 0), #647689 90%) left top repeat-x;
|
||||
}
|
||||
body.theme-steel-soft {
|
||||
background: linear-gradient(to bottom, #4e5d6c, #647689) left top repeat-x #647689;
|
||||
}
|
||||
body.theme-steel-soft #mainSection .list div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
body.theme-steel-soft #mainSection .list ul li {
|
||||
border: 1px solid #78889a;
|
||||
}
|
||||
body.theme-steel-soft #mainSection .list ul li.alert {
|
||||
background-color: #f0e277;
|
||||
border: 1px solid #f5eba4;
|
||||
color: #000000;
|
||||
}
|
||||
body.theme-steel-soft footer,
|
||||
body.theme-steel-soft #footer {
|
||||
background: linear-gradient(to bottom, rgba(100, 118, 137, 0), #647689 90%) left top repeat-x;
|
||||
}
|
||||
|
||||
@@ -11,11 +11,9 @@ html, body {
|
||||
}
|
||||
|
||||
body {
|
||||
background: linear-gradient(to bottom, darken(@ButtonColour, 10%), @ButtonColour) left top repeat-x @ButtonColour;
|
||||
font-size: 16px;
|
||||
font-family: @FontFamilyBody;
|
||||
color: @white;
|
||||
cursor: auto;
|
||||
cursor: none;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4 {
|
||||
@@ -31,6 +29,7 @@ div#page {
|
||||
|
||||
header, #header {
|
||||
position: relative;
|
||||
color: @white;
|
||||
background-color: @HeaderBackgroundColour;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
@@ -88,10 +87,10 @@ header, #header {
|
||||
margin-bottom: 10px;
|
||||
font-size: 1.4em;
|
||||
height: 30px;
|
||||
color: @white;
|
||||
}
|
||||
|
||||
div.content {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
height: calc(~"100% - 30px");
|
||||
overflow: hidden;
|
||||
|
||||
@@ -103,7 +102,6 @@ header, #header {
|
||||
text-align: center;
|
||||
text-transform: lowercase;
|
||||
margin-top: 40px;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
ul {
|
||||
@@ -114,16 +112,15 @@ header, #header {
|
||||
li {
|
||||
position: relative;
|
||||
margin: 4px 2px;
|
||||
background-color: #fff;
|
||||
border: 1px solid lighten(@ButtonColour, 10%);
|
||||
padding: 6px 8px;
|
||||
color: @black;
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
-ms-text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
background-color: @white;
|
||||
color: @black;
|
||||
|
||||
.small {
|
||||
display: inline-block;
|
||||
@@ -132,11 +129,6 @@ header, #header {
|
||||
margin-top: 0.1em;
|
||||
}
|
||||
|
||||
&.alert {
|
||||
background-color: @StatusError;
|
||||
color: @white;
|
||||
}
|
||||
|
||||
&:after {
|
||||
clear: both;
|
||||
content: ".";
|
||||
@@ -168,7 +160,6 @@ footer, #footer {
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
background: linear-gradient(to bottom, fadeout(@ButtonColour, 100%), @ButtonColour 90%) left top repeat-x;
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -207,3 +198,95 @@ body.status-error {
|
||||
opacity: 0.3;
|
||||
}
|
||||
}
|
||||
|
||||
/* Themes */
|
||||
|
||||
.theme-builder(@main-colour, @alert-colour: difference(@main-colour, @white), @alert-text-colour: contrast(@alert-colour)) {
|
||||
background: linear-gradient(to bottom, darken(@main-colour, 10%), @main-colour) left top repeat-x @main-colour;
|
||||
|
||||
#mainSection {
|
||||
.list {
|
||||
div.content {
|
||||
background: fade(@white, 20%);
|
||||
}
|
||||
|
||||
ul li {
|
||||
border: 1px solid softlight(@main-colour, #aaa);
|
||||
|
||||
&.alert {
|
||||
background-color: @alert-colour;
|
||||
border: 1px solid hardlight(@alert-colour, #aaa);
|
||||
color: @alert-text-colour;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
footer, #footer {
|
||||
background: linear-gradient(to bottom, fadeout(@main-colour, 100%), @main-colour 90%) left top repeat-x;
|
||||
}
|
||||
}
|
||||
|
||||
body.theme-default {
|
||||
.theme-builder(@ButtonColour, @ThemeRed);
|
||||
}
|
||||
|
||||
body.theme-default-soft {
|
||||
.theme-builder(@ButtonColour, hardlight(@ThemeYellow, #bbb));
|
||||
}
|
||||
|
||||
body.theme-green {
|
||||
.theme-builder(@ThemeGreen, @ThemeRed);
|
||||
}
|
||||
|
||||
body.theme-green-soft {
|
||||
.theme-builder(@ThemeGreen, screen(@ThemeYellow, #111));
|
||||
}
|
||||
|
||||
body.theme-violet {
|
||||
.theme-builder(@ThemeViolet, @ThemeRed);
|
||||
}
|
||||
|
||||
body.theme-violet-soft {
|
||||
.theme-builder(@ThemeViolet, hardlight(@ThemeYellow, #bbb));
|
||||
}
|
||||
|
||||
body.theme-magenta {
|
||||
.theme-builder(@ThemeMagenta, darken(@ThemeCyan, 10%), @white);
|
||||
}
|
||||
|
||||
body.theme-magenta-soft {
|
||||
.theme-builder(@ThemeMagenta, screen(@ThemeCyan, #777));
|
||||
}
|
||||
|
||||
body.theme-crimson {
|
||||
.theme-builder(@ThemeCrimson, screen(@ThemeLime, #222));
|
||||
}
|
||||
|
||||
body.theme-crimson-soft {
|
||||
.theme-builder(@ThemeCrimson, screen(@ThemeLime, #777));
|
||||
}
|
||||
|
||||
body.theme-amber {
|
||||
.theme-builder(@ThemeAmber, @ThemeCobalt);
|
||||
}
|
||||
|
||||
body.theme-amber-soft {
|
||||
.theme-builder(@ThemeAmber, hardlight(@ThemeCobalt, #ddd));
|
||||
}
|
||||
|
||||
body.theme-brown {
|
||||
.theme-builder(@ThemeBrown, @ThemeYellow);
|
||||
}
|
||||
|
||||
body.theme-brown-soft {
|
||||
.theme-builder(@ThemeBrown, hardlight(@ThemeYellow, #bbb));
|
||||
}
|
||||
|
||||
body.theme-steel {
|
||||
.theme-builder(@ThemeSteel, @ThemeRed);
|
||||
}
|
||||
|
||||
body.theme-steel-soft {
|
||||
.theme-builder(@ThemeSteel, hardlight(@ThemeYellow, #bbb));
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -273,6 +273,11 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Locations.cshtml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Areas\Config\Views\JobPreferences\Parts\Reports.generated.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Reports.cshtml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Areas\Config\Views\JobQueue\Create.generated.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
@@ -324,6 +329,7 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="Areas\Public\Controllers\HeldDevicesController.cs" />
|
||||
<Compile Include="Areas\Public\Models\UserHeldDevices\NoticeboardModel.cs" />
|
||||
<Compile Include="Areas\Public\Views\HeldDevices\Index.generated.cs">
|
||||
<DependentUpon>Index.cshtml</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -1188,6 +1194,10 @@
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>Locations.generated.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Areas\Config\Views\JobPreferences\Parts\Reports.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>Reports.generated.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Areas\Config\Views\JobQueue\Show.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>Show.generated.cs</LastGenOutput>
|
||||
|
||||
@@ -71,6 +71,12 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult UpdateDefaultNoticeboardTheme()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDefaultNoticeboardTheme);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult UpdateLocationMode()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateLocationMode);
|
||||
@@ -105,6 +111,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
public readonly string UpdateLongRunningJobDaysThreshold = "UpdateLongRunningJobDaysThreshold";
|
||||
public readonly string UpdateStaleJobMinutesThreshold = "UpdateStaleJobMinutesThreshold";
|
||||
public readonly string UpdateDefaultNoticeboardTheme = "UpdateDefaultNoticeboardTheme";
|
||||
public readonly string UpdateLocationMode = "UpdateLocationMode";
|
||||
public readonly string UpdateLocationList = "UpdateLocationList";
|
||||
public readonly string ImportLocationList = "ImportLocationList";
|
||||
@@ -115,6 +122,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
public const string UpdateLongRunningJobDaysThreshold = "UpdateLongRunningJobDaysThreshold";
|
||||
public const string UpdateStaleJobMinutesThreshold = "UpdateStaleJobMinutesThreshold";
|
||||
public const string UpdateDefaultNoticeboardTheme = "UpdateDefaultNoticeboardTheme";
|
||||
public const string UpdateLocationMode = "UpdateLocationMode";
|
||||
public const string UpdateLocationList = "UpdateLocationList";
|
||||
public const string ImportLocationList = "ImportLocationList";
|
||||
@@ -139,6 +147,15 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public readonly string StaleJobMinutesThreshold = "StaleJobMinutesThreshold";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_UpdateDefaultNoticeboardTheme s_params_UpdateDefaultNoticeboardTheme = new ActionParamsClass_UpdateDefaultNoticeboardTheme();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_UpdateDefaultNoticeboardTheme UpdateDefaultNoticeboardThemeParams { get { return s_params_UpdateDefaultNoticeboardTheme; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_UpdateDefaultNoticeboardTheme
|
||||
{
|
||||
public readonly string DefaultNoticeboardTheme = "DefaultNoticeboardTheme";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_UpdateLocationMode s_params_UpdateLocationMode = new ActionParamsClass_UpdateLocationMode();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_UpdateLocationMode UpdateLocationModeParams { get { return s_params_UpdateLocationMode; } }
|
||||
@@ -213,6 +230,19 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateDefaultNoticeboardThemeOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string DefaultNoticeboardTheme, bool redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateDefaultNoticeboardTheme(string DefaultNoticeboardTheme, bool redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDefaultNoticeboardTheme);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DefaultNoticeboardTheme", DefaultNoticeboardTheme);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateDefaultNoticeboardThemeOverride(callInfo, DefaultNoticeboardTheme, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateLocationModeOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, Disco.Models.BI.Job.LocationModes LocationMode, bool redirect);
|
||||
|
||||
|
||||
@@ -107,9 +107,11 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public readonly string General = "General";
|
||||
public readonly string Locations = "Locations";
|
||||
public readonly string Reports = "Reports";
|
||||
}
|
||||
public readonly string General = "~/Areas/Config/Views/JobPreferences/Parts/General.cshtml";
|
||||
public readonly string Locations = "~/Areas/Config/Views/JobPreferences/Parts/Locations.cshtml";
|
||||
public readonly string Reports = "~/Areas/Config/Views/JobPreferences/Parts/Reports.cshtml";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,12 @@ namespace Disco.Web.Areas.Public.Controllers
|
||||
return RedirectToActionPermanent(taskResult.Result);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult Index()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult HeldDevice()
|
||||
@@ -101,6 +107,17 @@ namespace Disco.Web.Areas.Public.Controllers
|
||||
}
|
||||
|
||||
|
||||
static readonly ActionParamsClass_Index s_params_Index = new ActionParamsClass_Index();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_Index IndexParams { get { return s_params_Index; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_Index
|
||||
{
|
||||
public readonly string DeviceProfileInclude = "DeviceProfileInclude";
|
||||
public readonly string DeviceProfileExclude = "DeviceProfileExclude";
|
||||
public readonly string DeviceAddressInclude = "DeviceAddressInclude";
|
||||
public readonly string DeviceAddressExclude = "DeviceAddressExclude";
|
||||
}
|
||||
static readonly ActionParamsClass_HeldDevice s_params_HeldDevice = new ActionParamsClass_HeldDevice();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_HeldDevice HeldDeviceParams { get { return s_params_HeldDevice; } }
|
||||
@@ -133,13 +150,17 @@ namespace Disco.Web.Areas.Public.Controllers
|
||||
public T4MVC_HeldDevicesController() : base(Dummy.Instance) { }
|
||||
|
||||
[NonAction]
|
||||
partial void IndexOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);
|
||||
partial void IndexOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, System.Collections.Generic.List<int?> DeviceProfileInclude, System.Collections.Generic.List<int?> DeviceProfileExclude, System.Collections.Generic.List<string> DeviceAddressInclude, System.Collections.Generic.List<string> DeviceAddressExclude);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult Index()
|
||||
public override System.Web.Mvc.ActionResult Index(System.Collections.Generic.List<int?> DeviceProfileInclude, System.Collections.Generic.List<int?> DeviceProfileExclude, System.Collections.Generic.List<string> DeviceAddressInclude, System.Collections.Generic.List<string> DeviceAddressExclude)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
|
||||
IndexOverride(callInfo);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileInclude", DeviceProfileInclude);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileExclude", DeviceProfileExclude);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressInclude", DeviceAddressInclude);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressExclude", DeviceAddressExclude);
|
||||
IndexOverride(callInfo, DeviceProfileInclude, DeviceProfileExclude, DeviceAddressInclude, DeviceAddressExclude);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,12 @@ namespace Disco.Web.Areas.Public.Controllers
|
||||
return RedirectToActionPermanent(taskResult.Result);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult Index()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult UserHeldDevice()
|
||||
@@ -101,6 +107,17 @@ namespace Disco.Web.Areas.Public.Controllers
|
||||
}
|
||||
|
||||
|
||||
static readonly ActionParamsClass_Index s_params_Index = new ActionParamsClass_Index();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_Index IndexParams { get { return s_params_Index; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_Index
|
||||
{
|
||||
public readonly string DeviceProfileInclude = "DeviceProfileInclude";
|
||||
public readonly string DeviceProfileExclude = "DeviceProfileExclude";
|
||||
public readonly string DeviceAddressInclude = "DeviceAddressInclude";
|
||||
public readonly string DeviceAddressExclude = "DeviceAddressExclude";
|
||||
}
|
||||
static readonly ActionParamsClass_UserHeldDevice s_params_UserHeldDevice = new ActionParamsClass_UserHeldDevice();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_UserHeldDevice UserHeldDeviceParams { get { return s_params_UserHeldDevice; } }
|
||||
@@ -133,13 +150,17 @@ namespace Disco.Web.Areas.Public.Controllers
|
||||
public T4MVC_UserHeldDevicesController() : base(Dummy.Instance) { }
|
||||
|
||||
[NonAction]
|
||||
partial void IndexOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);
|
||||
partial void IndexOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, System.Collections.Generic.List<int?> DeviceProfileInclude, System.Collections.Generic.List<int?> DeviceProfileExclude, System.Collections.Generic.List<string> DeviceAddressInclude, System.Collections.Generic.List<string> DeviceAddressExclude);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult Index()
|
||||
public override System.Web.Mvc.ActionResult Index(System.Collections.Generic.List<int?> DeviceProfileInclude, System.Collections.Generic.List<int?> DeviceProfileExclude, System.Collections.Generic.List<string> DeviceAddressInclude, System.Collections.Generic.List<string> DeviceAddressExclude)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
|
||||
IndexOverride(callInfo);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileInclude", DeviceProfileInclude);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileExclude", DeviceProfileExclude);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressInclude", DeviceAddressInclude);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressExclude", DeviceAddressExclude);
|
||||
IndexOverride(callInfo, DeviceProfileInclude, DeviceProfileExclude, DeviceAddressInclude, DeviceAddressExclude);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user