Permissions & Authorization for Users #24
Initial Release; Includes Database and MVC refactoring
This commit is contained in:
@@ -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");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user