Permissions & Authorization for Users #24

Initial Release; Includes Database and MVC refactoring
This commit is contained in:
Gary Sharp
2013-10-10 19:13:16 +11:00
parent 172ce5524a
commit a099d68915
458 changed files with 40221 additions and 12130 deletions
@@ -0,0 +1,28 @@
@model Disco.Web.Areas.Config.Models.AuthorizationRole.CreateModel
@{
Authorization.Require(Claims.DiscoAdminAccount);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Authorization Roles", MVC.Config.AuthorizationRole.Index(null), "Create");
}
@using (Html.BeginForm())
{
<div class="form" style="width: 450px">
<table>
<tr>
<th>
Name:
</th>
<td>
@Html.EditorFor(model => model.AuthorizationRole.Name)<br />@Html.ValidationMessageFor(model => model.AuthorizationRole.Name)
</td>
</tr>
</table>
<p class="actions">
<input type="submit" class="button" value="Create" />
</p>
</div>
<script type="text/javascript">
$(function () {
$('#AuthorizationRole_Name').focus().select();
});
</script>
}
@@ -0,0 +1,122 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18051
//
// 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.AuthorizationRole
{
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.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/AuthorizationRole/Create.cshtml")]
public partial class Create : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.AuthorizationRole.CreateModel>
{
public Create()
{
}
public override void Execute()
{
#line 2 "..\..\Areas\Config\Views\AuthorizationRole\Create.cshtml"
Authorization.Require(Claims.DiscoAdminAccount);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Authorization Roles", MVC.Config.AuthorizationRole.Index(null), "Create");
#line default
#line hidden
WriteLiteral("\r\n");
#line 6 "..\..\Areas\Config\Views\AuthorizationRole\Create.cshtml"
using (Html.BeginForm())
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 450px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n N" +
"ame:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 15 "..\..\Areas\Config\Views\AuthorizationRole\Create.cshtml"
Write(Html.EditorFor(model => model.AuthorizationRole.Name));
#line default
#line hidden
WriteLiteral("<br />");
#line 15 "..\..\Areas\Config\Views\AuthorizationRole\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.AuthorizationRole.Name));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n <p");
WriteLiteral(" class=\"actions\"");
WriteLiteral(">\r\n <input");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Create\"");
WriteLiteral(" />\r\n </p>\r\n </div>\r\n");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n $(\'#AuthorizationRole_Name\').focus().sele" +
"ct();\r\n });\r\n </script>\r\n");
#line 28 "..\..\Areas\Config\Views\AuthorizationRole\Create.cshtml"
}
#line default
#line hidden
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,43 @@
@model Disco.Web.Areas.Config.Models.AuthorizationRole.IndexModel
@{
Authorization.Require(Claims.DiscoAdminAccount);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Authorization Roles");
}
@if (Model.Tokens.Count == 0)
{
<div class="form" style="width: 450px; padding: 100px 0;">
<h2>No authorization roles are configured</h2>
</div>
}
else
{
<table class="tableData">
<tr>
<th>Name
</th>
<th>Linked Groups/Users
</th>
</tr>
@foreach (var item in Model.Tokens)
{
<tr>
<td>
@Html.ActionLink(item.Role.Name, MVC.Config.AuthorizationRole.Index(item.Role.Id))
</td>
<td>
@if (item.SubjectIds.Count == 0)
{
<span class="smallMessage">&lt;None&gt;</span>
}
else
{
@(string.Join(", ", item.SubjectIds.OrderBy(i => i)))
}
</td>
</tr>
}
</table>
}
<div class="actionBar">
@Html.ActionLinkButton("Create Authorization Role", MVC.Config.AuthorizationRole.Create())
</div>
@@ -0,0 +1,197 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18051
//
// 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.AuthorizationRole
{
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.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/AuthorizationRole/Index.cshtml")]
public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.AuthorizationRole.IndexModel>
{
public Index()
{
}
public override void Execute()
{
#line 2 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
Authorization.Require(Claims.DiscoAdminAccount);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Authorization Roles");
#line default
#line hidden
WriteLiteral("\r\n");
#line 6 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
if (Model.Tokens.Count == 0)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 450px; padding: 100px 0;\"");
WriteLiteral(">\r\n <h2>No authorization roles are configured</h2>\r\n </div> \r\n");
#line 11 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <table");
WriteLiteral(" class=\"tableData\"");
WriteLiteral(">\r\n <tr>\r\n <th>Name\r\n </th>\r\n <th>Linked " +
"Groups/Users\r\n </th>\r\n </tr>\r\n");
#line 21 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
#line default
#line hidden
#line 21 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
foreach (var item in Model.Tokens)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td>\r\n");
WriteLiteral(" ");
#line 25 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
Write(Html.ActionLink(item.Role.Name, MVC.Config.AuthorizationRole.Index(item.Role.Id)));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
#line 28 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
#line default
#line hidden
#line 28 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
if (item.SubjectIds.Count == 0)
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None&gt;</span>\r\n");
#line 31 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
}
else
{
#line default
#line hidden
#line 34 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
Write(string.Join(", ", item.SubjectIds.OrderBy(i => i)));
#line default
#line hidden
#line 34 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 38 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n");
#line 40 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("<div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 42 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
Write(Html.ActionLinkButton("Create Authorization Role", MVC.Config.AuthorizationRole.Create()));
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,320 @@
@model Disco.Web.Areas.Config.Models.AuthorizationRole.ShowModel
@using Disco.Models.Authorization;
@{
Authorization.Require(Claims.DiscoAdminAccount);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Authorization Roles", MVC.Config.AuthorizationRole.Index(null), Model.Token.Role.Name);
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
Html.BundleDeferred("~/Style/Fancytree");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Fancytree");
}
<div id="Config_AuthRoles_Show" class="form" style="width: 550px">
<table>
<tr>
<th style="width: 150px">Id:
</th>
<td>
@Html.DisplayFor(model => model.Token.Role.Id)
</td>
</tr>
<tr>
<th>Name:
</th>
<td>@Html.EditorFor(model => model.Token.Role.Name)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#Token_Role_Name'),
'Invalid Name',
'@(Url.Action(MVC.API.AuthorizationRole.UpdateName(Model.Token.Role.Id)))',
'RoleName'
);
});
</script>
</td>
</tr>
<tr>
<th>Linked Groups/Users:</th>
<td>
@if (Model.Token.SubjectIds.Count == 0)
{
<span class="smallMessage">None Associated</span>
}
else
{
<ul id="Config_AuthRoles_Subjects" class="none">
@foreach (var sg in Model.Subjects)
{
<li class="@(sg.IsGroup ? "group" : "user")">@(sg.Id == sg.Name ? sg.Id : string.Format("{0} [{1}]", sg.Name, sg.Id))</li>
}
</ul>
}
<div>
<a id="Config_AuthRoles_Subjects_Update" href="#" class="button small">Update</a>
<div id="Config_AuthRoles_Subjects_Update_Dialog" class="dialog" title="Authorization Role Linked Groups/Users">
<div id="Config_AuthRoles_Subjects_Update_Dialog_ListContainer">
<span id="Config_AuthRoles_Subjects_Update_Dialog_None" class="smallMessage">None Associated</span>
<ul id="Config_AuthRoles_Subjects_Update_Dialog_List" class="none">
@foreach (var sg in Model.Subjects)
{
<li class="@(sg.IsGroup ? "group" : "user")" data-subjectid="@sg.Id">@(sg.Id == sg.Name ? sg.Id : string.Format("{0} [{1}]", sg.Name, sg.Id)) <span class="remove"></span></li>
}
</ul>
</div>
<div id="Config_AuthRoles_Subjects_Update_Dialog_AddContainer">
<input type="text" id="Config_AuthRoles_Subjects_Update_Dialog_TextAdd" />
<a id="Config_AuthRoles_Subjects_Update_Dialog_Add" href="#" class="button small">Add</a>
</div>
<form id="Config_AuthRoles_Subjects_Update_Dialog_Form" action="@(Url.Action(MVC.API.AuthorizationRole.UpdateSubjects(Model.Token.Role.Id, null, true)))" method="post"></form>
</div>
<script>
(function(){
var dialog, textAdd, list, noSubjects, form;
function showDialog(){
if (!dialog){
dialog = $('#Config_AuthRoles_Subjects_Update_Dialog').dialog({
resizable: false,
modal: true,
autoOpen: false,
width: 350,
height: 420,
buttons: {
"Save Changes": saveChanges,
Cancel: cancel
}
});
dialog.on('click', '.remove', remove);
list = $('#Config_AuthRoles_Subjects_Update_Dialog_List');
noSubjects = $('#Config_AuthRoles_Subjects_Update_Dialog_None');
textAdd = $('#Config_AuthRoles_Subjects_Update_Dialog_TextAdd');
textAdd.watermark('Search Subjects')
.autocomplete({
source: '@(Url.Action(MVC.API.AuthorizationRole.SearchSubjects()))',
minLength: 2,
focus: function (e, ui) {
textAdd.val(ui.item.Id);
return false;
},
select: function (e, ui) {
textAdd.val(ui.item.Id).blur();
return false;
}
}).data('ui-autocomplete')._renderItem = function (ul, item) {
return $("<li></li>")
.data("item.autocomplete", item)
.append("<a><strong>" + item.Name + "</strong><br>" + item.Id + " (" + item.Type + ")</a>")
.appendTo(ul);
};
$('#Config_AuthRoles_Subjects_Update_Dialog_Add').click(add);
}
dialog.dialog('open');
updateNoSubjects();
return false;
}
function cancel(){
$(this).dialog("close");
list.find('li').each(function(){
$this = $(this);
if ($this.is('[data-subjectstatus="new"]')){
$this.remove();
}else{
if ($this.is('[data-subjectstatus="removed"]')){
$this.show();
}
}
});
}
function remove(){
$this = $(this).closest('li');
if ($this.is('[data-subjectstatus="new"]')){
$this.remove();
}else{
$this.attr('data-subjectstatus', 'removed').hide();
}
updateNoSubjects();
}
function add(){
var id = textAdd.val();
$.ajax({
url: '@Url.Action(MVC.API.AuthorizationRole.Subject())',
method: 'get',
data: { Id: id }
}).done(function(response){
if (response){
if (list.find('li[data-subjectid="'+response.Id+'"]').length == 0){
var li = $('<li>')
.append($('<span>').text(response.Id == response.Name ? response.Id : response.Name + ' [' + response.Id + ']'))
.append($('<span>').addClass('remove'))
.addClass(response.Type)
.attr('data-subjectid', response.Id)
.attr('data-subjectstatus', 'new');
list.append(li);
updateNoSubjects();
}else{
alert('That subject has already been added');
}
}else{
alert('Unknown Id');
}
}).fail(function(jqXHR, textStatus, errorThrown){
alert('Error: ' + errorThrown);
});
}
function updateNoSubjects(){
if (list.find('li:visible').length > 0)
noSubjects.hide();
else
noSubjects.show();
}
function saveChanges(){
var form = $('#Config_AuthRoles_Subjects_Update_Dialog_Form').empty();
list.find('li[data-subjectstatus!="removed"]').each(function(){
var subjectId = $(this).attr('data-subjectid');
form.append($('<input>').attr({
'name': 'Subjects',
'type': 'hidden'
}).val(subjectId));
}).get();
form.submit();
dialog.dialog("disable");
dialog.dialog("option", "buttons", null);
}
$(function(){
$('#Config_AuthRoles_Subjects_Update').click(showDialog);
});
})();
</script>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<div id="Config_AuthRoles_Claims_Tree">
</div>
<div>
<a href="#" id="Config_AuthRoles_Claims_SaveChanges" class="button small disabled">Save Changes</a>@AjaxHelpers.AjaxLoader()
</div>
<script>
(function(){
var claimNodes = @(new HtmlString(Newtonsoft.Json.JsonConvert.SerializeObject(Model.ClaimNavigatorFancyTreeNodes)));
$(function(){
var saveButton = $('#Config_AuthRoles_Claims_SaveChanges');
var ajaxLoading = saveButton.next('.ajaxLoading');
var tree = $('#Config_AuthRoles_Claims_Tree').fancytree({
source: claimNodes,
checkbox: true,
selectMode: 3,
select: function(){
saveButton.removeClass('disabled');
}
});
saveButton.click(function(){
if (!saveButton.is('.disabled')){
var selectedNodes = tree.fancytree('getTree').getSelectedNodes();
var selectedKeys = [];
for (var i = 0; i < selectedNodes.length; i++) {
var node = selectedNodes[i];
if (!node.folder)
selectedKeys.push(node.key);
}
ajaxLoading.show()
$.ajax({
url: '@Url.Action(MVC.API.AuthorizationRole.UpdateClaims(Model.Token.Role.Id))',
method: 'post',
data: { ClaimKeys: selectedKeys },
traditional: true
}).done(function(response, result){
if (result != 'success' || response != 'OK') {
alert('Unable to save changes:\n' + response);
ajaxLoading.hide();
} else {
saveButton.addClass('disabled');
ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
}).fail(function(jqXHR, textStatus, errorThrown){
alert('Error: ' + errorThrown);
});
}
return false;
});
});
})();
</script>
</td>
</tr>
</table>
</div>
<div class="actionBar">
@Html.ActionLinkButton("Delete", MVC.API.AuthorizationRole.Delete(Model.Token.Role.Id, true), "Config_AuthRoles_Actions_Delete_Button")
<div id="Config_AuthRoles_Actions_Delete_Dialog" title="Delete this Authorization Role?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
This item will be permanently deleted and cannot be recovered.<br />
<br />
Are you sure?
</p>
</div>
<script type="text/javascript">
$(function () {
var button = $('#Config_AuthRoles_Actions_Delete_Button');
var buttonDialog = $('#Config_AuthRoles_Actions_Delete_Dialog');
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
buttonDialog.dialog('open');
return false;
});
buttonDialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Delete": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog("close");
}
}
});
});
</script>
</div>
@@ -0,0 +1,632 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18051
//
// 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.AuthorizationRole
{
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.BI.Extensions;
#line 2 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
using Disco.Models.Authorization;
#line default
#line hidden
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/AuthorizationRole/Show.cshtml")]
public partial class Show : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.AuthorizationRole.ShowModel>
{
public Show()
{
}
public override void Execute()
{
#line 3 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Authorization.Require(Claims.DiscoAdminAccount);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Authorization Roles", MVC.Config.AuthorizationRole.Index(null), Model.Token.Role.Name);
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
Html.BundleDeferred("~/Style/Fancytree");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Fancytree");
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" id=\"Config_AuthRoles_Show\"");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 550px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 150px\"");
WriteLiteral(">Id:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 17 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(Html.DisplayFor(model => model.Token.Role.Id));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>Name:\r\n " +
" </th>\r\n <td>");
#line 23 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(Html.EditorFor(model => model.Token.Role.Name));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 24 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 25 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n document.DiscoFun" +
"ctions.PropertyChangeHelper(\r\n $(\'#Token_Role_Name\')," +
"\r\n \'Invalid Name\',\r\n \'");
#line 31 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(Url.Action(MVC.API.AuthorizationRole.UpdateName(Model.Token.Role.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n \'RoleName\'\r\n );\r\n " +
" });\r\n </script>\r\n </td>\r\n </tr>\r\n " +
" <tr>\r\n <th>Linked Groups/Users:</th>\r\n <td>\r\n");
#line 41 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
#line default
#line hidden
#line 41 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
if (Model.Token.SubjectIds.Count == 0)
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">None Associated</span>\r\n");
#line 44 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <ul");
WriteLiteral(" id=\"Config_AuthRoles_Subjects\"");
WriteLiteral(" class=\"none\"");
WriteLiteral(">\r\n");
#line 48 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
#line default
#line hidden
#line 48 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
foreach (var sg in Model.Subjects)
{
#line default
#line hidden
WriteLiteral(" <li");
WriteAttribute("class", Tuple.Create(" class=\"", 2069), Tuple.Create("\"", 2109)
#line 50 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
, Tuple.Create(Tuple.Create("", 2077), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
#line default
#line hidden
, 2077), false)
);
WriteLiteral(">");
#line 50 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(sg.Id == sg.Name ? sg.Id : string.Format("{0} [{1}]", sg.Name, sg.Id));
#line default
#line hidden
WriteLiteral("</li>\r\n");
#line 51 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ul>\r\n");
#line 53 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" <div>\r\n <a");
WriteLiteral(" id=\"Config_AuthRoles_Subjects_Update\"");
WriteLiteral(" href=\"#\"");
WriteLiteral(" class=\"button small\"");
WriteLiteral(">Update</a>\r\n <div");
WriteLiteral(" id=\"Config_AuthRoles_Subjects_Update_Dialog\"");
WriteLiteral(" class=\"dialog\"");
WriteLiteral(" title=\"Authorization Role Linked Groups/Users\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" id=\"Config_AuthRoles_Subjects_Update_Dialog_ListContainer\"");
WriteLiteral(">\r\n <span");
WriteLiteral(" id=\"Config_AuthRoles_Subjects_Update_Dialog_None\"");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">None Associated</span>\r\n <ul");
WriteLiteral(" id=\"Config_AuthRoles_Subjects_Update_Dialog_List\"");
WriteLiteral(" class=\"none\"");
WriteLiteral(">\r\n");
#line 60 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
#line default
#line hidden
#line 60 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
foreach (var sg in Model.Subjects)
{
#line default
#line hidden
WriteLiteral(" <li");
WriteAttribute("class", Tuple.Create(" class=\"", 2982), Tuple.Create("\"", 3022)
#line 62 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
, Tuple.Create(Tuple.Create("", 2990), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
#line default
#line hidden
, 2990), false)
);
WriteLiteral(" data-subjectid=\"");
#line 62 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(sg.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">");
#line 62 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(sg.Id == sg.Name ? sg.Id : string.Format("{0} [{1}]", sg.Name, sg.Id));
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"remove\"");
WriteLiteral("></span></li>\r\n");
#line 63 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ul>\r\n </div>\r\n " +
" <div");
WriteLiteral(" id=\"Config_AuthRoles_Subjects_Update_Dialog_AddContainer\"");
WriteLiteral(">\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" id=\"Config_AuthRoles_Subjects_Update_Dialog_TextAdd\"");
WriteLiteral(" />\r\n <a");
WriteLiteral(" id=\"Config_AuthRoles_Subjects_Update_Dialog_Add\"");
WriteLiteral(" href=\"#\"");
WriteLiteral(" class=\"button small\"");
WriteLiteral(">Add</a>\r\n </div>\r\n <form");
WriteLiteral(" id=\"Config_AuthRoles_Subjects_Update_Dialog_Form\"");
WriteAttribute("action", Tuple.Create(" action=\"", 3681), Tuple.Create("\"", 3778)
#line 70 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
, Tuple.Create(Tuple.Create("", 3690), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.AuthorizationRole.UpdateSubjects(Model.Token.Role.Id, null, true))
#line default
#line hidden
, 3690), false)
);
WriteLiteral(" method=\"post\"");
WriteLiteral("></form>\r\n </div>\r\n <script>\r\n " +
" (function(){\r\n var dialog, textAdd, list, " +
"noSubjects, form;\r\n \r\n fun" +
"ction showDialog(){\r\n if (!dialog){\r\n " +
" dialog = $(\'#Config_AuthRoles_Subjects_Update_Dialog\').d" +
"ialog({\r\n resizable: false,\r\n " +
" modal: true,\r\n " +
" autoOpen: false,\r\n width: 350,\r\n " +
" height: 420,\r\n " +
" buttons: {\r\n \"Save Changes\": s" +
"aveChanges,\r\n Cancel: cancel\r\n " +
" }\r\n });\r\n\r\n " +
" dialog.on(\'click\', \'.remove\', remove);\r\n\r\n " +
" list = $(\'#Config_AuthRoles_Subjects_Update_Dia" +
"log_List\');\r\n noSubjects = $(\'#Config_AuthRol" +
"es_Subjects_Update_Dialog_None\');\r\n\r\n textAdd" +
" = $(\'#Config_AuthRoles_Subjects_Update_Dialog_TextAdd\');\r\n\r\n " +
" textAdd.watermark(\'Search Subjects\')\r\n " +
" .autocomplete({\r\n sour" +
"ce: \'");
#line 99 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(Url.Action(MVC.API.AuthorizationRole.SearchSubjects()));
#line default
#line hidden
WriteLiteral("\',\r\n minLength: 2,\r\n " +
" focus: function (e, ui) {\r\n " +
" textAdd.val(ui.item.Id);\r\n " +
" return false;\r\n },\r\n " +
" select: function (e, ui) {\r\n " +
" textAdd.val(ui.item.Id).blur();\r\n " +
" return false;\r\n " +
" }\r\n }).data(\'ui-autocom" +
"plete\')._renderItem = function (ul, item) {\r\n " +
" return $(\"<li></li>\")\r\n " +
".data(\"item.autocomplete\", item)\r\n " +
" .append(\"<a><strong>\" + item.Name + \"</strong><br>\" + item.Id + \" (\" + item.Ty" +
"pe + \")</a>\")\r\n .appendTo(ul);\r\n " +
" };\r\n\r\n " +
" $(\'#Config_AuthRoles_Subjects_Update_Dialog_Add\').click(add);\r\n " +
" }\r\n\r\n dialog.dialog(\'open\');\r\n\r\n " +
" updateNoSubjects();\r\n " +
" return false;\r\n }\r\n\r\n " +
"function cancel(){\r\n $(this).dialog(\"close\");\r\n\r\n" +
" list.find(\'li\').each(function(){\r\n " +
" $this = $(this);\r\n if (" +
"$this.is(\'[data-subjectstatus=\"new\"]\')){\r\n " +
" $this.remove();\r\n }else{\r\n " +
" if ($this.is(\'[data-subjectstatus=\"removed\"]\')){\r\n " +
" $this.show();\r\n " +
" }\r\n }\r\n " +
" });\r\n }\r\n\r\n function" +
" remove(){\r\n $this = $(this).closest(\'li\');\r\n\r\n " +
" if ($this.is(\'[data-subjectstatus=\"new\"]\')){\r\n " +
" $this.remove();\r\n " +
" }else{\r\n $this.attr(\'data-subjectstatus\', \'r" +
"emoved\').hide();\r\n }\r\n\r\n " +
" updateNoSubjects();\r\n }\r\n\r\n " +
" function add(){\r\n \r\n " +
" var id = textAdd.val();\r\n\r\n $.ajax({\r" +
"\n url: \'");
#line 157 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(Url.Action(MVC.API.AuthorizationRole.Subject()));
#line default
#line hidden
WriteLiteral("\',\r\n method: \'get\',\r\n " +
" data: { Id: id }\r\n }).done(function(re" +
"sponse){\r\n if (response){\r\n " +
" if (list.find(\'li[data-subjectid=\"\'+response.Id+\'\"]\').leng" +
"th == 0){\r\n var li = $(\'<li>\')\r\n " +
" .append($(\'<span>\').text(response.Id " +
"== response.Name ? response.Id : response.Name + \' [\' + response.Id + \']\'))\r\n " +
" .append($(\'<span>\').addClass(\'remo" +
"ve\'))\r\n .addClass(response.Type)\r" +
"\n .attr(\'data-subjectid\', respons" +
"e.Id)\r\n .attr(\'data-subjectstatus" +
"\', \'new\');\r\n\r\n list.append(li);\r\n\r\n " +
" updateNoSubjects(); " +
" \r\n }else{\r\n " +
" alert(\'That subject has already been added\');" +
"\r\n }\r\n " +
" }else{\r\n alert(\'Unknown Id\');\r\n " +
" }\r\n }).fail(function(j" +
"qXHR, textStatus, errorThrown){\r\n alert(\'Erro" +
"r: \' + errorThrown);\r\n });\r\n " +
" }\r\n\r\n function updateNoSubjects(){\r\n " +
" if (list.find(\'li:visible\').length > 0)\r\n " +
" noSubjects.hide();\r\n else\r" +
"\n noSubjects.show();\r\n " +
" }\r\n\r\n function saveChanges(){\r\n " +
" var form = $(\'#Config_AuthRoles_Subjects_Update_Dialog_Form\').emp" +
"ty();\r\n\r\n list.find(\'li[data-subjectstatus!=\"remo" +
"ved\"]\').each(function(){\r\n var subjectId = $(" +
"this).attr(\'data-subjectid\');\r\n \r\n " +
" form.append($(\'<input>\').attr({\r\n " +
" \'name\': \'Subjects\',\r\n \'" +
"type\': \'hidden\'\r\n }).val(subjectId));\r\n\r\n " +
" }).get();\r\n\r\n form.su" +
"bmit();\r\n\r\n dialog.dialog(\"disable\");\r\n " +
" dialog.dialog(\"option\", \"buttons\", null);\r\n " +
" }\r\n\r\n $(function(){\r\n " +
" $(\'#Config_AuthRoles_Subjects_Update\').click(showDialog);\r\n " +
" });\r\n\r\n })();\r\n </" +
"script>\r\n </div>\r\n </td>\r\n </tr>\r\n <tr>\r" +
"\n <td");
WriteLiteral(" colspan=\"2\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" id=\"Config_AuthRoles_Claims_Tree\"");
WriteLiteral(">\r\n </div>\r\n <div>\r\n <a");
WriteLiteral(" href=\"#\"");
WriteLiteral(" id=\"Config_AuthRoles_Claims_SaveChanges\"");
WriteLiteral(" class=\"button small disabled\"");
WriteLiteral(">Save Changes</a>");
#line 224 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n <script>\r\n (function" +
"(){\r\n var claimNodes = ");
#line 228 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(new HtmlString(Newtonsoft.Json.JsonConvert.SerializeObject(Model.ClaimNavigatorFancyTreeNodes)));
#line default
#line hidden
WriteLiteral(@";
$(function(){
var saveButton = $('#Config_AuthRoles_Claims_SaveChanges');
var ajaxLoading = saveButton.next('.ajaxLoading');
var tree = $('#Config_AuthRoles_Claims_Tree').fancytree({
source: claimNodes,
checkbox: true,
selectMode: 3,
select: function(){
saveButton.removeClass('disabled');
}
});
saveButton.click(function(){
if (!saveButton.is('.disabled')){
var selectedNodes = tree.fancytree('getTree').getSelectedNodes();
var selectedKeys = [];
for (var i = 0; i < selectedNodes.length; i++) {
var node = selectedNodes[i];
if (!node.folder)
selectedKeys.push(node.key);
}
ajaxLoading.show()
$.ajax({
url: '");
#line 257 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(Url.Action(MVC.API.AuthorizationRole.UpdateClaims(Model.Token.Role.Id)));
#line default
#line hidden
WriteLiteral(@"',
method: 'post',
data: { ClaimKeys: selectedKeys },
traditional: true
}).done(function(response, result){
if (result != 'success' || response != 'OK') {
alert('Unable to save changes:\n' + response);
ajaxLoading.hide();
} else {
saveButton.addClass('disabled');
ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
}).fail(function(jqXHR, textStatus, errorThrown){
alert('Error: ' + errorThrown);
});
}
return false;
});
});
})();
</script>
</td>
</tr>
</table>
</div>
<div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 283 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(Html.ActionLinkButton("Delete", MVC.API.AuthorizationRole.Delete(Model.Token.Role.Id, true), "Config_AuthRoles_Actions_Delete_Button"));
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" id=\"Config_AuthRoles_Actions_Delete_Dialog\"");
WriteLiteral(" title=\"Delete this Authorization Role?\"");
WriteLiteral(">\r\n <p>\r\n <span");
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
WriteLiteral("></span>\r\n This item will be permanently deleted and cannot be recover" +
"ed.<br />\r\n <br />\r\n Are you sure?\r\n </p>\r\n </di" +
"v>\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var button = $('#Config_AuthRoles_Actions_Delete_Button');
var buttonDialog = $('#Config_AuthRoles_Actions_Delete_Dialog');
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
buttonDialog.dialog('open');
return false;
});
buttonDialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
""Delete"": function () {
var $this = $(this);
$this.dialog(""disable"");
$this.dialog(""option"", ""buttons"", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog(""close"");
}
}
});
});
</script>
</div>
");
}
}
}
#pragma warning restore 1591
@@ -1,62 +1,106 @@
@model Disco.Web.Areas.Config.Models.Config.IndexModel
@{
Authorization.Require(Claims.Config.Show);
ViewBag.Title = "Configuration";
}
<table id="pageMenu">
<tr>
<td>
<div class="pageMenuArea">
<h2>Hosting</h2>
@Html.ActionLinkClass("System", MVC.Config.SystemConfig.Index(), "config")
<div class="pageMenuBlurb">
Update system configuration, such as the Data Storage Location and Proxy settings.
@if (Authorization.HasAny(Claims.Config.System.Show, Claims.Config.Organisation.Show, Claims.DiscoAdminAccount, Claims.Config.Logging.Show))
{
<td>
<div class="pageMenuArea">
<h2>Hosting</h2>
@if (Authorization.Has(Claims.Config.System.Show))
{
@Html.ActionLinkClass("System", MVC.Config.SystemConfig.Index(), "config")
<div class="pageMenuBlurb">
Update system configuration, such as the Data Storage Location and Proxy settings.
</div>
}
@if (Authorization.Has(Claims.Config.Organisation.Show))
{
@Html.ActionLinkClass("Organisation Details", MVC.Config.Organisation.Index(), "config")
<div class="pageMenuBlurb">
Update the Organisation Name, Logo and Addresses associated with this organisation.
</div>
}
@if (Authorization.Has(Claims.DiscoAdminAccount))
{
@Html.ActionLinkClass("Authorization Roles", MVC.Config.AuthorizationRole.Index(), "config")
<div class="pageMenuBlurb">
Configure roles and permissions for users.
</div>
}
@if (Authorization.Has(Claims.Config.Logging.Show))
{
@Html.ActionLinkClass("Logging", MVC.Config.Logging.Index(), "config")
<div class="pageMenuBlurb">
Export Log files from various Disco Modules and view Live Logging.
</div>
}
</div>
@Html.ActionLinkClass("Organisation Details", MVC.Config.Organisation.Index(), "config")
<div class="pageMenuBlurb">
Update the Organisation Name, Logo and Addresses associated with this organisation.
</div>
@Html.ActionLinkClass("Logging", MVC.Config.Logging.Index(), "config")
<div class="pageMenuBlurb">
Export Log files from various Disco Modules and view Live Logging.
</div>
</div>
</td>
<td>
<div class="pageMenuArea">
<h2>Devices</h2>
@Html.ActionLinkClass("Models", MVC.Config.DeviceModel.Index(), "config")
<div class="pageMenuBlurb">
Configure Components, Product Images and default settings for Device Models.
</div>
@Html.ActionLinkClass("Batches", MVC.Config.DeviceBatch.Index(), "config")
<div class="pageMenuBlurb">
Create and Configure Device Batches.
</div>
@Html.ActionLinkClass("Profiles", MVC.Config.DeviceProfile.Index(), "config")
<div class="pageMenuBlurb">
Configure Device Profiles including computer name generation, distribution and Active
</td>
}
@if (Authorization.HasAny(Claims.Config.DeviceModel.Show, Claims.Config.DeviceBatch.Show, Claims.Config.DeviceProfile.Show, Claims.Config.Enrolment.Show))
{
<td>
<div class="pageMenuArea">
<h2>Devices</h2>
@if (Authorization.Has(Claims.Config.DeviceModel.Show))
{
@Html.ActionLinkClass("Models", MVC.Config.DeviceModel.Index(), "config")
<div class="pageMenuBlurb">
Configure Components, Product Images and default settings for Device Models.
</div>
}
@if (Authorization.Has(Claims.Config.DeviceBatch.Show))
{
@Html.ActionLinkClass("Batches", MVC.Config.DeviceBatch.Index(), "config")
<div class="pageMenuBlurb">
Create and Configure Device Batches.
</div>
}
@if (Authorization.Has(Claims.Config.DeviceProfile.Show))
{
@Html.ActionLinkClass("Profiles", MVC.Config.DeviceProfile.Index(), "config")
<div class="pageMenuBlurb">
Configure Device Profiles including computer name generation, distribution and Active
Directory OU layout.
</div>
}
@if (Authorization.Has(Claims.Config.Enrolment.Show))
{
@Html.ActionLinkClass("Enrolment", MVC.Config.Enrolment.Index(), "config")
<div class="pageMenuBlurb">
Configure Enrolment settings including secure credentials.
</div>
}
</div>
@Html.ActionLinkClass("Enrolment", MVC.Config.Enrolment.Index(), "config")
<div class="pageMenuBlurb">
Configure Enrolment settings including secure credentials.
</div>
</div>
</td>
<td>
<div class="pageMenuArea">
<h2>Features</h2>
@Html.ActionLinkClass("Document Templates", MVC.Config.DocumentTemplate.Index(), "config")
<div class="pageMenuBlurb">
Create, Update and Bulk Generate documents based on PDF Templates for Jobs, Devices
</td>
}
@if (Authorization.HasAny(Claims.Config.DocumentTemplate.Show, Claims.Config.Plugin.Show))
{
<td>
<div class="pageMenuArea">
<h2>Features</h2>
@if (Authorization.Has(Claims.Config.DocumentTemplate.Show))
{
@Html.ActionLinkClass("Document Templates", MVC.Config.DocumentTemplate.Index(), "config")
<div class="pageMenuBlurb">
Create, Update and Bulk Generate documents based on PDF Templates for Jobs, Devices
and Users.
</div>
}
@if (Authorization.Has(Claims.Config.Plugin.Show))
{
@Html.ActionLinkClass("Plugins", MVC.Config.Plugins.Index(), "config")
<div class="pageMenuBlurb">
Manage extensions to the Disco platform.
</div>
}
</div>
@Html.ActionLinkClass("Plugins", MVC.Config.Plugins.Index(), "config")
<div class="pageMenuBlurb">
Manage extensions to the Disco platform.
</div>
</div>
</td>
</td>
}
</tr>
</table>
@{
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.Config
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Config/Index.cshtml")]
public partial class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Config.IndexModel>
public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.Config.IndexModel>
{
public Index()
{
@@ -43,6 +45,7 @@ namespace Disco.Web.Areas.Config.Views.Config
#line 2 "..\..\Areas\Config\Views\Config\Index.cshtml"
Authorization.Require(Claims.Config.Show);
ViewBag.Title = "Configuration";
@@ -52,170 +55,485 @@ WriteLiteral("\r\n<table");
WriteLiteral(" id=\"pageMenu\"");
WriteLiteral(">\r\n <tr>\r\n <td>\r\n <div");
WriteLiteral(">\r\n <tr>\r\n");
#line 8 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
#line 8 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.HasAny(Claims.Config.System.Show, Claims.Config.Organisation.Show, Claims.DiscoAdminAccount, Claims.Config.Logging.Show))
{
#line default
#line hidden
WriteLiteral(" <td>\r\n <div");
WriteLiteral(" class=\"pageMenuArea\"");
WriteLiteral(">\r\n <h2>Hosting</h2>\r\n");
WriteLiteral(" ");
WriteLiteral(">\r\n <h2>Hosting</h2>\r\n");
#line 10 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("System", MVC.Config.SystemConfig.Index(), "config"));
#line 13 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
#line 13 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.Has(Claims.Config.System.Show))
{
#line default
#line hidden
#line 15 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("System", MVC.Config.SystemConfig.Index(), "config"));
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
WriteLiteral(">\r\n Update system configuration, such as the Data Storage Loca" +
"tion and Proxy settings.\r\n </div>\r\n");
WriteLiteral(" ");
#line 14 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Organisation Details", MVC.Config.Organisation.Index(), "config"));
#line 15 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
WriteLiteral(">\r\n Update the Organisation Name, Logo and Addresses associate" +
"d with this organisation.\r\n </div>\r\n");
WriteLiteral(" ");
WriteLiteral(">\r\n Update system configuration, such as the Data Stor" +
"age Location and Proxy settings.\r\n </div>\r\n");
#line 18 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Logging", MVC.Config.Logging.Index(), "config"));
#line 19 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" ");
#line 20 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.Has(Claims.Config.Organisation.Show))
{
#line default
#line hidden
#line 22 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Organisation Details", MVC.Config.Organisation.Index(), "config"));
#line default
#line hidden
#line 22 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
WriteLiteral(">\r\n Export Log files from various Disco Modules and view Live " +
"Logging.\r\n </div>\r\n </div>\r\n </td>\r\n <td" +
">\r\n <div");
WriteLiteral(">\r\n Update the Organisation Name, Logo and Addresses a" +
"ssociated with this organisation.\r\n </div>\r\n");
WriteLiteral(" class=\"pageMenuArea\"");
#line 26 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
WriteLiteral(">\r\n <h2>Devices</h2>\r\n");
WriteLiteral(" ");
#line default
#line hidden
WriteLiteral(" ");
#line 27 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Models", MVC.Config.DeviceModel.Index(), "config"));
if (Authorization.Has(Claims.DiscoAdminAccount))
{
#line default
#line hidden
#line 29 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Authorization Roles", MVC.Config.AuthorizationRole.Index(), "config"));
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
WriteLiteral(">\r\n Configure Components, Product Images and default settings " +
"for Device Models.\r\n </div>\r\n");
WriteLiteral(" ");
#line 31 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Batches", MVC.Config.DeviceBatch.Index(), "config"));
#line 29 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
WriteLiteral(">\r\n Create and Configure Device Batches.\r\n </di" +
"v>\r\n");
WriteLiteral(" ");
WriteLiteral(">\r\n Configure roles and permissions for users.\r\n " +
" </div>\r\n");
#line 35 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Profiles", MVC.Config.DeviceProfile.Index(), "config"));
#line 33 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" ");
#line 34 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.Has(Claims.Config.Logging.Show))
{
#line default
#line hidden
#line 36 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Logging", MVC.Config.Logging.Index(), "config"));
#line default
#line hidden
#line 36 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
WriteLiteral(">\r\n Configure Device Profiles including computer name generati" +
"on, distribution and Active\r\n Directory OU layout.\r\n " +
" </div>\r\n");
WriteLiteral(" ");
WriteLiteral(">\r\n Export Log files from various Disco Modules and vi" +
"ew Live Logging.\r\n </div>\r\n");
#line 40 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Enrolment", MVC.Config.Enrolment.Index(), "config"));
}
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" </div>\r\n </td>\r\n");
WriteLiteral(" class=\"pageMenuBlurb\"");
#line 43 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
WriteLiteral(">\r\n Configure Enrolment settings including secure credentials." +
"\r\n </div>\r\n </div>\r\n </td>\r\n <td>\r\n " +
" <div");
#line default
#line hidden
WriteLiteral(" ");
#line 44 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.HasAny(Claims.Config.DeviceModel.Show, Claims.Config.DeviceBatch.Show, Claims.Config.DeviceProfile.Show, Claims.Config.Enrolment.Show))
{
#line default
#line hidden
WriteLiteral(" <td>\r\n <div");
WriteLiteral(" class=\"pageMenuArea\"");
WriteLiteral(">\r\n <h2>Features</h2>\r\n");
WriteLiteral(" ");
WriteLiteral(">\r\n <h2>Devices</h2>\r\n");
#line 49 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Document Templates", MVC.Config.DocumentTemplate.Index(), "config"));
#line default
#line hidden
#line 49 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.Has(Claims.Config.DeviceModel.Show))
{
#line default
#line hidden
#line 51 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Models", MVC.Config.DeviceModel.Index(), "config"));
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
WriteLiteral(">\r\n Create, Update and Bulk Generate documents based on PDF Te" +
"mplates for Jobs, Devices\r\n and Users.\r\n </div" +
">\r\n");
WriteLiteral(" ");
#line 54 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Plugins", MVC.Config.Plugins.Index(), "config"));
#line 51 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
WriteLiteral(">\r\n Manage extensions to the Disco platform.\r\n " +
"</div>\r\n </div>\r\n </td>\r\n </tr>\r\n</table>\r\n");
WriteLiteral(">\r\n Configure Components, Product Images and default s" +
"ettings for Device Models.\r\n </div>\r\n");
#line 55 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 56 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.Has(Claims.Config.DeviceBatch.Show))
{
#line default
#line hidden
#line 58 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Batches", MVC.Config.DeviceBatch.Index(), "config"));
#line default
#line hidden
#line 58 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
WriteLiteral(">\r\n Create and Configure Device Batches.\r\n " +
" </div>\r\n");
#line 62 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 63 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.Has(Claims.Config.DeviceProfile.Show))
{
#line default
#line hidden
#line 65 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Profiles", MVC.Config.DeviceProfile.Index(), "config"));
#line default
#line hidden
#line 65 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
WriteLiteral(">\r\n Configure Device Profiles including computer name " +
"generation, distribution and Active\r\n Directory OU layout.\r\n " +
" </div>\r\n");
#line 70 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 71 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.Has(Claims.Config.Enrolment.Show))
{
#line default
#line hidden
#line 73 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Enrolment", MVC.Config.Enrolment.Index(), "config"));
#line default
#line hidden
#line 73 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
WriteLiteral(">\r\n Configure Enrolment settings including secure cred" +
"entials.\r\n </div>\r\n");
#line 77 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n </td>\r\n");
#line 80 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 81 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.HasAny(Claims.Config.DocumentTemplate.Show, Claims.Config.Plugin.Show))
{
#line default
#line hidden
WriteLiteral(" <td>\r\n <div");
WriteLiteral(" class=\"pageMenuArea\"");
WriteLiteral(">\r\n <h2>Features</h2>\r\n");
#line 86 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
#line 86 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.Has(Claims.Config.DocumentTemplate.Show))
{
#line default
#line hidden
#line 88 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Document Templates", MVC.Config.DocumentTemplate.Index(), "config"));
#line default
#line hidden
#line 88 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
WriteLiteral(">\r\n Create, Update and Bulk Generate documents based o" +
"n PDF Templates for Jobs, Devices\r\n and Users.\r\n " +
" </div>\r\n");
#line 93 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 94 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Authorization.Has(Claims.Config.Plugin.Show))
{
#line default
#line hidden
#line 96 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Html.ActionLinkClass("Plugins", MVC.Config.Plugins.Index(), "config"));
#line default
#line hidden
#line 96 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
WriteLiteral(">\r\n Manage extensions to the Disco platform.\r\n " +
" </div>\r\n");
#line 100 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n </td>\r\n");
#line 103 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </tr>\r\n</table>\r\n");
#line 106 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Model.UpdateAvailable)
{
@@ -229,14 +547,14 @@ WriteLiteral(" id=\"updateAvailableContainer\"");
WriteLiteral(">\r\n <div>An updated version of Disco is available</div>\r\n <a");
WriteAttribute("href", Tuple.Create(" href=\"", 3034), Tuple.Create("\"", 3070)
WriteAttribute("href", Tuple.Create(" href=\"", 5401), Tuple.Create("\"", 5437)
#line 67 "..\..\Areas\Config\Views\Config\Index.cshtml"
, Tuple.Create(Tuple.Create("", 3041), Tuple.Create<System.Object, System.Int32>(Model.UpdateResponse.UrlLink
#line 111 "..\..\Areas\Config\Views\Config\Index.cshtml"
, Tuple.Create(Tuple.Create("", 5408), Tuple.Create<System.Object, System.Int32>(Model.UpdateResponse.UrlLink
#line default
#line hidden
, 3041), false)
, 5408), false)
);
WriteLiteral(" target=\"_blank\"");
@@ -244,7 +562,7 @@ WriteLiteral(" target=\"_blank\"");
WriteLiteral(">Download Disco v");
#line 67 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 111 "..\..\Areas\Config\Views\Config\Index.cshtml"
Write(Model.UpdateResponse.Version);
@@ -261,13 +579,13 @@ WriteLiteral(@" <script>
");
#line 75 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 119 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line default
#line hidden
#line 75 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 119 "..\..\Areas\Config\Views\Config\Index.cshtml"
if (Model.UpdateResponse.VersionReleasedTimestamp < DateTime.Now.AddDays(-7))
{
@@ -283,7 +601,7 @@ WriteLiteral("\r\n updateAvailableContainer.effect(\"shake\", { t
WriteLiteral("\r\n");
#line 81 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 125 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
@@ -292,7 +610,7 @@ WriteLiteral("\r\n");
WriteLiteral("\r\n });\r\n })();\r\n </script>\r\n");
#line 86 "..\..\Areas\Config\Views\Config\Index.cshtml"
#line 130 "..\..\Areas\Config\Views\Config\Index.cshtml"
}
@@ -1,5 +1,6 @@
@model Disco.Web.Areas.Config.Models.DeviceBatch.CreateModel
@{
Authorization.Require(Claims.Config.DeviceBatch.Create);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches", MVC.Config.DeviceBatch.Index(null), "Create");
}
@using (Html.BeginForm())
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DeviceBatch
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceBatch/Create.cshtml")]
public partial class Create : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceBatch.CreateModel>
public partial class Create : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DeviceBatch.CreateModel>
{
public Create()
{
@@ -43,6 +45,7 @@ namespace Disco.Web.Areas.Config.Views.DeviceBatch
#line 2 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
Authorization.Require(Claims.Config.DeviceBatch.Create);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches", MVC.Config.DeviceBatch.Index(null), "Create");
@@ -51,7 +54,7 @@ namespace Disco.Web.Areas.Config.Views.DeviceBatch
WriteLiteral("\r\n");
#line 5 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
#line 6 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
using (Html.BeginForm())
{
@@ -70,7 +73,7 @@ WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r
WriteLiteral(" ");
#line 14 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
#line 15 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.Name));
@@ -79,7 +82,7 @@ WriteLiteral(" ");
WriteLiteral("<br />");
#line 14 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
#line 15 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.DeviceBatch.Name));
@@ -90,7 +93,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
"d>");
#line 21 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
#line 22 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
Write(Html.EditorFor(model => model.DeviceBatch.PurchaseDate));
@@ -99,7 +102,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral("<br />");
#line 21 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
#line 22 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.DeviceBatch.PurchaseDate));
@@ -136,7 +139,7 @@ WriteLiteral(@">
");
#line 39 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
#line 40 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
}
@@ -1,69 +1,78 @@
@model Disco.Web.Areas.Config.Models.DeviceBatch.IndexModel
@{
Authorization.Require(Claims.Config.DeviceBatch.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches");
}
<table class="tableData">
<tr>
<th>
Name
</th>
<th>
Default Model
</th>
<th>
Purchase Date
</th>
<th>
Warranty Expires
</th>
<th>
Insurance Expires
</th>
<th>
Device Count
</th>
</tr>
@foreach (var item in Model.DeviceBatches)
{
@if (Model.DeviceBatches.Count == 0)
{
<div class="form" style="width: 450px; padding: 100px 0;">
<h2>No device batches are configured</h2>
</div>
}
else
{
<table class="tableData">
<tr>
<td>
@Html.ActionLink(item.Name, MVC.Config.DeviceBatch.Index(item.Id))
</td>
<td>
@item.DefaultDeviceModel
</td>
<td>
@CommonHelpers.FriendlyDate(item.PurchaseDate)
</td>
<td>
@CommonHelpers.FriendlyDate(item.WarrantyExpires, "Unknown")
</td>
<td>
@CommonHelpers.FriendlyDate(item.InsuredUntil, item.InsuranceSupplier == null ? "N/A" : "Unknown")
@(item.InsuranceSupplier == null ? string.Empty : string.Format("[{0}]", item.InsuranceSupplier))
</td>
<td>
@if (item.PurchaseUnitQuantity.HasValue)
{
<span>@item.DeviceCount.ToString("n0")/@(item.PurchaseUnitQuantity.Value.ToString("n0"))</span>
}
else
{
@item.DeviceCount.ToString("n0")
}
@if (item.DeviceDecommissionedCount > 0)
{
<span class="smallMessage" title="@(item.DeviceDecommissionedCount.ToString("n0")) Decommissioned">
(@(item.DeviceDecommissionedCount.ToString("n0")))</span>
}
</td>
<th>Name
</th>
<th>Default Model
</th>
<th>Purchase Date
</th>
<th>Warranty Expires
</th>
<th>Insurance Expires
</th>
<th>Device Count
</th>
</tr>
}
</table>
<div class="actionBar">
@if (Model.DeviceBatches.Count > 0)
{
@Html.ActionLinkButton("Timeline", MVC.Config.DeviceBatch.Timeline())
}
@Html.ActionLinkButton("Create Device Batch", MVC.Config.DeviceBatch.Create())
</div>
@foreach (var item in Model.DeviceBatches)
{
<tr>
<td>
@Html.ActionLink(item.Name, MVC.Config.DeviceBatch.Index(item.Id))
</td>
<td>
@item.DefaultDeviceModel
</td>
<td>
@CommonHelpers.FriendlyDate(item.PurchaseDate)
</td>
<td>
@CommonHelpers.FriendlyDate(item.WarrantyExpires, "Unknown")
</td>
<td>
@CommonHelpers.FriendlyDate(item.InsuredUntil, item.InsuranceSupplier == null ? "N/A" : "Unknown")
@(item.InsuranceSupplier == null ? string.Empty : string.Format("[{0}]", item.InsuranceSupplier))
</td>
<td>
@if (item.PurchaseUnitQuantity.HasValue)
{
<span>@item.DeviceCount.ToString("n0")/@(item.PurchaseUnitQuantity.Value.ToString("n0"))</span>
}
else
{
@item.DeviceCount.ToString("n0")
}
@if (item.DeviceDecommissionedCount > 0)
{
<span class="smallMessage" title="@(item.DeviceDecommissionedCount.ToString("n0")) Decommissioned">(@(item.DeviceDecommissionedCount.ToString("n0")))</span>
}
</td>
</tr>
}
</table>
}
@if (Authorization.HasAny(Claims.Config.DeviceBatch.Create, Claims.Config.DeviceBatch.ShowTimeline))
{
<div class="actionBar">
@if (Authorization.Has(Claims.Config.DeviceBatch.ShowTimeline) && Model.DeviceBatches.Count > 0)
{
@Html.ActionLinkButton("Timeline", MVC.Config.DeviceBatch.Timeline())
}
@if (Authorization.HasAll(Claims.Config.DeviceBatch.Create, Claims.Config.DeviceBatch.Configure))
{
@Html.ActionLinkButton("Create Device Batch", MVC.Config.DeviceBatch.Create())
}
</div>
}
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DeviceBatch
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceBatch/Index.cshtml")]
public partial class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceBatch.IndexModel>
public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DeviceBatch.IndexModel>
{
public Index()
{
@@ -43,139 +45,161 @@ namespace Disco.Web.Areas.Config.Views.DeviceBatch
#line 2 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Authorization.Require(Claims.Config.DeviceBatch.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches");
#line default
#line hidden
WriteLiteral("\r\n<table");
WriteLiteral(" class=\"tableData\"");
WriteLiteral(@">
<tr>
<th>
Name
</th>
<th>
Default Model
</th>
<th>
Purchase Date
</th>
<th>
Warranty Expires
</th>
<th>
Insurance Expires
</th>
<th>
Device Count
</th>
</tr>
");
#line 26 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
#line default
#line hidden
#line 26 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
foreach (var item in Model.DeviceBatches)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td>\r\n");
WriteLiteral(" ");
#line 30 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(Html.ActionLink(item.Name, MVC.Config.DeviceBatch.Index(item.Id)));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 33 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(item.DefaultDeviceModel);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 36 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(CommonHelpers.FriendlyDate(item.PurchaseDate));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 39 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(CommonHelpers.FriendlyDate(item.WarrantyExpires, "Unknown"));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 42 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(CommonHelpers.FriendlyDate(item.InsuredUntil, item.InsuranceSupplier == null ? "N/A" : "Unknown"));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 43 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(item.InsuranceSupplier == null ? string.Empty : string.Format("[{0}]", item.InsuranceSupplier));
#line 6 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
if (Model.DeviceBatches.Count == 0)
{
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" <div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 450px; padding: 100px 0;\"");
WriteLiteral(">\r\n <h2>No device batches are configured</h2>\r\n </div> \r\n");
#line 11 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <table");
WriteLiteral(" class=\"tableData\"");
WriteLiteral(@">
<tr>
<th>Name
</th>
<th>Default Model
</th>
<th>Purchase Date
</th>
<th>Warranty Expires
</th>
<th>Insurance Expires
</th>
<th>Device Count
</th>
</tr>
");
#line 29 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
#line default
#line hidden
#line 29 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
foreach (var item in Model.DeviceBatches)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td>\r\n");
WriteLiteral(" ");
#line 33 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(Html.ActionLink(item.Name, MVC.Config.DeviceBatch.Index(item.Id)));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 36 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(item.DefaultDeviceModel);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 39 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(CommonHelpers.FriendlyDate(item.PurchaseDate));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 42 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(CommonHelpers.FriendlyDate(item.WarrantyExpires, "Unknown"));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 45 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(CommonHelpers.FriendlyDate(item.InsuredUntil, item.InsuranceSupplier == null ? "N/A" : "Unknown"));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 46 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
#line default
#line hidden
#line 46 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
if (item.PurchaseUnitQuantity.HasValue)
{
Write(item.InsuranceSupplier == null ? string.Empty : string.Format("[{0}]", item.InsuranceSupplier));
#line default
#line hidden
WriteLiteral(" <span>");
WriteLiteral("\r\n </td>\r\n <td>\r\n");
#line 48 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(item.DeviceCount.ToString("n0"));
#line 49 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
#line default
#line hidden
#line 49 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
if (item.PurchaseUnitQuantity.HasValue)
{
#line default
#line hidden
WriteLiteral(" <span>");
#line 51 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(item.DeviceCount.ToString("n0"));
#line default
@@ -183,8 +207,8 @@ WriteLiteral(" <span>");
WriteLiteral("/");
#line 48 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(item.PurchaseUnitQuantity.Value.ToString("n0"));
#line 51 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(item.PurchaseUnitQuantity.Value.ToString("n0"));
#line default
@@ -192,59 +216,59 @@ WriteLiteral("/");
WriteLiteral("</span>\r\n");
#line 49 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
}
else
{
#line default
#line hidden
#line 52 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(item.DeviceCount.ToString("n0"));
}
else
{
#line default
#line hidden
#line 55 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(item.DeviceCount.ToString("n0"));
#line default
#line hidden
#line 52 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
}
#line 55 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 54 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
if (item.DeviceDecommissionedCount > 0)
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1775), Tuple.Create("\"", 1846)
#line 56 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
, Tuple.Create(Tuple.Create("", 1783), Tuple.Create<System.Object, System.Int32>(item.DeviceDecommissionedCount.ToString("n0")
#line default
#line hidden
, 1783), false)
, Tuple.Create(Tuple.Create(" ", 1831), Tuple.Create("Decommissioned", 1832), true)
);
WriteLiteral(">\r\n (");
WriteLiteral(" ");
#line 57 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(item.DeviceDecommissionedCount.ToString("n0"));
if (item.DeviceDecommissionedCount > 0)
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteAttribute("title", Tuple.Create(" title=\"", 2117), Tuple.Create("\"", 2188)
#line 59 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
, Tuple.Create(Tuple.Create("", 2125), Tuple.Create<System.Object, System.Int32>(item.DeviceDecommissionedCount.ToString("n0")
#line default
#line hidden
, 2125), false)
, Tuple.Create(Tuple.Create(" ", 2173), Tuple.Create("Decommissioned", 2174), true)
);
WriteLiteral(">(");
#line 59 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(item.DeviceDecommissionedCount.ToString("n0"));
#line default
@@ -252,67 +276,106 @@ WriteLiteral(">\r\n (");
WriteLiteral(")</span>\r\n");
#line 58 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
}
#line 60 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 61 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
}
#line 63 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("</table>\r\n<div");
WriteLiteral(" </table>\r\n");
#line 65 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
}
#line default
#line hidden
#line 66 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
if (Authorization.HasAny(Claims.Config.DeviceBatch.Create, Claims.Config.DeviceBatch.ShowTimeline))
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
#line 64 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
#line default
#line hidden
#line 64 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
if (Model.DeviceBatches.Count > 0)
{
#line 69 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
#line default
#line hidden
#line 66 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(Html.ActionLinkButton("Timeline", MVC.Config.DeviceBatch.Timeline()));
#line 69 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
if (Authorization.Has(Claims.Config.DeviceBatch.ShowTimeline) && Model.DeviceBatches.Count > 0)
{
#line default
#line hidden
#line 71 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(Html.ActionLinkButton("Timeline", MVC.Config.DeviceBatch.Timeline()));
#line default
#line hidden
#line 66 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
}
#line 71 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
WriteLiteral(" ");
#line 68 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(Html.ActionLinkButton("Create Device Batch", MVC.Config.DeviceBatch.Create()));
#line 73 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
if (Authorization.HasAll(Claims.Config.DeviceBatch.Create, Claims.Config.DeviceBatch.Configure))
{
#line default
#line hidden
#line 75 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
Write(Html.ActionLinkButton("Create Device Batch", MVC.Config.DeviceBatch.Create()));
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n");
#line 75 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
#line 78 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
}
#line default
#line hidden
}
}
}
@@ -1,9 +1,18 @@
@model Disco.Web.Areas.Config.Models.DeviceBatch.ShowModel
@{
Authorization.Require(Claims.Config.DeviceBatch.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches", MVC.Config.DeviceBatch.Index(null), Model.DeviceBatch.ToString());
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
Html.BundleDeferred("~/ClientScripts/Modules/tinymce");
var canConfig = Authorization.Has(Claims.Config.DeviceBatch.Configure);
var canDeviceModelShow = Authorization.Has(Claims.Config.DeviceModel.Show);
if (canConfig)
{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
Html.BundleDeferred("~/ClientScripts/Modules/tinymce");
}
}
<div class="form deviceBatches" style="width: 730px">
<table>
@@ -17,26 +26,35 @@
<tr>
<th>Name:
</th>
<td>@Html.EditorFor(model => model.DeviceBatch.Name)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#DeviceBatch_Name'),
'Invalid Name',
'@(Url.Action(MVC.API.DeviceBatch.UpdateName(Model.DeviceBatch.Id)))',
<td>
@if (canConfig)
{
@Html.EditorFor(model => model.DeviceBatch.Name)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#DeviceBatch_Name'),
'Invalid Name',
'@(Url.Action(MVC.API.DeviceBatch.UpdateName(Model.DeviceBatch.Id)))',
'BatchName'
);
});
</script>
});
</script>
}
else
{
@Model.DeviceBatch.Name
}
</td>
</tr>
<tr>
<th>Default Device Model:
</th>
<td>
@Html.DropDownListFor(model => model.DeviceBatch.DefaultDeviceModelId, Model.DeviceModels.ToSelectListItems())
<td>@if (canConfig)
{
@Html.DropDownListFor(model => model.DeviceBatch.DefaultDeviceModelId, Model.DeviceModels.ToSelectListItems(null, true))
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
@@ -49,6 +67,15 @@
);
});
</script>
}
else
{
if (Model.DefaultDeviceModel == null)
{<span class="smallMessage">&lt;None Specified&gt;</span>}
else
{@Model.DefaultDeviceModel.ToString();
}
}
<br />
<span class="smallMessage">Devices added offline will default to this Device Model.
Once a device enrols the Device Model will be accurately represented.</span>
@@ -72,7 +99,14 @@
{
<tr>
<td>
@Html.ActionLink(membership.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(membership.DeviceModel.Id))
@if (canDeviceModelShow)
{
@Html.ActionLink(membership.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(membership.DeviceModel.Id))
}
else
{
@membership.DeviceModel.ToString()
}
</td>
<td>
@membership.DeviceCount.ToString("n0")
@@ -115,27 +149,35 @@
<th class="name" style="width: 100px">Purchase Date:
</th>
<td>
@Html.EditorFor(model => model.DeviceBatch.PurchaseDate)
@AjaxHelpers.AjaxLoader()
<script>
$(function () {
var dateField = $('#DeviceBatch_PurchaseDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Invalid Date',
'@(Url.Action(MVC.API.DeviceBatch.UpdatePurchaseDate(Model.DeviceBatch.Id)))',
@if (canConfig)
{
@Html.EditorFor(model => model.DeviceBatch.PurchaseDate)
@AjaxHelpers.AjaxLoader()
<script>
$(function () {
var dateField = $('#DeviceBatch_PurchaseDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Invalid Date',
'@(Url.Action(MVC.API.DeviceBatch.UpdatePurchaseDate(Model.DeviceBatch.Id)))',
'PurchaseDate',
null,
true
);
});
</script>
});
</script>
}
else
{
@CommonHelpers.FriendlyDate(Model.DeviceBatch.PurchaseDate)
}
</td>
</tr>
<tr>
<th>Supplier:
</th>
<td>
<td>@if (canConfig)
{
@Html.EditorFor(model => model.DeviceBatch.Supplier)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
@@ -149,12 +191,21 @@
);
});
</script>
}
else
{
if (string.IsNullOrEmpty(Model.DeviceBatch.Supplier))
{<span class="smallMessage">&lt;None Specified&gt;</span>}
else
{@Model.DeviceBatch.Supplier}
}
</td>
</tr>
<tr>
<th>Unit Cost:
</th>
<td>
<td>@if (canConfig)
{
@Html.EditorFor(model => model.DeviceBatch.UnitCost)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
@@ -168,12 +219,21 @@
);
});
</script>
}
else
{
if (!Model.DeviceBatch.UnitCost.HasValue)
{<span class="smallMessage">&lt;None Specified&gt;</span>}
else
{@Model.DeviceBatch.UnitCost.Value.ToString("C")}
}
</td>
</tr>
<tr>
<th>Quantity:
</th>
<td>
<td>@if (canConfig)
{
@Html.EditorFor(model => model.DeviceBatch.UnitQuantity)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
@@ -187,6 +247,14 @@
);
});
</script>
}
else
{
if (!Model.DeviceBatch.UnitQuantity.HasValue)
{<span class="smallMessage">&lt;None Specified&gt;</span>}
else
{@Model.DeviceBatch.UnitQuantity.Value.ToString("n0")}
}
</td>
</tr>
</table>
@@ -194,55 +262,65 @@
<div>
Details @AjaxHelpers.AjaxLoader("ajaxPurchaseDetails")
</div>
@Html.EditorFor(model => model.DeviceBatch.PurchaseDetails)
<script type="text/javascript">
$(function () {
var model = {
$field: $('#DeviceBatch_PurchaseDetails'),
fieldName: 'PurchaseDetails',
$ajax_loading: null,
$ajax_ok: null,
updated: function () {
if (!model.$ajax_loading)
model.$ajax_loading = $('#ajax' + model.fieldName + '_loading');
if (!model.$ajax_ok)
model.$ajax_ok = $('#ajax' + model.fieldName + '_ok');
model.$ajax_loading.show();
var data = {};
data[model.fieldName] = model.$field.tinymce().getContent();
$.ajax({
url: '@(Url.Action(MVC.API.DeviceBatch.UpdatePurchaseDetails(Model.DeviceBatch.Id)))',
dataType: 'json',
data: data,
traditional: true,
type: 'POST',
success: function (d) {
if (d == 'OK') {
@if (canConfig)
{
@Html.EditorFor(model => model.DeviceBatch.PurchaseDetails)
<script type="text/javascript">
$(function () {
var model = {
$field: $('#DeviceBatch_PurchaseDetails'),
fieldName: 'PurchaseDetails',
$ajax_loading: null,
$ajax_ok: null,
updated: function () {
if (!model.$ajax_loading)
model.$ajax_loading = $('#ajax' + model.fieldName + '_loading');
if (!model.$ajax_ok)
model.$ajax_ok = $('#ajax' + model.fieldName + '_ok');
model.$ajax_loading.show();
var data = {};
data[model.fieldName] = model.$field.tinymce().getContent();
$.ajax({
url: '@(Url.Action(MVC.API.DeviceBatch.UpdatePurchaseDetails(Model.DeviceBatch.Id)))',
dataType: 'json',
data: data,
traditional: true,
type: 'POST',
success: function (d) {
if (d == 'OK') {
model.$ajax_loading.hide();
model.$ajax_ok.show().delay('fast').fadeOut('slow');
} else {
model.$ajax_loading.hide();
alert('Unable to update purchase details: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update purchase details: ' + errorThrown);
model.$ajax_loading.hide();
model.$ajax_ok.show().delay('fast').fadeOut('slow');
} else {
model.$ajax_loading.hide();
alert('Unable to update purchase details: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update purchase details: ' + errorThrown);
model.$ajax_loading.hide();
}
})
}
};
})
}
};
model.$field.tinymce({
theme: 'simple',
setup: function (ed) {
ed.onInit.add(function (ed) {
$(ed.getWin()).blur(model.updated);
});
}
model.$field.tinymce({
theme: 'simple',
setup: function (ed) {
ed.onInit.add(function (ed) {
$(ed.getWin()).blur(model.updated);
});
}
});
});
});
</script>
</script>
}
else
{
if (string.IsNullOrEmpty(Model.DeviceBatch.PurchaseDetails))
{<span class="smallMessage">&lt;None Specified&gt;</span>}
else
{@(new HtmlString(Model.DeviceBatch.PurchaseDetails))}
}
</div>
</td>
</tr>
@@ -255,21 +333,28 @@
<th class="name" style="width: 100px">Valid Until:
</th>
<td>
@Html.EditorFor(model => model.DeviceBatch.WarrantyValidUntil)
@AjaxHelpers.AjaxLoader()
<script>
$(function () {
var dateField = $('#DeviceBatch_WarrantyValidUntil');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Warranty Valid Until',
'@(Url.Action(MVC.API.DeviceBatch.UpdateWarrantyValidUntil(Model.DeviceBatch.Id)))',
@if (canConfig)
{
@Html.EditorFor(model => model.DeviceBatch.WarrantyValidUntil)
@AjaxHelpers.AjaxLoader()
<script>
$(function () {
var dateField = $('#DeviceBatch_WarrantyValidUntil');
document.DiscoFunctions.DateChangeHelper(
dateField,
'Warranty Valid Until',
'@(Url.Action(MVC.API.DeviceBatch.UpdateWarrantyValidUntil(Model.DeviceBatch.Id)))',
'WarrantyValidUntil',
null,
true
);
});
</script>
});
</script>
}
else
{
@CommonHelpers.FriendlyDate(Model.DeviceBatch.WarrantyValidUntil, "Unknown")
}
</td>
</tr>
</table>
@@ -277,55 +362,65 @@
<div>
Details @AjaxHelpers.AjaxLoader("ajaxWarrantyDetails")
</div>
@Html.EditorFor(model => model.DeviceBatch.WarrantyDetails)
<script type="text/javascript">
$(function () {
var model = {
$field: $('#DeviceBatch_WarrantyDetails'),
fieldName: 'WarrantyDetails',
$ajax_loading: null,
$ajax_ok: null,
updated: function () {
if (!model.$ajax_loading)
model.$ajax_loading = $('#ajax' + model.fieldName + '_loading');
if (!model.$ajax_ok)
model.$ajax_ok = $('#ajax' + model.fieldName + '_ok');
model.$ajax_loading.show();
var data = {};
data[model.fieldName] = model.$field.tinymce().getContent();
$.ajax({
url: '@(Url.Action(MVC.API.DeviceBatch.UpdateWarrantyDetails(Model.DeviceBatch.Id)))',
dataType: 'json',
data: data,
traditional: true,
type: 'POST',
success: function (d) {
if (d == 'OK') {
@if (canConfig)
{
@Html.EditorFor(model => model.DeviceBatch.WarrantyDetails)
<script type="text/javascript">
$(function () {
var model = {
$field: $('#DeviceBatch_WarrantyDetails'),
fieldName: 'WarrantyDetails',
$ajax_loading: null,
$ajax_ok: null,
updated: function () {
if (!model.$ajax_loading)
model.$ajax_loading = $('#ajax' + model.fieldName + '_loading');
if (!model.$ajax_ok)
model.$ajax_ok = $('#ajax' + model.fieldName + '_ok');
model.$ajax_loading.show();
var data = {};
data[model.fieldName] = model.$field.tinymce().getContent();
$.ajax({
url: '@(Url.Action(MVC.API.DeviceBatch.UpdateWarrantyDetails(Model.DeviceBatch.Id)))',
dataType: 'json',
data: data,
traditional: true,
type: 'POST',
success: function (d) {
if (d == 'OK') {
model.$ajax_loading.hide();
model.$ajax_ok.show().delay('fast').fadeOut('slow');
} else {
model.$ajax_loading.hide();
alert('Unable to update warranty details: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update warranty details: ' + errorThrown);
model.$ajax_loading.hide();
model.$ajax_ok.show().delay('fast').fadeOut('slow');
} else {
model.$ajax_loading.hide();
alert('Unable to update warranty details: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update warranty details: ' + errorThrown);
model.$ajax_loading.hide();
}
})
}
};
})
}
};
model.$field.tinymce({
theme: 'simple',
setup: function (ed) {
ed.onInit.add(function (ed) {
$(ed.getWin()).blur(model.updated);
});
}
model.$field.tinymce({
theme: 'simple',
setup: function (ed) {
ed.onInit.add(function (ed) {
$(ed.getWin()).blur(model.updated);
});
}
});
});
});
</script>
</script>
}
else
{
if (string.IsNullOrEmpty(Model.DeviceBatch.WarrantyDetails))
{<span class="smallMessage">&lt;None Specified&gt;</span>}
else
{@(new HtmlString(Model.DeviceBatch.WarrantyDetails))}
}
</div>
</td>
</tr>
@@ -337,7 +432,8 @@
<tr>
<th class="name" style="width: 100px">Supplier:
</th>
<td>
<td>@if (canConfig)
{
@Html.EditorFor(model => model.DeviceBatch.InsuranceSupplier)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
@@ -351,12 +447,22 @@
);
});
</script>
}
else
{
if (string.IsNullOrEmpty(Model.DeviceBatch.InsuranceSupplier))
{<span class="smallMessage">&lt;None Specified&gt;</span>}
else
{@Model.DeviceBatch.InsuranceSupplier;
}
}
</td>
</tr>
<tr>
<th class="name">Insured Date:
</th>
<td>
<td>@if (canConfig)
{
@Html.EditorFor(model => model.DeviceBatch.InsuredDate)
@AjaxHelpers.AjaxLoader()
<script>
@@ -372,12 +478,18 @@
);
});
</script>
}
else
{
@CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredDate, "Unknown")
}
</td>
</tr>
<tr>
<th class="name">Insured Until:
</th>
<td>
<td>@if (canConfig)
{
@Html.EditorFor(model => model.DeviceBatch.InsuredUntil)
@AjaxHelpers.AjaxLoader()
<script>
@@ -393,6 +505,11 @@
);
});
</script>
}
else
{
@CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredUntil, "Unknown")
}
</td>
</tr>
</table>
@@ -400,54 +517,64 @@
<div>
Details @AjaxHelpers.AjaxLoader("ajaxInsuranceDetails")
</div>
@Html.EditorFor(model => model.DeviceBatch.InsuranceDetails)
<script type="text/javascript">
$(function () {
var model = {
$DeviceBatch_Comments: $('#DeviceBatch_InsuranceDetails'),
$ajax_loading: null,
$ajax_ok: null,
updated: function () {
if (!model.$ajax_loading)
model.$ajax_loading = $('#ajaxInsuranceDetails_loading');
if (!model.$ajax_ok)
model.$ajax_ok = $('#ajaxInsuranceDetails_ok');
model.$ajax_loading.show();
var data = { InsuranceDetails: model.$DeviceBatch_Comments.tinymce().getContent() };
$.ajax({
url: '@(Url.Action(MVC.API.DeviceBatch.UpdateInsuranceDetails(Model.DeviceBatch.Id)))',
dataType: 'json',
data: data,
traditional: true,
type: 'POST',
success: function (d) {
if (d == 'OK') {
@if (canConfig)
{
@Html.EditorFor(model => model.DeviceBatch.InsuranceDetails)
<script type="text/javascript">
$(function () {
var model = {
$DeviceBatch_Comments: $('#DeviceBatch_InsuranceDetails'),
$ajax_loading: null,
$ajax_ok: null,
updated: function () {
if (!model.$ajax_loading)
model.$ajax_loading = $('#ajaxInsuranceDetails_loading');
if (!model.$ajax_ok)
model.$ajax_ok = $('#ajaxInsuranceDetails_ok');
model.$ajax_loading.show();
var data = { InsuranceDetails: model.$DeviceBatch_Comments.tinymce().getContent() };
$.ajax({
url: '@(Url.Action(MVC.API.DeviceBatch.UpdateInsuranceDetails(Model.DeviceBatch.Id)))',
dataType: 'json',
data: data,
traditional: true,
type: 'POST',
success: function (d) {
if (d == 'OK') {
model.$ajax_loading.hide();
model.$ajax_ok.show().delay('fast').fadeOut('slow');
} else {
model.$ajax_loading.hide();
alert('Unable to update insurance details: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update insurance details: ' + errorThrown);
model.$ajax_loading.hide();
model.$ajax_ok.show().delay('fast').fadeOut('slow');
} else {
model.$ajax_loading.hide();
alert('Unable to update insurance details: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update insurance details: ' + errorThrown);
model.$ajax_loading.hide();
}
})
}
};
})
}
};
model.$DeviceBatch_Comments.tinymce({
theme: 'simple',
setup: function (ed) {
//ed.onChange.add(model.updatedThrottle);
ed.onInit.add(function (ed) {
$(ed.getWin()).blur(model.updated);
});
}
model.$DeviceBatch_Comments.tinymce({
theme: 'simple',
setup: function (ed) {
//ed.onChange.add(model.updatedThrottle);
ed.onInit.add(function (ed) {
$(ed.getWin()).blur(model.updated);
});
}
});
});
});
</script>
</script>
}
else
{
if (string.IsNullOrEmpty(Model.DeviceBatch.InsuranceDetails))
{<span class="smallMessage">&lt;None Specified&gt;</span>}
else
{@(new HtmlString(Model.DeviceBatch.InsuranceDetails))}
}
</div>
</td>
</tr>
@@ -455,7 +582,8 @@
<th>Comments:<br />
@AjaxHelpers.AjaxLoader("ajaxComments")
</th>
<td>
<td>@if (canConfig)
{
@Html.EditorFor(model => model.DeviceBatch.Comments)
<script type="text/javascript">
$(function () {
@@ -504,6 +632,14 @@
});
});
</script>
}
else
{
if (string.IsNullOrEmpty(Model.DeviceBatch.Comments))
{<span class="smallMessage">&lt;None Specified&gt;</span>}
else
{@(new HtmlString(Model.DeviceBatch.Comments))}
}
</td>
</tr>
</table>
@@ -514,8 +650,14 @@
@Html.ActionLinkButton("Delete", MVC.API.DeviceBatch.Delete(Model.DeviceBatch.Id, true), "buttonDelete")
}
@if (Model.DeviceCount > 0)
{
{
if (Authorization.Has(Claims.Device.Actions.Export))
{
@Html.ActionLinkButton("Export Devices", MVC.API.DeviceBatch.ExportDevices(Model.DeviceBatch.Id))
}
if (Authorization.Has(Claims.Device.Search))
{
@Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch"))
}
}
</div>
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,6 @@
@{
Authorization.Require(Claims.Config.DeviceBatch.ShowTimeline);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches", MVC.Config.DeviceBatch.Index(null), "Timeline");
Html.BundleDeferred("~/Style/Timeline");
Html.BundleDeferred("~/ClientScripts/Modules/Timeline");
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DeviceBatch
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceBatch/Timeline.cshtml")]
public partial class Timeline : System.Web.Mvc.WebViewPage<dynamic>
public partial class Timeline : Disco.Services.Web.WebViewPage<dynamic>
{
public Timeline()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Areas.Config.Views.DeviceBatch
#line 1 "..\..\Areas\Config\Views\DeviceBatch\Timeline.cshtml"
Authorization.Require(Claims.Config.DeviceBatch.ShowTimeline);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches", MVC.Config.DeviceBatch.Index(null), "Timeline");
Html.BundleDeferred("~/Style/Timeline");
Html.BundleDeferred("~/ClientScripts/Modules/Timeline");
@@ -63,7 +67,7 @@ WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n (function () {\r\n var dataUrl = \'");
#line 10 "..\..\Areas\Config\Views\DeviceBatch\Timeline.cshtml"
#line 12 "..\..\Areas\Config\Views\DeviceBatch\Timeline.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.Timeline()));
@@ -1,5 +1,7 @@
@model Disco.Web.Areas.Config.Models.DeviceModel.ComponentsModel
@{
Authorization.Require(Claims.Config.DeviceModel.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models", MVC.Config.DeviceModel.Index(null), "Generic Components");
}
@Html.Partial(MVC.Config.DeviceModel.Views._DeviceComponentsTable, Model)
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DeviceModel
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceModel/GenericComponents.cshtml")]
public partial class GenericComponents : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.ComponentsModel>
public partial class GenericComponents : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.ComponentsModel>
{
public GenericComponents()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Areas.Config.Views.DeviceModel
#line 2 "..\..\Areas\Config\Views\DeviceModel\GenericComponents.cshtml"
Authorization.Require(Claims.Config.DeviceModel.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models", MVC.Config.DeviceModel.Index(null), "Generic Components");
@@ -51,7 +55,7 @@ namespace Disco.Web.Areas.Config.Views.DeviceModel
WriteLiteral("\r\n");
#line 5 "..\..\Areas\Config\Views\DeviceModel\GenericComponents.cshtml"
#line 7 "..\..\Areas\Config\Views\DeviceModel\GenericComponents.cshtml"
Write(Html.Partial(MVC.Config.DeviceModel.Views._DeviceComponentsTable, Model));
@@ -1,5 +1,7 @@
@model Disco.Web.Areas.Config.Models.DeviceModel.IndexModel
@{
Authorization.Require(Claims.Config.DeviceModel.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models");
}
<table class="tableData">
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DeviceModel
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceModel/Index.cshtml")]
public partial class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.IndexModel>
public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.IndexModel>
{
public Index()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Areas.Config.Views.DeviceModel
#line 2 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
Authorization.Require(Claims.Config.DeviceModel.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models");
@@ -73,13 +77,13 @@ WriteLiteral(@">
");
#line 23 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line 25 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line default
#line hidden
#line 23 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line 25 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
foreach (var item in Model.DeviceModels)
{
@@ -91,7 +95,7 @@ WriteLiteral(" <tr>\r\n <td>\r\n");
WriteLiteral(" ");
#line 27 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line 29 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
Write(Html.ActionLink(item.ToString(), MVC.Config.DeviceModel.Index(item.Id)));
@@ -102,7 +106,7 @@ WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 30 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line 32 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
Write(Html.DisplayFor(modelItem => item.Manufacturer));
@@ -113,7 +117,7 @@ WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 33 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line 35 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
Write(Html.DisplayFor(modelItem => item.Model));
@@ -124,7 +128,7 @@ WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 36 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line 38 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
Write(Html.DisplayFor(modelItem => item.ModelType));
@@ -135,7 +139,7 @@ WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 39 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line 41 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
Write(item.DeviceCount.ToString("n0"));
@@ -144,13 +148,13 @@ WriteLiteral(" ");
WriteLiteral("\r\n");
#line 40 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line 42 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line default
#line hidden
#line 40 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line 42 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
if (item.DeviceDecommissionedCount > 0)
{
@@ -161,21 +165,21 @@ WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1167), Tuple.Create("\"", 1223)
WriteAttribute("title", Tuple.Create(" title=\"", 1233), Tuple.Create("\"", 1289)
#line 42 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
, Tuple.Create(Tuple.Create("", 1175), Tuple.Create<System.Object, System.Int32>(item.DeviceDecommissionedCount
#line 44 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
, Tuple.Create(Tuple.Create("", 1241), Tuple.Create<System.Object, System.Int32>(item.DeviceDecommissionedCount
#line default
#line hidden
, 1175), false)
, Tuple.Create(Tuple.Create(" ", 1208), Tuple.Create("Decommissioned", 1209), true)
, 1241), false)
, Tuple.Create(Tuple.Create(" ", 1274), Tuple.Create("Decommissioned", 1275), true)
);
WriteLiteral(">\r\n (");
#line 43 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line 45 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
Write(item.DeviceDecommissionedCount.ToString("n0"));
@@ -184,7 +188,7 @@ WriteLiteral(">\r\n (");
WriteLiteral(")</span>\r\n");
#line 44 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line 46 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
}
@@ -193,7 +197,7 @@ WriteLiteral(")</span>\r\n");
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 47 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line 49 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
}
@@ -208,7 +212,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 50 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
#line 52 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
Write(Html.ActionLinkButton("Generic Components", MVC.Config.DeviceModel.GenericComponents()));
@@ -1,37 +1,44 @@
@model Disco.Web.Areas.Config.Models.DeviceModel.ShowModel
@{
Authorization.Require(Claims.Config.DeviceModel.Show);
var canConfig = Authorization.Has(Claims.Config.DeviceModel.Configure);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models", MVC.Config.DeviceModel.Index(null), Model.DeviceModel.ToString());
}
<div class="form" style="width: 530px">
<table>
<tr>
<th style="width: 150px">
Id:
<th style="width: 150px">Id:
</th>
<td>
@Html.DisplayFor(model => model.DeviceModel.Id)
</td>
</tr>
<tr>
<th>
Description:
<th>Description:
</th>
<td>@Html.EditorFor(model => model.DeviceModel.Description)
<td>@if (canConfig)
{
@Html.EditorFor(model => model.DeviceModel.Description)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
}
else
{
@Html.DisplayFor(model => model.DeviceModel.Description)
}
</td>
</tr>
<tr>
<th>
Manufacturer:
<th>Manufacturer:
</th>
<td>
@Html.DisplayFor(model => model.DeviceModel.Manufacturer)
</td>
</tr>
<tr>
<th>
Model:
<th>Model:
</th>
<td>
@Html.DisplayFor(model => model.DeviceModel.Model)
@@ -48,169 +55,206 @@
</td>
</tr>
<tr>
<th>
Default Purchase Date:
<th>Default Purchase Date:
</th>
<td>
<td>@if (canConfig)
{
@Html.EditorFor(model => model.DeviceModel.DefaultPurchaseDate)
@AjaxHelpers.AjaxLoader()
}
else
{
@CommonHelpers.FriendlyDate(Model.DeviceModel.DefaultPurchaseDate, "Unknown")
}
</td>
</tr>
<tr>
<th>
Default Warranty Provider:
<th>Default Warranty Provider:
</th>
<td>
<td>@if (canConfig)
{
@Html.DropDownListFor(model => model.DeviceModel.DefaultWarrantyProvider, Model.WarrantyProviders.ToSelectListItems(Model.DeviceModel.DefaultWarrantyProvider, true, "None"))
@AjaxHelpers.AjaxLoader()
}
else
{
if (Model.DeviceModel.DefaultWarrantyProvider == null)
{
<span class="smallMessage">&lt;None Specified&gt;</span>
}
else
{
var provider = Model.WarrantyProviders.FirstOrDefault(wp => wp.Id == Model.DeviceModel.DefaultWarrantyProvider);
if (provider == null)
{
<span class="smallMessage">&lt;None Specified&gt;</span>
}
else
{
@provider.Name
}
}
}
</td>
</tr>
<tr>
<th>
Type:
<th>Type:
</th>
<td>
@Html.DisplayFor(model => model.DeviceModel.ModelType)
</td>
</tr>
<tr>
<th>
Image:
<th>Image:
</th>
<td>
<img alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, Model.DeviceModel.ImageHash()))" />
</td>
</tr>
<tr>
<th>
<label for="DeviceModel_Image">
Update Image:
</label>
</th>
<td>
@using (Html.BeginForm(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<input type="file" name="Image" id="Image" style="width: 250px;" />
<input class="button" type="submit" value="Update" />
}
</td>
</tr>
@if (canConfig)
{
<tr>
<th>
<label for="DeviceModel_Image">
Update Image:
</label>
</th>
<td>
@using (Html.BeginForm(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<input type="file" name="Image" id="Image" style="width: 250px;" />
<input class="button" type="submit" value="Update" />
}
</td>
</tr>
}
</table>
<script type="text/javascript">
$(function () {
var $Description = $('#DeviceModel_Description');
var $DescriptionAjaxSave = $Description.next('.ajaxSave');
$Description
.watermark('Model Description')
.focus(function () { $Description.select() })
.keydown(function (e) {
$DescriptionAjaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$DescriptionAjaxSave.hide();
@if (canConfig)
{
<script type="text/javascript">
$(function () {
var $Description = $('#DeviceModel_Description');
var $DescriptionAjaxSave = $Description.next('.ajaxSave');
$Description
.watermark('Model Description')
.focus(function () { $Description.select() })
.keydown(function (e) {
$DescriptionAjaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$DescriptionAjaxSave.hide();
})
.change(function () {
$DescriptionAjaxSave.hide();
var $ajaxLoading = $DescriptionAjaxSave.next('.ajaxLoading').show();
var data = { Description: $Description.val() };
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.UpdateDescription(Model.DeviceModel.Id))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to update description: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update description: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
</script>
<script type="text/javascript">
$(function () {
var $dataField = $('#DeviceModel_DefaultPurchaseDate');
var $ajaxLoading = $dataField.next('.ajaxLoading');
var dateFieldValue = $dataField.val();
var dateFieldChangeToken = null;
$dataField
.watermark('None')
.datepicker({
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd'
})
.change(function () {
$DescriptionAjaxSave.hide();
var $ajaxLoading = $DescriptionAjaxSave.next('.ajaxLoading').show();
var data = { Description: $Description.val() };
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.UpdateDescription(Model.DeviceModel.Id))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to update description: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update description: ' + textStatus);
$ajaxLoading.hide();
}
});
var dateText = $dataField.val();
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()) {
dateFieldValue = dateText;
if (dateFieldChangeToken)
window.clearTimeout(dateFieldChangeToken);
dateFieldChangeToken = window.setTimeout(function () {
$ajaxLoading.show();
var data = {};
data['DefaultPurchaseDate'] = dateFieldValue;
$.getJSON('@(Url.Action(MVC.API.DeviceModel.UpdateDefaultPurchaseDate(Model.DeviceModel.Id)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Date:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
dateFieldChangeToken = null;
}, 500);
}
}).focus(function () {
$(this).select();
});
});
</script>
<script type="text/javascript">
$(function () {
var $dataField = $('#DeviceModel_DefaultPurchaseDate');
var $ajaxLoading = $dataField.next('.ajaxLoading');
var dateFieldValue = $dataField.val();
var dateFieldChangeToken = null;
$dataField
.watermark('None')
.datepicker({
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd'
})
.change(function () {
var dateText = $dataField.val();
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()) {
dateFieldValue = dateText;
if (dateFieldChangeToken)
window.clearTimeout(dateFieldChangeToken);
dateFieldChangeToken = window.setTimeout(function () {
});
</script>
<script type="text/javascript">
$(function () {
var $DefaultWarrantyProvider = $('#DeviceModel_DefaultWarrantyProvider');
var $ajaxLoading = $DefaultWarrantyProvider.next('.ajaxLoading');
$DefaultWarrantyProvider
.change(function () {
$ajaxLoading.show();
var data = {};
data['DefaultPurchaseDate'] = dateFieldValue;
$.getJSON('@(Url.Action(MVC.API.DeviceModel.UpdateDefaultPurchaseDate(Model.DeviceModel.Id)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Date:\n' + response);
var data = { DefaultWarrantyProvider: $DefaultWarrantyProvider.val() };
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.UpdateDefaultWarrantyProvider(Model.DeviceModel.Id))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to default warranty provider: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to default warranty provider: ' + textStatus);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
dateFieldChangeToken = null;
}, 500);
}
}).focus(function () {
$(this).select();
});
});
</script>
<script type="text/javascript">
$(function () {
var $DefaultWarrantyProvider = $('#DeviceModel_DefaultWarrantyProvider');
var $ajaxLoading = $DefaultWarrantyProvider.next('.ajaxLoading');
$DefaultWarrantyProvider
.change(function () {
$ajaxLoading.show();
var data = { DefaultWarrantyProvider: $DefaultWarrantyProvider.val() };
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.UpdateDefaultWarrantyProvider(Model.DeviceModel.Id))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to default warranty provider: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to default warranty provider: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
});
</script>
});
</script>
}
</div>
<h2>
Components</h2>
<h2>Components</h2>
@Html.Partial(MVC.Config.DeviceModel.Views._DeviceComponentsTable, Model.DeviceComponentsModel)
<div class="actionBar">
@if (Model.CanDelete)
@if (Model.CanDelete)
{
@Html.ActionLinkButton("Delete", MVC.API.DeviceModel.Delete(Model.DeviceModel.Id, true), "buttonDelete")
}
@Html.ActionLinkButton("Export Devices", MVC.API.DeviceModel.ExportDevices(Model.DeviceModel.Id))
@Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceModel.Id.ToString(), "DeviceModel"))
@if (Model.DeviceCount > 0)
{
if (Authorization.Has(Claims.Device.Actions.Export))
{
@Html.ActionLinkButton("Export Devices", MVC.API.DeviceModel.ExportDevices(Model.DeviceModel.Id))
}
if (Authorization.Has(Claims.Device.Search))
{
@Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceModel.Id.ToString(), "DeviceModel"))
}
}
</div>
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DeviceModel
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceModel/Show.cshtml")]
public partial class Show : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.ShowModel>
public partial class Show : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.ShowModel>
{
public Show()
{
@@ -43,6 +45,10 @@ namespace Disco.Web.Areas.Config.Views.DeviceModel
#line 2 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Authorization.Require(Claims.Config.DeviceModel.Show);
var canConfig = Authorization.Has(Claims.Config.DeviceModel.Configure);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models", MVC.Config.DeviceModel.Index(null), Model.DeviceModel.ToString());
@@ -58,68 +64,107 @@ WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 150px\"");
WriteLiteral(">\r\n Id:\r\n </th>\r\n <td>\r\n");
WriteLiteral(">Id:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 12 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 15 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DisplayFor(model => model.DeviceModel.Id));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
" Description:\r\n </th>\r\n <td>");
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>Description:\r\n " +
" </th>\r\n <td>");
#line 19 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 21 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 23 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceModel.Description));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 20 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 23 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 24 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 21 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 24 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 25 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
" Manufacturer:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 25 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
else
{
#line default
#line hidden
#line 29 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DisplayFor(model => model.DeviceModel.Manufacturer));
Write(Html.DisplayFor(model => model.DeviceModel.Description));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
" Model:\r\n </th>\r\n <td>\r\n");
#line 29 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>Manufacturer:\r\n " +
" </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 37 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DisplayFor(model => model.DeviceModel.Manufacturer));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>Model:\r\n " +
" </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 44 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DisplayFor(model => model.DeviceModel.Model));
@@ -129,7 +174,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n
"\r\n <td>\r\n <div><strong>");
#line 43 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 50 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Model.DeviceCount.ToString("n0"));
@@ -138,7 +183,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n
WriteLiteral("</strong> ");
#line 43 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 50 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Model.DeviceCount == 1 ? "devices is" : "devices are");
@@ -147,13 +192,13 @@ WriteLiteral("</strong> ");
WriteLiteral(" of this model type.</div>\r\n");
#line 44 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 51 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 44 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 51 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (Model.DeviceDecommissionedCount > 0)
{
@@ -167,7 +212,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">");
#line 46 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 53 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Model.DeviceDecommissionedCount.ToString("n0"));
@@ -176,7 +221,7 @@ WriteLiteral(">");
WriteLiteral(" ");
#line 46 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 53 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Model.DeviceDecommissionedCount == 1 ? "device is" : "devices are");
@@ -185,108 +230,228 @@ WriteLiteral(" ");
WriteLiteral(" decommissioned.</div>\r\n");
#line 47 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 54 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
" Default Purchase Date:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>Default Purchase " +
"Date:\r\n </th>\r\n <td>");
#line 55 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceModel.DefaultPurchaseDate));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 56 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
" Default Warranty Provider:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 64 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DropDownListFor(model => model.DeviceModel.DefaultWarrantyProvider, Model.WarrantyProviders.ToSelectListItems(Model.DeviceModel.DefaultWarrantyProvider, true, "None")));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 65 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
" Type:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 73 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DisplayFor(model => model.DeviceModel.ModelType));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
" Image:\r\n </th>\r\n <td>\r\n <img");
WriteLiteral(" alt=\"Model Image\"");
WriteAttribute("src", Tuple.Create(" src=\"", 2690), Tuple.Create("\"", 2787)
#line 81 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
, Tuple.Create(Tuple.Create("", 2696), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, Model.DeviceModel.ImageHash()))
#line default
#line hidden
, 2696), false)
);
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
" <label");
WriteLiteral(" for=\"DeviceModel_Image\"");
WriteLiteral(">\r\n Update Image:\r\n </label>\r\n </th>" +
"\r\n <td>\r\n");
#line 91 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 60 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 91 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
using (Html.BeginForm(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
#line 62 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceModel.DefaultPurchaseDate));
#line default
#line hidden
WriteLiteral(" <input");
#line 62 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 63 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 63 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
else
{
#line default
#line hidden
#line 67 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(CommonHelpers.FriendlyDate(Model.DeviceModel.DefaultPurchaseDate, "Unknown"));
#line default
#line hidden
#line 67 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>Default Warranty " +
"Provider:\r\n </th>\r\n <td>");
#line 74 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 76 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DropDownListFor(model => model.DeviceModel.DefaultWarrantyProvider, Model.WarrantyProviders.ToSelectListItems(Model.DeviceModel.DefaultWarrantyProvider, true, "None")));
#line default
#line hidden
#line 76 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 77 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 77 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
else
{
if (Model.DeviceModel.DefaultWarrantyProvider == null)
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>\r\n");
#line 84 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
else
{
var provider = Model.WarrantyProviders.FirstOrDefault(wp => wp.Id == Model.DeviceModel.DefaultWarrantyProvider);
if (provider == null)
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>\r\n");
#line 91 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
else
{
#line default
#line hidden
#line 94 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(provider.Name);
#line default
#line hidden
#line 94 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>Type:\r\n " +
" </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 104 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DisplayFor(model => model.DeviceModel.ModelType));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>Image:\r\n " +
" </th>\r\n <td>\r\n <img");
WriteLiteral(" alt=\"Model Image\"");
WriteAttribute("src", Tuple.Create(" src=\"", 3910), Tuple.Create("\"", 4007)
#line 111 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
, Tuple.Create(Tuple.Create("", 3916), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, Model.DeviceModel.ImageHash()))
#line default
#line hidden
, 3916), false)
);
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n");
#line 114 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 114 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>\r\n <label");
WriteLiteral(" for=\"DeviceModel_Image\"");
WriteLiteral(">\r\n Update Image:\r\n </label>\r\n " +
" </th>\r\n <td>\r\n");
#line 123 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 123 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
using (Html.BeginForm(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" type=\"file\"");
@@ -298,7 +463,7 @@ WriteLiteral(" style=\"width: 250px;\"");
WriteLiteral(" />\r\n");
WriteLiteral(" <input");
WriteLiteral(" <input");
WriteLiteral(" class=\"button\"");
@@ -309,164 +474,199 @@ WriteLiteral(" value=\"Update\"");
WriteLiteral(" />\r\n");
#line 95 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
#line 127 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n </table>\r\n <script");
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 130 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n");
#line 132 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 132 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var $Description = $('#DeviceModel_Description');
var $DescriptionAjaxSave = $Description.next('.ajaxSave');
$Description
.watermark('Model Description')
.focus(function () { $Description.select() })
.keydown(function (e) {
$DescriptionAjaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$DescriptionAjaxSave.hide();
})
.change(function () {
$DescriptionAjaxSave.hide();
var $ajaxLoading = $DescriptionAjaxSave.next('.ajaxLoading').show();
var data = { Description: $Description.val() };
$.ajax({
url: '");
$(function () {
var $Description = $('#DeviceModel_Description');
var $DescriptionAjaxSave = $Description.next('.ajaxSave');
$Description
.watermark('Model Description')
.focus(function () { $Description.select() })
.keydown(function (e) {
$DescriptionAjaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$DescriptionAjaxSave.hide();
})
.change(function () {
$DescriptionAjaxSave.hide();
var $ajaxLoading = $DescriptionAjaxSave.next('.ajaxLoading').show();
var data = { Description: $Description.val() };
$.ajax({
url: '");
#line 119 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Url.Action(MVC.API.DeviceModel.UpdateDescription(Model.DeviceModel.Id)));
#line 154 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Url.Action(MVC.API.DeviceModel.UpdateDescription(Model.DeviceModel.Id)));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to update description: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update description: ' + textStatus);
$ajaxLoading.hide();
alert('Unable to update description: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update description: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
});
</script>
<script");
});
</script>
");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var $dataField = $('#DeviceModel_DefaultPurchaseDate');
var $ajaxLoading = $dataField.next('.ajaxLoading');
var dateFieldValue = $dataField.val();
var dateFieldChangeToken = null;
$dataField
.watermark('None')
.datepicker({
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd'
})
.change(function () {
var dateText = $dataField.val();
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()) {
dateFieldValue = dateText;
if (dateFieldChangeToken)
window.clearTimeout(dateFieldChangeToken);
dateFieldChangeToken = window.setTimeout(function () {
$ajaxLoading.show();
var data = {};
data['DefaultPurchaseDate'] = dateFieldValue;
$.getJSON('");
$(function () {
var $dataField = $('#DeviceModel_DefaultPurchaseDate');
var $ajaxLoading = $dataField.next('.ajaxLoading');
var dateFieldValue = $dataField.val();
var dateFieldChangeToken = null;
$dataField
.watermark('None')
.datepicker({
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd'
})
.change(function () {
var dateText = $dataField.val();
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()) {
dateFieldValue = dateText;
if (dateFieldChangeToken)
window.clearTimeout(dateFieldChangeToken);
dateFieldChangeToken = window.setTimeout(function () {
$ajaxLoading.show();
var data = {};
data['DefaultPurchaseDate'] = dateFieldValue;
$.getJSON('");
#line 161 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultPurchaseDate(Model.DeviceModel.Id)));
#line 196 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultPurchaseDate(Model.DeviceModel.Id)));
#line default
#line hidden
WriteLiteral(@"', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Date:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
dateFieldChangeToken = null;
}, 500);
}
}).focus(function () {
$(this).select();
});
});
</script>
<script");
if (result != 'success' || response != 'OK') {
alert('Unable to change Date:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
dateFieldChangeToken = null;
}, 500);
}
}).focus(function () {
$(this).select();
});
});
</script>
");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var $DefaultWarrantyProvider = $('#DeviceModel_DefaultWarrantyProvider');
var $ajaxLoading = $DefaultWarrantyProvider.next('.ajaxLoading');
$DefaultWarrantyProvider
.change(function () {
$ajaxLoading.show();
var data = { DefaultWarrantyProvider: $DefaultWarrantyProvider.val() };
$.ajax({
url: '");
$(function () {
var $DefaultWarrantyProvider = $('#DeviceModel_DefaultWarrantyProvider');
var $ajaxLoading = $DefaultWarrantyProvider.next('.ajaxLoading');
$DefaultWarrantyProvider
.change(function () {
$ajaxLoading.show();
var data = { DefaultWarrantyProvider: $DefaultWarrantyProvider.val() };
$.ajax({
url: '");
#line 186 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultWarrantyProvider(Model.DeviceModel.Id)));
#line 221 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultWarrantyProvider(Model.DeviceModel.Id)));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to default warranty provider: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to default warranty provider: ' + textStatus);
$ajaxLoading.hide();
alert('Unable to default warranty provider: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to default warranty provider: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
});
</script>
</div>
<h2>
Components</h2>
});
</script>
");
#line 208 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 240 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
#line default
#line hidden
WriteLiteral("</div>\r\n<h2>Components</h2>\r\n");
#line 243 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.Partial(MVC.Config.DeviceModel.Views._DeviceComponentsTable, Model.DeviceComponentsModel));
@@ -479,28 +679,28 @@ WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
#line 210 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 245 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 210 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (Model.CanDelete)
#line 245 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (Model.CanDelete)
{
#line default
#line hidden
#line 212 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 247 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.ActionLinkButton("Delete", MVC.API.DeviceModel.Delete(Model.DeviceModel.Id, true), "buttonDelete"));
#line default
#line hidden
#line 212 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 247 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
@@ -510,24 +710,49 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 214 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.ActionLinkButton("Export Devices", MVC.API.DeviceModel.ExportDevices(Model.DeviceModel.Id)));
#line 249 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (Model.DeviceCount > 0)
{
if (Authorization.Has(Claims.Device.Actions.Export))
{
#line default
#line hidden
#line 253 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.ActionLinkButton("Export Devices", MVC.API.DeviceModel.ExportDevices(Model.DeviceModel.Id)));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 215 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceModel.Id.ToString(), "DeviceModel")));
#line 253 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
if (Authorization.Has(Claims.Device.Search))
{
#line default
#line hidden
#line 257 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceModel.Id.ToString(), "DeviceModel")));
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n");
#line 257 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
}
#line default
#line hidden
WriteLiteral("</div>\r\n");
}
}
@@ -1,271 +1,312 @@
@model Disco.Web.Areas.Config.Models.DeviceModel.ComponentsModel
@{
Authorization.Require(Claims.Config.DeviceModel.Show);
var canConfig = Authorization.Has(Claims.Config.DeviceModel.ConfigureComponents);
Html.BundleDeferred("~/ClientScripts/Modules/Disco-jQueryExtensions");
}
<table id="deviceComponents" data-devicemodelid="@(Model.DeviceModelId.HasValue ? Model.DeviceModelId.Value.ToString() : string.Empty)">
<tr>
<th>
Description
</th>
<th>
Cost
</th>
<th>
Job Types
</th>
<th class="actions">
&nbsp;
</th>
</tr>
@foreach (var item in Model.DeviceComponents)
{
<tr data-devicecomponentid="@item.Id">
<td>
<input type="text" class="description" value="@item.Description" />
</td>
<td>
<input type="text" class="cost" value="@item.Cost.ToString("C")" />
</td>
<td>
<span class="edit@(item.JobSubTypes.Count > 0 ? " editAlert" : string.Empty)"></span>
</td>
<td>
<span class="remove"></span>
@if (canConfig)
{
<table id="deviceComponents" data-devicemodelid="@(Model.DeviceModelId.HasValue ? Model.DeviceModelId.Value.ToString() : string.Empty)">
<tr>
<th>Description
</th>
<th>Cost
</th>
<th>Job Types
</th>
<th class="actions">&nbsp;
</th>
</tr>
@foreach (var item in Model.DeviceComponents)
{
<tr data-devicecomponentid="@item.Id">
<td>
<input type="text" class="description" value="@item.Description" />
</td>
<td>
<input type="text" class="cost" value="@item.Cost.ToString("C")" />
</td>
<td>
<span class="edit@(item.JobSubTypes.Count > 0 ? " editAlert" : string.Empty)"></span>
</td>
<td>
<span class="remove"></span>
</td>
</tr>
}
<tr>
<td colspan="4">
<a href="#" id="addDeviceComponent">Add Component</a>
</td>
</tr>
}
<tr>
<td colspan="4">
<a href="#" id="addDeviceComponent">Add Component</a>
</td>
</tr>
</table>
<script type="text/javascript">
$(function () {
var $deviceComponents = $('#deviceComponents');
</table>
<script type="text/javascript">
$(function () {
var $deviceComponents = $('#deviceComponents');
$('#addDeviceComponent').click(function () {
var dc = $('<tr><td><input type="text" class="description" /></td><td><input type="text" class="cost" /></td><td><span class="edit"></span></td><td><span class="remove"></span></td></tr>');
dc.find('input').focus(function () { $(this).select() })
dc.insertBefore($deviceComponents.find('tr').last());
dc.find('input.description').focus();
return false;
});
$('#addDeviceComponent').click(function () {
var dc = $('<tr><td><input type="text" class="description" /></td><td><input type="text" class="cost" /></td><td><span class="edit"></span></td><td><span class="remove"></span></td></tr>');
dc.find('input').focus(function () { $(this).select() })
dc.insertBefore($deviceComponents.find('tr').last());
dc.find('input.description').focus();
return false;
});
$deviceComponents.on('change', 'input', updateComponent);
$deviceComponents.on('focus', 'input', function () { $(this).select(); });
$deviceComponents.on('change', 'input', updateComponent);
$deviceComponents.on('focus', 'input', function () { $(this).select(); });
$deviceComponents.on('click', 'span.remove', removeComponent);
$deviceComponents.on('click', 'span.edit', editComponentJobTypes);
$deviceComponents.on('click', 'span.remove', removeComponent);
$deviceComponents.on('click', 'span.edit', editComponentJobTypes);
function removeComponentConfirmed(id, row) {
var data = { id: id };
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentRemove())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
row.remove();
} else {
alert('Unable to remove component: ' + d);
function removeComponentConfirmed(id, row) {
var data = { id: id };
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentRemove())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
row.remove();
} else {
alert('Unable to remove component: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to remove component: ' + textStatus);
}
});
}
function removeComponent() {
var componentRow = $(this).closest('tr');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
var dialog = $("#dialogConfirmRemove");
var buttons = dialog.dialog("option", "buttons");
buttons['Remove'] = function () { removeComponentConfirmed(id, componentRow); $(this).dialog("close"); };
var buttons = dialog.dialog("option", "buttons", buttons);
dialog.dialog('open');
} else {
// New - Remove
componentRow.remove();
}
}
function updateComponent() {
var componentRow = $(this).closest('tr');
componentRow.find('input').attr('disabled', true).addClass('updating');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
// Update
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentUpdate())',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
});
} else {
// Add
id = componentRow.closest('table').attr('data-devicemodelid');
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentAdd(null, null, null))',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-devicecomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
}
function editComponentJobTypes() {
var edit$this = $(this);
var componentRow = edit$this.closest('tr');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
var data = {
id: id
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.Component())',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
$dialogUpdateJobTypes = $('#dialogUpdateJobTypes');
$dialogUpdateJobTypes.find('input:checked').each(function () { $(this).prop('checked', false) });
for (var i = 0; i < d.Component.JobSubTypes.length; i++) {
var sjt = d.Component.JobSubTypes[i];
$dialogUpdateJobTypes.find('#SubTypes_' + sjt).prop('checked', true);
}
$('#CheckboxBulkSelect_dialogUpdateJobTypes').checkboxBulkSelect('update');
var buttons = $dialogUpdateJobTypes.dialog("option", "buttons");
buttons['Save'] = function () {
$dialogUpdateJobTypes.dialog("disable");
var selectedSJTs = [];
$dialogUpdateJobTypes.find('input:checked').each(function () { selectedSJTs.push($(this).val()) });
var data = {
id: id,
JobSubTypes: selectedSJTs
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentUpdateJobSubTypes())',
dataType: 'json',
type: 'POST',
traditional: true,
data: data,
success: function (d) {
if (d.Result == 'OK') {
if (d.Component.JobSubTypes.length > 0) {
edit$this.addClass('editAlert');
} else {
edit$this.removeClass('editAlert');
}
$dialogUpdateJobTypes.dialog("enable");
$dialogUpdateJobTypes.dialog("close");
} else {
alert('Unable to update component sub types: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component sub types: ' + textStatus);
}
});
};
var buttons = $dialogUpdateJobTypes.dialog("option", "buttons", buttons);
$dialogUpdateJobTypes.dialog('open');
} else {
alert('Unable to load component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to load component: ' + textStatus);
}
});
}
}
$("#dialogConfirmRemove").dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
"Remove": function () {
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to remove component: ' + textStatus);
}
});
}
function removeComponent() {
var componentRow = $(this).closest('tr');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
var dialog = $("#dialogConfirmRemove");
var buttons = dialog.dialog("option", "buttons");
buttons['Remove'] = function () { removeComponentConfirmed(id, componentRow); $(this).dialog("close"); };
var buttons = dialog.dialog("option", "buttons", buttons);
dialog.dialog('open');
} else {
// New - Remove
componentRow.remove();
}
}
function updateComponent() {
var componentRow = $(this).closest('tr');
componentRow.find('input').attr('disabled', true).addClass('updating');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
// Update
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentUpdate())',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
$('#dialogUpdateJobTypes').dialog({
resizable: false,
modal: true,
autoOpen: false,
width: 550,
buttons: {
"Save": function () {
$(this).dialog("close");
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
Cancel: function () {
$(this).dialog("close");
}
});
} else {
// Add
id = componentRow.closest('table').attr('data-devicemodelid');
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentAdd(null, null, null))',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-devicecomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
}
function editComponentJobTypes() {
var edit$this = $(this);
var componentRow = edit$this.closest('tr');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
var data = {
id: id
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.Component())',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
$dialogUpdateJobTypes = $('#dialogUpdateJobTypes');
$dialogUpdateJobTypes.find('input:checked').each(function () { $(this).prop('checked', false) });
for (var i = 0; i < d.Component.JobSubTypes.length; i++) {
var sjt = d.Component.JobSubTypes[i];
$dialogUpdateJobTypes.find('#SubTypes_' + sjt).prop('checked', true);
}
$('#CheckboxBulkSelect_dialogUpdateJobTypes').checkboxBulkSelect('update');
var buttons = $dialogUpdateJobTypes.dialog("option", "buttons");
buttons['Save'] = function () {
$dialogUpdateJobTypes.dialog("disable");
var selectedSJTs = [];
$dialogUpdateJobTypes.find('input:checked').each(function () { selectedSJTs.push($(this).val()) });
var data = {
id: id,
JobSubTypes: selectedSJTs
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentUpdateJobSubTypes())',
dataType: 'json',
type: 'POST',
traditional: true,
data: data,
success: function (d) {
if (d.Result == 'OK') {
if (d.Component.JobSubTypes.length > 0) {
edit$this.addClass('editAlert');
} else {
edit$this.removeClass('editAlert');
}
$dialogUpdateJobTypes.dialog("enable");
$dialogUpdateJobTypes.dialog("close");
} else {
alert('Unable to update component sub types: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component sub types: ' + textStatus);
}
});
};
var buttons = $dialogUpdateJobTypes.dialog("option", "buttons", buttons);
$dialogUpdateJobTypes.dialog('open');
} else {
alert('Unable to load component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to load component: ' + textStatus);
}
});
}
}
$("#dialogConfirmRemove").dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
"Remove": function () {
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
});
$('#dialogUpdateJobTypes').dialog({
resizable: false,
modal: true,
autoOpen: false,
width: 550,
buttons: {
"Save": function () {
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
$('#CheckboxBulkSelect_dialogUpdateJobTypes').checkboxBulkSelect({ parentSelector: 'div' });
});
$('#CheckboxBulkSelect_dialogUpdateJobTypes').checkboxBulkSelect({ parentSelector: 'div' });
});
</script>
<div id="dialogUpdateJobTypes" title="Update Job Types">
<div>
<h2>
Hardware Non-Warranty Job Types</h2>
@CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.ToSelectListItems(), 2)
<br />
<span id="CheckboxBulkSelect_dialogUpdateJobTypes" class="checkboxBulkSelectContainer">
</span>
</script>
<div id="dialogUpdateJobTypes" title="Update Job Types">
<div>
<h2>Hardware Non-Warranty Job Types</h2>
@CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.ToSelectListItems(), 2)
<br />
<span id="CheckboxBulkSelect_dialogUpdateJobTypes" class="checkboxBulkSelectContainer"></span>
</div>
</div>
</div>
<div id="dialogConfirmRemove" title="Delete this Component?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
This item will be permanently deleted and cannot be recovered. Are you sure?</p>
</div>
<div id="dialogConfirmRemove" title="Delete this Component?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
This item will be permanently deleted and cannot be recovered. Are you sure?
</p>
</div>
}
else
{
<table id="deviceComponents" data-devicemodelid="@(Model.DeviceModelId.HasValue ? Model.DeviceModelId.Value.ToString() : string.Empty)">
<tr>
<th>Description
</th>
<th>Cost
</th>
<th>Job Types
</th>
</tr>
@foreach (var item in Model.DeviceComponents)
{
<tr data-devicecomponentid="@item.Id">
<td>
@item.Description
</td>
<td>
@item.Cost.ToString("C")
</td>
<td>
@if (item.JobSubTypes.Count > 0)
{
<ul>
@foreach (var jst in item.JobSubTypes)
{
<li>@jst.Description</li>
}
</ul>
}
else
{
<span class="smallMessage">&lt;None Specified&gt;</span>
}
</td>
</tr>
}
</table>
}
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DeviceModel
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceModel/_DeviceComponentsTable.cshtml")]
public partial class DeviceComponentsTable : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.ComponentsModel>
public partial class DeviceComponentsTable : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.ComponentsModel>
{
public DeviceComponentsTable()
{
@@ -43,370 +45,564 @@ namespace Disco.Web.Areas.Config.Views.DeviceModel
#line 2 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Authorization.Require(Claims.Config.DeviceModel.Show);
var canConfig = Authorization.Has(Claims.Config.DeviceModel.ConfigureComponents);
Html.BundleDeferred("~/ClientScripts/Modules/Disco-jQueryExtensions");
#line default
#line hidden
WriteLiteral("\r\n<table");
WriteLiteral("\r\n");
#line 9 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
if (canConfig)
{
#line default
#line hidden
WriteLiteral(" <table");
WriteLiteral(" id=\"deviceComponents\"");
WriteLiteral(" data-devicemodelid=\"");
#line 5 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Model.DeviceModelId.HasValue ? Model.DeviceModelId.Value.ToString() : string.Empty);
#line 11 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Model.DeviceModelId.HasValue ? Model.DeviceModelId.Value.ToString() : string.Empty);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <tr>\r\n <th>\r\n Description\r\n </th>\r\n <th>\r\n" +
" Cost\r\n </th>\r\n <th>\r\n Job Types\r\n </" +
"th>\r\n <th");
WriteLiteral(">\r\n <tr>\r\n <th>Description\r\n </th>\r\n <th>" +
"Cost\r\n </th>\r\n <th>Job Types\r\n </th>\r\n " +
" <th");
WriteLiteral(" class=\"actions\"");
WriteLiteral(">\r\n &nbsp;\r\n </th>\r\n </tr>\r\n");
WriteLiteral(">&nbsp;\r\n </th>\r\n </tr>\r\n");
#line 20 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
#line 22 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
#line default
#line hidden
#line 20 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
foreach (var item in Model.DeviceComponents)
{
#line 22 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
foreach (var item in Model.DeviceComponents)
{
#line default
#line hidden
WriteLiteral(" <tr");
WriteLiteral(" <tr");
WriteLiteral(" data-devicecomponentid=\"");
#line 22 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(item.Id);
#line 24 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(item.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <td>\r\n <input");
WriteLiteral(">\r\n <td>\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" class=\"description\"");
WriteAttribute("value", Tuple.Create(" value=\"", 704), Tuple.Create("\"", 729)
WriteAttribute("value", Tuple.Create(" value=\"", 883), Tuple.Create("\"", 908)
#line 24 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
, Tuple.Create(Tuple.Create("", 712), Tuple.Create<System.Object, System.Int32>(item.Description
#line 26 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
, Tuple.Create(Tuple.Create("", 891), Tuple.Create<System.Object, System.Int32>(item.Description
#line default
#line hidden
, 712), false)
, 891), false)
);
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <input");
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" class=\"cost\"");
WriteAttribute("value", Tuple.Create(" value=\"", 819), Tuple.Create("\"", 851)
WriteAttribute("value", Tuple.Create(" value=\"", 1010), Tuple.Create("\"", 1042)
#line 27 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
, Tuple.Create(Tuple.Create("", 827), Tuple.Create<System.Object, System.Int32>(item.Cost.ToString("C")
#line 29 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
, Tuple.Create(Tuple.Create("", 1018), Tuple.Create<System.Object, System.Int32>(item.Cost.ToString("C")
#line default
#line hidden
, 827), false)
, 1018), false)
);
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <span");
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <span");
WriteAttribute("class", Tuple.Create(" class=\"", 915), Tuple.Create("\"", 986)
, Tuple.Create(Tuple.Create("", 923), Tuple.Create("edit", 923), true)
WriteAttribute("class", Tuple.Create(" class=\"", 1118), Tuple.Create("\"", 1189)
, Tuple.Create(Tuple.Create("", 1126), Tuple.Create("edit", 1126), true)
#line 30 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
, Tuple.Create(Tuple.Create("", 927), Tuple.Create<System.Object, System.Int32>(item.JobSubTypes.Count > 0 ? " editAlert" : string.Empty
#line 32 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
, Tuple.Create(Tuple.Create("", 1130), Tuple.Create<System.Object, System.Int32>(item.JobSubTypes.Count > 0 ? " editAlert" : string.Empty
#line default
#line hidden
, 927), false)
, 1130), false)
);
WriteLiteral("></span>\r\n </td>\r\n <td>\r\n <span");
WriteLiteral("></span>\r\n </td>\r\n <td>\r\n <span");
WriteLiteral(" class=\"remove\"");
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n");
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n");
#line 36 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
}
#line 38 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
}
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td");
WriteLiteral(" <tr>\r\n <td");
WriteLiteral(" colspan=\"4\"");
WriteLiteral(">\r\n <a");
WriteLiteral(">\r\n <a");
WriteLiteral(" href=\"#\"");
WriteLiteral(" id=\"addDeviceComponent\"");
WriteLiteral(">Add Component</a>\r\n </td>\r\n </tr>\r\n</table>\r\n<script");
WriteLiteral(">Add Component</a>\r\n </td>\r\n </tr>\r\n </table>\r\n");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var $deviceComponents = $('#deviceComponents');
$(function () {
var $deviceComponents = $('#deviceComponents');
$('#addDeviceComponent').click(function () {
var dc = $('<tr><td><input type=""text"" class=""description"" /></td><td><input type=""text"" class=""cost"" /></td><td><span class=""edit""></span></td><td><span class=""remove""></span></td></tr>');
dc.find('input').focus(function () { $(this).select() })
dc.insertBefore($deviceComponents.find('tr').last());
dc.find('input.description').focus();
return false;
});
$('#addDeviceComponent').click(function () {
var dc = $('<tr><td><input type=""text"" class=""description"" /></td><td><input type=""text"" class=""cost"" /></td><td><span class=""edit""></span></td><td><span class=""remove""></span></td></tr>');
dc.find('input').focus(function () { $(this).select() })
dc.insertBefore($deviceComponents.find('tr').last());
dc.find('input.description').focus();
return false;
});
$deviceComponents.on('change', 'input', updateComponent);
$deviceComponents.on('focus', 'input', function () { $(this).select(); });
$deviceComponents.on('change', 'input', updateComponent);
$deviceComponents.on('focus', 'input', function () { $(this).select(); });
$deviceComponents.on('click', 'span.remove', removeComponent);
$deviceComponents.on('click', 'span.edit', editComponentJobTypes);
$deviceComponents.on('click', 'span.remove', removeComponent);
$deviceComponents.on('click', 'span.edit', editComponentJobTypes);
function removeComponentConfirmed(id, row) {
var data = { id: id };
$.ajax({
url: '");
#line 64 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentRemove()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n data: data,\r\n " +
" success: function (d) {\r\n if (d == \'OK\') {\r\n " +
" row.remove();\r\n } else {\r\n a" +
"lert(\'Unable to remove component: \' + d);\r\n }\r\n " +
" },\r\n error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to remove component: \' + textStatus);\r\n " +
" }\r\n });\r\n }\r\n function removeComponent() {\r\n " +
" var componentRow = $(this).closest(\'tr\');\r\n var id = componentRow" +
".attr(\'data-devicecomponentid\');\r\n if (id) {\r\n var dia" +
"log = $(\"#dialogConfirmRemove\");\r\n var buttons = dialog.dialog(\"o" +
"ption\", \"buttons\");\r\n buttons[\'Remove\'] = function () { removeCom" +
"ponentConfirmed(id, componentRow); $(this).dialog(\"close\"); };\r\n " +
"var buttons = dialog.dialog(\"option\", \"buttons\", buttons);\r\n dial" +
"og.dialog(\'open\');\r\n } else {\r\n // New - Remove\r\n " +
" componentRow.remove();\r\n }\r\n }\r\n function up" +
"dateComponent() {\r\n var componentRow = $(this).closest(\'tr\');\r\n " +
" componentRow.find(\'input\').attr(\'disabled\', true).addClass(\'updating\');\r\n\r" +
"\n var id = componentRow.attr(\'data-devicecomponentid\');\r\n " +
"if (id) {\r\n // Update\r\n var data = {\r\n " +
" id: id,\r\n Description: componentRow.find(\'input.descr" +
"iption\').val(),\r\n Cost: componentRow.find(\'input.cost\').val()" +
"\r\n };\r\n $.ajax({\r\n url: \'");
#line 106 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentUpdate()));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
});
} else {
// Add
id = componentRow.closest('table').attr('data-devicemodelid');
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
function removeComponentConfirmed(id, row) {
var data = { id: id };
$.ajax({
url: '");
#line 132 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentAdd(null, null, null)));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-devicecomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
}
function editComponentJobTypes() {
var edit$this = $(this);
var componentRow = edit$this.closest('tr');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
var data = {
id: id
};
$.ajax({
url: '");
#line 163 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.Component()));
#line 66 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentRemove()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n data: data,\r\n " +
" success: function (d) {\r\n componentRow.fin" +
"d(\'input\').attr(\'disabled\', false).removeClass(\'updating\');\r\n " +
" if (d.Result == \'OK\') {\r\n $dialogUpdateJobTypes " +
"= $(\'#dialogUpdateJobTypes\');\r\n $dialogUpdateJobTypes" +
".find(\'input:checked\').each(function () { $(this).prop(\'checked\', false) });\r\n " +
" for (var i = 0; i < d.Component.JobSubTypes.length; i+" +
"+) {\r\n var sjt = d.Component.JobSubTypes[i];\r\n " +
" $dialogUpdateJobTypes.find(\'#SubTypes_\' + sjt).prop" +
"(\'checked\', true);\r\n }\r\n $" +
"(\'#CheckboxBulkSelect_dialogUpdateJobTypes\').checkboxBulkSelect(\'update\');\r\n " +
" var buttons = $dialogUpdateJobTypes.dialog(\"option\", \"bu" +
"ttons\");\r\n buttons[\'Save\'] = function () {\r\n " +
" $dialogUpdateJobTypes.dialog(\"disable\");\r\n " +
" var selectedSJTs = [];\r\n $dialog" +
"UpdateJobTypes.find(\'input:checked\').each(function () { selectedSJTs.push($(this" +
").val()) });\r\n\r\n var data = {\r\n " +
" id: id,\r\n JobSubTypes: sele" +
"ctedSJTs\r\n };\r\n $." +
"ajax({\r\n url: \'");
" success: function (d) {\r\n if (d == \'OK\') {" +
"\r\n row.remove();\r\n } else {\r\n " +
" alert(\'Unable to remove component: \' + d);\r\n " +
" }\r\n },\r\n error: function (j" +
"qXHR, textStatus, errorThrown) {\r\n alert(\'Unable to remov" +
"e component: \' + textStatus);\r\n }\r\n });\r\n " +
" }\r\n function removeComponent() {\r\n var componentRow" +
" = $(this).closest(\'tr\');\r\n var id = componentRow.attr(\'data-devi" +
"cecomponentid\');\r\n if (id) {\r\n var dialog = $(" +
"\"#dialogConfirmRemove\");\r\n var buttons = dialog.dialog(\"optio" +
"n\", \"buttons\");\r\n buttons[\'Remove\'] = function () { removeCom" +
"ponentConfirmed(id, componentRow); $(this).dialog(\"close\"); };\r\n " +
" var buttons = dialog.dialog(\"option\", \"buttons\", buttons);\r\n " +
" dialog.dialog(\'open\');\r\n } else {\r\n // New" +
" - Remove\r\n componentRow.remove();\r\n }\r\n " +
" }\r\n function updateComponent() {\r\n var component" +
"Row = $(this).closest(\'tr\');\r\n componentRow.find(\'input\').attr(\'d" +
"isabled\', true).addClass(\'updating\');\r\n\r\n var id = componentRow.a" +
"ttr(\'data-devicecomponentid\');\r\n if (id) {\r\n /" +
"/ Update\r\n var data = {\r\n id: id,\r\n " +
" Description: componentRow.find(\'input.description\').val(),\r" +
"\n Cost: componentRow.find(\'input.cost\').val()\r\n " +
" };\r\n $.ajax({\r\n url: \'");
#line 187 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentUpdateJobSubTypes()));
#line 108 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentUpdate()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" type: \'POST\',\r\n traditional: tr" +
"ue,\r\n data: data,\r\n " +
" success: function (d) {\r\n if (d" +
".Result == \'OK\') {\r\n if (d.Component." +
"JobSubTypes.length > 0) {\r\n edit$" +
"this.addClass(\'editAlert\');\r\n } else " +
"{\r\n edit$this.removeClass(\'editAl" +
"ert\');\r\n }\r\n " +
" $dialogUpdateJobTypes.dialog(\"enable\");\r\n " +
" $dialogUpdateJobTypes.dialog(\"close\");\r\n " +
" } else {\r\n al" +
"ert(\'Unable to update component sub types: \' + d.Result);\r\n " +
" }\r\n },\r\n " +
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to update component sub types: \' + t" +
"extStatus);\r\n }\r\n " +
" });\r\n };\r\n var buttons" +
" = $dialogUpdateJobTypes.dialog(\"option\", \"buttons\", buttons);\r\n " +
" $dialogUpdateJobTypes.dialog(\'open\');\r\n } els" +
"e {\r\n alert(\'Unable to load component: \' + d.Result);" +
"\r\n }\r\n },\r\n error: " +
"function (jqXHR, textStatus, errorThrown) {\r\n alert(\'Unab" +
"le to load component: \' + textStatus);\r\n }\r\n }" +
");\r\n }\r\n\r\n }\r\n\r\n $(\"#dialogConfirmRemove\").dialog({\r\n " +
" resizable: false,\r\n height: 140,\r\n modal: true,\r" +
"\n autoOpen: false,\r\n buttons: {\r\n \"Remove\":" +
" function () {\r\n $(this).dialog(\"close\");\r\n }," +
"\r\n Cancel: function () {\r\n $(this).dialog(\"clo" +
"se\");\r\n }\r\n }\r\n });\r\n\r\n $(\'#dialogUpdate" +
"JobTypes\').dialog({\r\n resizable: false,\r\n modal: true,\r\n " +
" autoOpen: false,\r\n width: 550,\r\n buttons: {\r\n " +
" \"Save\": function () {\r\n $(this).dialog(\"close\");" +
"\r\n },\r\n Cancel: function () {\r\n " +
" $(this).dialog(\"close\");\r\n }\r\n }\r\n });\r\n\r\n " +
" $(\'#CheckboxBulkSelect_dialogUpdateJobTypes\').checkboxBulkSelect({ parentSel" +
"ector: \'div\' });\r\n });\r\n</script>\r\n<div");
WriteLiteral(@"',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
});
} else {
// Add
id = componentRow.closest('table').attr('data-devicemodelid');
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '");
#line 134 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentAdd(null, null, null)));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-devicecomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
}
function editComponentJobTypes() {
var edit$this = $(this);
var componentRow = edit$this.closest('tr');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
var data = {
id: id
};
$.ajax({
url: '");
#line 165 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.Component()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n data: data" +
",\r\n success: function (d) {\r\n " +
"componentRow.find(\'input\').attr(\'disabled\', false).removeClass(\'updating\');\r\n " +
" if (d.Result == \'OK\') {\r\n " +
" $dialogUpdateJobTypes = $(\'#dialogUpdateJobTypes\');\r\n " +
" $dialogUpdateJobTypes.find(\'input:checked\').each(function () { $(this).pr" +
"op(\'checked\', false) });\r\n for (var i = 0; i < d." +
"Component.JobSubTypes.length; i++) {\r\n var sj" +
"t = d.Component.JobSubTypes[i];\r\n $dialogUpda" +
"teJobTypes.find(\'#SubTypes_\' + sjt).prop(\'checked\', true);\r\n " +
" }\r\n $(\'#CheckboxBulkSelect_dialogUpda" +
"teJobTypes\').checkboxBulkSelect(\'update\');\r\n var " +
"buttons = $dialogUpdateJobTypes.dialog(\"option\", \"buttons\");\r\n " +
" buttons[\'Save\'] = function () {\r\n " +
" $dialogUpdateJobTypes.dialog(\"disable\");\r\n " +
" var selectedSJTs = [];\r\n $dialogUpdateJobTyp" +
"es.find(\'input:checked\').each(function () { selectedSJTs.push($(this).val()) });" +
"\r\n\r\n var data = {\r\n " +
" id: id,\r\n JobSubTypes: sele" +
"ctedSJTs\r\n };\r\n " +
" $.ajax({\r\n url: \'");
#line 189 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentUpdateJobSubTypes()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" type: \'POST\',\r\n tra" +
"ditional: true,\r\n data: data,\r\n " +
" success: function (d) {\r\n " +
" if (d.Result == \'OK\') {\r\n " +
" if (d.Component.JobSubTypes.length > 0) {\r\n " +
" edit$this.addClass(\'editAlert\');\r\n " +
" } else {\r\n " +
" edit$this.removeClass(\'editAlert\');\r\n " +
" }\r\n $dialogUpdate" +
"JobTypes.dialog(\"enable\");\r\n $dia" +
"logUpdateJobTypes.dialog(\"close\");\r\n " +
"} else {\r\n alert(\'Unable to updat" +
"e component sub types: \' + d.Result);\r\n " +
" }\r\n },\r\n " +
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to update component sub types: \' + textS" +
"tatus);\r\n }\r\n " +
" });\r\n };\r\n " +
" var buttons = $dialogUpdateJobTypes.dialog(\"option\", \"buttons\", buttons);\r\n " +
" $dialogUpdateJobTypes.dialog(\'open\');\r\n " +
" } else {\r\n alert(\'Unable to load c" +
"omponent: \' + d.Result);\r\n }\r\n " +
" },\r\n error: function (jqXHR, textStatus, errorThrown) {\r" +
"\n alert(\'Unable to load component: \' + textStatus);\r\n" +
" }\r\n });\r\n }\r\n\r\n " +
" }\r\n\r\n $(\"#dialogConfirmRemove\").dialog({\r\n resiza" +
"ble: false,\r\n height: 140,\r\n modal: true,\r\n " +
" autoOpen: false,\r\n buttons: {\r\n \"Remo" +
"ve\": function () {\r\n $(this).dialog(\"close\");\r\n " +
" },\r\n Cancel: function () {\r\n " +
" $(this).dialog(\"close\");\r\n }\r\n }\r\n " +
" });\r\n\r\n $(\'#dialogUpdateJobTypes\').dialog({\r\n resizab" +
"le: false,\r\n modal: true,\r\n autoOpen: false,\r\n " +
" width: 550,\r\n buttons: {\r\n \"Save\":" +
" function () {\r\n $(this).dialog(\"close\");\r\n " +
" },\r\n Cancel: function () {\r\n $(t" +
"his).dialog(\"close\");\r\n }\r\n }\r\n });" +
"\r\n\r\n $(\'#CheckboxBulkSelect_dialogUpdateJobTypes\').checkboxBulkSelect" +
"({ parentSelector: \'div\' });\r\n });\r\n </script>\r\n");
WriteLiteral(" <div");
WriteLiteral(" id=\"dialogUpdateJobTypes\"");
WriteLiteral(" title=\"Update Job Types\"");
WriteLiteral(">\r\n <div>\r\n <h2>\r\n Hardware Non-Warranty Job Types</h2>\r\n");
WriteLiteral(">\r\n <div>\r\n <h2>Hardware Non-Warranty Job Types</h2>\r\n");
WriteLiteral(" ");
WriteLiteral(" ");
#line 261 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.ToSelectListItems(), 2));
#line 262 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.ToSelectListItems(), 2));
#line default
#line hidden
WriteLiteral("\r\n <br />\r\n <span");
WriteLiteral("\r\n <br />\r\n <span");
WriteLiteral(" id=\"CheckboxBulkSelect_dialogUpdateJobTypes\"");
WriteLiteral(" class=\"checkboxBulkSelectContainer\"");
WriteLiteral(">\r\n </span>\r\n </div>\r\n</div>\r\n<div");
WriteLiteral("></span>\r\n </div>\r\n </div>\r\n");
WriteLiteral(" <div");
WriteLiteral(" id=\"dialogConfirmRemove\"");
WriteLiteral(" title=\"Delete this Component?\"");
WriteLiteral(">\r\n <p>\r\n <span");
WriteLiteral(">\r\n <p>\r\n <span");
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
WriteLiteral("></span>\r\n This item will be permanently deleted and cannot be recovered. " +
"Are you sure?</p>\r\n</div>\r\n");
WriteLiteral("></span>\r\n This item will be permanently deleted and cannot be recover" +
"ed. Are you sure?\r\n </p>\r\n </div>\r\n");
#line 273 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <table");
WriteLiteral(" id=\"deviceComponents\"");
WriteLiteral(" data-devicemodelid=\"");
#line 276 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Model.DeviceModelId.HasValue ? Model.DeviceModelId.Value.ToString() : string.Empty);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <tr>\r\n <th>Description\r\n </th>\r\n <th>" +
"Cost\r\n </th>\r\n <th>Job Types\r\n </th>\r\n <" +
"/tr>\r\n");
#line 285 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
#line default
#line hidden
#line 285 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
foreach (var item in Model.DeviceComponents)
{
#line default
#line hidden
WriteLiteral(" <tr");
WriteLiteral(" data-devicecomponentid=\"");
#line 287 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(item.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <td>\r\n");
WriteLiteral(" ");
#line 289 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(item.Description);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 292 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(item.Cost.ToString("C"));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
#line 295 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
#line default
#line hidden
#line 295 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
if (item.JobSubTypes.Count > 0)
{
#line default
#line hidden
WriteLiteral(" <ul>\r\n");
#line 298 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
#line default
#line hidden
#line 298 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
foreach (var jst in item.JobSubTypes)
{
#line default
#line hidden
WriteLiteral(" <li>");
#line 300 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(jst.Description);
#line default
#line hidden
WriteLiteral("</li>\r\n");
#line 301 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ul>\r\n");
#line 303 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>\r\n");
#line 307 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 310 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n");
#line 312 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
}
#line default
#line hidden
}
}
}
@@ -1,5 +1,7 @@
@model Disco.Web.Areas.Config.Models.DeviceProfile.CreateModel
@{
Authorization.RequireAll(Claims.Config.DeviceProfile.Create, Claims.Config.DeviceProfile.Configure);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), "Create");
}
@using (Html.BeginForm())
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DeviceProfile
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceProfile/Create.cshtml")]
public partial class Create : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.CreateModel>
public partial class Create : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.CreateModel>
{
public Create()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Areas.Config.Views.DeviceProfile
#line 2 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Authorization.RequireAll(Claims.Config.DeviceProfile.Create, Claims.Config.DeviceProfile.Configure);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), "Create");
@@ -51,7 +55,7 @@ namespace Disco.Web.Areas.Config.Views.DeviceProfile
WriteLiteral("\r\n");
#line 5 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
#line 7 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
using (Html.BeginForm())
{
@@ -59,14 +63,14 @@ WriteLiteral("\r\n");
#line default
#line hidden
#line 7 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
#line 9 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.ValidationSummary(false));
#line default
#line hidden
#line 7 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
#line 9 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
@@ -84,7 +88,7 @@ WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r
WriteLiteral(" ");
#line 15 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
#line 17 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.TextBoxFor(model => model.DeviceProfile.Name));
@@ -93,7 +97,7 @@ WriteLiteral(" ");
WriteLiteral("<br />");
#line 15 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
#line 17 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.DeviceProfile.Name));
@@ -103,7 +107,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
">\r\n Short Name:\r\n </th>\r\n <td>");
#line 22 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
#line 24 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.TextBoxFor(model => model.DeviceProfile.ShortName));
@@ -112,7 +116,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral("<br />");
#line 22 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
#line 24 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.DeviceProfile.ShortName));
@@ -123,7 +127,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
"");
#line 29 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
#line 31 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.TextBoxFor(model => model.DeviceProfile.Description));
@@ -132,7 +136,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral("<br />");
#line 29 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
#line 31 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.DeviceProfile.Description));
@@ -143,7 +147,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>
WriteLiteral(" ");
#line 33 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
#line 35 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.HiddenFor(model => model.DeviceProfile.ComputerNameTemplate));
@@ -154,7 +158,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 34 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
#line 36 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.HiddenFor(model => model.DeviceProfile.ProvisionADAccount));
@@ -165,7 +169,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 35 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
#line 37 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.HiddenFor(model => model.DeviceProfile.DistributionType));
@@ -193,7 +197,7 @@ WriteLiteral(">\r\n $(function () {\r\n $(\'#Name\').focus().s
"\r\n </script>\r\n");
#line 45 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
#line 47 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
}
@@ -1,5 +1,7 @@
@model Disco.Web.Areas.Config.Models.DeviceProfile.DefaultsModel
@{
Authorization.Require(Claims.Config.DeviceProfile.ConfigureDefaults);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), "Defaults");
}
<div class="form" style="width: 600px">
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DeviceProfile
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceProfile/Defaults.cshtml")]
public partial class Defaults : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.DefaultsModel>
public partial class Defaults : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.DefaultsModel>
{
public Defaults()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Areas.Config.Views.DeviceProfile
#line 2 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
Authorization.Require(Claims.Config.DeviceProfile.ConfigureDefaults);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), "Defaults");
@@ -69,7 +73,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 12 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
#line 14 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
Write(Html.DropDownListFor(m => m.Default, Model.DeviceProfiles.ToSelectListItems(Model.Default)));
@@ -80,7 +84,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 13 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
#line 15 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -99,7 +103,7 @@ WriteLiteral(@">
$.getJSON('");
#line 20 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
#line 22 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
Write(Url.Action(MVC.API.DeviceProfile.Default()));
@@ -133,7 +137,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 38 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
#line 40 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
Write(Html.DropDownListFor(m => m.DefaultAddDeviceOffline, Model.DeviceProfilesAndNone.ToSelectListItems(Model.DefaultAddDeviceOffline)));
@@ -144,7 +148,7 @@ WriteLiteral("\r\n");
WriteLiteral(" ");
#line 39 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
#line 41 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -163,7 +167,7 @@ WriteLiteral(@">
$.getJSON('");
#line 46 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
#line 48 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
Write(Url.Action(MVC.API.DeviceProfile.DefaultAddDeviceOffline()));
@@ -1,9 +1,17 @@
@model Disco.Web.Areas.Config.Models.DeviceProfile.IndexModel
@{
Authorization.Require(Claims.Config.DeviceProfile.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles");
}
@Html.Partial(MVC.Config.DeviceProfile.Views._Table, Model, new ViewDataDictionary())
<div class="actionBar">
@Html.ActionLinkButton("Modify Default Profiles", MVC.Config.DeviceProfile.Defaults())
@Html.ActionLinkButton("Create Device Profile", MVC.Config.DeviceProfile.Create())
@if (Authorization.Has(Claims.Config.DeviceProfile.ConfigureDefaults))
{
@Html.ActionLinkButton("Modify Default Profiles", MVC.Config.DeviceProfile.Defaults())
}
@if (Authorization.HasAll(Claims.Config.DeviceProfile.Configure, Claims.Config.DeviceProfile.Create))
{
@Html.ActionLinkButton("Create Device Profile", MVC.Config.DeviceProfile.Create())
}
</div>
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DeviceProfile
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceProfile/Index.cshtml")]
public partial class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.IndexModel>
public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.IndexModel>
{
public Index()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Areas.Config.Views.DeviceProfile
#line 2 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
Authorization.Require(Claims.Config.DeviceProfile.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles");
@@ -51,7 +55,7 @@ namespace Disco.Web.Areas.Config.Views.DeviceProfile
WriteLiteral("\r\n");
#line 5 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
#line 7 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
Write(Html.Partial(MVC.Config.DeviceProfile.Views._Table, Model, new ViewDataDictionary()));
@@ -63,27 +67,61 @@ WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 7 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
Write(Html.ActionLinkButton("Modify Default Profiles", MVC.Config.DeviceProfile.Defaults()));
#line 9 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
#line default
#line hidden
#line 9 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
if (Authorization.Has(Claims.Config.DeviceProfile.ConfigureDefaults))
{
#line default
#line hidden
#line 11 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
Write(Html.ActionLinkButton("Modify Default Profiles", MVC.Config.DeviceProfile.Defaults()));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 8 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
Write(Html.ActionLinkButton("Create Device Profile", MVC.Config.DeviceProfile.Create()));
#line 11 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n");
WriteLiteral(" ");
#line 13 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
if (Authorization.HasAll(Claims.Config.DeviceProfile.Configure, Claims.Config.DeviceProfile.Create))
{
#line default
#line hidden
#line 15 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
Write(Html.ActionLinkButton("Create Device Profile", MVC.Config.DeviceProfile.Create()));
#line default
#line hidden
#line 15 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("</div>\r\n");
}
}
@@ -1,8 +1,18 @@
@model Disco.Web.Areas.Config.Models.DeviceProfile.ShowModel
@{
Authorization.Require(Claims.Config.DeviceProfile.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), Model.DeviceProfile.ToString());
Html.BundleDeferred("~/Style/jQueryUI/dynatree");
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-DynaTree");
var canConfig = Authorization.Has(Claims.Config.DeviceProfile.Configure);
var canConfigExpression = Authorization.Has(Claims.Config.DeviceProfile.ConfigureComputerNameTemplate);
var canDelete = (Authorization.Has(Claims.Config.DeviceProfile.Delete) && Model.CanDelete);
if (canConfig)
{
Html.BundleDeferred("~/Style/jQueryUI/dynatree");
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-DynaTree");
}
}
<div id="configurationDeviceProfileShow" class="form" style="width: 600px">
<table>
@@ -16,7 +26,9 @@
<tr>
<th>Name:
</th>
<td>@Html.TextBoxFor(model => model.DeviceProfile.Name)
<td>@if (canConfig)
{
@Html.TextBoxFor(model => model.DeviceProfile.Name)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
@@ -58,12 +70,19 @@
});
});
</script>
}
else
{
@Model.DeviceProfile.Name
}
</td>
</tr>
<tr>
<th>Short Name:
</th>
<td>@Html.TextBoxFor(model => model.DeviceProfile.ShortName)
<td>@if (canConfig)
{
@Html.TextBoxFor(model => model.DeviceProfile.ShortName)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
@@ -105,12 +124,19 @@
});
});
</script>
}
else
{
@Model.DeviceProfile.ShortName
}
</td>
</tr>
<tr>
<th>Description:
</th>
<td>@Html.TextBoxFor(model => model.DeviceProfile.Description)
<td>@if (canConfig)
{
@Html.TextBoxFor(model => model.DeviceProfile.Description)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
@@ -152,6 +178,11 @@
});
});
</script>
}
else
{
@Model.DeviceProfile.Description
}
</td>
</tr>
<tr>
@@ -167,7 +198,8 @@
<tr>
<th>Distribution Type:
</th>
<td>
<td>@if (canConfig)
{
@Html.DropDownList("DeviceProfile_DistributionType", Model.DeviceProfileDistributionTypes)
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
@@ -187,12 +219,18 @@
});
});
</script>
}
else
{
@Model.DeviceProfile.DistributionType.ToString()
}
</td>
</tr>
<tr>
<th>Address:
</th>
<td>
<td>@if (canConfig)
{
@Html.DropDownListFor(m => m.DeviceProfile.DefaultOrganisationAddress, Model.OrganisationAddresses.ToSelectListItems(Model.DeviceProfile.DefaultOrganisationAddress, true, "None"))
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
@@ -212,12 +250,25 @@
});
});
</script>
}
else
{
if (Model.DefaultOrganisationAddress == null)
{
<span class="smallMessage">&lt;None Specified&gt;</span>
}
else
{
@Model.DefaultOrganisationAddress.ToString()
}
}
</td>
</tr>
<tr>
<th>Allocate Certificates:
</th>
<td>
<td>@if (canConfig)
{
@Html.DropDownListFor(model => model.DeviceProfile.CertificateProviderId, Model.CertificateProviders.ToSelectListItems(null, true, "Not Allocated"))
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
@@ -248,12 +299,34 @@
});
});
</script>
}
else
{
if (string.IsNullOrEmpty(Model.DeviceProfile.CertificateProviderId))
{
<span class="smallMessage">&lt;None Allocated&gt;</span>
}
else
{
var cp = Model.CertificateProviders.FirstOrDefault(p => p.Id == Model.DeviceProfile.CertificateProviderId);
if (cp == null)
{
<span class="smallMessage">&lt;None Allocated&gt;</span>
}
else
{
@cp.Name
}
}
}
</td>
</tr>
<tr>
<th>Computer Name Template Expression:
</th>
<td>@Html.TextBoxFor(model => model.DeviceProfile.ComputerNameTemplate)
<td>@if (canConfig && canConfigExpression)
{
@Html.TextBoxFor(model => model.DeviceProfile.ComputerNameTemplate)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<a id="expressionBrowserAnchor" href="@(Url.Action(MVC.Config.DocumentTemplate.ExpressionBrowser()))">&nbsp;</a>
@@ -295,60 +368,89 @@
});
});
</script>
}
else
{
if (string.IsNullOrWhiteSpace(Model.DeviceProfile.ComputerNameTemplate))
{
<span class="smallMessage">&lt;None Specified&gt;</span>
}
else
{
<div class="code">
@Model.DeviceProfile.ComputerNameTemplate
</div>
}
}
<div style="margin-top: 8px;">
<label for="DeviceProfile_ProvisionADAccount">
Provision Active Directory Account:
</label>
<input id="DeviceProfile_ProvisionADAccount" type="checkbox" @(Model.DeviceProfile.ProvisionADAccount ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#DeviceProfile_ProvisionADAccount').click(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { ProvisionADAccount: $this.is(':checked') };
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateProvisionADAccount(Model.DeviceProfile.Id))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Provision AD Account:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
@if (canConfig)
{
<input id="DeviceProfile_ProvisionADAccount" type="checkbox" @(Model.DeviceProfile.ProvisionADAccount ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#DeviceProfile_ProvisionADAccount').click(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { ProvisionADAccount: $this.is(':checked') };
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateProvisionADAccount(Model.DeviceProfile.Id))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Provision AD Account:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
});
</script>
</script>
}
else
{
<input id="DeviceProfile_ProvisionADAccount" type="checkbox" @(Model.DeviceProfile.ProvisionADAccount ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) disabled="disabled" />
}
</div>
<div style="margin-top: 8px;">
<label for="DeviceProfile_EnforceComputerNameConvention">
Enforce Naming Convention:
</label>
<input id="DeviceProfile_EnforceComputerNameConvention" type="checkbox" @(Model.DeviceProfile.EnforceComputerNameConvention ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#DeviceProfile_EnforceComputerNameConvention').click(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { EnforceComputerNameConvention: $this.is(':checked') };
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateEnforceComputerNameConvention(Model.DeviceProfile.Id))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Enforce Computer Name Convention:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
@if (canConfig)
{
<input id="DeviceProfile_EnforceComputerNameConvention" type="checkbox" @(Model.DeviceProfile.EnforceComputerNameConvention ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#DeviceProfile_EnforceComputerNameConvention').click(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { EnforceComputerNameConvention: $this.is(':checked') };
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateEnforceComputerNameConvention(Model.DeviceProfile.Id))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Enforce Computer Name Convention:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
});
</script>
</script>
}
else
{
<input id="DeviceProfile_EnforceComputerNameConvention" type="checkbox" @(Model.DeviceProfile.EnforceComputerNameConvention ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) disabled="disabled" />
}
</div>
</td>
</tr>
<tr>
<th>Default Organisational Unit:
</th>
<td>
<td>@if (canConfig)
{
@Html.HiddenFor(model => model.DeviceProfile.OrganisationalUnit)
<div id="displayOrganisationalUnit">
</div>
@@ -466,19 +568,35 @@
updateDisplayOrganisationalUnit();
});
</script>
}
else
{
if (string.IsNullOrEmpty(Model.DeviceProfile.OrganisationalUnit))
{
<span>{Default Computers Container}</span>
}
else
{
<span>
@string.Join(" > ", Model.DeviceProfile.OrganisationalUnit.Split(',').Select(s => s.Substring(3)).Reverse())
</span>
}
}
<div style="margin-top: 8px;">
<label for="DeviceProfile_EnforceOrganisationalUnit">
Enforce:
</label>
<input id="DeviceProfile_EnforceOrganisationalUnit" type="checkbox" @(Model.DeviceProfile.EnforceOrganisationalUnit ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#DeviceProfile_EnforceOrganisationalUnit').click(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { EnforceOrganisationalUnit: $this.is(':checked') };
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateEnforceOrganisationalUnit(Model.DeviceProfile.Id))', data, function (response, result) {
@if (canConfig)
{
<input id="DeviceProfile_EnforceOrganisationalUnit" type="checkbox" @(Model.DeviceProfile.EnforceOrganisationalUnit ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#DeviceProfile_EnforceOrganisationalUnit').click(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { EnforceOrganisationalUnit: $this.is(':checked') };
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateEnforceOrganisationalUnit(Model.DeviceProfile.Id))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Enforce Organisation Unit:\n' + response);
$ajaxLoading.hide();
@@ -488,51 +606,65 @@
});
});
});
</script>
</script>
}
else
{
<input id="DeviceProfile_EnforceOrganisationalUnit" type="checkbox" @(Model.DeviceProfile.EnforceOrganisationalUnit ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) disabled="disabled" />
}
</div>
</td>
</tr>
</table>
</div>
<div id="dialogConfirmDelete" title="Delete this Device Profile?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
This item will be permanently deleted and cannot be recovered. Are you sure?
</p>
</div>
<script type="text/javascript">
$(function () {
@if (canDelete)
{
<div id="dialogConfirmDelete" title="Delete this Device Profile?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
This item will be permanently deleted and cannot be recovered. Are you sure?
</p>
</div>
<script type="text/javascript">
$(function () {
var button = $('#buttonDelete');
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
$("#dialogConfirmDelete").dialog('open');
});
var button = $('#buttonDelete');
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
$("#dialogConfirmDelete").dialog('open');
});
$("#dialogConfirmDelete").dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
"Delete": function () {
$(this).dialog('disable');
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog("close");
$("#dialogConfirmDelete").dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
"Delete": function () {
$(this).dialog('disable');
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog("close");
}
}
}
});
});
});
</script>
});
</script>
}
<div class="actionBar">
@if (Model.CanDelete)
@if (canDelete)
{
@Html.ActionLinkButton("Delete", MVC.API.DeviceProfile.Delete(Model.DeviceProfile.Id, true), "buttonDelete")
}
@Html.ActionLinkButton("Export Devices", MVC.API.DeviceProfile.ExportDevices(Model.DeviceProfile.Id))
@Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceProfile.Id.ToString(), "DeviceProfile"))
@if (Authorization.Has(Claims.Device.Actions.Export))
{
@Html.ActionLinkButton("Export Devices", MVC.API.DeviceProfile.ExportDevices(Model.DeviceProfile.Id))
}
@if (Authorization.Has(Claims.Device.Search))
{
@Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceProfile.Id.ToString(), "DeviceProfile"))
}
</div>
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,8 @@
@model Disco.Web.Areas.Config.Models.DeviceProfile.IndexModel
@using Disco.Web.Areas.Config.Models.DeviceProfile
@{
Authorization.Require(Claims.Config.DeviceProfile.Show);
}
@if (DiscoApplication.MultiSiteMode)
{
var deviceProfilesGrouped = Model.DeviceProfiles.OrderBy(i => i.AddressName).GroupBy(i => i.AddressName);
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,6 +28,8 @@ namespace Disco.Web.Areas.Config.Views.DeviceProfile
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
#line 2 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
@@ -39,7 +41,7 @@ namespace Disco.Web.Areas.Config.Views.DeviceProfile
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceProfile/_Table.cshtml")]
public partial class Table : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.IndexModel>
public partial class Table : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.IndexModel>
{
public Table()
{
@@ -48,6 +50,16 @@ namespace Disco.Web.Areas.Config.Views.DeviceProfile
{
#line 3 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
Authorization.Require(Claims.Config.DeviceProfile.Show);
#line default
#line hidden
WriteLiteral("\r\n");
#line 6 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
if (DiscoApplication.MultiSiteMode)
{
var deviceProfilesGrouped = Model.DeviceProfiles.OrderBy(i => i.AddressName).GroupBy(i => i.AddressName);
@@ -61,7 +73,7 @@ namespace Disco.Web.Areas.Config.Views.DeviceProfile
WriteLiteral(" <h2>");
#line 9 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
#line 12 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
Write(deviceProfilesGroup.Key);
@@ -70,21 +82,21 @@ WriteLiteral(" <h2>");
WriteLiteral("</h2> ");
#line 9 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
#line 12 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
}
#line default
#line hidden
#line 10 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
#line 13 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
Write(Html.Partial(MVC.Config.DeviceProfile.Views._TableRender, deviceProfilesGroup.Cast<_IndexModelItem>(), new ViewDataDictionary()));
#line default
#line hidden
#line 10 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
#line 13 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
}
}
@@ -95,14 +107,14 @@ else
#line default
#line hidden
#line 15 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
#line 18 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
Write(Html.Partial(MVC.Config.DeviceProfile.Views._TableRender, Model.DeviceProfiles.Cast<_IndexModelItem>(), new ViewDataDictionary()));
#line default
#line hidden
#line 15 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
#line 18 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
}
@@ -1,4 +1,7 @@
@model IEnumerable<Disco.Web.Areas.Config.Models.DeviceProfile._IndexModelItem>
@{
Authorization.Require(Claims.Config.DeviceProfile.Show);
}
<table class="tableData deviceProfileTable">
<tr>
<th class="name">
@@ -28,19 +28,29 @@ namespace Disco.Web.Areas.Config.Views.DeviceProfile
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceProfile/_TableRender.cshtml")]
public partial class TableRender : System.Web.Mvc.WebViewPage<IEnumerable<Disco.Web.Areas.Config.Models.DeviceProfile._IndexModelItem>>
public partial class TableRender : Disco.Services.Web.WebViewPage<IEnumerable<Disco.Web.Areas.Config.Models.DeviceProfile._IndexModelItem>>
{
public TableRender()
{
}
public override void Execute()
{
WriteLiteral("<table");
#line 2 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
Authorization.Require(Claims.Config.DeviceProfile.Show);
#line default
#line hidden
WriteLiteral("\r\n<table");
WriteLiteral(" class=\"tableData deviceProfileTable\"");
@@ -63,13 +73,13 @@ WriteLiteral(" class=\"deviceCount\"");
WriteLiteral(">\r\n Device Count\r\n </th>\r\n </tr>\r\n");
#line 17 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line 20 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line default
#line hidden
#line 17 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line 20 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
foreach (var item in Model)
{
@@ -81,7 +91,7 @@ WriteLiteral(" <tr>\r\n <td>\r\n");
WriteLiteral(" ");
#line 21 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line 24 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
Write(Html.ActionLink(item.Name, MVC.Config.DeviceProfile.Index(item.Id)));
@@ -92,7 +102,7 @@ WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 24 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line 27 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
Write(Html.DisplayFor(modelItem => item.Description));
@@ -103,7 +113,7 @@ WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 27 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line 30 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
Write(Html.DisplayFor(modelItem => item.DistributionType));
@@ -114,7 +124,7 @@ WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 30 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line 33 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
Write(item.DeviceCount.ToString("n0"));
@@ -123,13 +133,13 @@ WriteLiteral(" ");
WriteLiteral("\r\n");
#line 31 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line 34 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line default
#line hidden
#line 31 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line 34 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
if (item.DeviceDecommissionedCount > 0)
{
@@ -140,21 +150,21 @@ WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteAttribute("title", Tuple.Create(" title=\"", 996), Tuple.Create("\"", 1067)
WriteAttribute("title", Tuple.Create(" title=\"", 1065), Tuple.Create("\"", 1136)
#line 33 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
, Tuple.Create(Tuple.Create("", 1004), Tuple.Create<System.Object, System.Int32>(item.DeviceDecommissionedCount.ToString("n0")
#line 36 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
, Tuple.Create(Tuple.Create("", 1073), Tuple.Create<System.Object, System.Int32>(item.DeviceDecommissionedCount.ToString("n0")
#line default
#line hidden
, 1004), false)
, Tuple.Create(Tuple.Create(" ", 1052), Tuple.Create("Decommissioned", 1053), true)
, 1073), false)
, Tuple.Create(Tuple.Create(" ", 1121), Tuple.Create("Decommissioned", 1122), true)
);
WriteLiteral(">\r\n (");
#line 34 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line 37 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
Write(item.DeviceDecommissionedCount.ToString("n0"));
@@ -163,7 +173,7 @@ WriteLiteral(">\r\n (");
WriteLiteral(")</span>\r\n");
#line 35 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line 38 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
}
@@ -172,7 +182,7 @@ WriteLiteral(")</span>\r\n");
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 38 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line 41 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
}
@@ -1,5 +1,7 @@
@model Disco.Web.Areas.Config.Models.DocumentTemplate.CreateModel
@{
Authorization.RequireAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), "Create");
}
@using (Html.BeginForm(MVC.Config.DocumentTemplate.Create(), FormMethod.Post, new { enctype = "multipart/form-data" }))
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/Create.cshtml")]
public partial class Create : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.CreateModel>
public partial class Create : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.CreateModel>
{
public Create()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
#line 2 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
Authorization.RequireAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), "Create");
@@ -51,7 +55,7 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
WriteLiteral("\r\n");
#line 5 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 7 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
using (Html.BeginForm(MVC.Config.DocumentTemplate.Create(), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
@@ -68,7 +72,7 @@ WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r
"d:\r\n </th>\r\n <td>");
#line 13 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 15 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
Write(Html.TextBoxFor(model => model.DocumentTemplate.Id));
@@ -77,7 +81,7 @@ WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r
WriteLiteral("<br />");
#line 13 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 15 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.DocumentTemplate.Id));
@@ -88,7 +92,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
"");
#line 20 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 22 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
Write(Html.TextBoxFor(model => model.DocumentTemplate.Description));
@@ -97,7 +101,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral("<br />");
#line 20 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 22 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.DocumentTemplate.Description));
@@ -109,7 +113,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral(" ");
#line 28 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 30 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
Write(Html.DropDownListFor(model => model.DocumentTemplate.Scope, Model.Scopes.ToSelectListItems(null)));
@@ -126,7 +130,7 @@ WriteLiteral(" name=\"Template\"");
WriteLiteral(" /><br />");
#line 36 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 38 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
Write(Html.ValidationMessage("Template"));
@@ -149,7 +153,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 44 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 46 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
Write(CommonHelpers.CheckBoxList("Types", Model.JobTypes.ToSelectListItems(Model.Types), 2));
@@ -158,13 +162,13 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 49 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line default
#line hidden
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 49 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
foreach (var jt in Model.JobTypes)
{
@@ -173,15 +177,15 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line hidden
WriteLiteral(" <tr");
WriteAttribute("id", Tuple.Create(" id=\"", 1914), Tuple.Create("\"", 1939)
, Tuple.Create(Tuple.Create("", 1919), Tuple.Create("trJobSubType", 1919), true)
WriteAttribute("id", Tuple.Create(" id=\"", 2032), Tuple.Create("\"", 2057)
, Tuple.Create(Tuple.Create("", 2037), Tuple.Create("trJobSubType", 2037), true)
#line 49 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
, Tuple.Create(Tuple.Create("", 1931), Tuple.Create<System.Object, System.Int32>(jt.Id
#line 51 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
, Tuple.Create(Tuple.Create("", 2049), Tuple.Create<System.Object, System.Int32>(jt.Id
#line default
#line hidden
, 1931), false)
, 2049), false)
);
WriteLiteral(" class=\"jobSubTypes\"");
@@ -195,7 +199,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 51 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 53 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
Write(jt.Description);
@@ -206,7 +210,7 @@ WriteLiteral("<br />\r\n Sub Types<br />\r\n");
WriteLiteral(" ");
#line 53 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 55 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
Write(CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id)));
@@ -221,7 +225,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 56 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 58 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
Write(CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.Where(jst => jst.JobTypeId == jt.Id).ToList().ToSelectListItems(Model.SubTypes), 2));
@@ -230,7 +234,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr> \r\n");
#line 59 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 61 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
}
@@ -288,7 +292,7 @@ WriteLiteral(@">
");
#line 96 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
#line 98 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
}
#line default
@@ -1,5 +1,7 @@
@model Disco.Web.Areas.Config.Models.DocumentTemplate.ExpressionBrowserModel
@{
Authorization.Require(Claims.Config.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), "Expression Browser");
Html.BundleDeferred("~/Style/jQueryUI/dynatree");
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-DynaTree");
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/ExpressionBrowser.cshtml")]
public partial class ExpressionBrowser : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.ExpressionBrowserModel>
public partial class ExpressionBrowser : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.ExpressionBrowserModel>
{
public ExpressionBrowser()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
#line 2 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
Authorization.Require(Claims.Config.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), "Expression Browser");
Html.BundleDeferred("~/Style/jQueryUI/dynatree");
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-DynaTree");
@@ -107,7 +111,7 @@ WriteLiteral(">\r\n $(function () {\r\n if (!document.DiscoFunctions)
"oadTypeUrl = \'");
#line 40 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
#line 42 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
Write(Url.Action(MVC.Config.DocumentTemplate.ExpressionBrowser()));
@@ -160,7 +164,7 @@ WriteLiteral("\';\r\n var deviceScopeTree = $(\'#deviceScopeTree\');\r\n
" loadType(deviceScopeTree.dynatree(\'getRoot\'), \'");
#line 104 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
#line 106 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
Write(Model.DeviceType);
@@ -170,7 +174,7 @@ WriteLiteral("\');\r\n\r\n jobScopeTree.dynatree({ onLazyRead: lazyLoadNo
"Type(jobScopeTree.dynatree(\'getRoot\'), \'");
#line 107 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
#line 109 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
Write(Model.JobType);
@@ -180,7 +184,7 @@ WriteLiteral("\');\r\n\r\n userScopeTree.dynatree({ onLazyRead: lazyLoadN
"dType(userScopeTree.dynatree(\'getRoot\'), \'");
#line 110 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
#line 112 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
Write(Model.UserType);
@@ -202,7 +206,7 @@ WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n");
#line 121 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
#line 123 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
foreach (var variable in Model.Variables)
{
@@ -215,7 +219,7 @@ WriteLiteral(" ");
WriteLiteral("document.DiscoFunctions.expressionInitVariable(\'");
#line 124 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
#line 126 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
Write(variable.Key);
@@ -224,7 +228,7 @@ WriteLiteral("document.DiscoFunctions.expressionInitVariable(\'");
WriteLiteral("\', \'");
#line 124 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
#line 126 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
Write(variable.Value);
@@ -235,7 +239,7 @@ WriteLiteral("\');");
WriteLiteral("\r\n");
#line 125 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
#line 127 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
}
foreach (var variable in Model.ExtensionLibraries)
{
@@ -248,7 +252,7 @@ WriteLiteral(" ");
WriteLiteral("document.DiscoFunctions.expressionInitExpressionLibrary(\'");
#line 128 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
#line 130 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
Write(variable.Key);
@@ -257,7 +261,7 @@ WriteLiteral("document.DiscoFunctions.expressionInitExpressionLibrary(\'");
WriteLiteral("\', \'");
#line 128 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
#line 130 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
Write(variable.Value);
@@ -268,7 +272,7 @@ WriteLiteral("\');");
WriteLiteral("\r\n");
#line 129 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
#line 131 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
}
@@ -1,4 +1,6 @@
@{
Authorization.Require(Claims.Config.DocumentTemplate.ShowStatus);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(), "Import Status");
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml")]
public partial class ImportStatus : System.Web.Mvc.WebViewPage<dynamic>
public partial class ImportStatus : Disco.Services.Web.WebViewPage<dynamic>
{
public ImportStatus()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
#line 1 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Authorization.Require(Claims.Config.DocumentTemplate.ShowStatus);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(), "Import Status");
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
@@ -261,7 +265,7 @@ WriteLiteral(">\r\n $(function () {\r\n var vm;\r\n var host =
" var urlDeviceShow = \'");
#line 102 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
#line 104 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.Device.Show()));
@@ -270,7 +274,7 @@ WriteLiteral(">\r\n $(function () {\r\n var vm;\r\n var host =
WriteLiteral("/\'\r\n var urlJobShow = \'");
#line 103 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
#line 105 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.Job.Show()));
@@ -279,7 +283,7 @@ WriteLiteral("/\'\r\n var urlJobShow = \'");
WriteLiteral("/\'\r\n var urlUserShow = \'");
#line 104 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
#line 106 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.User.Show()));
@@ -288,7 +292,7 @@ WriteLiteral("/\'\r\n var urlUserShow = \'");
WriteLiteral("/\'\r\n var urlPageThumbnail = \'");
#line 105 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
#line 107 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.API.DocumentTemplate.ImporterThumbnail()));
@@ -297,7 +301,7 @@ WriteLiteral("/\'\r\n var urlPageThumbnail = \'");
WriteLiteral("/\'\r\n var urlDocumentTemplate = \'");
#line 106 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
#line 108 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.Config.DocumentTemplate.Index()));
@@ -306,7 +310,7 @@ WriteLiteral("/\'\r\n var urlDocumentTemplate = \'");
WriteLiteral("/\';\r\n var urlManuallyAssign = \'");
#line 107 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
#line 109 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.Config.DocumentTemplate.UndetectedPages()));
@@ -315,7 +319,7 @@ WriteLiteral("/\';\r\n var urlManuallyAssign = \'");
WriteLiteral("\';\r\n var iconErrorUrl = \'url(");
#line 108 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
#line 110 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Links.ClientSource.Style.Images.Status.fail32_png);
@@ -423,7 +427,7 @@ WriteLiteral(")\';\r\n var isLive = false;\r\n\r\n function pageVi
" url: \'");
#line 283 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
#line 285 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.API.Logging.RetrieveEvents()));
@@ -452,7 +456,7 @@ WriteLiteral(@"',
liveConnection = $.connection('");
#line 303 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
#line 305 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Content("~/API/Logging/Notifications"));
@@ -461,7 +465,7 @@ WriteLiteral(@"',
WriteLiteral("\', { addToGroups: \'");
#line 303 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
#line 305 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Disco.BI.DocumentTemplateBI.Importer.DocumentImporterLog.Current.LiveLogGroupName);
@@ -1,37 +1,57 @@
@model Disco.Web.Areas.Config.Models.DocumentTemplate.IndexModel
@{
Authorization.Require(Claims.Config.DocumentTemplate.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates");
}
<table class="tableData">
<tr>
<th>
Id
</th>
<th>
Description
</th>
<th>
Scope
</th>
</tr>
@foreach (var item in Model.DocumentTemplates)
{
@if (Model.DocumentTemplates.Count == 0)
{
<div class="form" style="width: 450px; padding: 100px 0;">
<h2>No document templates are configured</h2>
</div>
}
else
{
<table class="tableData">
<tr>
<td>
@Html.ActionLink(item.Id.ToString(), MVC.Config.DocumentTemplate.Index(item.Id))
</td>
<td>
@Html.DisplayFor(modelItem => item.Description)
</td>
<td>
@Html.DisplayFor(modelItem => item.Scope)
</td>
<th>Id
</th>
<th>Description
</th>
<th>Scope
</th>
</tr>
}
</table>
@foreach (var item in Model.DocumentTemplates)
{
<tr>
<td>
@Html.ActionLink(item.Id.ToString(), MVC.Config.DocumentTemplate.Index(item.Id))
</td>
<td>
@Html.DisplayFor(modelItem => item.Description)
</td>
<td>
@Html.DisplayFor(modelItem => item.Scope)
</td>
</tr>
}
</table>
}
<div class="actionBar">
@Html.ActionLinkButton("Undetected Pages", MVC.Config.DocumentTemplate.UndetectedPages())
@Html.ActionLinkButton("Import Status", MVC.Config.DocumentTemplate.ImportStatus())
@Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser())
@Html.ActionLinkButton("Create Document Template", MVC.Config.DocumentTemplate.Create())
</div>
@if (Authorization.Has(Claims.Config.DocumentTemplate.UndetectedPages))
{
@Html.ActionLinkButton("Undetected Pages", MVC.Config.DocumentTemplate.UndetectedPages())
}
@if (Authorization.Has(Claims.Config.DocumentTemplate.ShowStatus))
{
@Html.ActionLinkButton("Import Status", MVC.Config.DocumentTemplate.ImportStatus())
}
@if (Authorization.Has(Claims.Config.Show))
{
@Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser())
}
@if (Authorization.HasAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure))
{
@Html.ActionLinkButton("Create Document Template", MVC.Config.DocumentTemplate.Create())
}
</div>
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/Index.cshtml")]
public partial class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.IndexModel>
public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.IndexModel>
{
public Index()
{
@@ -43,124 +45,224 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
#line 2 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Authorization.Require(Claims.Config.DocumentTemplate.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates");
#line default
#line hidden
WriteLiteral("\r\n<table");
WriteLiteral("\r\n");
#line 7 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
if (Model.DocumentTemplates.Count == 0)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 450px; padding: 100px 0;\"");
WriteLiteral(">\r\n <h2>No document templates are configured</h2>\r\n </div> \r\n");
#line 12 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <table");
WriteLiteral(" class=\"tableData\"");
WriteLiteral(">\r\n <tr>\r\n <th>\r\n Id\r\n </th>\r\n <th>\r\n " +
" Description\r\n </th>\r\n <th>\r\n Scope\r\n </th>\r\n " +
" </tr>\r\n");
#line 17 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
#line default
#line hidden
#line 17 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
foreach (var item in Model.DocumentTemplates)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td>\r\n");
WriteLiteral(" ");
#line 21 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLink(item.Id.ToString(), MVC.Config.DocumentTemplate.Index(item.Id)));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
WriteLiteral(">\r\n <tr>\r\n <th>Id\r\n </th>\r\n <th>Descripti" +
"on\r\n </th>\r\n <th>Scope\r\n </th>\r\n </tr>\r\n" +
"");
#line 24 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.DisplayFor(modelItem => item.Description));
#line default
#line hidden
#line 24 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
foreach (var item in Model.DocumentTemplates)
{
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" <tr>\r\n <td>\r\n");
WriteLiteral(" ");
WriteLiteral(" ");
#line 27 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.DisplayFor(modelItem => item.Scope));
#line 28 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLink(item.Id.ToString(), MVC.Config.DocumentTemplate.Index(item.Id)));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 30 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
#line 31 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.DisplayFor(modelItem => item.Description));
#line default
#line hidden
WriteLiteral("</table>\r\n<div");
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 34 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.DisplayFor(modelItem => item.Scope));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 37 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n");
#line 39 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("<div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 33 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLinkButton("Undetected Pages", MVC.Config.DocumentTemplate.UndetectedPages()));
#line 41 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
#line default
#line hidden
#line 41 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
if (Authorization.Has(Claims.Config.DocumentTemplate.UndetectedPages))
{
#line default
#line hidden
#line 43 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLinkButton("Undetected Pages", MVC.Config.DocumentTemplate.UndetectedPages()));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 34 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLinkButton("Import Status", MVC.Config.DocumentTemplate.ImportStatus()));
#line 43 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 35 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser()));
#line 45 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
if (Authorization.Has(Claims.Config.DocumentTemplate.ShowStatus))
{
#line default
#line hidden
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLinkButton("Import Status", MVC.Config.DocumentTemplate.ImportStatus()));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 36 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLinkButton("Create Document Template", MVC.Config.DocumentTemplate.Create()));
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n</div>");
WriteLiteral(" ");
#line 49 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
if (Authorization.Has(Claims.Config.Show))
{
#line default
#line hidden
#line 51 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser()));
#line default
#line hidden
#line 51 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 53 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
if (Authorization.HasAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure))
{
#line default
#line hidden
#line 55 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLinkButton("Create Document Template", MVC.Config.DocumentTemplate.Create()));
#line default
#line hidden
#line 55 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("</div>\r\n");
}
}
@@ -1,28 +1,52 @@
@model Disco.Web.Areas.Config.Models.DocumentTemplate.ShowModel
@{
Authorization.Require(Claims.Config.DocumentTemplate.Show);
var canConfig = Authorization.Has(Claims.Config.DocumentTemplate.Configure);
#region Can Bulk Generate
var canBulkGenerate = Authorization.Has(Claims.Config.DocumentTemplate.BulkGenerate);
if (canBulkGenerate)
{
switch (Model.DocumentTemplate.Scope)
{
case DocumentTemplate.DocumentTemplateScopes.Device:
canBulkGenerate = Authorization.Has(Claims.Device.Actions.GenerateDocuments);
break;
case DocumentTemplate.DocumentTemplateScopes.Job:
canBulkGenerate = Authorization.Has(Claims.Job.Actions.GenerateDocuments);
break;
case DocumentTemplate.DocumentTemplateScopes.User:
canBulkGenerate = Authorization.Has(Claims.User.Actions.GenerateDocuments);
break;
default:
throw new InvalidOperationException("Invalid DocumentType Scope");
}
}
#endregion
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), Model.DocumentTemplate.Description);
}
<div class="form" style="width: 650px">
<table>
<tr>
<th>
Id:
<th>Id:
</th>
<td>@Html.DisplayFor(model => model.DocumentTemplate.Id)
</td>
</tr>
<tr>
<th>
Stored Instances:
<th>Stored Instances:
</th>
<td>@Html.DisplayFor(model => model.StoredInstanceCount)
</td>
</tr>
<tr>
<th>
Description:
<th>Description:
</th>
<td>@Html.TextBoxFor(model => model.DocumentTemplate.Description)
<td>@if (canConfig)
{
@Html.TextBoxFor(model => model.DocumentTemplate.Description)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
@@ -64,13 +88,25 @@
});
});
</script>
}
else
{
if (string.IsNullOrEmpty(Model.DocumentTemplate.Description))
{
<span class="smallMessage">&lt;None Specified&gt;</span>
}
else
{
@Model.DocumentTemplate.Description
}
}
</td>
</tr>
<tr>
<th>
Always Flatten Form:
<th>Always Flatten Form:
</th>
<td>
<td>@if (canConfig)
{
<input id="DocumentTemplate_FlattenForm" type="checkbox" @(Model.DocumentTemplate.FlattenForm ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
@@ -90,13 +126,18 @@
});
});
</script>
}
else
{
<input id="DocumentTemplate_FlattenForm" type="checkbox" @(Model.DocumentTemplate.FlattenForm ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) disabled="disabled" />
}
</td>
</tr>
<tr>
<th>
Scope:
<th>Scope:
</th>
<td>
<td>@if (canConfig)
{
@Html.DropDownListFor(model => model.DocumentTemplate.Scope, Model.Scopes.ToSelectListItems(null))
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
@@ -191,66 +232,92 @@
scopeChange();
});
</script>
}
else
{
@Model.DocumentTemplate.Scope
}
</td>
</tr>
<tr id="trJobTypes">
<th class="name">
Types:
</th>
<td class="value">
@CommonHelpers.CheckBoxList("Types", Model.JobTypes.ToSelectListItems(Model.Types), 2)
</td>
</tr>
@foreach (var jt in Model.JobTypes)
@if (canConfig || (Model.DocumentTemplate.Scope == DocumentTemplate.DocumentTemplateScopes.Job))
{
<tr id="trJobTypes">
<th class="name">Types:
</th>
<td class="value">
@CommonHelpers.CheckBoxList("Types", Model.JobTypes.ToSelectListItems(Model.Types), 2)
</td>
</tr>
foreach (var jt in Model.JobTypes)
{
<tr id="trJobSubType@(jt.Id)" class="jobSubTypes">
<th class="name">
@jt.Description<br />
Sub Types<br />
@CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id))
@if (canConfig)
{
@CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id))
}
</th>
<td class="value">
@CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.Where(jst => jst.JobTypeId == jt.Id).ToList().ToSelectListItems(Model.SubTypes), 2)
</td>
</tr>
}
if (canConfig)
{
<tr id="trJobTypeActions">
<th class="name"></th>
<td class="value">
<a id="TypeAction_Save" href="#" class="button">Save Job Types</a>@AjaxHelpers.AjaxLoader()
</td>
</tr>
}
else if (Model.DocumentTemplate.Scope == DocumentTemplate.DocumentTemplateScopes.Job)
{
<script>
$(function () {
$('.jobSubTypes').hide().find('input[type="checkbox"]').prop('disabled', true);
$('#trJobTypes').find('input[type="checkbox"]').prop('disabled', true).filter(':checked').each(function () {
$('#trJobSubType' + $(this).val()).show();
});
});
</script>
}
}
<tr id="trJobTypeActions">
<th class="name">
</th>
<td class="value">
<a id="TypeAction_Save" href="#" class="button">Save Job Types</a>@AjaxHelpers.AjaxLoader()
</td>
</tr>
<tr>
<th>
Template PDF
<th>Template PDF
</th>
<td>
@Html.ActionLink("Download Template", MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id))
<br />
@using (Html.BeginForm(MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
@if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.Upload))
{
<br />
using (Html.BeginForm(MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<input type="file" name="Template" id="Template" style="width: 250px;" />
<input class="button" type="submit" value="Upload" />
}
<script type="text/javascript">
$(function () {
var $template = $('#Template');
$template.closest('form').submit(function () {
if ($template.val() == '') {
alert('A template file is required to upload.');
return false;
}
}
<script type="text/javascript">
$(function () {
var $template = $('#Template');
$template.closest('form').submit(function () {
if ($template.val() == '') {
alert('A template file is required to upload.');
return false;
}
});
});
});
</script>
</script>
}
</td>
</tr>
<tr>
<th>
Filter Expression:
<th>Filter Expression:
</th>
<td>@Html.TextBoxFor(model => model.DocumentTemplate.FilterExpression)
<td>@if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.ConfigureFilterExpression))
{
@Html.TextBoxFor(model => model.DocumentTemplate.FilterExpression)
@AjaxHelpers.AjaxRemove()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
@@ -300,32 +367,47 @@
};
});
</script>
</td>
</tr>
<tr>
<th>
Bulk Generate
</th>
<td>
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id), FormMethod.Post))
}
else
{
<textarea name="DataIds"></textarea>
<input class="button" type="submit" value="Generate" />
if (string.IsNullOrWhiteSpace(Model.DocumentTemplate.FilterExpression))
{
<span class="smallMessage">&lt;None Specified&gt;</span>
}
else
{
<div class="code">
@Model.DocumentTemplate.FilterExpression
</div>
}
}
</td>
</tr>
@if (canBulkGenerate)
{
<tr>
<th>Bulk Generate
</th>
<td>
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id), FormMethod.Post))
{
<textarea name="DataIds"></textarea>
<input class="button" type="submit" value="Generate" />
}
</td>
</tr>
}
</table>
</div>
<h2>
Template Expressions</h2>
<h2>Template Expressions</h2>
@Html.Partial(MVC.Config.DocumentTemplate.Views._ExpressionsTable, Model.TemplateExpressions)
<div id="dialogConfirmDelete" title="Delete this Document Template?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 100px 0;">
</span>This item will be permanently deleted and cannot be recovered.<br />
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 100px 0;"></span>This item will be permanently deleted and cannot be recovered.<br />
<em>This <strong>will not delete attachments</strong> which have already been imported,
but any generated documents will no longer be automatically imported.</em><br />
Are you sure?</p>
Are you sure?
</p>
</div>
<script type="text/javascript">
$(function () {
@@ -357,6 +439,12 @@
});
</script>
<div class="actionBar">
@Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser())
@Html.ActionLinkButton("Delete", MVC.API.DocumentTemplate.Delete(Model.DocumentTemplate.Id, true), "buttonDelete")
@if (Authorization.Has(Claims.Config.Show))
{
@Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser())
}
@if (Authorization.Has(Claims.Config.DocumentTemplate.Delete))
{
@Html.ActionLinkButton("Delete", MVC.API.DocumentTemplate.Delete(Model.DocumentTemplate.Id, true), "buttonDelete")
}
</div>
File diff suppressed because it is too large Load Diff
@@ -1,39 +1,41 @@
@model Disco.Web.Areas.Config.Models.DocumentTemplate.UndetectedPagesModel
@{
Authorization.Require(Claims.Config.DocumentTemplate.UndetectedPages);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(), "Undetected Pages");
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
}
<div id="undetectedPagesContainer">
<div id="noUndetectedPages" data-bind="visible: noUndetectedPages">
<h3>
No Undetected Pages</h3>
<h3>No Undetected Pages</h3>
</div>
<ul id="undetectedPages" class="clearfix" data-bind="visible: !noUndetectedPages(), foreach: {data: undetectedPages}">
<li class="undetectedPage" data-bind="style: {backgroundImage: thumbnailUrl}, click: select">
<div class="pageDetails" data-bind="text: timestampFuzzy, attr: {title: timestamp}">
<ul id="undetectedPages" class="clearfix" data-bind="visible: !noUndetectedPages(), foreach: { data: undetectedPages }">
<li class="undetectedPage" data-bind="style: { backgroundImage: thumbnailUrl }, click: select">
<div class="pageDetails" data-bind="text: timestampFuzzy, attr: { title: timestamp }">
</div>
</li>
</ul>
</div>
<div id="undetectedPageDialog" data-bind="with: selectedUndetectedPage">
<div class="pagePreview" data-bind="style: {backgroundImage: previewUrl}">
<div class="pagePreview" data-bind="style: { backgroundImage: previewUrl }">
</div>
<div class="actions">
<a href="#" class="button" target="_blank" data-bind="attr: {href: sourceUrl}">Download</a>
<a href="#" class="button" target="_blank" data-bind="attr: { href: sourceUrl }">Download</a>
<a href="#" class="button" id="dialogDeleteButton" data-bind="click: deletePage">Delete</a>
</div>
<div class="actions">
Type: @Html.DropDownList("dialogDocumentTemplateId", Model.DocumentTemplatesSelectListItems, new Dictionary<string, object> { { "data-bind", "value: dialogTemplateId" } })
Data:
<input id="dialogDataId" type="text" data-bind="value: dialogDataId, autocomplete: {source: dialogDataIdService, minLength: 3, position: {my: 'left bottom', at: 'left top'}}" />
<input id="dialogDataId" type="text" data-bind="value: dialogDataId, autocomplete: { source: dialogDataIdService, minLength: 3, position: { my: 'left bottom', at: 'left top' } }" />
<a href="#" class="button" id="dialogAssignButton" data-bind="click: assignPage">Assign</a>
</div>
</div>
<div id="dialogRemove" title="Delete this Page?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?</p>
Are you sure?
</p>
</div>
<script type="text/javascript">
ko.bindingHandlers.autocomplete = {
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/UndetectedPages.cshtml")]
public partial class UndetectedPages : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.UndetectedPagesModel>
public partial class UndetectedPages : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.UndetectedPagesModel>
{
public UndetectedPages()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
#line 2 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
Authorization.Require(Claims.Config.DocumentTemplate.UndetectedPages);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(), "Undetected Pages");
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
@@ -60,25 +64,25 @@ WriteLiteral(" id=\"noUndetectedPages\"");
WriteLiteral(" data-bind=\"visible: noUndetectedPages\"");
WriteLiteral(">\r\n <h3>\r\n No Undetected Pages</h3>\r\n </div>\r\n <ul");
WriteLiteral(">\r\n <h3>No Undetected Pages</h3>\r\n </div>\r\n <ul");
WriteLiteral(" id=\"undetectedPages\"");
WriteLiteral(" class=\"clearfix\"");
WriteLiteral(" data-bind=\"visible: !noUndetectedPages(), foreach: {data: undetectedPages}\"");
WriteLiteral(" data-bind=\"visible: !noUndetectedPages(), foreach: { data: undetectedPages }\"");
WriteLiteral(">\r\n <li");
WriteLiteral(" class=\"undetectedPage\"");
WriteLiteral(" data-bind=\"style: {backgroundImage: thumbnailUrl}, click: select\"");
WriteLiteral(" data-bind=\"style: { backgroundImage: thumbnailUrl }, click: select\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"pageDetails\"");
WriteLiteral(" data-bind=\"text: timestampFuzzy, attr: {title: timestamp}\"");
WriteLiteral(" data-bind=\"text: timestampFuzzy, attr: { title: timestamp }\"");
WriteLiteral(">\r\n </div>\r\n </li>\r\n </ul>\r\n</div>\r\n<div");
@@ -90,7 +94,7 @@ WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"pagePreview\"");
WriteLiteral(" data-bind=\"style: {backgroundImage: previewUrl}\"");
WriteLiteral(" data-bind=\"style: { backgroundImage: previewUrl }\"");
WriteLiteral(">\r\n </div>\r\n <div");
@@ -104,7 +108,7 @@ WriteLiteral(" class=\"button\"");
WriteLiteral(" target=\"_blank\"");
WriteLiteral(" data-bind=\"attr: {href: sourceUrl}\"");
WriteLiteral(" data-bind=\"attr: { href: sourceUrl }\"");
WriteLiteral(">Download</a>\r\n <a");
@@ -123,7 +127,7 @@ WriteLiteral(" class=\"actions\"");
WriteLiteral(">\r\n Type: ");
#line 27 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
#line 28 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
Write(Html.DropDownList("dialogDocumentTemplateId", Model.DocumentTemplatesSelectListItems, new Dictionary<string, object> { { "data-bind", "value: dialogTemplateId" } }));
@@ -135,8 +139,8 @@ WriteLiteral(" id=\"dialogDataId\"");
WriteLiteral(" type=\"text\"");
WriteLiteral(" data-bind=\"value: dialogDataId, autocomplete: {source: dialogDataIdService, minL" +
"ength: 3, position: {my: \'left bottom\', at: \'left top\'}}\"");
WriteLiteral(" data-bind=\"value: dialogDataId, autocomplete: { source: dialogDataIdService, min" +
"Length: 3, position: { my: \'left bottom\', at: \'left top\' } }\"");
WriteLiteral(" />\r\n <a");
@@ -160,7 +164,7 @@ WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
WriteLiteral("></span>\r\n Are you sure?</p>\r\n</div>\r\n<script");
WriteLiteral("></span>\r\n Are you sure?\r\n </p>\r\n</div>\r\n<script");
WriteLiteral(" type=\"text/javascript\"");
@@ -193,7 +197,7 @@ WriteLiteral(">\r\n $(function () {\r\n\r\n var vm;\r\n var url
" = \'");
#line 63 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
#line 65 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
Write(new HtmlString(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedFile(null, false, true))));
@@ -202,7 +206,7 @@ WriteLiteral(">\r\n $(function () {\r\n\r\n var vm;\r\n var url
WriteLiteral("\';\r\n var urlUndetectedPagePreview = \'");
#line 64 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
#line 66 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
Write(new HtmlString(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedFile(null, false, false))));
@@ -211,7 +215,7 @@ WriteLiteral("\';\r\n var urlUndetectedPagePreview = \'");
WriteLiteral("\';\r\n var urlUndetectedPageSource = \'");
#line 65 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
#line 67 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
Write(new HtmlString(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedFile(null, true, false))));
@@ -220,7 +224,7 @@ WriteLiteral("\';\r\n var urlUndetectedPageSource = \'");
WriteLiteral("\';\r\n var urlDataIdLookupService = \'");
#line 66 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
#line 68 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
Write(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedDataIdLookup()));
@@ -229,7 +233,7 @@ WriteLiteral("\';\r\n var urlDataIdLookupService = \'");
WriteLiteral("/\';\r\n var urlImporterUndetectedAssign = \'");
#line 67 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
#line 69 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
Write(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedAssign()));
@@ -238,7 +242,7 @@ WriteLiteral("/\';\r\n var urlImporterUndetectedAssign = \'");
WriteLiteral("/\';\r\n var urlImporterUndetectedDelete = \'");
#line 68 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
#line 70 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
Write(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedDelete()));
@@ -318,7 +322,7 @@ WriteLiteral("/\';\r\n var $undetectedPageDialog = $(\'#undetectedPageDia
"m = new pageViewModel();\r\n\r\n $.ajax({\r\n url: \'");
#line 202 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
#line 204 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
Write(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedFiles()));
@@ -1,4 +1,7 @@
@model IEnumerable<Disco.BI.Expressions.Expression>
@{
Authorization.Require(Claims.Config.DocumentTemplate.Show);
}
<div class="expressionsTable">
@if (Model.Count() > 0)
{
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,32 +28,42 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/_ExpressionsTable.cshtml")]
public partial class ExpressionsTable : System.Web.Mvc.WebViewPage<IEnumerable<Disco.BI.Expressions.Expression>>
public partial class ExpressionsTable : Disco.Services.Web.WebViewPage<IEnumerable<Disco.BI.Expressions.Expression>>
{
public ExpressionsTable()
{
}
public override void Execute()
{
WriteLiteral("<div");
#line 2 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
Authorization.Require(Claims.Config.DocumentTemplate.Show);
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" class=\"expressionsTable\"");
WriteLiteral(">\r\n");
#line 3 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 6 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line default
#line hidden
#line 3 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 6 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
if (Model.Count() > 0)
{
@@ -79,13 +89,13 @@ WriteLiteral(@">
");
#line 17 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 20 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line default
#line hidden
#line 17 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 20 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
foreach (var expression in Model.Where(m => m.IsDynamic))
{
var expressionParts = expression.Where(e => e.IsDynamic).ToArray();
@@ -95,14 +105,14 @@ WriteLiteral(@">
#line hidden
WriteLiteral(" <tr>\r\n <td");
WriteAttribute("rowspan", Tuple.Create(" rowspan=\"", 647), Tuple.Create("\"", 682)
WriteAttribute("rowspan", Tuple.Create(" rowspan=\"", 719), Tuple.Create("\"", 754)
#line 21 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
, Tuple.Create(Tuple.Create("", 657), Tuple.Create<System.Object, System.Int32>(expressionParts.Length
#line 24 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
, Tuple.Create(Tuple.Create("", 729), Tuple.Create<System.Object, System.Int32>(expressionParts.Length
#line default
#line hidden
, 657), false)
, 729), false)
);
WriteLiteral(">\r\n");
@@ -110,7 +120,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 22 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 25 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
Write(expression.Name);
@@ -119,13 +129,13 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n");
#line 24 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 27 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line default
#line hidden
#line 24 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 27 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
if (expressionParts[0].ParseError)
{
@@ -141,7 +151,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 27 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 30 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
Write(expressionParts[0].Source.ToMultilineString());
@@ -157,7 +167,7 @@ WriteLiteral(">\r\n <strong>Expression Compilatio
WriteLiteral(" ");
#line 30 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 33 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
Write(expressionParts[0].ParseErrorMessage);
@@ -166,7 +176,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n </td>\r\n");
#line 33 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 36 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
}
else
{
@@ -179,7 +189,7 @@ WriteLiteral(" <td>\r\n");
WriteLiteral(" ");
#line 37 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 40 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
Write(expressionParts[0].Source.ToMultilineString());
@@ -188,7 +198,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n");
#line 39 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 42 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
}
@@ -199,7 +209,7 @@ WriteLiteral(" <td>\r\n");
WriteLiteral(" ");
#line 41 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 44 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
Write(expressionParts[0].ErrorsAllowed ? "Yes" : "No");
@@ -208,7 +218,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 44 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
for (int expressionIndex = 1; expressionIndex < expressionParts.Length; expressionIndex++)
{
@@ -218,13 +228,13 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n");
WriteLiteral(" <tr>\r\n");
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 50 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line default
#line hidden
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 50 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
if (expressionParts[expressionIndex].ParseError)
{
@@ -240,7 +250,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 50 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 53 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
Write(expressionParts[expressionIndex].Source.ToMultilineString());
@@ -256,7 +266,7 @@ WriteLiteral(">\r\n <strong>Expression Compilatio
WriteLiteral(" ");
#line 53 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 56 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
Write(expressionParts[expressionIndex].ParseErrorMessage);
@@ -265,7 +275,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n </td>\r\n");
#line 56 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 59 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
}
else
{
@@ -278,7 +288,7 @@ WriteLiteral(" <td>\r\n");
WriteLiteral(" ");
#line 60 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 63 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
Write(expressionParts[expressionIndex].Source.ToMultilineString());
@@ -287,7 +297,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n");
#line 62 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 65 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
}
@@ -298,7 +308,7 @@ WriteLiteral(" <td>\r\n");
WriteLiteral(" ");
#line 64 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 67 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
Write(expressionParts[expressionIndex].ErrorsAllowed ? "Yes" : "No");
@@ -307,7 +317,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 67 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 70 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
}
}
@@ -317,7 +327,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n");
WriteLiteral(" </table>\r\n");
#line 70 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 73 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
}
else
{
@@ -332,7 +342,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Expressions Found</span>\r\n");
#line 74 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
#line 77 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
}
@@ -1,5 +1,10 @@
@model Disco.Web.Areas.Config.Models.Enrolment.IndexModel
@{
Authorization.Require(Claims.Config.Enrolment.Show);
var canConfig = Authorization.Has(Claims.Config.Enrolment.Configure);
var canShowStatus = Authorization.Has(Claims.Config.Enrolment.ShowStatus);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrolment");
}
<div class="form" style="width: 530px;">
@@ -8,7 +13,9 @@
<tr>
<th>Username:
</th>
<td>@Html.TextBoxFor(model => model.MacSshUsername)
<td>@if (canConfig)
{
@Html.TextBoxFor(model => model.MacSshUsername)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
@@ -50,12 +57,26 @@
});
});
</script>
}
else
{
if (string.IsNullOrEmpty(Model.MacSshUsername))
{
<span class="smallMessage">&lt;None Specified&gt;</span>
}
else
{
@Model.MacSshUsername
}
}
</td>
</tr>
<tr>
<th>Password:
</th>
<td>
<td>@if (canConfig)
{
<input id="MacSshPassword" type="password" />
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
@@ -98,6 +119,11 @@
});
});
</script>
}
else
{
<text>********</text>
}
</td>
</tr>
<tr>
@@ -115,8 +141,10 @@
</tr>
</table>
</div>
<h2>Live Enrolment Logging</h2>
@Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel()
@if (canShowStatus && Authorization.Has(Claims.Config.Logging.Show))
{
<h2>Live Enrolment Logging</h2>
@Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel()
{
IsLive = true,
TakeFilter = 100,
@@ -124,7 +152,14 @@
ModuleFilter = Disco.BI.DeviceBI.EnrolmentLog.Current,
ViewPortHeight = 250
})
}
<div class="actionBar">
@Html.ActionLinkButton("Download Bootstrapper", MVC.Services.Client.Bootstrapper())
@Html.ActionLinkButton("Enrolment Status", MVC.Config.Enrolment.Status())
@if (Authorization.Has(Claims.Config.Enrolment.DownloadBootstrapper))
{
@Html.ActionLinkButton("Download Bootstrapper", MVC.Services.Client.Bootstrapper())
}
@if (canShowStatus)
{
@Html.ActionLinkButton("Enrolment Status", MVC.Config.Enrolment.Status())
}
</div>
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.Enrolment
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Enrolment/Index.cshtml")]
public partial class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Enrolment.IndexModel>
public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.Enrolment.IndexModel>
{
public Index()
{
@@ -43,6 +45,11 @@ namespace Disco.Web.Areas.Config.Views.Enrolment
#line 2 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
Authorization.Require(Claims.Config.Enrolment.Show);
var canConfig = Authorization.Has(Claims.Config.Enrolment.Configure);
var canShowStatus = Authorization.Has(Claims.Config.Enrolment.ShowStatus);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrolment");
@@ -58,35 +65,56 @@ WriteLiteral(">\r\n <h2>Apple Mac Secure Enrol</h2>\r\n <table>\r\n
"h>Username:\r\n </th>\r\n <td>");
#line 11 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line 16 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
if (canConfig)
{
#line default
#line hidden
#line 18 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
Write(Html.TextBoxFor(model => model.MacSshUsername));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 12 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line 18 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line default
#line hidden
#line 19 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 13 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line 19 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line default
#line hidden
#line 20 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
#line 20 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
@@ -113,7 +141,7 @@ WriteLiteral(@">
url: '");
#line 34 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line 41 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
Write(Url.Action(MVC.API.Bootstrapper.MacSshUsername()));
@@ -138,13 +166,62 @@ WriteLiteral(@"',
});
});
</script>
</td>
</tr>
<tr>
<th>Password:
</th>
<td>
<input");
");
#line 60 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
}
else
{
if (string.IsNullOrEmpty(Model.MacSshUsername))
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>\r\n");
#line 66 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
}
else
{
#line default
#line hidden
#line 69 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
Write(Model.MacSshUsername);
#line default
#line hidden
#line 69 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n\r\n <tr>\r\n <th>Password:\r\n " +
" </th>\r\n <td>");
#line 78 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
if (canConfig)
{
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" id=\"MacSshPassword\"");
@@ -152,27 +229,41 @@ WriteLiteral(" type=\"password\"");
WriteLiteral(" />\r\n");
WriteLiteral(" ");
#line 60 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line 81 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line default
#line hidden
#line 81 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 61 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line 81 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line default
#line hidden
#line 82 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
#line 82 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
@@ -199,7 +290,7 @@ WriteLiteral(@">
url: '");
#line 82 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line 103 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
Write(Url.Action(MVC.API.Bootstrapper.MacSshPassword()));
@@ -224,10 +315,31 @@ WriteLiteral(@"',
});
});
</script>
</td>
</tr>
<tr>
<td");
");
#line 122 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" ");
WriteLiteral("********");
WriteLiteral("\r\n");
#line 126 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <td");
WriteLiteral(" colspan=\"2\"");
@@ -284,11 +396,26 @@ WriteLiteral(">&lt;a&gt;</span>) or <span");
WriteLiteral(" class=\"code\"");
WriteLiteral(">&lt;script&gt;</span>\r\n tag embedded on the organisation\'s in" +
"tranet.</span>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>\r\n<h2>Live" +
" Enrolment Logging</h2>\r\n");
"tranet.</span>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>\r\n");
#line 119 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line 144 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
if (canShowStatus && Authorization.Has(Claims.Config.Logging.Show))
{
#line default
#line hidden
WriteLiteral(" <h2>Live Enrolment Logging</h2>\r\n");
#line 147 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line default
#line hidden
#line 147 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
Write(Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel()
{
IsLive = true,
@@ -301,33 +428,75 @@ Write(Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config
#line default
#line hidden
WriteLiteral("\r\n<div");
#line 154 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("<div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 128 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
Write(Html.ActionLinkButton("Download Bootstrapper", MVC.Services.Client.Bootstrapper()));
#line 157 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
#line default
#line hidden
#line 157 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
if (Authorization.Has(Claims.Config.Enrolment.DownloadBootstrapper))
{
#line default
#line hidden
#line 159 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
Write(Html.ActionLinkButton("Download Bootstrapper", MVC.Services.Client.Bootstrapper()));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 129 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
Write(Html.ActionLinkButton("Enrolment Status", MVC.Config.Enrolment.Status()));
#line 159 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n");
WriteLiteral(" ");
#line 161 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
if (canShowStatus)
{
#line default
#line hidden
#line 163 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
Write(Html.ActionLinkButton("Enrolment Status", MVC.Config.Enrolment.Status()));
#line default
#line hidden
#line 163 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("</div>\r\n");
}
}
@@ -1,4 +1,6 @@
@{
Authorization.Require(Claims.Config.Enrolment.ShowStatus);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrolment", MVC.Config.Enrolment.Index(), "Status");
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.Enrolment
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Enrolment/Status.cshtml")]
public partial class Status : System.Web.Mvc.WebViewPage<dynamic>
public partial class Status : Disco.Services.Web.WebViewPage<dynamic>
{
public Status()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Areas.Config.Views.Enrolment
#line 1 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Authorization.Require(Claims.Config.Enrolment.ShowStatus);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrolment", MVC.Config.Enrolment.Index(), "Status");
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
@@ -313,7 +317,7 @@ WriteLiteral(@">
var deviceBaseUrl = '");
#line 141 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 143 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Url.Action(MVC.Device.Show()));
@@ -322,7 +326,7 @@ WriteLiteral(@">
WriteLiteral("/\'\r\n var deviceModelImageUrl = \'");
#line 142 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 144 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Url.Action(MVC.API.DeviceModel.Image()));
@@ -331,7 +335,7 @@ WriteLiteral("/\'\r\n var deviceModelImageUrl = \'");
WriteLiteral("/\'\r\n var iconWarningUrl = \'url(");
#line 143 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 145 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Links.ClientSource.Style.Images.Status.warning32_png);
@@ -340,7 +344,7 @@ WriteLiteral("/\'\r\n var iconWarningUrl = \'url(");
WriteLiteral(")\';\r\n var iconErrorUrl = \'url(");
#line 144 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 146 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Links.ClientSource.Style.Images.Status.fail32_png);
@@ -443,7 +447,7 @@ WriteLiteral(")\';\r\n\r\n function pageViewModel() {\r\n var
" vm = new pageViewModel();\r\n $.ajax({\r\n url: \'");
#line 308 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 310 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Url.Action(MVC.API.DeviceModel.Index()));
@@ -477,7 +481,7 @@ WriteLiteral(@"',
url: '");
#line 333 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 335 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Url.Action(MVC.API.Logging.RetrieveEvents()));
@@ -513,7 +517,7 @@ WriteLiteral(@"',
liveConnection = $.connection('");
#line 360 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 362 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Url.Content("~/API/Logging/Notifications"));
@@ -522,7 +526,7 @@ WriteLiteral(@"',
WriteLiteral("\', { addToGroups: \'");
#line 360 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
#line 362 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Disco.BI.DeviceBI.EnrolmentLog.Current.LiveLogGroupName);
@@ -1,5 +1,9 @@
@model Disco.Web.Areas.Config.Models.Expressions.EditorModel
@{
// Under Construction - Not In Production
Authorization.Require(Claims.DiscoAdminAccount);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Expressions");
Html.BundleDeferred("~/ClientScripts/Modules/Disco-ExpressionEditor");
}
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.Expressions
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Expressions/Editor.cshtml")]
public partial class Editor : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Expressions.EditorModel>
public partial class Editor : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.Expressions.EditorModel>
{
public Editor()
{
@@ -43,6 +45,10 @@ namespace Disco.Web.Areas.Config.Views.Expressions
#line 2 "..\..\Areas\Config\Views\Expressions\Editor.cshtml"
// Under Construction - Not In Production
Authorization.Require(Claims.DiscoAdminAccount);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Expressions");
Html.BundleDeferred("~/ClientScripts/Modules/Disco-ExpressionEditor");
@@ -78,7 +84,7 @@ WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var initExpression = \'");
#line 21 "..\..\Areas\Config\Views\Expressions\Editor.cshtml"
#line 25 "..\..\Areas\Config\Views\Expressions\Editor.cshtml"
Write(Model.Expression);
@@ -87,7 +93,7 @@ WriteLiteral(">\r\n $(function () {\r\n var initExpression = \
WriteLiteral("\';\r\n var hostSrcUrl = \'");
#line 22 "..\..\Areas\Config\Views\Expressions\Editor.cshtml"
#line 26 "..\..\Areas\Config\Views\Expressions\Editor.cshtml"
Write(Links.ClientSource.Style.ExpressionEditor_htm);
@@ -103,7 +109,7 @@ WriteLiteral(@"';
var editor = new DiscoExpressionEditor(host, '");
#line 29 "..\..\Areas\Config\Views\Expressions\Editor.cshtml"
#line 33 "..\..\Areas\Config\Views\Expressions\Editor.cshtml"
Write(Url.Action(MVC.API.Expressions.ValidateExpression()));
@@ -1,18 +1,18 @@
@model Disco.Web.Areas.Config.Models.Logging.IndexModel
@using Disco.Services.Logging
@{
Authorization.Require(Claims.Config.Logging.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging");
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-TimePicker");
}
@using (Html.BeginForm(MVC.API.Logging.RetrieveEvents()))
{
<div class="form" style="width: 520px;">
<h2>
Export Logs</h2>
<h2>Export Logs</h2>
<table>
<tr>
<th style="width: 105px;">
Start Filter
<th style="width: 105px;">Start Filter
</th>
<td>
<input id="filterStart" type="text" name="Start" />
@@ -20,8 +20,7 @@
</td>
</tr>
<tr>
<th>
End Filter
<th>End Filter
</th>
<td>
<input id="filterEnd" type="text" name="End" />
@@ -29,8 +28,7 @@
</td>
</tr>
<tr>
<th>
Limit Filter
<th>Limit Filter
</th>
<td>
<select name="Take">
@@ -44,8 +42,7 @@
</td>
</tr>
<tr>
<th>
Module Filter
<th>Module Filter
</th>
<td>
<select id="moduleId" name="ModuleId">
@@ -58,10 +55,8 @@
</td>
</tr>
<tr id="trLogModuleEventTypes" style="display: none">
<th>
Event Type Filter <span style="display: block;" class="checkboxBulkSelectContainer">
Select: <a id="eventTypesSelectAll" href="#">ALL</a> | <a id="eventTypesSelectNone"
href="#">NONE</a></span>
<th>Event Type Filter <span style="display: block;" class="checkboxBulkSelectContainer">Select: <a id="eventTypesSelectAll" href="#">ALL</a> | <a id="eventTypesSelectNone"
href="#">NONE</a></span>
</th>
<td>
@{int uniqueIdSeed = 0;
@@ -76,8 +71,7 @@
</td>
</tr>
<tr>
<th>
</th>
<th></th>
<td>
@Html.Hidden("Format", "CSV")
<input type="submit" class="button" value="Download CSV" />
@@ -153,8 +147,7 @@
</script>
</div>
}
<h2>
Live Logging</h2>
<h2>Live Logging</h2>
@Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel()
{
IsLive = true,
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,18 +28,20 @@ namespace Disco.Web.Areas.Config.Views.Logging
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
#line 2 "..\..\Areas\Config\Views\Logging\Index.cshtml"
using Disco.Services.Logging;
#line default
#line hidden
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/Logging/Index.cshtml")]
public partial class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Logging.IndexModel>
public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.Logging.IndexModel>
{
public Index()
{
@@ -49,6 +51,8 @@ namespace Disco.Web.Areas.Config.Views.Logging
#line 3 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Authorization.Require(Claims.Config.Logging.Show);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging");
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-TimePicker");
@@ -58,7 +62,7 @@ namespace Disco.Web.Areas.Config.Views.Logging
WriteLiteral("\r\n");
#line 7 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 9 "..\..\Areas\Config\Views\Logging\Index.cshtml"
using (Html.BeginForm(MVC.API.Logging.RetrieveEvents()))
{
@@ -71,13 +75,13 @@ WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 520px;\"");
WriteLiteral(">\r\n <h2>\r\n Export Logs</h2>\r\n <table>\r\n <tr>\r" +
"\n <th");
WriteLiteral(">\r\n <h2>Export Logs</h2>\r\n <table>\r\n <tr>\r\n " +
" <th");
WriteLiteral(" style=\"width: 105px;\"");
WriteLiteral(">\r\n Start Filter\r\n </th>\r\n <td>\r" +
"\n <input");
WriteLiteral(">Start Filter\r\n </th>\r\n <td>\r\n <" +
"input");
WriteLiteral(" id=\"filterStart\"");
@@ -90,8 +94,8 @@ WriteLiteral(" />\r\n <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">* Optional</span>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th>\r\n End Filter\r\n </th>\r\n " +
" <td>\r\n <input");
" <th>End Filter\r\n </th>\r\n <td>\r\n " +
" <input");
WriteLiteral(" id=\"filterEnd\"");
@@ -104,8 +108,8 @@ WriteLiteral(" />\r\n <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">* Optional</span>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th>\r\n Limit Filter\r\n </th>\r\n " +
" <td>\r\n <select");
" <th>Limit Filter\r\n </th>\r\n <td>\r\n " +
" <select");
WriteLiteral(" name=\"Take\"");
@@ -136,9 +140,8 @@ WriteLiteral(">50 Events</option>\r\n <option");
WriteLiteral(" value=\"10\"");
WriteLiteral(">10 Events</option>\r\n </select>\r\n </td>\r\n " +
" </tr>\r\n <tr>\r\n <th>\r\n Module " +
"Filter\r\n </th>\r\n <td>\r\n <select" +
"");
" </tr>\r\n <tr>\r\n <th>Module Filter\r\n " +
" </th>\r\n <td>\r\n <select");
WriteLiteral(" id=\"moduleId\"");
@@ -153,13 +156,13 @@ WriteLiteral(" selected=\"selected\"");
WriteLiteral(">- All Modules -</option>\r\n");
#line 53 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 50 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line default
#line hidden
#line 53 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 50 "..\..\Areas\Config\Views\Logging\Index.cshtml"
foreach (var lm in Model.LogModules.Keys.OrderBy(lm => lm.ModuleDescription))
{
@@ -168,20 +171,20 @@ WriteLiteral(">- All Modules -</option>\r\n");
#line hidden
WriteLiteral(" <option");
WriteAttribute("value", Tuple.Create(" value=\"", 2126), Tuple.Create("\"", 2146)
WriteAttribute("value", Tuple.Create(" value=\"", 2082), Tuple.Create("\"", 2102)
#line 55 "..\..\Areas\Config\Views\Logging\Index.cshtml"
, Tuple.Create(Tuple.Create("", 2134), Tuple.Create<System.Object, System.Int32>(lm.ModuleId
#line 52 "..\..\Areas\Config\Views\Logging\Index.cshtml"
, Tuple.Create(Tuple.Create("", 2090), Tuple.Create<System.Object, System.Int32>(lm.ModuleId
#line default
#line hidden
, 2134), false)
, 2090), false)
);
WriteLiteral(">");
#line 55 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 52 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(lm.ModuleDescription);
@@ -190,7 +193,7 @@ WriteLiteral(">");
WriteLiteral("</option> \r\n");
#line 56 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 53 "..\..\Areas\Config\Views\Logging\Index.cshtml"
}
@@ -203,13 +206,13 @@ WriteLiteral(" id=\"trLogModuleEventTypes\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <th>\r\n Event Type Filter <span");
WriteLiteral(">\r\n <th>Event Type Filter <span");
WriteLiteral(" style=\"display: block;\"");
WriteLiteral(" class=\"checkboxBulkSelectContainer\"");
WriteLiteral(">\r\n Select: <a");
WriteLiteral(">Select: <a");
WriteLiteral(" id=\"eventTypesSelectAll\"");
@@ -219,18 +222,18 @@ WriteLiteral(">ALL</a> | <a");
WriteLiteral(" id=\"eventTypesSelectNone\"");
WriteLiteral("\r\n href=\"#\"");
WriteLiteral("\r\n href=\"#\"");
WriteLiteral(">NONE</a></span>\r\n </th>\r\n <td>\r\n");
#line 67 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 62 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line default
#line hidden
#line 67 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 62 "..\..\Areas\Config\Views\Logging\Index.cshtml"
int uniqueIdSeed = 0;
@@ -239,13 +242,13 @@ WriteLiteral(">NONE</a></span>\r\n </th>\r\n <td>\
WriteLiteral("\r\n");
#line 69 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 64 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line default
#line hidden
#line 69 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 64 "..\..\Areas\Config\Views\Logging\Index.cshtml"
foreach (var lm in Model.LogModules)
{
@@ -257,7 +260,7 @@ WriteLiteral(" <div");
WriteLiteral(" data-logmoduleid=\"");
#line 71 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 66 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(lm.Key.ModuleId);
@@ -272,7 +275,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 72 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 67 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(CommonHelpers.CheckBoxList("EventTypeIds", lm.Value.ToSelectListItems(), 2, false, uniqueIdSeed));
@@ -281,20 +284,20 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n");
#line 74 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 69 "..\..\Areas\Config\Views\Logging\Index.cshtml"
uniqueIdSeed += lm.Value.Count;
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>\r" +
"\n </th>\r\n <td>\r\n");
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th><" +
"/th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 82 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 76 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(Html.Hidden("Format", "CSV"));
@@ -359,16 +362,16 @@ WriteLiteral(">\r\n $(function () {\r\n var filterStar
" </script>\r\n </div>\r\n");
#line 155 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 149 "..\..\Areas\Config\Views\Logging\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("<h2>\r\n Live Logging</h2>\r\n");
WriteLiteral("<h2>Live Logging</h2>\r\n");
#line 158 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line 151 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel()
{
IsLive = true,
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.Logging
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Logging/TaskStatus.cshtml")]
public partial class TaskStatus : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Logging.TaskStatusModel>
public partial class TaskStatus : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.Logging.TaskStatusModel>
{
public TaskStatus()
{
@@ -1,5 +1,9 @@
@model Disco.Web.Areas.Config.Models.Organisation.IndexModel
@{
Authorization.Require(Claims.Config.Organisation.Show);
var canConfigAddresses = Authorization.Has(Claims.Config.Organisation.ConfigureAddresses);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Organisation Details");
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
@@ -10,7 +14,8 @@
<tr>
<th style="width: 160px">Name:
</th>
<td>
<td>@if (Authorization.Has(Claims.Config.Organisation.ConfigureName))
{
@Html.EditorFor(m => m.OrganisationName)
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
@@ -24,13 +29,21 @@
);
});
</script>
}
else
{
<h3>@Model.OrganisationName</h3>
}
</td>
</tr>
<tr>
<th style="width: 160px">Logo:
<br />
<br />
<a id="buttonUpdateOrganisationLogo" href="#" class="button">Update</a>
@if (Authorization.Has(Claims.Config.Organisation.ConfigureLogo))
{
<br />
<br />
<a id="buttonUpdateOrganisationLogo" href="#" class="button">Update</a>
}
</th>
<td>
<div style="text-align: center;">
@@ -41,13 +54,10 @@
<tr>
<th style="width: 160px">Multi-Site Mode:
</th>
<td>
<td>@if (Authorization.Has(Claims.Config.Organisation.ConfigureMultiSiteMode))
{
@Html.EditorFor(m => m.MultiSiteMode) @Html.LabelFor(m => m.MultiSiteMode)
@AjaxHelpers.AjaxLoader()
<div id="messageMultiSiteMode" style="display: none; padding: 0.7em 0.7em; margin-top: 20px;" class="ui-state-highlight ui-corner-all">
<span style="margin-right: 0.3em; float: left;" class="ui-icon ui-icon-info"></span>
Multi-Site mode is recommended where multiple addresses are configured.
</div>
<script type="text/javascript">
$(function () {
var field = $('#MultiSiteMode');
@@ -57,19 +67,30 @@
'@(Url.Action(MVC.API.System.UpdateMultiSiteMode()))',
'MultiSiteMode'
);
var $orgAddresses = $('#organisationAddresses');
if ($orgAddresses.length > 0 && $orgAddresses.find('tr').length > 2)
$('#messageMultiSiteMode').show();
});
</script>
}
else
{
<input name="MultiSiteMode" class="check-box" id="MultiSiteMode" type="checkbox" @(Model.MultiSiteMode ? new HtmlString("checked=\"checked\" ") : new HtmlString(string.Empty))disabled="disabled"> @Html.LabelFor(m => m.MultiSiteMode)
}
@if (Model.OrganisationAddresses.Count > 1)
{
<div id="messageMultiSiteMode" style="padding: 0.7em 0.7em; margin-top: 20px;" class="ui-state-highlight ui-corner-all">
<span style="margin-right: 0.3em; float: left;" class="ui-icon ui-icon-info"></span>
Multi-Site mode is recommended where multiple addresses are configured.
</div>
}
</td>
</tr>
<tr>
<th style="width: 160px">Addresses:
<br />
<br />
<a href="#" id="createAddress" class="button">Create</a>
@if (canConfigAddresses)
{
<br />
<br />
<a href="#" id="createAddress" class="button">Create</a>
}
</th>
<td>
@if (Model.OrganisationAddresses.Count > 0)
@@ -96,7 +117,10 @@
<span class="smallMessage">Fax:</span> <span class="faxNumber">@Html.DisplayFor(modelItem => item.FaxNumber)</span>
</td>
<td>
<span class="edit" title="Edit Address"></span><span class="delete" title="Delete Address"></span>
@if (canConfigAddresses)
{
<span class="edit" title="Edit Address"></span><span class="delete" title="Delete Address"></span>
}
</td>
</tr>
}
@@ -110,165 +134,170 @@
</tr>
</table>
</div>
<div id="dialogUpdateOrganisationLogo" title="Update Organisation Logo">
@using (Html.BeginForm(MVC.API.System.OrganisationLogo(true, null, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<h3>Update Action</h3>
<div style="margin-top: 10px; padding-bottom: 5px;">
<input id="updateOrganisationLogoResetLogo" type="radio" name="ResetLogo" value="true"
checked="checked" /><label for="updateOrganisationLogoResetLogo">Remove Logo</label>
</div>
<div style="margin-top: 5px; border-top: 1px dashed #aaa; padding-top: 5px;">
<input id="updateOrganisationLogoUploadLogo" type="radio" name="ResetLogo" value="false" /><label
for="updateOrganisationLogoUploadLogo">Upload Logo</label>
<div id="updateOrganisationLogoUploadLogoContainer" style="display: none; padding-left: 10px;">
<input id="updateOrganisationLogoUploadLogoImage" type="file" name="Image" />
<span id="updateOrganisationLogoUploadLogoImageRequired" class="field-validation-valid field-validation-error">* Required</span>
@if (Authorization.Has(Claims.Config.Organisation.ConfigureLogo))
{
<div id="dialogUpdateOrganisationLogo" title="Update Organisation Logo">
@using (Html.BeginForm(MVC.API.System.OrganisationLogo(true, null, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<h3>Update Action</h3>
<div style="margin-top: 10px; padding-bottom: 5px;">
<input id="updateOrganisationLogoResetLogo" type="radio" name="ResetLogo" value="true"
checked="checked" /><label for="updateOrganisationLogoResetLogo">Remove Logo</label>
</div>
</div>
}
</div>
<script type="text/javascript">
$(function () {
var button = $('#buttonUpdateOrganisationLogo');
var buttonDialog = $('#dialogUpdateOrganisationLogo');
button.click(function () {
buttonDialog.dialog('open');
return false;
});
buttonDialog.find('input[type="radio"]').click(function () {
if ($('#updateOrganisationLogoUploadLogo').is(':checked')) {
$('#updateOrganisationLogoUploadLogoImage').removeAttr('disabled');
$('#updateOrganisationLogoUploadLogoContainer').slideDown();
}
else {
$('#updateOrganisationLogoUploadLogoContainer').slideUp();
$('#updateOrganisationLogoUploadLogoImage').attr('disabled', 'disabled');
}
});
buttonDialog.dialog({
resizable: false,
height: 200,
modal: true,
autoOpen: false,
buttons: {
"Save": function () {
var $this = $(this);
<div style="margin-top: 5px; border-top: 1px dashed #aaa; padding-top: 5px;">
<input id="updateOrganisationLogoUploadLogo" type="radio" name="ResetLogo" value="false" /><label
for="updateOrganisationLogoUploadLogo">Upload Logo</label>
<div id="updateOrganisationLogoUploadLogoContainer" style="display: none; padding-left: 10px;">
<input id="updateOrganisationLogoUploadLogoImage" type="file" name="Image" />
<span id="updateOrganisationLogoUploadLogoImageRequired" class="field-validation-valid field-validation-error">* Required</span>
</div>
</div>
}
</div>
<script type="text/javascript">
$(function () {
var button = $('#buttonUpdateOrganisationLogo');
var buttonDialog = $('#dialogUpdateOrganisationLogo');
button.click(function () {
buttonDialog.dialog('open');
return false;
});
buttonDialog.find('input[type="radio"]').click(function () {
if ($('#updateOrganisationLogoUploadLogo').is(':checked')) {
$('#updateOrganisationLogoUploadLogoImage').removeAttr('disabled');
$('#updateOrganisationLogoUploadLogoContainer').slideDown();
}
else {
$('#updateOrganisationLogoUploadLogoContainer').slideUp();
$('#updateOrganisationLogoUploadLogoImage').attr('disabled', 'disabled');
}
});
buttonDialog.dialog({
resizable: false,
height: 200,
modal: true,
autoOpen: false,
buttons: {
"Save": function () {
var $this = $(this);
var $image = $('#updateOrganisationLogoUploadLogoImage');
if ($('#updateOrganisationLogoUploadLogo').is(':checked') && $image.val() == '') {
$image.addClass('input-validation-error');
$('#updateOrganisationLogoUploadLogoImageRequired').removeClass('field-validation-valid');
} else {
$image.removeClass('input-validation-error');
$('#updateOrganisationLogoUploadLogoImageRequired').addClass('field-validation-valid');
$this.dialog("disable");
$this.dialog("option", "buttons", null);
$this.find('form').submit();
var $image = $('#updateOrganisationLogoUploadLogoImage');
if ($('#updateOrganisationLogoUploadLogo').is(':checked') && $image.val() == '') {
$image.addClass('input-validation-error');
$('#updateOrganisationLogoUploadLogoImageRequired').removeClass('field-validation-valid');
} else {
$image.removeClass('input-validation-error');
$('#updateOrganisationLogoUploadLogoImageRequired').addClass('field-validation-valid');
$this.dialog("disable");
$this.dialog("option", "buttons", null);
$this.find('form').submit();
}
},
Cancel: function () {
$(this).dialog("close");
}
},
Cancel: function () {
$(this).dialog("close");
}
}
});
});
});
</script>
<div id="dialogConfirmRemove" title="Delete this Component?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
This item will be permanently deleted and cannot be recovered. Are you sure?
</p>
</div>
<div id="dialogEdit" title="Edit/Create Address">
<table>
<tr>
<td>Short&nbsp;Name
</td>
<td>
<input id="editShortName" type="text" />
</td>
</tr>
<tr>
<td>Name
</td>
<td>
<input id="editName" type="text" />
</td>
</tr>
<tr>
<td>Address
</td>
<td>
<input id="editAddress" type="text" />
</td>
</tr>
<tr>
<td>Suburb
</td>
<td>
<input id="editSuburb" type="text" />
</td>
</tr>
<tr>
<td>Postcode
</td>
<td>
<input id="editPostcode" type="text" />
</td>
</tr>
<tr>
<td>State
</td>
<td>
<input id="editState" type="text" />
</td>
</tr>
<tr>
<td>Country
</td>
<td>
<input id="editCountry" type="text" />
</td>
</tr>
<tr>
<td>Phone Number
</td>
<td>
<input id="editPhoneNumber" type="text" />
</td>
</tr>
<tr>
<td>Fax Number
</td>
<td>
<input id="editFaxNumber" type="text" />
</td>
</tr>
</table>
</div>
<script type="text/javascript">
$(function () {
$("#dialogConfirmRemove").dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Delete": function () {
return null;
},
Cancel: function () {
$(this).dialog("close");
</script>
}
@if (canConfigAddresses)
{
<div id="dialogConfirmRemove" title="Delete this Address?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
This item will be permanently deleted and cannot be recovered. Are you sure?
</p>
</div>
<div id="dialogEdit" title="Edit/Create Address">
<table>
<tr>
<td>Short&nbsp;Name
</td>
<td>
<input id="editShortName" type="text" />
</td>
</tr>
<tr>
<td>Name
</td>
<td>
<input id="editName" type="text" />
</td>
</tr>
<tr>
<td>Address
</td>
<td>
<input id="editAddress" type="text" />
</td>
</tr>
<tr>
<td>Suburb
</td>
<td>
<input id="editSuburb" type="text" />
</td>
</tr>
<tr>
<td>Postcode
</td>
<td>
<input id="editPostcode" type="text" />
</td>
</tr>
<tr>
<td>State
</td>
<td>
<input id="editState" type="text" />
</td>
</tr>
<tr>
<td>Country
</td>
<td>
<input id="editCountry" type="text" />
</td>
</tr>
<tr>
<td>Phone Number
</td>
<td>
<input id="editPhoneNumber" type="text" />
</td>
</tr>
<tr>
<td>Fax Number
</td>
<td>
<input id="editFaxNumber" type="text" />
</td>
</tr>
</table>
</div>
<script type="text/javascript">
$(function () {
$("#dialogConfirmRemove").dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Delete": function () {
return null;
},
Cancel: function () {
$(this).dialog("close");
}
}
}
});
$('#organisationAddresses').find('span.delete').click(function () {
var componentRow = $(this).closest('tr');
var id = componentRow.attr('data-addressid');
if (id) {
var dialog = $("#dialogConfirmRemove");
var buttons = dialog.dialog("option", "buttons");
buttons['Delete'] = function () { $(this).dialog("disable"); window.location.href = '@(Url.Action(MVC.API.System.DeleteOrganisationAddress()))' + '?redirect=true&id=' + id; };
});
$('#organisationAddresses').find('span.delete').click(function () {
var componentRow = $(this).closest('tr');
var id = componentRow.attr('data-addressid');
if (id) {
var dialog = $("#dialogConfirmRemove");
var buttons = dialog.dialog("option", "buttons");
buttons['Delete'] = function () { $(this).dialog("disable"); window.location.href = '@(Url.Action(MVC.API.System.DeleteOrganisationAddress()))' + '?redirect=true&id=' + id; };
var buttons = dialog.dialog("option", "buttons", buttons);
dialog.dialog('open');
}
@@ -368,4 +397,5 @@
});
});
</script>
</script>
}
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,7 @@
@model Disco.Web.Areas.Config.Models.Plugins.PluginConfigurationViewModel
@{
Authorization.Require(Claims.Config.Plugin.Configure);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Plugins", MVC.Config.Plugins.Index(), Model.Manifest.Name);
}
@using (Html.BeginForm())
+102 -77
View File
@@ -1,6 +1,12 @@
@model Disco.Web.Areas.Config.Models.Plugins.IndexViewModel
@using Disco.Services.Plugins;
@{
Authorization.Require(Claims.Config.Plugin.Show);
var canConfig = Authorization.Has(Claims.Config.Plugin.Configure);
var canUninstall = Authorization.Has(Claims.Config.Plugin.Uninstall);
var canInstall = Authorization.Has(Claims.Config.Plugin.Install);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Plugins");
}
<div id="plugins">
@@ -34,9 +40,16 @@
<h2>@Plugins.PluginFeatureCategoryDisplayName(pluginGroup.Item1)</h2>
@foreach (var pluginDefinition in pluginGroup.Item2)
{
if (canConfig)
{
<a href="@Url.Action(MVC.Config.Plugins.Configure(pluginDefinition.Id))">
<h3>@pluginDefinition.Name</h3>
</a>
}
else
{
<h3>@pluginDefinition.Name</h3>
}
<div class="pageMenuBlurb">
<span class="pluginVersion">v@(pluginDefinition.VersionFormatted)</span> | @pluginDefinition.Author | <a href="@pluginDefinition.Url" target="_blank">More Information</a>
</div>
@@ -48,6 +61,8 @@
}
</tr>
</table>
if (canUninstall)
{
<div id="dialogUninstallPlugins" title="Uninstall Plugin">
<div>
@Html.DropDownList("uninstallPlugin", Model.PluginManifests.ToSelectListItems(null, true, "Select a Plugin to Uninstall"))
@@ -72,91 +87,98 @@
$(function () {
// Uninstall
var uninstallUrl = '@(Url.Action(MVC.API.Plugin.Uninstall()))/';
var uninstallPlugin, uninstallPluginData, $dialogConfirm, uninstallPluginConfirm, uninstallPluginDataConfirm;
var uninstallPlugin, uninstallPluginData, $dialogConfirm, uninstallPluginConfirm, uninstallPluginDataConfirm;
var pluginId, pluginName, pluginUninstallData;
var pluginId, pluginName, pluginUninstallData;
var $dialog = $('#dialogUninstallPlugins').dialog({
resizable: false,
modal: true,
width: 350,
autoOpen: false,
buttons: {
"Uninstall": function () {
pluginId = uninstallPlugin.val();
pluginName = uninstallPlugin.find('option:selected').text();
pluginUninstallData = uninstallPluginData.is(':checked');
var $dialog = $('#dialogUninstallPlugins').dialog({
resizable: false,
modal: true,
width: 350,
autoOpen: false,
buttons: {
"Uninstall": function () {
pluginId = uninstallPlugin.val();
pluginName = uninstallPlugin.find('option:selected').text();
pluginUninstallData = uninstallPluginData.is(':checked');
if (!pluginId) {
alert('Select a plugin to uninstall');
} else {
uninstallPluginConfirm.text(pluginName + ' [' + pluginId + ']');
if (pluginUninstallData)
uninstallPluginDataConfirm.show();
else
uninstallPluginDataConfirm.hide();
$dialogConfirm.dialog('open');
$(this).dialog("close");
}
},
Cancel: function () {
uninstallPluginData.prop('checked', false);
$('#uninstallPluginDataAlert').hide();
$(this).dialog("close");
}
}
});
$dialogConfirm = $('#dialogUninstallPluginConfirm').dialog({
resizable: false,
modal: true,
width: 350,
autoOpen: false,
buttons: {
"Confirm Uninstall": function () {
var url = uninstallUrl + pluginId;
if (pluginUninstallData)
url += '?UninstallData=true'
else
url += '?UninstallData=false'
window.location.href = url;
$(this).dialog("disable");
},
Cancel: function () {
uninstallPluginData.prop('checked', false);
$('#uninstallPluginDataAlert').hide();
$(this).dialog("close");
}
}
});
uninstallPlugin = $('#uninstallPlugin');
uninstallPluginData = $('#uninstallPluginData');
uninstallPluginConfirm = $('#uninstallPluginConfirm');
uninstallPluginDataConfirm = $('#uninstallPluginDataConfirm');
$('#buttonUninstall').click(function () {
$dialog.dialog('open');
return false;
});
$('#uninstallPluginData').change(function () {
if ($(this).is(':checked')) {
$('#uninstallPluginDataAlert').slideDown();
if (!pluginId) {
alert('Select a plugin to uninstall');
} else {
$('#uninstallPluginDataAlert').slideUp();
uninstallPluginConfirm.text(pluginName + ' [' + pluginId + ']');
if (pluginUninstallData)
uninstallPluginDataConfirm.show();
else
uninstallPluginDataConfirm.hide();
$dialogConfirm.dialog('open');
$(this).dialog("close");
}
});
});
},
Cancel: function () {
uninstallPluginData.prop('checked', false);
$('#uninstallPluginDataAlert').hide();
$(this).dialog("close");
}
}
});
$dialogConfirm = $('#dialogUninstallPluginConfirm').dialog({
resizable: false,
modal: true,
width: 350,
autoOpen: false,
buttons: {
"Confirm Uninstall": function () {
var url = uninstallUrl + pluginId;
if (pluginUninstallData)
url += '?UninstallData=true'
else
url += '?UninstallData=false'
window.location.href = url;
$(this).dialog("disable");
},
Cancel: function () {
uninstallPluginData.prop('checked', false);
$('#uninstallPluginDataAlert').hide();
$(this).dialog("close");
}
}
});
uninstallPlugin = $('#uninstallPlugin');
uninstallPluginData = $('#uninstallPluginData');
uninstallPluginConfirm = $('#uninstallPluginConfirm');
uninstallPluginDataConfirm = $('#uninstallPluginDataConfirm');
$('#buttonUninstall').click(function () {
$dialog.dialog('open');
return false;
});
$('#uninstallPluginData').change(function () {
if ($(this).is(':checked')) {
$('#uninstallPluginDataAlert').slideDown();
} else {
$('#uninstallPluginDataAlert').slideUp();
}
});
});
</script>
}
if (Model.PluginUpdates.Count > 0)
{
<div id="updateAvailableContainer">
<div>@(Model.PluginUpdates.Count) plugin update@(Model.PluginUpdates.Count == 1 ? " is" : "s are") available</div>
@Html.ActionLinkButton("Update Now", MVC.API.Plugin.UpdateAll())
@if (canInstall)
{
@Html.ActionLinkButton("Update Now", MVC.API.Plugin.UpdateAll())
}
else
{
<div class="smallMessage">You do not have sufficient permission to install these updates.</div>
}
</div>
<script>
(function () {
@@ -172,9 +194,12 @@
}
</div>
<div class="actionBar">
@if (Model.PluginManifests.Count > 0)
@if (canUninstall && Model.PluginManifests.Count > 0)
{
@Html.ActionLinkButton("Uninstall Plugins", MVC.Config.Plugins.Index(), "buttonUninstall")
}
@Html.ActionLinkButton("Install Plugins", MVC.Config.Plugins.Install())
@if (canInstall)
{
@Html.ActionLinkButton("Install Plugins", MVC.Config.Plugins.Install())
}
</div>
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,18 +28,20 @@ namespace Disco.Web.Areas.Config.Views.Plugins
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
#line 2 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
using Disco.Services.Plugins;
#line default
#line hidden
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/Plugins/Index.cshtml")]
public partial class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Plugins.IndexViewModel>
public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.Plugins.IndexViewModel>
{
public Index()
{
@@ -49,6 +51,12 @@ namespace Disco.Web.Areas.Config.Views.Plugins
#line 3 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Authorization.Require(Claims.Config.Plugin.Show);
var canConfig = Authorization.Has(Claims.Config.Plugin.Configure);
var canUninstall = Authorization.Has(Claims.Config.Plugin.Uninstall);
var canInstall = Authorization.Has(Claims.Config.Plugin.Install);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Plugins");
@@ -61,13 +69,13 @@ WriteLiteral(" id=\"plugins\"");
WriteLiteral(">\r\n");
#line 7 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 13 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line default
#line hidden
#line 7 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 13 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
if (Model.PluginManifests.Count == 0)
{
@@ -84,7 +92,7 @@ WriteLiteral(" style=\"width: 450px; padding: 100px 0;\"");
WriteLiteral(">\r\n <h2>No Plugins are Installed</h2>\r\n </div> \r\n");
#line 13 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 19 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
}
else
{
@@ -105,13 +113,13 @@ WriteLiteral(" id=\"pageMenu\"");
WriteLiteral(">\r\n <tr>\r\n");
#line 24 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 30 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line default
#line hidden
#line 24 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 30 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
for (int i = 0; i < 3; i++)
{
@@ -121,13 +129,13 @@ WriteLiteral(">\r\n <tr>\r\n");
WriteLiteral(" <td>\r\n");
#line 27 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 33 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line default
#line hidden
#line 27 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 33 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
int itemsForThisColumn = itemsPerColumn + (pluginGroups.Count % 3 > i ? 1 : 0);
for (int i2 = 0; i2 < itemsForThisColumn && itemNextId < pluginGroups.Count; i2++)
@@ -145,7 +153,7 @@ WriteLiteral(" class=\"pageMenuArea\"");
WriteLiteral(">\r\n <h2>");
#line 34 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 40 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Plugins.PluginFeatureCategoryDisplayName(pluginGroup.Item1));
@@ -154,35 +162,37 @@ WriteLiteral(">\r\n <h2>");
WriteLiteral("</h2>\r\n");
#line 35 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 41 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line default
#line hidden
#line 35 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 41 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
foreach (var pluginDefinition in pluginGroup.Item2)
{
if (canConfig)
{
#line default
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 1439), Tuple.Create("\"", 1508)
WriteAttribute("href", Tuple.Create(" href=\"", 1807), Tuple.Create("\"", 1876)
#line 37 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
, Tuple.Create(Tuple.Create("", 1446), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Configure(pluginDefinition.Id))
#line 45 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
, Tuple.Create(Tuple.Create("", 1814), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Configure(pluginDefinition.Id))
#line default
#line hidden
, 1446), false)
, 1814), false)
);
WriteLiteral(">\r\n <h3>");
#line 38 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 46 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(pluginDefinition.Name);
@@ -190,6 +200,33 @@ WriteLiteral(">\r\n <h3>");
#line hidden
WriteLiteral("</h3>\r\n </a>\r\n");
#line 48 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <h3>");
#line 51 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(pluginDefinition.Name);
#line default
#line hidden
WriteLiteral("</h3>\r\n");
#line 52 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"pageMenuBlurb\"");
@@ -201,7 +238,7 @@ WriteLiteral(" class=\"pluginVersion\"");
WriteLiteral(">v");
#line 41 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 54 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(pluginDefinition.VersionFormatted);
@@ -210,7 +247,7 @@ WriteLiteral(">v");
WriteLiteral("</span> | ");
#line 41 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 54 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(pluginDefinition.Author);
@@ -218,14 +255,14 @@ WriteLiteral("</span> | ");
#line hidden
WriteLiteral(" | <a");
WriteAttribute("href", Tuple.Create(" href=\"", 1836), Tuple.Create("\"", 1864)
WriteAttribute("href", Tuple.Create(" href=\"", 2432), Tuple.Create("\"", 2460)
#line 41 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
, Tuple.Create(Tuple.Create("", 1843), Tuple.Create<System.Object, System.Int32>(pluginDefinition.Url
#line 54 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
, Tuple.Create(Tuple.Create("", 2439), Tuple.Create<System.Object, System.Int32>(pluginDefinition.Url
#line default
#line hidden
, 1843), false)
, 2439), false)
);
WriteLiteral(" target=\"_blank\"");
@@ -233,7 +270,7 @@ WriteLiteral(" target=\"_blank\"");
WriteLiteral(">More Information</a>\r\n </div>\r\n");
#line 43 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 56 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
}
@@ -242,7 +279,7 @@ WriteLiteral(">More Information</a>\r\n </div
WriteLiteral(" </div>\r\n");
#line 45 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 58 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
}
@@ -251,7 +288,7 @@ WriteLiteral(" </div>\r\n");
WriteLiteral("\r\n </td>\r\n");
#line 48 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 61 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
}
@@ -259,6 +296,14 @@ WriteLiteral("\r\n </td>\r\n");
#line hidden
WriteLiteral(" </tr>\r\n </table>\r\n");
#line 64 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
if (canUninstall)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"dialogUninstallPlugins\"");
@@ -270,7 +315,7 @@ WriteLiteral(">\r\n <div>\r\n");
WriteLiteral(" ");
#line 53 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 68 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Html.DropDownList("uninstallPlugin", Model.PluginManifests.ToSelectListItems(null, true, "Select a Plugin to Uninstall")));
@@ -346,61 +391,54 @@ WriteLiteral(" <script>\r\n $(function () {\r\n
" var uninstallUrl = \'");
#line 74 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 89 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Url.Action(MVC.API.Plugin.Uninstall()));
#line default
#line hidden
WriteLiteral("/\';\r\n var uninstallPlugin, uninstallPluginData, $dialogConfirm, un" +
"installPluginConfirm, uninstallPluginDataConfirm;\r\n\r\n var pluginI" +
"d, pluginName, pluginUninstallData;\r\n\r\n var $dialog = $(\'#dialogU" +
"ninstallPlugins\').dialog({\r\n resizable: false,\r\n " +
" modal: true,\r\n width: 350,\r\n autoOp" +
"en: false,\r\n buttons: {\r\n \"Uninstall\":" +
" function () {\r\n pluginId = uninstallPlugin.val();\r\n " +
" pluginName = uninstallPlugin.find(\'option:selected\')." +
"text();\r\n pluginUninstallData = uninstallPluginData.i" +
"s(\':checked\');\r\n\r\n if (!pluginId) {\r\n " +
" alert(\'Select a plugin to uninstall\');\r\n " +
" } else {\r\n uninstallPluginConfirm.text(plugin" +
"Name + \' [\' + pluginId + \']\');\r\n if (pluginUninst" +
"allData)\r\n uninstallPluginDataConfirm.show();" +
"\r\n else\r\n unin" +
"stallPluginDataConfirm.hide();\r\n\r\n $dialogConfirm" +
".dialog(\'open\');\r\n $(this).dialog(\"close\");\r\n " +
" }\r\n },\r\n C" +
"ancel: function () {\r\n uninstallPluginData.prop(\'chec" +
"ked\', false);\r\n $(\'#uninstallPluginDataAlert\').hide()" +
";\r\n $(this).dialog(\"close\");\r\n " +
" }\r\n }\r\n });\r\n\r\n $dialogConfirm" +
" = $(\'#dialogUninstallPluginConfirm\').dialog({\r\n resizable: f" +
"alse,\r\n modal: true,\r\n width: 350,\r\n " +
" autoOpen: false,\r\n buttons: {\r\n " +
" \"Confirm Uninstall\": function () {\r\n var url " +
"= uninstallUrl + pluginId;\r\n if (pluginUninstallData)" +
"\r\n url += \'?UninstallData=true\'\r\n " +
" else\r\n url += \'?UninstallData=false\'\r" +
"\n\r\n window.location.href = url;\r\n " +
" $(this).dialog(\"disable\");\r\n },\r\n " +
" Cancel: function () {\r\n uninstallPluginData.p" +
"rop(\'checked\', false);\r\n $(\'#uninstallPluginDataAlert" +
"\').hide();\r\n $(this).dialog(\"close\");\r\n " +
" }\r\n }\r\n });\r\n\r\n unins" +
"tallPlugin = $(\'#uninstallPlugin\');\r\n uninstallPluginData = $(\'#u" +
"ninstallPluginData\');\r\n uninstallPluginConfirm = $(\'#uninstallPlu" +
"ginConfirm\');\r\n uninstallPluginDataConfirm = $(\'#uninstallPluginD" +
"ataConfirm\');\r\n\r\n $(\'#buttonUninstall\').click(function () {\r\n " +
" $dialog.dialog(\'open\');\r\n return false;\r\n " +
" });\r\n\r\n $(\'#uninstallPluginData\').change(function () " +
"{\r\n if ($(this).is(\':checked\')) {\r\n $(" +
"\'#uninstallPluginDataAlert\').slideDown();\r\n } else {\r\n " +
" $(\'#uninstallPluginDataAlert\').slideUp();\r\n " +
"}\r\n });\r\n });\r\n </script>\r\n");
WriteLiteral("/\';\r\n var uninstallPlugin, uninstallPluginData, $dialogConfirm, uninstallP" +
"luginConfirm, uninstallPluginDataConfirm;\r\n\r\n var pluginId, pluginName, p" +
"luginUninstallData;\r\n\r\n var $dialog = $(\'#dialogUninstallPlugins\').dialog" +
"({\r\n resizable: false,\r\n modal: true,\r\n width: " +
"350,\r\n autoOpen: false,\r\n buttons: {\r\n \"Uni" +
"nstall\": function () {\r\n pluginId = uninstallPlugin.val();\r\n " +
" pluginName = uninstallPlugin.find(\'option:selected\').text();\r" +
"\n pluginUninstallData = uninstallPluginData.is(\':checked\');\r\n" +
"\r\n if (!pluginId) {\r\n alert(\'Select a " +
"plugin to uninstall\');\r\n } else {\r\n un" +
"installPluginConfirm.text(pluginName + \' [\' + pluginId + \']\');\r\n " +
" if (pluginUninstallData)\r\n uninstallPluginDat" +
"aConfirm.show();\r\n else\r\n unin" +
"stallPluginDataConfirm.hide();\r\n\r\n $dialogConfirm.dialog(" +
"\'open\');\r\n $(this).dialog(\"close\");\r\n " +
"}\r\n },\r\n Cancel: function () {\r\n " +
" uninstallPluginData.prop(\'checked\', false);\r\n $(\'#uninstall" +
"PluginDataAlert\').hide();\r\n $(this).dialog(\"close\");\r\n " +
" }\r\n }\r\n });\r\n\r\n $dialogConfirm = $(\'#dialogUni" +
"nstallPluginConfirm\').dialog({\r\n resizable: false,\r\n modal" +
": true,\r\n width: 350,\r\n autoOpen: false,\r\n butt" +
"ons: {\r\n \"Confirm Uninstall\": function () {\r\n " +
"var url = uninstallUrl + pluginId;\r\n if (pluginUninstallData)" +
"\r\n url += \'?UninstallData=true\'\r\n else" +
"\r\n url += \'?UninstallData=false\'\r\n\r\n w" +
"indow.location.href = url;\r\n $(this).dialog(\"disable\");\r\n " +
" },\r\n Cancel: function () {\r\n unins" +
"tallPluginData.prop(\'checked\', false);\r\n $(\'#uninstallPluginD" +
"ataAlert\').hide();\r\n $(this).dialog(\"close\");\r\n " +
" }\r\n }\r\n });\r\n\r\n uninstallPlugin = $(\'#uninstallPlugin" +
"\');\r\n uninstallPluginData = $(\'#uninstallPluginData\');\r\n uninstall" +
"PluginConfirm = $(\'#uninstallPluginConfirm\');\r\n uninstallPluginDataConfir" +
"m = $(\'#uninstallPluginDataConfirm\');\r\n\r\n $(\'#buttonUninstall\').click(fun" +
"ction () {\r\n $dialog.dialog(\'open\');\r\n return false;\r\n " +
" });\r\n\r\n $(\'#uninstallPluginData\').change(function () {\r\n i" +
"f ($(this).is(\':checked\')) {\r\n $(\'#uninstallPluginDataAlert\').sli" +
"deDown();\r\n } else {\r\n $(\'#uninstallPluginDataAlert\')." +
"slideUp();\r\n }\r\n });\r\n });\r\n </script>\r\n");
#line 154 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 169 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
}
if (Model.PluginUpdates.Count > 0)
{
@@ -414,7 +452,7 @@ WriteLiteral(" id=\"updateAvailableContainer\"");
WriteLiteral(">\r\n <div>");
#line 158 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 173 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Model.PluginUpdates.Count);
@@ -423,7 +461,7 @@ WriteLiteral(">\r\n <div>");
WriteLiteral(" plugin update");
#line 158 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 173 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Model.PluginUpdates.Count == 1 ? " is" : "s are");
@@ -431,16 +469,51 @@ WriteLiteral(" plugin update");
#line hidden
WriteLiteral(" available</div>\r\n");
WriteLiteral(" ");
#line 159 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Html.ActionLinkButton("Update Now", MVC.API.Plugin.UpdateAll()));
#line 174 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line default
#line hidden
#line 174 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
if (canInstall)
{
#line default
#line hidden
#line 176 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Html.ActionLinkButton("Update Now", MVC.API.Plugin.UpdateAll()));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n");
#line 176 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">You do not have sufficient permission to install these updates.</div>\r\n");
#line 181 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
WriteLiteral(@" <script>
(function () {
@@ -454,7 +527,7 @@ WriteLiteral(@" <script>
");
#line 170 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 192 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
}
}
@@ -468,28 +541,28 @@ WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
#line 175 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 197 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line default
#line hidden
#line 175 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
if (Model.PluginManifests.Count > 0)
#line 197 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
if (canUninstall && Model.PluginManifests.Count > 0)
{
#line default
#line hidden
#line 177 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 199 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Html.ActionLinkButton("Uninstall Plugins", MVC.Config.Plugins.Index(), "buttonUninstall"));
#line default
#line hidden
#line 177 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line 199 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
}
@@ -499,13 +572,29 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 179 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Html.ActionLinkButton("Install Plugins", MVC.Config.Plugins.Install()));
#line 201 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
if (canInstall)
{
#line default
#line hidden
#line 203 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Html.ActionLinkButton("Install Plugins", MVC.Config.Plugins.Install()));
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n");
#line 203 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("</div>\r\n");
}
}
@@ -1,6 +1,10 @@
@model Disco.Web.Areas.Config.Models.Plugins.InstallModel
@using Disco.Services.Plugins;
@{
Authorization.Require(Claims.Config.Plugin.Install);
var canInstallLocal = Authorization.Has(Claims.Config.Plugin.InstallLocal);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Plugins", MVC.Config.Plugins.Index(), "Install Plugin");
}
<div id="pluginCatalog">
@@ -31,14 +35,20 @@
var installedPlugin = Plugins.PluginInstalled(plugin.Id) ? Plugins.GetPlugin(plugin.Id) : null;
<div class="pageMenuArea pluginItem@(installedPlugin != null ? " pluginInstalled" : string.Empty)">
<h2 class="pluginName">@plugin.Name
@if (installedPlugin == null){
<a class="pluginInstallLink button" href="@(Url.Action(MVC.API.Plugin.Install(plugin.Id)))">Install</a>
}else{
if (Version.Parse(plugin.LatestVersion) > installedPlugin.Version){
<a class="pluginUpdateLink button" href="@(Url.Action(MVC.API.Plugin.Update(plugin.Id)))">Update</a>
}else{
<a class="pluginInstalledLink button disabled" href="#">Installed</a>
@if (installedPlugin == null)
{
<a class="pluginInstallLink button" href="@(Url.Action(MVC.API.Plugin.Install(plugin.Id)))">Install</a>
}
else
{
if (Version.Parse(plugin.LatestVersion) > installedPlugin.Version)
{
<a class="pluginUpdateLink button" href="@(Url.Action(MVC.API.Plugin.Update(plugin.Id)))">Update</a>
}
else
{
<a class="pluginInstalledLink button disabled" href="#">Installed</a>
}
}
</h2>
<div class="pluginItemBlurb">@(new HtmlString(plugin.Blurb))</div>
@@ -63,19 +73,22 @@
<strong>Only Install plugins from a trusted source.</strong>
</div>
</div>
<div id="dialogUploadPlugin" title="Install Plugin Package">
<div style="padding-bottom: 10px;">
@using (Html.BeginForm(MVC.API.Plugin.InstallLocal(), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<label for="pluginFile">Plugin Package: </label>
<input id="pluginFile" name="Plugin" type="file" />
}
@if (canInstallLocal)
{
<div id="dialogUploadPlugin" title="Install Plugin Package">
<div style="padding-bottom: 10px;">
@using (Html.BeginForm(MVC.API.Plugin.InstallLocal(), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<label for="pluginFile">Plugin Package: </label>
<input id="pluginFile" name="Plugin" type="file" />
}
</div>
<div style="padding: 0.7em 0.7em; margin-top: 8px;" class="ui-state-error ui-corner-all">
<span style="margin-right: 0.3em; margin-bottom: 2em; float: left;" class="ui-icon ui-icon-alert"></span>Warning: All plugins run with the same level of network privileges as the Disco Web App.<br />
<strong>Only install plugins from a trusted source.</strong>
</div>
</div>
<div style="padding: 0.7em 0.7em; margin-top: 8px;" class="ui-state-error ui-corner-all">
<span style="margin-right: 0.3em; margin-bottom: 2em; float: left;" class="ui-icon ui-icon-alert"></span>Warning: All plugins run with the same level of network privileges as the Disco Web App.<br />
<strong>Only install plugins from a trusted source.</strong>
</div>
</div>
}
<script>
$(function () {
var $selectedPlugin;
@@ -132,6 +145,8 @@
return false;
});
@if (canInstallLocal)
{<text>
// Upload
var $dialogUpload = $('#dialogUploadPlugin').dialog({
resizable: false,
@@ -157,9 +172,13 @@
$dialogUpload.dialog('open');
return false;
});
</text>}
});
</script>
<div class="actionBar">
@Html.ActionLinkButton("Update Catalogue", MVC.API.Plugin.UpdateLibraryCatalogue())
@Html.ActionLinkButton("Install Plugin Package", MVC.API.Plugin.InstallLocal(), "buttonUpload")
@if (canInstallLocal)
{
@Html.ActionLinkButton("Install Plugin Package", MVC.API.Plugin.InstallLocal(), "buttonUpload")
}
</div>
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,18 +28,20 @@ namespace Disco.Web.Areas.Config.Views.Plugins
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
#line 2 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
using Disco.Services.Plugins;
#line default
#line hidden
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/Plugins/Install.cshtml")]
public partial class Install : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Plugins.InstallModel>
public partial class Install : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.Plugins.InstallModel>
{
public Install()
{
@@ -49,6 +51,10 @@ namespace Disco.Web.Areas.Config.Views.Plugins
#line 3 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
Authorization.Require(Claims.Config.Plugin.Install);
var canInstallLocal = Authorization.Has(Claims.Config.Plugin.InstallLocal);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Plugins", MVC.Config.Plugins.Index(), "Install Plugin");
@@ -69,7 +75,7 @@ WriteLiteral(" href=\"http://discoict.com.au/\"");
WriteLiteral(">http://discoict.com.au</a>] was last updated ");
#line 7 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 11 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Catalogue.ResponseTimestamp));
@@ -78,13 +84,13 @@ WriteLiteral(">http://discoict.com.au</a>] was last updated ");
WriteLiteral("\r\n </h4>\r\n");
#line 9 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 13 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line default
#line hidden
#line 9 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 13 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
if (Model.Catalogue.Plugins.Count == 0)
{
@@ -100,7 +106,7 @@ WriteLiteral(" style=\"width: 450px; padding: 100px 0;\"");
WriteLiteral(">\r\n <h2>No Plugins are Available</h2>\r\n </div> \r\n");
#line 14 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 18 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}
else
{
@@ -118,13 +124,13 @@ WriteLiteral(" id=\"pageMenu\"");
WriteLiteral(">\r\n <tr>\r\n");
#line 22 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 26 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line default
#line hidden
#line 22 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 26 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
for (int i = 0; i < 3; i++)
{
@@ -134,13 +140,13 @@ WriteLiteral(">\r\n <tr>\r\n");
WriteLiteral(" <td>\r\n");
#line 25 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 29 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line default
#line hidden
#line 25 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 29 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
int itemsForThisColumn = itemsPerColumn + (plugins.Count % 3 > i ? 1 : 0);
for (int i2 = 0; i2 < itemsForThisColumn && itemNextId < plugins.Count; i2++)
@@ -154,16 +160,16 @@ WriteLiteral(" <td>\r\n");
#line hidden
WriteLiteral(" <div");
WriteAttribute("class", Tuple.Create(" class=\"", 1449), Tuple.Create("\"", 1542)
, Tuple.Create(Tuple.Create("", 1457), Tuple.Create("pageMenuArea", 1457), true)
, Tuple.Create(Tuple.Create(" ", 1469), Tuple.Create("pluginItem", 1470), true)
WriteAttribute("class", Tuple.Create(" class=\"", 1592), Tuple.Create("\"", 1685)
, Tuple.Create(Tuple.Create("", 1600), Tuple.Create("pageMenuArea", 1600), true)
, Tuple.Create(Tuple.Create(" ", 1612), Tuple.Create("pluginItem", 1613), true)
#line 32 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
, Tuple.Create(Tuple.Create("", 1480), Tuple.Create<System.Object, System.Int32>(installedPlugin != null ? " pluginInstalled" : string.Empty
#line 36 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
, Tuple.Create(Tuple.Create("", 1623), Tuple.Create<System.Object, System.Int32>(installedPlugin != null ? " pluginInstalled" : string.Empty
#line default
#line hidden
, 1480), false)
, 1623), false)
);
WriteLiteral(">\r\n <h2");
@@ -173,7 +179,7 @@ WriteLiteral(" class=\"pluginName\"");
WriteLiteral(">");
#line 33 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 37 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
Write(plugin.Name);
@@ -182,38 +188,42 @@ WriteLiteral(">");
WriteLiteral("\r\n");
#line 34 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 38 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line default
#line hidden
#line 34 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
if (installedPlugin == null){
#line 38 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
if (installedPlugin == null)
{
#line default
#line hidden
WriteLiteral(" <a");
WriteLiteral(" <a");
WriteLiteral(" class=\"pluginInstallLink button\"");
WriteAttribute("href", Tuple.Create(" href=\"", 1754), Tuple.Create("\"", 1809)
WriteAttribute("href", Tuple.Create(" href=\"", 1939), Tuple.Create("\"", 1994)
#line 35 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
, Tuple.Create(Tuple.Create("", 1761), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Plugin.Install(plugin.Id))
#line 40 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
, Tuple.Create(Tuple.Create("", 1946), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Plugin.Install(plugin.Id))
#line default
#line hidden
, 1761), false)
, 1946), false)
);
WriteLiteral(">Install</a>\r\n");
#line 36 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}else{
if (Version.Parse(plugin.LatestVersion) > installedPlugin.Version){
#line 41 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}
else
{
if (Version.Parse(plugin.LatestVersion) > installedPlugin.Version)
{
#line default
@@ -222,21 +232,23 @@ WriteLiteral(" <a");
WriteLiteral(" class=\"pluginUpdateLink button\"");
WriteAttribute("href", Tuple.Create(" href=\"", 2047), Tuple.Create("\"", 2101)
WriteAttribute("href", Tuple.Create(" href=\"", 2354), Tuple.Create("\"", 2408)
#line 38 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
, Tuple.Create(Tuple.Create("", 2054), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Plugin.Update(plugin.Id))
#line 46 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
, Tuple.Create(Tuple.Create("", 2361), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Plugin.Update(plugin.Id))
#line default
#line hidden
, 2054), false)
, 2361), false)
);
WriteLiteral(">Update</a> \r\n");
#line 39 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}else{
#line 47 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}
else
{
#line default
@@ -250,8 +262,8 @@ WriteLiteral(" href=\"#\"");
WriteLiteral(">Installed</a> \r\n");
#line 41 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}
#line 51 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}
}
@@ -264,7 +276,7 @@ WriteLiteral(" class=\"pluginItemBlurb\"");
WriteLiteral(">");
#line 44 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 54 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
Write(new HtmlString(plugin.Blurb));
@@ -281,7 +293,7 @@ WriteLiteral(" class=\"pluginId\"");
WriteLiteral(">");
#line 46 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 56 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
Write(plugin.Id);
@@ -294,7 +306,7 @@ WriteLiteral(" class=\"pluginVersion\"");
WriteLiteral(">v");
#line 46 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 56 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
Write(plugin.LatestVersion);
@@ -303,7 +315,7 @@ WriteLiteral(">v");
WriteLiteral("</span> | ");
#line 46 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 56 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
Write(plugin.Author);
@@ -311,14 +323,14 @@ WriteLiteral("</span> | ");
#line hidden
WriteLiteral(" | <a");
WriteAttribute("href", Tuple.Create(" href=\"", 2716), Tuple.Create("\"", 2734)
WriteAttribute("href", Tuple.Create(" href=\"", 3115), Tuple.Create("\"", 3133)
#line 46 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
, Tuple.Create(Tuple.Create("", 2723), Tuple.Create<System.Object, System.Int32>(plugin.Url
#line 56 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
, Tuple.Create(Tuple.Create("", 3122), Tuple.Create<System.Object, System.Int32>(plugin.Url
#line default
#line hidden
, 2723), false)
, 3122), false)
);
WriteLiteral(" target=\"_blank\"");
@@ -327,7 +339,7 @@ WriteLiteral(">More Information</a>\r\n </div>\r\
" </div>\r\n");
#line 49 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 59 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}
@@ -336,7 +348,7 @@ WriteLiteral(">More Information</a>\r\n </div>\r\
WriteLiteral("\r\n </td>\r\n");
#line 52 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 62 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}
@@ -345,7 +357,7 @@ WriteLiteral("\r\n </td>\r\n");
WriteLiteral(" </tr>\r\n </table>\r\n");
#line 55 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 65 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}
@@ -379,39 +391,49 @@ WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
WriteLiteral("></span>Warning: All plugins run with the same level of network privileges as the" +
" Disco Web App.<br />\r\n <strong>Only Install plugins from a trusted sourc" +
"e.</strong>\r\n </div>\r\n</div>\r\n<div");
"e.</strong>\r\n </div>\r\n</div>\r\n");
#line 76 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
if (canInstallLocal)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"dialogUploadPlugin\"");
WriteLiteral(" title=\"Install Plugin Package\"");
WriteLiteral(">\r\n <div");
WriteLiteral(">\r\n <div");
WriteLiteral(" style=\"padding-bottom: 10px;\"");
WriteLiteral(">\r\n");
#line 68 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 80 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line default
#line hidden
#line 68 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
using (Html.BeginForm(MVC.API.Plugin.InstallLocal(), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
#line 80 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
using (Html.BeginForm(MVC.API.Plugin.InstallLocal(), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
#line default
#line hidden
WriteLiteral(" <label");
WriteLiteral(" <label");
WriteLiteral(" for=\"pluginFile\"");
WriteLiteral(">Plugin Package: </label>\r\n");
WriteLiteral(" <input");
WriteLiteral(" <input");
WriteLiteral(" id=\"pluginFile\"");
@@ -422,65 +444,112 @@ WriteLiteral(" type=\"file\"");
WriteLiteral(" />\r\n");
#line 72 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}
#line 84 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n <div");
WriteLiteral(" </div>\r\n <div");
WriteLiteral(" style=\"padding: 0.7em 0.7em; margin-top: 8px;\"");
WriteLiteral(" class=\"ui-state-error ui-corner-all\"");
WriteLiteral(">\r\n <span");
WriteLiteral(">\r\n <span");
WriteLiteral(" style=\"margin-right: 0.3em; margin-bottom: 2em; float: left;\"");
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
WriteLiteral("></span>Warning: All plugins run with the same level of network privileges as the" +
" Disco Web App.<br />\r\n <strong>Only install plugins from a trusted sourc" +
"e.</strong>\r\n </div>\r\n</div>\r\n<script>\r\n $(function () {\r\n var $sel" +
"ectedPlugin;\r\n var $selectedPluginUrl;\r\n\r\n // Install\r\n var" +
" $dialogInstall = $(\'#dialogInstallPlugin\').dialog({\r\n resizable: fal" +
"se,\r\n modal: true,\r\n width: 350,\r\n autoOpen: fa" +
"lse,\r\n buttons: {\r\n \"Install\": function () {\r\n " +
" if ($selectedPlugin == null || !$selectedPluginUrl) {\r\n " +
" $(this).dialog(\"close\");\r\n return;\r\n " +
" }\r\n $(this).dialog(\"disable\");\r\n\r\n " +
" window.location.href = $selectedPluginUrl;\r\n },\r\n " +
" Cancel: function () {\r\n $selectedPlugin = null;\r\n " +
" $(this).dialog(\"close\");\r\n }\r\n }\r\n }" +
");\r\n $(\'#pageMenu\').find(\'a.pluginInstallLink\').click(function () {\r\n " +
" $this = $(this);\r\n\r\n $selectedPlugin = $this.closest(\'.plugin" +
"Item\');\r\n $selectedPluginUrl = $this.attr(\'href\');\r\n\r\n $(\'" +
"#dialogInstallPluginName\').text($selectedPlugin.find(\'.pluginName\').text());\r\n " +
" $(\'#dialogInstallPluginDetails\').text($selectedPlugin.find(\'.pluginId\'" +
").text() + \' | \' + $selectedPlugin.find(\'.pluginVersion\').text());\r\n\r\n " +
" $dialogInstall.dialog(\'option\', \'title\', \'Install this Plugin?\');\r\n " +
" $dialogInstall.dialog(\'open\');\r\n\r\n return false;\r\n });\r\n " +
" $(\'#pageMenu\').find(\'a.pluginUpdateLink\').click(function () {\r\n $t" +
"his = $(this);\r\n\r\n $selectedPlugin = $this.closest(\'.pluginItem\');\r\n " +
" $selectedPluginUrl = $this.attr(\'href\');\r\n\r\n $(\'#dialogIns" +
"tallPluginName\').text($selectedPlugin.find(\'.pluginName\').text());\r\n " +
"$(\'#dialogInstallPluginDetails\').text($selectedPlugin.find(\'.pluginId\').text() +" +
" \' | \' + $selectedPlugin.find(\'.pluginVersion\').text());\r\n\r\n $dialogI" +
"nstall.dialog(\'option\', \'title\', \'Update this Plugin?\');\r\n $dialogIns" +
"tall.dialog(\'open\');\r\n\r\n return false;\r\n });\r\n\r\n // Upl" +
"oad\r\n var $dialogUpload = $(\'#dialogUploadPlugin\').dialog({\r\n " +
"resizable: false,\r\n modal: true,\r\n width: 350,\r\n " +
" autoOpen: false,\r\n buttons: {\r\n \"Upload & Install\": " +
"function () {\r\n var pluginFile = $(\'#pluginFile\');\r\n " +
" if (pluginFile.val()) {\r\n pluginFile.closest(\'" +
"form\').submit();\r\n $(this).dialog(\'disable\');\r\n " +
" } else {\r\n alert(\'Choose a Plugin Package to Up" +
"load\');\r\n }\r\n },\r\n Cancel: func" +
"tion () {\r\n $(this).dialog(\"close\");\r\n }\r\n " +
" }\r\n });\r\n $(\'#buttonUpload\').click(function () {\r\n " +
" $dialogUpload.dialog(\'open\');\r\n return false;\r\n });\r\n }" +
");\r\n</script>\r\n<div");
" Disco Web App.<br />\r\n <strong>Only install plugins from a trusted s" +
"ource.</strong>\r\n </div>\r\n </div>\r\n");
#line 91 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}
#line default
#line hidden
WriteLiteral("<script>\r\n $(function () {\r\n var $selectedPlugin;\r\n var $selecte" +
"dPluginUrl;\r\n\r\n // Install\r\n var $dialogInstall = $(\'#dialogInstal" +
"lPlugin\').dialog({\r\n resizable: false,\r\n modal: true,\r\n " +
" width: 350,\r\n autoOpen: false,\r\n buttons: {\r\n " +
" \"Install\": function () {\r\n if ($selectedPlugin ==" +
" null || !$selectedPluginUrl) {\r\n $(this).dialog(\"close\")" +
";\r\n return;\r\n }\r\n $" +
"(this).dialog(\"disable\");\r\n\r\n window.location.href = $selecte" +
"dPluginUrl;\r\n },\r\n Cancel: function () {\r\n " +
" $selectedPlugin = null;\r\n $(this).dialog(\"close\")" +
";\r\n }\r\n }\r\n });\r\n $(\'#pageMenu\').find(\'a" +
".pluginInstallLink\').click(function () {\r\n $this = $(this);\r\n\r\n " +
" $selectedPlugin = $this.closest(\'.pluginItem\');\r\n $selectedPlug" +
"inUrl = $this.attr(\'href\');\r\n\r\n $(\'#dialogInstallPluginName\').text($s" +
"electedPlugin.find(\'.pluginName\').text());\r\n $(\'#dialogInstallPluginD" +
"etails\').text($selectedPlugin.find(\'.pluginId\').text() + \' | \' + $selectedPlugin" +
".find(\'.pluginVersion\').text());\r\n\r\n $dialogInstall.dialog(\'option\', " +
"\'title\', \'Install this Plugin?\');\r\n $dialogInstall.dialog(\'open\');\r\n\r" +
"\n return false;\r\n });\r\n $(\'#pageMenu\').find(\'a.pluginUp" +
"dateLink\').click(function () {\r\n $this = $(this);\r\n\r\n $sel" +
"ectedPlugin = $this.closest(\'.pluginItem\');\r\n $selectedPluginUrl = $t" +
"his.attr(\'href\');\r\n\r\n $(\'#dialogInstallPluginName\').text($selectedPlu" +
"gin.find(\'.pluginName\').text());\r\n $(\'#dialogInstallPluginDetails\').t" +
"ext($selectedPlugin.find(\'.pluginId\').text() + \' | \' + $selectedPlugin.find(\'.pl" +
"uginVersion\').text());\r\n\r\n $dialogInstall.dialog(\'option\', \'title\', \'" +
"Update this Plugin?\');\r\n $dialogInstall.dialog(\'open\');\r\n\r\n " +
" return false;\r\n });\r\n\r\n");
#line 148 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line default
#line hidden
#line 148 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
if (canInstallLocal)
{
#line default
#line hidden
WriteLiteral(@"
// Upload
var $dialogUpload = $('#dialogUploadPlugin').dialog({
resizable: false,
modal: true,
width: 350,
autoOpen: false,
buttons: {
""Upload & Install"": function () {
var pluginFile = $('#pluginFile');
if (pluginFile.val()) {
pluginFile.closest('form').submit();
$(this).dialog('disable');
} else {
alert('Choose a Plugin Package to Upload');
}
},
Cancel: function () {
$(this).dialog(""close"");
}
}
});
$('#buttonUpload').click(function () {
$dialogUpload.dialog('open');
return false;
});
");
#line 175 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}
#line default
#line hidden
WriteLiteral(" });\r\n</script>\r\n<div");
WriteLiteral(" class=\"actionBar\"");
@@ -489,7 +558,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 163 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line 179 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
Write(Html.ActionLinkButton("Update Catalogue", MVC.API.Plugin.UpdateLibraryCatalogue()));
@@ -497,16 +566,36 @@ Write(Html.ActionLinkButton("Update Catalogue", MVC.API.Plugin.UpdateLibraryCata
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 164 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
Write(Html.ActionLinkButton("Install Plugin Package", MVC.API.Plugin.InstallLocal(), "buttonUpload"));
#line 180 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
#line default
#line hidden
#line 180 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
if (canInstallLocal)
{
#line default
#line hidden
#line 182 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
Write(Html.ActionLinkButton("Install Plugin Package", MVC.API.Plugin.InstallLocal(), "buttonUpload"));
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n");
#line 182 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
}
#line default
#line hidden
WriteLiteral("</div>\r\n");
}
}
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.Plugins
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Plugins/Configure.cshtml")]
public partial class Configure : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Plugins.PluginConfigurationViewModel>
public partial class Configure : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.Plugins.PluginConfigurationViewModel>
{
public Configure()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Areas.Config.Views.Plugins
#line 2 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
Authorization.Require(Claims.Config.Plugin.Configure);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Plugins", MVC.Config.Plugins.Index(), Model.Manifest.Name);
@@ -51,7 +55,7 @@ namespace Disco.Web.Areas.Config.Views.Plugins
WriteLiteral("\r\n");
#line 5 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
#line 7 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
using (Html.BeginForm())
{
@@ -59,14 +63,14 @@ WriteLiteral("\r\n");
#line default
#line hidden
#line 7 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
#line 9 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
Write(Html.ValidationSummary(false));
#line default
#line hidden
#line 7 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
#line 9 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
@@ -81,7 +85,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 9 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
#line 11 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
Write(Html.PartialCompiled(Model.PluginViewType, Model.PluginViewModel));
@@ -104,7 +108,7 @@ WriteLiteral(" value=\"Save Configuration\"");
WriteLiteral(" />\r\n </div>\r\n");
#line 14 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
#line 16 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
}
#line default
@@ -1,5 +1,7 @@
@model Disco.Web.Areas.Config.Models.Shared.LogEventsModel
@{
Authorization.Require(Claims.Config.Logging.Show);
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
var uniqueId = Guid.NewGuid().ToString("N");
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.Shared
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Shared/LogEvents.cshtml")]
public partial class LogEvents : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Shared.LogEventsModel>
public partial class LogEvents : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.Shared.LogEventsModel>
{
public LogEvents()
{
@@ -43,6 +45,8 @@ namespace Disco.Web.Areas.Config.Views.Shared
#line 2 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Authorization.Require(Claims.Config.Logging.Show);
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
var uniqueId = Guid.NewGuid().ToString("N");
@@ -52,15 +56,15 @@ namespace Disco.Web.Areas.Config.Views.Shared
#line hidden
WriteLiteral("\r\n<div");
WriteAttribute("id", Tuple.Create(" id=\"", 251), Tuple.Create("\"", 277)
, Tuple.Create(Tuple.Create("", 256), Tuple.Create("LogEvents_", 256), true)
WriteAttribute("id", Tuple.Create(" id=\"", 313), Tuple.Create("\"", 339)
, Tuple.Create(Tuple.Create("", 318), Tuple.Create("LogEvents_", 318), true)
#line 7 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
, Tuple.Create(Tuple.Create("", 266), Tuple.Create<System.Object, System.Int32>(uniqueId
#line 9 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
, Tuple.Create(Tuple.Create("", 328), Tuple.Create<System.Object, System.Int32>(uniqueId
#line default
#line hidden
, 266), false)
, 328), false)
);
WriteLiteral(" class=\"logEventsViewport\"");
@@ -90,21 +94,21 @@ WriteLiteral(">Message\r\n </th>\r\n </tr>\r\n
WriteLiteral(" class=\"logEventsViewportContainer\"");
WriteAttribute("style", Tuple.Create(" style=\"", 752), Tuple.Create("\"", 962)
WriteAttribute("style", Tuple.Create(" style=\"", 814), Tuple.Create("\"", 1024)
#line 22 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
, Tuple.Create(Tuple.Create("", 760), Tuple.Create<System.Object, System.Int32>(Model.ViewPortWidth.HasValue ? string.Format("width:{0}px;", Model.ViewPortWidth.Value) : null
#line 24 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
, Tuple.Create(Tuple.Create("", 822), Tuple.Create<System.Object, System.Int32>(Model.ViewPortWidth.HasValue ? string.Format("width:{0}px;", Model.ViewPortWidth.Value) : null
#line default
#line hidden
, 760), false)
, 822), false)
#line 22 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
, Tuple.Create(Tuple.Create("", 857), Tuple.Create<System.Object, System.Int32>(Model.ViewPortHeight.HasValue ? string.Format("height:{0}px;", Model.ViewPortHeight.Value - 18) : null
#line 24 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
, Tuple.Create(Tuple.Create("", 919), Tuple.Create<System.Object, System.Int32>(Model.ViewPortHeight.HasValue ? string.Format("height:{0}px;", Model.ViewPortHeight.Value - 18) : null
#line default
#line hidden
, 857), false)
, 919), false)
);
WriteLiteral(">\r\n <div");
@@ -156,13 +160,13 @@ WriteLiteral("></td>\r\n </tr>\r\n </tbody>\r\n
"\r\n");
#line 39 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line 41 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line default
#line hidden
#line 39 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line 41 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
var eventTypesFilterJson = (Model.EventTypesFilter != null) ? Newtonsoft.Json.JsonConvert.SerializeObject(Model.EventTypesFilter.Select(et => et.Id).ToArray()) : "null";
@@ -176,7 +180,7 @@ WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var logEventsHost = $(\'LogEvents_");
#line 44 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line 46 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(uniqueId);
@@ -185,7 +189,7 @@ WriteLiteral(">\r\n $(function () {\r\n var logEventsHost = $(
WriteLiteral("\');\r\n var logModuleId = \'");
#line 45 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line 47 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.ModuleFilter != null ? Model.ModuleFilter.ModuleId.ToString() : null);
@@ -194,7 +198,7 @@ WriteLiteral("\');\r\n var logModuleId = \'");
WriteLiteral("\';\r\n var logModuleLiveGroupName = \'");
#line 46 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line 48 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.ModuleFilter != null ? Model.ModuleFilter.LiveLogGroupName : Disco.BI.Interop.SignalRHandlers.LogNotifications.AllNotifications);
@@ -203,7 +207,7 @@ WriteLiteral("\';\r\n var logModuleLiveGroupName = \'");
WriteLiteral("\';\r\n var logEventTypeFiltered = ");
#line 47 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line 49 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(eventTypesFilterJson);
@@ -212,7 +216,7 @@ WriteLiteral("\';\r\n var logEventTypeFiltered = ");
WriteLiteral(";\r\n var logStartFiler = ");
#line 48 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line 50 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(AjaxHelpers.JsonDate(Model.StartFilter));
@@ -221,7 +225,7 @@ WriteLiteral(";\r\n var logStartFiler = ");
WriteLiteral(";\r\n var logEndFiler = ");
#line 49 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line 51 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(AjaxHelpers.JsonDate(Model.EndFilter));
@@ -230,7 +234,7 @@ WriteLiteral(";\r\n var logEndFiler = ");
WriteLiteral(";\r\n var logTakeFiler = \'");
#line 50 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line 52 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.TakeFilter);
@@ -240,7 +244,7 @@ WriteLiteral("\';\r\n var liveConnection = null;\r\n var l
"tion = \'");
#line 52 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line 54 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.JavascriptLiveEventFunctionName);
@@ -249,7 +253,7 @@ WriteLiteral("\';\r\n var liveConnection = null;\r\n var l
WriteLiteral("\';\r\n var useLive = (\'True\'===\'");
#line 53 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line 55 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.IsLive);
@@ -292,7 +296,7 @@ WriteLiteral(@"');
url: '");
#line 87 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line 89 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Url.Action(MVC.API.Logging.RetrieveEvents()));
@@ -329,7 +333,7 @@ WriteLiteral(@"',
liveConnection = $.connection('");
#line 115 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line 117 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Url.Content("~/API/Logging/Notifications"));
@@ -1,140 +1,146 @@
@model Disco.Web.Areas.Config.Models.SystemConfig.IndexModel
@{
Authorization.Require(Claims.Config.System.Show);
var canConfigProxy = Authorization.Has(Claims.Config.System.ConfigureProxy);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "System");
}
@using (Html.BeginForm())
{
<div class="form" style="width: 450px">
<table>
<div class="form" style="width: 450px">
<table>
<tr>
<th style="width: 135px">Disco Version:
</th>
<td>
<div>
<code>@Model.DiscoVersion.ToString(4)</code>
</div>
<div class="smallMessage" title="@Model.DiscoVersionBuilt.ToFullDateTime()">
Built @Model.DiscoVersionBuilt.ToFuzzy("Unknown")
</div>
</td>
</tr>
<tr>
<th style="width: 135px">Database Connection:
</th>
<td>
<table class="sub">
<tr>
<th>Server:</th>
<td><span class="code">@Model.DatabaseServer</span></td>
</tr>
<tr>
<th>Database:</th>
<td><span class="code">@Model.DatabaseName</span></td>
</tr>
<tr>
<th>Authentication:</th>
<td>@Model.DatabaseAuthentication</td>
</tr>
@{if (Model.DatabaseSqlAuthUsername != null)
{
<tr>
<th>SQL&nbsp;User:</th>
<td><span class="code">@Model.DatabaseSqlAuthUsername</span></td>
</tr>
}
}
</table>
</td>
</tr>
<tr>
<th style="width: 135px">Data Store Location:
</th>
<td>
<span class="code">@Model.DataStoreLocation</span>
@* @Html.EditorFor(m => m.DataStoreLocation)<br />
@Html.ValidationMessageFor(m => m.DataStoreLocation)*@
</td>
</tr>
</table>
</div>
<div class="form" style="width: 450px; margin-top: 15px;">
<h2>Updates</h2>
<table>
@{
if (Model.UpdateLatestResponse == null)
{
<tr>
<th style="width: 135px">Disco Version:
<th style="width: 135px">Last Check:
</th>
<td>
<div class="error"><span class="icon error" style="margin-right: 6px;"></span>Never</div>
</td>
</tr>
}
else
{
<tr>
<th style="width: 135px">Last Run:
</th>
<td>
<span>@CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.ResponseTimestamp)</span>
</td>
</tr>
if (Model.UpdateLatestResponse.IsUpdatable(typeof(DiscoApplication).Assembly.GetName().Version))
{
<tr>
<th style="width: 135px">Update Available:
</th>
<td>
<div>
<code>@Model.DiscoVersion.ToString(4)</code>
<span class="icon warning" style="margin-right: 6px;"></span>Version @(Model.UpdateLatestResponse.Version) is available
</div>
<div class="smallMessage" title="@Model.DiscoVersionBuilt.ToFullDateTime()">
Built @Model.DiscoVersionBuilt.ToFuzzy("Unknown")
</div>
</td>
</tr>
<tr>
<th style="width: 135px">Database Connection:
</th>
<td>
<table class="sub">
<tr>
<th>Server:</th>
<td><span class="code">@Model.DatabaseServer</span></td>
</tr>
<tr>
<th>Database:</th>
<td><span class="code">@Model.DatabaseName</span></td>
</tr>
<tr>
<th>Authentication:</th>
<td>@Model.DatabaseAuthentication</td>
</tr>
@{if (Model.DatabaseSqlAuthUsername != null)
{
<tr>
<th>SQL&nbsp;User:</th>
<td><span class="code">@Model.DatabaseSqlAuthUsername</span></td>
</tr>
}
}
</table>
</td>
</tr>
<tr>
<th style="width: 135px">Data Store Location:
</th>
<td>
<span class="code">@Model.DataStoreLocation</span>
@* @Html.EditorFor(m => m.DataStoreLocation)<br />
@Html.ValidationMessageFor(m => m.DataStoreLocation)*@
</td>
</tr>
</table>
</div>
<div class="form" style="width: 450px; margin-top: 15px;">
<h2>Updates</h2>
<table>
@{
if (Model.UpdateLatestResponse == null)
{
<tr>
<th style="width: 135px">Last Check:
</th>
<td>
<div class="error"><span class="icon error" style="margin-right: 6px;"></span>Never</div>
</td>
</tr>
}
else
{
<tr>
<th style="width: 135px">Last Run:
</th>
<td>
<span>@CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.ResponseTimestamp)</span>
</td>
</tr>
if (Model.UpdateLatestResponse.IsUpdatable(typeof(DiscoApplication).Assembly.GetName().Version))
{
<tr>
<th style="width: 135px">Update Available:
</th>
<td>
<div>
<span class="icon warning" style="margin-right: 6px;"></span>Version @(Model.UpdateLatestResponse.Version) is available
</div>
<div class="smallMessage">
[Released @(CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.VersionReleasedTimestamp))]
</div>
<div class="smallMessage">@(new HtmlString(Model.UpdateLatestResponse.Blurb))</div>
<a href="@(Model.UpdateLatestResponse.UrlLink)" target="_blank">Download Now</a>
</td>
</tr>
}
else
{
<tr>
<th style="width: 135px">Status:
</th>
<td>
<span class="icon success" style="margin-right: 6px;"></span><span>The latest version is installed</span>
</td>
</tr>
}
}
}
<tr>
<th style="width: 135px">Check for Update:@{
if (Model.UpdateBetaDeployment)
{
<div class="alert"><span class="icon warning" style="margin-right: 6px;"></span>Beta Deployment</div>
}
}
</th>
<td>
@{
if (Model.UpdateRunningStatus == null)
{
<div>@Html.ActionLink("Check Now", MVC.API.System.UpdateCheck())</div>
}
else
{
<div>Running now - @Html.ActionLink("Check Status", MVC.Config.Logging.TaskStatus(Model.UpdateRunningStatus.SessionId))</div>
}
}
<div class="smallMessage">
Next Scheduled: @CommonHelpers.FriendlyDate(Model.UpdateNextScheduled, "Unknown")
[Released @(CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.VersionReleasedTimestamp))]
</div>
<div class="smallMessage">@(new HtmlString(Model.UpdateLatestResponse.Blurb))</div>
<a href="@(Model.UpdateLatestResponse.UrlLink)" target="_blank">Download Now</a>
</td>
</tr>
</table>
</div>
}
else
{
<tr>
<th style="width: 135px">Status:
</th>
<td>
<span class="icon success" style="margin-right: 6px;"></span><span>The latest version is installed</span>
</td>
</tr>
}
}
}
<tr>
<th style="width: 135px">Check for Update:@{
if (Model.UpdateBetaDeployment)
{
<div class="alert"><span class="icon warning" style="margin-right: 6px;"></span>Beta Deployment</div>
}
}
</th>
<td>
@{
if (Model.UpdateRunningStatus == null)
{
<div>@Html.ActionLink("Check Now", MVC.API.System.UpdateCheck())</div>
}
else
{
<div>Running now - @Html.ActionLink("Check Status", MVC.Config.Logging.TaskStatus(Model.UpdateRunningStatus.SessionId))</div>
}
}
<div class="smallMessage">
Next Scheduled: @CommonHelpers.FriendlyDate(Model.UpdateNextScheduled, "Unknown")
</div>
</td>
</tr>
</table>
</div>
@if (canConfigProxy)
{
using (Html.BeginForm())
{
<div class="form" style="width: 450px; margin-top: 15px;">
<h2>Proxy Settings</h2>
<table>
@@ -170,10 +176,52 @@
@Html.ValidationMessageFor(m => m.ProxyPassword)
</td>
</tr>
<tr>
<th style="width: 135px">&nbsp;
</th>
<td>
<input type="submit" class="button small" value="Save Proxy Settings" />
</td>
</tr>
</table>
</div>
<div class="actionBar">
@Html.ActionLinkButton("Update Device Last Network Logons", MVC.API.System.UpdateLastNetworkLogonDates())
<input type="submit" class="button" value="Save Configuration" />
}
}
else
{
<div class="form" style="width: 450px; margin-top: 15px;">
<h2>Proxy Settings</h2>
<table>
<tr>
<th style="width: 135px">Address:
</th>
<td>
@Html.DisplayFor(m => m.ProxyAddress)
</td>
</tr>
<tr>
<th style="width: 135px">Port:
</th>
<td>
@Html.DisplayFor(m => m.ProxyPort)
</td>
</tr>
<tr>
<th style="width: 135px">Username:
</th>
<td>
@Html.DisplayFor(m => m.ProxyUsername)
</td>
</tr>
<tr>
<th style="width: 135px">Password:
</th>
<td>********
</td>
</tr>
</table>
</div>
}
<div class="actionBar">
@Html.ActionLinkButton("Update Device Last Network Logons", MVC.API.System.UpdateLastNetworkLogonDates())
</div>
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,12 +28,14 @@ namespace Disco.Web.Areas.Config.Views.SystemConfig
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/SystemConfig/Index.cshtml")]
public partial class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.SystemConfig.IndexModel>
public partial class Index : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.SystemConfig.IndexModel>
{
public Index()
{
@@ -43,204 +45,195 @@ namespace Disco.Web.Areas.Config.Views.SystemConfig
#line 2 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Authorization.Require(Claims.Config.System.Show);
var canConfigProxy = Authorization.Has(Claims.Config.System.ConfigureProxy);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "System");
#line default
#line hidden
WriteLiteral("\r\n");
#line 5 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
using (Html.BeginForm())
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral("\r\n<div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 450px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Disco Version:\r\n </th>\r\n <td>\r\n " +
" <div>\r\n <code>");
WriteLiteral(">Disco Version:\r\n </th>\r\n <td>\r\n <div>\r\n " +
" <code>");
#line 14 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.DiscoVersion.ToString(4));
#line 16 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.DiscoVersion.ToString(4));
#line default
#line hidden
WriteLiteral("</code>\r\n </div>\r\n <div");
WriteLiteral("</code>\r\n </div>\r\n <div");
WriteLiteral(" class=\"smallMessage\"");
WriteAttribute("title", Tuple.Create(" title=\"", 546), Tuple.Create("\"", 595)
WriteAttribute("title", Tuple.Create(" title=\"", 616), Tuple.Create("\"", 665)
#line 16 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
, Tuple.Create(Tuple.Create("", 554), Tuple.Create<System.Object, System.Int32>(Model.DiscoVersionBuilt.ToFullDateTime()
#line 18 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
, Tuple.Create(Tuple.Create("", 624), Tuple.Create<System.Object, System.Int32>(Model.DiscoVersionBuilt.ToFullDateTime()
#line default
#line hidden
, 554), false)
, 624), false)
);
WriteLiteral(">\r\n Built ");
WriteLiteral(">\r\n Built ");
#line 17 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.DiscoVersionBuilt.ToFuzzy("Unknown"));
#line 19 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.DiscoVersionBuilt.ToFuzzy("Unknown"));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n </td>\r\n </tr>\r\n " +
" <tr>\r\n <th");
WriteLiteral("\r\n </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th");
WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Database Connection:\r\n </th>\r\n <td>\r\n " +
" <table");
WriteLiteral(">Database Connection:\r\n </th>\r\n <td>\r\n <tabl" +
"e");
WriteLiteral(" class=\"sub\"");
WriteLiteral(">\r\n <tr>\r\n <th>Server:</th>\r\n " +
" <td><span");
WriteLiteral(">\r\n <tr>\r\n <th>Server:</th>\r\n " +
" <td><span");
WriteLiteral(" class=\"code\"");
WriteLiteral(">");
#line 28 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.DatabaseServer);
#line 30 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.DatabaseServer);
#line default
#line hidden
WriteLiteral("</span></td>\r\n </tr>\r\n <tr>\r\n " +
" <th>Database:</th>\r\n <td><span");
WriteLiteral("</span></td>\r\n </tr>\r\n <tr>\r\n " +
" <th>Database:</th>\r\n <td><span");
WriteLiteral(" class=\"code\"");
WriteLiteral(">");
#line 32 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.DatabaseName);
#line 34 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.DatabaseName);
#line default
#line hidden
WriteLiteral("</span></td>\r\n </tr>\r\n <tr>\r\n " +
" <th>Authentication:</th>\r\n <td>" +
"");
#line 36 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.DatabaseAuthentication);
#line default
#line hidden
WriteLiteral("</td>\r\n </tr>\r\n");
WriteLiteral("</span></td>\r\n </tr>\r\n <tr>\r\n " +
" <th>Authentication:</th>\r\n <td>");
#line 38 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 38 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.DatabaseSqlAuthUsername != null)
{
Write(Model.DatabaseAuthentication);
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>SQL&nbsp;Us" +
"er:</th>\r\n <td><span");
WriteLiteral("</td>\r\n </tr>\r\n");
#line 40 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 40 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.DatabaseSqlAuthUsername != null)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>SQL&nbsp;User:</th>" +
"\r\n <td><span");
WriteLiteral(" class=\"code\"");
WriteLiteral(">");
#line 42 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.DatabaseSqlAuthUsername);
#line default
#line hidden
WriteLiteral("</span></td>\r\n </tr> \r\n");
#line 44 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
Write(Model.DatabaseSqlAuthUsername);
#line default
#line hidden
WriteLiteral("\r\n </table>\r\n </td>\r\n </tr>\r\n " +
" <tr>\r\n <th");
WriteLiteral("</span></td>\r\n </tr> \r\n");
#line 46 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n </table>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th");
WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Data Store Location:\r\n </th>\r\n <td>\r\n " +
" <span");
WriteLiteral(">Data Store Location:\r\n </th>\r\n <td>\r\n <span" +
"");
WriteLiteral(" class=\"code\"");
WriteLiteral(">");
#line 53 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.DataStoreLocation);
#line 55 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.DataStoreLocation);
#line default
#line hidden
WriteLiteral("</span>\r\n ");
WriteLiteral("</span>\r\n ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n");
WriteLiteral(" <div");
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n</div>\r\n<div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 450px; margin-top: 15px;\"");
WriteLiteral(">\r\n <h2>Updates</h2>\r\n <table>\r\n");
WriteLiteral(">\r\n <h2>Updates</h2>\r\n <table>\r\n");
#line 63 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 65 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 63 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.UpdateLatestResponse == null)
{
#line 65 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.UpdateLatestResponse == null)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th");
WriteLiteral(" <tr>\r\n <th");
WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Last Check:\r\n </th>\r\n <td>\r\n " +
" <div");
WriteLiteral(">Last Check:\r\n </th>\r\n <td>\r\n <d" +
"iv");
WriteLiteral(" class=\"error\"");
@@ -250,47 +243,47 @@ WriteLiteral(" class=\"icon error\"");
WriteLiteral(" style=\"margin-right: 6px;\"");
WriteLiteral("></span>Never</div>\r\n </td>\r\n </tr>\r\n");
WriteLiteral("></span>Never</div>\r\n </td>\r\n </tr>\r\n");
#line 73 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
else
{
#line 75 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th");
WriteLiteral(" <tr>\r\n <th");
WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Last Run:\r\n </th>\r\n <td>\r\n " +
" <span>");
WriteLiteral(">Last Run:\r\n </th>\r\n <td>\r\n <spa" +
"n>");
#line 80 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.ResponseTimestamp));
#line 82 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.ResponseTimestamp));
#line default
#line hidden
WriteLiteral("</span>\r\n </td>\r\n </tr>\r\n");
WriteLiteral("</span>\r\n </td>\r\n </tr>\r\n");
#line 83 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.UpdateLatestResponse.IsUpdatable(typeof(DiscoApplication).Assembly.GetName().Version))
{
#line 85 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.UpdateLatestResponse.IsUpdatable(typeof(DiscoApplication).Assembly.GetName().Version))
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th");
WriteLiteral(" <tr>\r\n <th");
WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Update Available:\r\n </th>\r\n <td>\r\n " +
" <div>\r\n <span");
WriteLiteral(">Update Available:\r\n </th>\r\n <td>\r\n " +
" <div>\r\n <span");
WriteLiteral(" class=\"icon warning\"");
@@ -299,101 +292,100 @@ WriteLiteral(" style=\"margin-right: 6px;\"");
WriteLiteral("></span>Version ");
#line 90 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.UpdateLatestResponse.Version);
#line 92 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Model.UpdateLatestResponse.Version);
#line default
#line hidden
WriteLiteral(" is available\r\n </div>\r\n <div");
WriteLiteral(" is available\r\n </div>\r\n <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n [Released ");
WriteLiteral(">\r\n [Released ");
#line 93 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.VersionReleasedTimestamp));
#line 95 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(CommonHelpers.FriendlyDate(Model.UpdateLatestResponse.VersionReleasedTimestamp));
#line default
#line hidden
WriteLiteral("]\r\n </div>\r\n <div");
WriteLiteral("]\r\n </div>\r\n <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">");
#line 95 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(new HtmlString(Model.UpdateLatestResponse.Blurb));
#line 97 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(new HtmlString(Model.UpdateLatestResponse.Blurb));
#line default
#line hidden
WriteLiteral("</div>\r\n <a");
WriteLiteral("</div>\r\n <a");
WriteAttribute("href", Tuple.Create(" href=\"", 4129), Tuple.Create("\"", 4173)
WriteAttribute("href", Tuple.Create(" href=\"", 3813), Tuple.Create("\"", 3857)
#line 96 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
, Tuple.Create(Tuple.Create("", 4136), Tuple.Create<System.Object, System.Int32>(Model.UpdateLatestResponse.UrlLink
#line 98 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
, Tuple.Create(Tuple.Create("", 3820), Tuple.Create<System.Object, System.Int32>(Model.UpdateLatestResponse.UrlLink
#line default
#line hidden
, 4136), false)
, 3820), false)
);
WriteLiteral(" target=\"_blank\"");
WriteLiteral(">Download Now</a>\r\n </td>\r\n </tr>\r\n");
WriteLiteral(">Download Now</a>\r\n </td>\r\n </tr>\r\n");
#line 99 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
else
{
#line 101 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th");
WriteLiteral(" <tr>\r\n <th");
WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Status:\r\n </th>\r\n <td>\r\n " +
" <span");
WriteLiteral(">Status:\r\n </th>\r\n <td>\r\n <span");
WriteLiteral(" class=\"icon success\"");
WriteLiteral(" style=\"margin-right: 6px;\"");
WriteLiteral("></span><span>The latest version is installed</span>\r\n </td>\r\n" +
" </tr>\r\n");
WriteLiteral("></span><span>The latest version is installed</span>\r\n </td>\r\n " +
" </tr>\r\n");
#line 109 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
}
#line 111 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
}
#line default
#line hidden
WriteLiteral("\r\n <tr>\r\n <th");
WriteLiteral("\r\n <tr>\r\n <th");
WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Check for Update:");
#line 113 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.UpdateBetaDeployment)
{
#line 115 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.UpdateBetaDeployment)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" <div");
WriteLiteral(" class=\"alert\"");
@@ -406,34 +398,34 @@ WriteLiteral(" style=\"margin-right: 6px;\"");
WriteLiteral("></span>Beta Deployment</div>\r\n");
#line 117 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
#line 119 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n </th>\r\n <td>\r\n");
#line 123 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
WriteLiteral("\r\n </th>\r\n <td>\r\n");
#line 121 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line default
#line hidden
#line 121 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.UpdateRunningStatus == null)
{
#line 123 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (Model.UpdateRunningStatus == null)
{
#line default
#line hidden
WriteLiteral(" <div>");
WriteLiteral(" <div>");
#line 124 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ActionLink("Check Now", MVC.API.System.UpdateCheck()));
#line 126 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ActionLink("Check Now", MVC.API.System.UpdateCheck()));
#line default
@@ -441,19 +433,19 @@ WriteLiteral(" <div>");
WriteLiteral("</div>\r\n");
#line 125 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
else
{
#line 127 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <div>Running now - ");
WriteLiteral(" <div>Running now - ");
#line 128 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ActionLink("Check Status", MVC.Config.Logging.TaskStatus(Model.UpdateRunningStatus.SessionId)));
#line 130 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ActionLink("Check Status", MVC.Config.Logging.TaskStatus(Model.UpdateRunningStatus.SessionId)));
#line default
@@ -461,28 +453,38 @@ WriteLiteral(" <div>Running now - ");
WriteLiteral("</div>\r\n");
#line 129 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
#line 131 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n Next Scheduled: ");
WriteLiteral(">\r\n Next Scheduled: ");
#line 132 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(CommonHelpers.FriendlyDate(Model.UpdateNextScheduled, "Unknown"));
#line 134 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(CommonHelpers.FriendlyDate(Model.UpdateNextScheduled, "Unknown"));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n </td>\r\n </tr>\r\n <" +
"/table>\r\n </div>\r\n");
WriteLiteral("\r\n </div>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>\r" +
"\n");
#line 140 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
if (canConfigProxy)
{
using (Html.BeginForm())
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"form\"");
@@ -499,7 +501,7 @@ WriteLiteral(">Address:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 145 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 151 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.EditorFor(m => m.ProxyAddress));
@@ -510,7 +512,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 146 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 152 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ValidationMessageFor(m => m.ProxyAddress));
@@ -526,7 +528,7 @@ WriteLiteral(">Port:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 153 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 159 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.EditorFor(m => m.ProxyPort));
@@ -537,7 +539,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 154 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 160 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ValidationMessageFor(m => m.ProxyPort));
@@ -553,7 +555,7 @@ WriteLiteral(">Username:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 161 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 167 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.EditorFor(m => m.ProxyUsername));
@@ -564,7 +566,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 162 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 168 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ValidationMessageFor(m => m.ProxyUsername));
@@ -580,7 +582,7 @@ WriteLiteral(">Password:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 169 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 175 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.EditorFor(m => m.ProxyPassword));
@@ -591,46 +593,123 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 170 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
#line 176 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ValidationMessageFor(m => m.ProxyPassword));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n");
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
"");
WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">&nbsp;\r\n </th>\r\n <td>\r\n <input");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button small\"");
WriteLiteral(" value=\"Save Proxy Settings\"");
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n");
#line 188 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
}
else
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 450px; margin-top: 15px;\"");
WriteLiteral(">\r\n <h2>Proxy Settings</h2>\r\n <table>\r\n <tr>\r\n " +
" <th");
WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Address:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 199 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.DisplayFor(m => m.ProxyAddress));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
"");
WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Port:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 206 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.DisplayFor(m => m.ProxyPort));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
"");
WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Username:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 213 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.DisplayFor(m => m.ProxyUsername));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
"");
WriteLiteral(" style=\"width: 135px\"");
WriteLiteral(">Password:\r\n </th>\r\n <td>********\r\n " +
"</td>\r\n </tr>\r\n </table>\r\n </div>\r\n");
#line 224 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("<div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
WriteLiteral(" ");
#line 176 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ActionLinkButton("Update Device Last Network Logons", MVC.API.System.UpdateLastNetworkLogonDates()));
#line 226 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
Write(Html.ActionLinkButton("Update Device Last Network Logons", MVC.API.System.UpdateLastNetworkLogonDates()));
#line default
#line hidden
WriteLiteral("\r\n <input");
WriteLiteral("\r\n</div>\r\n");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Save Configuration\"");
WriteLiteral(" />\r\n </div>\r\n");
#line 179 "..\..\Areas\Config\Views\SystemConfig\Index.cshtml"
}
#line default
#line hidden
}
}
}
+4 -2
View File
@@ -10,10 +10,12 @@
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<pages pageBaseType="Disco.Services.Web.WebViewPage">
<namespaces>
<add namespace="Disco.Models.Repository" />
<add namespace="Disco.BI.Extensions" />
<add namespace="Disco.Models.Repository" />
<add namespace="Disco.Services.Authorization" />
<add namespace="Disco.Services.Web" />
<add namespace="Disco.Web" />
<add namespace="Disco.Web.Extensions" />
<add namespace="System.Web.Mvc" />
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18033
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -28,6 +28,8 @@ namespace Disco.Web.Areas.Config.Views
using System.Web.WebPages;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;