From 902cd9953e5af1cc5f59d6a9902ef7f29e70e1bc Mon Sep 17 00:00:00 2001 From: RaidMax Date: Sun, 29 Dec 2019 11:32:36 -0600 Subject: [PATCH] finish help layout and show only on permission level --- WebfrontCore/Controllers/HomeController.cs | 10 +++++++--- WebfrontCore/Views/Home/Help.cshtml | 7 +++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/WebfrontCore/Controllers/HomeController.cs b/WebfrontCore/Controllers/HomeController.cs index 35674695d..54e095ca2 100644 --- a/WebfrontCore/Controllers/HomeController.cs +++ b/WebfrontCore/Controllers/HomeController.cs @@ -52,16 +52,20 @@ namespace WebfrontCore.Controllers public IActionResult Help() { ViewBag.IsFluid = true; + ViewBag.Title = Localization["WEBFRONT_NAV_HELP"]; + + // we don't need to the name of the shared library assembly var excludedAssembly = typeof(BaseController).Assembly; var commands = Manager.GetCommands() + .Where(_cmd => _cmd.Permission <= Client.Level) .OrderByDescending(_cmd => _cmd.Permission) .GroupBy(_cmd => { - + // we need the plugin type the command is defined in var pluginType = _cmd.GetType().Assembly.GetTypes().FirstOrDefault(_type => _type.Assembly != excludedAssembly && typeof(IPlugin).IsAssignableFrom(_type)); return pluginType == null ? - Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_HELP_COMMAND_NATIVE"] : - SharedLibraryCore.Plugins.PluginImporter.ActivePlugins.First(_plugin => _plugin.GetType() == pluginType).Name; + Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_HELP_COMMAND_NATIVE"] : + SharedLibraryCore.Plugins.PluginImporter.ActivePlugins.First(_plugin => _plugin.GetType() == pluginType).Name; // for now we're just returning the name of the plugin, maybe later we'll include more info }) .Select(_grp => (_grp.Key, _grp.AsEnumerable())); diff --git a/WebfrontCore/Views/Home/Help.cshtml b/WebfrontCore/Views/Home/Help.cshtml index 9270fcf37..5c3a25ab2 100644 --- a/WebfrontCore/Views/Home/Help.cshtml +++ b/WebfrontCore/Views/Home/Help.cshtml @@ -4,12 +4,12 @@ } @foreach ((var pluginName, var commandList) in Model) { -

@pluginName

+

@pluginName

- +
- + @@ -71,5 +71,4 @@ }
@loc["WEBFRONT_HELP_COMMAND_DESC_NAME"] @loc["WEBFRONT_HELP_COMMAND_DESC_ALIAS"] @loc["WEBFRONT_HELP_COMMAND_DESC_DESCRIPTION"]
-} } \ No newline at end of file