Update #43: Disco Administrators are configurable
This commit is contained in:
@@ -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.
|
||||
@@ -176,22 +176,315 @@ WriteLiteral(" </table>\r\n");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<div");
|
||||
WriteLiteral("<!-- #region Administrator Subjects -->\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"Config_AuthRoles_Subjects_Update_Dialog\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Disco Administrators\"");
|
||||
|
||||
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 46 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 46 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
foreach (var sg in Model.AdministratorSubjects)
|
||||
{
|
||||
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=\"", 1805), Tuple.Create("\"", 1845)
|
||||
|
||||
#line 49 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1813), Tuple.Create<System.Object, System.Int32>(sg.IsGroup ? "group" : "user"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1813), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" data-subjectid=\"");
|
||||
|
||||
|
||||
#line 49 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
Write(sg.Id);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 49 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
if (sg.IsGroup)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-users fa-lg\"");
|
||||
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 51 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 51 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
Write(displayName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 51 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-user fa-lg\"");
|
||||
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 55 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 55 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
Write(displayName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 55 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-times-circle remove\"");
|
||||
|
||||
WriteLiteral("></i></li>\r\n");
|
||||
|
||||
|
||||
#line 57 "..\..\Areas\Config\Views\AuthorizationRole\Index.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=\"", 2876), Tuple.Create("\"", 2965)
|
||||
|
||||
#line 64 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2885), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.AuthorizationRole.UpdateAdministratorSubjects(null, true))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2885), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" method=\"post\"");
|
||||
|
||||
WriteLiteral(@"></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: '");
|
||||
|
||||
|
||||
#line 93 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
Write(Url.Action(MVC.API.AuthorizationRole.SearchSubjects()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n minLength: 2,\r\n focus: functio" +
|
||||
"n (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-autocomplete\')._renderItem = function (ul, item" +
|
||||
") {\r\n return $(\"<li></li>\")\r\n " +
|
||||
".data(\"item.autocomplete\", item)\r\n .append(\"<a><stron" +
|
||||
"g>\" + item.Name + \"</strong><br>\" + item.Id + \" (\" + item.Type + \")</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-subject" +
|
||||
"status\', \'removed\').hide();\r\n }\r\n\r\n updateNoSubjects();\r\n " +
|
||||
" }\r\n\r\n function add() {\r\n var id = textAdd.val();\r\n\r\n " +
|
||||
" $.ajax({\r\n url: \'");
|
||||
|
||||
|
||||
#line 150 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
Write(Url.Action(MVC.API.AuthorizationRole.Subject()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n method: \'post\',\r\n data: { Id: id }\r\n " +
|
||||
" }).done(function (response) {\r\n if (response) {\r\n " +
|
||||
" if (list.find(\'li[data-subjectid=\"\' + response.Id + \'\"]\').length == 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 " +
|
||||
" liIcon.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(\'f" +
|
||||
"a fa-times-circle remove\'))\r\n .addClass(response.Type" +
|
||||
")\r\n .attr(\'data-subjectid\', 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 already been adde" +
|
||||
"d\');\r\n }\r\n } else {\r\n alert" +
|
||||
"(\'Unknown Id\');\r\n }\r\n }).fail(function (jqXHR, textSta" +
|
||||
"tus, errorThrown) {\r\n alert(\'Error: \' + errorThrown);\r\n " +
|
||||
" });\r\n }\r\n\r\n function updateNoSubjects() {\r\n if (l" +
|
||||
"ist.find(\'li:visible\').length > 0)\r\n noSubjects.hide();\r\n " +
|
||||
" else\r\n noSubjects.show();\r\n }\r\n\r\n function save" +
|
||||
"Changes() {\r\n var form = $(\'#Config_AuthRoles_Subjects_Update_Dialog_" +
|
||||
"Form\').empty();\r\n\r\n list.find(\'li[data-subjectstatus!=\"removed\"]\').ea" +
|
||||
"ch(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(subj" +
|
||||
"ectId));\r\n\r\n }).get();\r\n\r\n form.submit();\r\n\r\n d" +
|
||||
"ialog.dialog(\"disable\");\r\n dialog.dialog(\"option\", \"buttons\", null);\r" +
|
||||
"\n }\r\n\r\n $(function () {\r\n $(\'#Config_AuthRoles_UpdateAd" +
|
||||
"ministrators\').click(showDialog);\r\n });\r\n\r\n })();\r\n</script>\r\n<!-- #en" +
|
||||
"dregion -->\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
WriteLiteral(">\r\n <a");
|
||||
|
||||
WriteLiteral(" id=\"Config_AuthRoles_UpdateAdministrators\"");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(">Update Disco Administrators [");
|
||||
|
||||
|
||||
#line 219 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
Write(Model.AdministratorSubjects.Count);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]</a>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 42 "..\..\Areas\Config\Views\AuthorizationRole\Index.cshtml"
|
||||
#line 220 "..\..\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");
|
||||
WriteLiteral("\r\n</div>");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user