f1ee2937cd
New icon, theme, and fuzzy time. Add moment.js
684 lines
28 KiB
C#
684 lines
28 KiB
C#
#pragma warning disable 1591
|
|
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by a tool.
|
|
// Runtime Version:4.0.30319.34003
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
namespace Disco.Web.Areas.Config.Views.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;
|
|
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)
|
|
{
|
|
var displayName = sg.Id == sg.Name ? sg.Id : string.Format("{0} [{1}]", sg.Name, sg.Id);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <li");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 2187), Tuple.Create("\"", 2227)
|
|
|
|
#line 51 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 2195), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
|
|
|
|
#line default
|
|
#line hidden
|
|
, 2195), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 51 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
|
|
if (sg.IsGroup)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 53 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
|
|
Write(displayName);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 53 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <a");
|
|
|
|
WriteAttribute("href", Tuple.Create(" href=\"", 2724), Tuple.Create("\"", 2794)
|
|
|
|
#line 57 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 2731), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.User.Show(sg.Id))
|
|
|
|
#line default
|
|
#line hidden
|
|
, 2731), false)
|
|
, Tuple.Create(Tuple.Create("", 2766), Tuple.Create("#UserDetailTab-Authorization", 2766), true)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 57 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
|
|
Write(displayName);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</a>\r\n");
|
|
|
|
|
|
#line 58 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</li>\r\n");
|
|
|
|
|
|
#line 59 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </ul>\r\n");
|
|
|
|
|
|
#line 61 "..\..\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 68 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 68 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
|
|
foreach (var sg in Model.Subjects)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <li");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 3687), Tuple.Create("\"", 3727)
|
|
|
|
#line 70 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 3695), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
|
|
|
|
#line default
|
|
#line hidden
|
|
, 3695), false)
|
|
);
|
|
|
|
WriteLiteral(" data-subjectid=\"");
|
|
|
|
|
|
#line 70 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
|
|
Write(sg.Id);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 70 "..\..\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 71 "..\..\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=\"", 4386), Tuple.Create("\"", 4483)
|
|
|
|
#line 78 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 4395), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.AuthorizationRole.UpdateSubjects(Model.Token.Role.Id, null, true))
|
|
|
|
#line default
|
|
#line hidden
|
|
, 4395), 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 107 "..\..\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 165 "..\..\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 232 "..\..\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 236 "..\..\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');
|
|
},
|
|
keyboard: false
|
|
});
|
|
|
|
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 266 "..\..\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 292 "..\..\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
|