Update #43: Disco Administrators are configurable

This commit is contained in:
Gary Sharp
2014-04-11 19:57:51 +10:00
parent e984221c95
commit 41dc002ef8
17 changed files with 742 additions and 111 deletions
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34011
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -538,63 +538,63 @@ WriteLiteral("\',\r\n minLength: 2,\r
" }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: \'");
" function add(){\r\n var id = textAdd.val()" +
";\r\n\r\n $.ajax({\r\n " +
" url: \'");
#line 173 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
#line 172 "..\..\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 \r\n " +
" var liIcon = $(\'<i>\').addClass(\'fa fa-lg\');\r\n " +
" if (response.Type === \'user\')\r\n " +
" liIcon.addClass(\'fa-user\');\r\n " +
" else\r\n liIc" +
"on.addClass(\'fa-users\');\r\n\r\n var li =" +
" $(\'<li>\')\r\n .append(liIcon)\r\n " +
" .append($(\'<span>\').text(response.I" +
"d == response.Name ? response.Id : response.Name + \' [\' + response.Id + \']\'))\r\n" +
" .append($(\'<i>\').addClass(\'fa fa" +
"-times-circle remove\'))\r\n .addCla" +
"ss(response.Type)\r\n .attr(\'data-s" +
"ubjectid\', response.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 alr" +
"eady been added\');\r\n }\r\n " +
" }else{\r\n alert(\'Unknow" +
"n Id\');\r\n }\r\n " +
"}).fail(function(jqXHR, textStatus, errorThrown){\r\n " +
" alert(\'Error: \' + errorThrown);\r\n });\r\n " +
" }\r\n\r\n function updateNoS" +
"ubjects(){\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\').empty();\r\n\r\n list.find(\'li[data-su" +
"bjectstatus!=\"removed\"]\').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(su" +
"bjectId));\r\n\r\n }).get();\r\n\r\n " +
" form.submit();\r\n\r\n dialog.dialog(\"disa" +
"ble\");\r\n dialog.dialog(\"option\", \"buttons\", null)" +
";\r\n }\r\n\r\n $(function(){\r\n " +
" $(\'#Config_AuthRoles_Subjects_Update\').click(show" +
"Dialog);\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("\',\r\n method: \'post\',\r\n " +
" data: { Id: id }\r\n }).done(function(r" +
"esponse){\r\n if (response){\r\n " +
" if (list.find(\'li[data-subjectid=\"\'+response.Id+\'\"]\').len" +
"gth == 0){\r\n \r\n " +
" var liIcon = $(\'<i>\').addClass(\'fa fa-lg\');\r\n " +
" if (response.Type === \'user\')\r\n " +
" liIcon.addClass(\'fa-user\');\r\n " +
" else\r\n liI" +
"con.addClass(\'fa-users\');\r\n\r\n var li " +
"= $(\'<li>\')\r\n .append(liIcon)\r\n " +
" .append($(\'<span>\').text(response." +
"Id == response.Name ? response.Id : response.Name + \' [\' + response.Id + \']\'))\r" +
"\n .append($(\'<i>\').addClass(\'fa f" +
"a-times-circle remove\'))\r\n .addCl" +
"ass(response.Type)\r\n .attr(\'data-" +
"subjectid\', response.Id)\r\n .attr(" +
"\'data-subjectstatus\', \'new\');\r\n\r\n lis" +
"t.append(li);\r\n\r\n updateNoSubjects();" +
" \r\n " +
" }else{\r\n alert(\'That subject has al" +
"ready been added\');\r\n }\r\n " +
" }else{\r\n alert(\'Unkno" +
"wn Id\');\r\n }\r\n " +
" }).fail(function(jqXHR, textStatus, errorThrown){\r\n " +
" alert(\'Error: \' + errorThrown);\r\n });\r\n " +
" }\r\n\r\n function updateNo" +
"Subjects(){\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_Updat" +
"e_Dialog_Form\').empty();\r\n\r\n list.find(\'li[data-s" +
"ubjectstatus!=\"removed\"]\').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(s" +
"ubjectId));\r\n\r\n }).get();\r\n\r\n " +
" form.submit();\r\n\r\n dialog.dialog(\"dis" +
"able\");\r\n dialog.dialog(\"option\", \"buttons\", null" +
");\r\n }\r\n\r\n $(function(){\r\n" +
" $(\'#Config_AuthRoles_Subjects_Update\').click(sho" +
"wDialog);\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\"");
@@ -613,7 +613,7 @@ WriteLiteral(" class=\"button small disabled\"");
WriteLiteral(">Save Changes</a>");
#line 248 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
#line 247 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
@@ -623,7 +623,7 @@ WriteLiteral("\r\n </div>\r\n <script>\r\n
"(){\r\n var claimNodes = ");
#line 252 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
#line 251 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(new HtmlString(Newtonsoft.Json.JsonConvert.SerializeObject(Model.ClaimNavigatorFancyTreeNodes)));
@@ -662,7 +662,7 @@ WriteLiteral(@";
url: '");
#line 282 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
#line 281 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(Url.Action(MVC.API.AuthorizationRole.UpdateClaims(Model.Token.Role.Id)));
@@ -702,7 +702,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 308 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
#line 307 "..\..\Areas\Config\Views\AuthorizationRole\Show.cshtml"
Write(Html.ActionLinkButton("Delete", MVC.API.AuthorizationRole.Delete(Model.Token.Role.Id, true), "Config_AuthRoles_Actions_Delete_Button"));