improve help display and add supported games list
This commit is contained in:
parent
841bcf6156
commit
ccedb01e8d
@ -5,54 +5,107 @@
|
|||||||
<div class="content mt-20">
|
<div class="content mt-20">
|
||||||
@foreach (var (pluginName, commandList) in Model)
|
@foreach (var (pluginName, commandList) in Model)
|
||||||
{
|
{
|
||||||
<h2 class="content-title mb-lg-20 mt-20 ">@(pluginName == "Native" ? ViewBag.Localization["WEBFRONT_HELP_COMMANDS_NATIVE_TITLE"] : pluginName)</h2>
|
<div class="command-assembly-container">
|
||||||
|
<h2 class="content-title mb-lg-20 mt-20 ">@(pluginName == "Native" ? ViewBag.Localization["WEBFRONT_HELP_COMMANDS_NATIVE_TITLE"] : pluginName)</h2>
|
||||||
<table class="table rounded">
|
|
||||||
<thead>
|
<table class="table rounded">
|
||||||
<!-- desktop -->
|
<thead>
|
||||||
<tr class="bg-primary text-light d-none d-lg-table-row ">
|
|
||||||
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_NAME"]</th>
|
|
||||||
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_ALIAS"]</th>
|
|
||||||
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_DESCRIPTION"]</th>
|
|
||||||
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRES_TARGET"]</th>
|
|
||||||
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_SYNTAX"]</th>
|
|
||||||
<th class="text-right">@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRED_LEVEL"]</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach (var command in commandList)
|
|
||||||
{
|
|
||||||
<!-- desktop -->
|
<!-- desktop -->
|
||||||
<tr class="d-none d-lg-table-row bg-dark-dm bg-light-lm">
|
<tr class="bg-primary text-light d-none d-lg-table-row ">
|
||||||
<td>@command.Name</td>
|
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_NAME"]</th>
|
||||||
<td>@command.Alias</td>
|
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_ALIAS"]</th>
|
||||||
<td>@command.Description</td>
|
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_DESCRIPTION"]</th>
|
||||||
<td>@command.RequiresTarget</td>
|
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRES_TARGET"]</th>
|
||||||
<td>@ViewBag.CommandPrefix@command.Syntax.Split(ViewBag.CommandPrefix)[1]</td>
|
<th>@loc["WEBFRONT_HELP_COMMAND_DESC_SYNTAX"]</th>
|
||||||
<td class="text-right level-color-@((int)command.Permission)">@command.Permission.ToLocalizedLevelName()</td>
|
<th>@loc["WEBFRONT_HELP_SUPPORTED_GAMES"]</th>
|
||||||
|
<th class="text-right">@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRED_LEVEL"]</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
</thead>
|
||||||
<!-- mobile -->
|
<tbody>
|
||||||
<tr class="d-table-row d-lg-none d-flex bg-dark-dm bg-light-lm">
|
@foreach (var command in commandList)
|
||||||
<td class="bg-primary text-right" style="min-width: 124px;">
|
{
|
||||||
<div class="mt-5 mb-5">@loc["WEBFRONT_HELP_COMMAND_DESC_NAME"]</div>
|
<!-- desktop -->
|
||||||
<div class="mt-5 mb-5">@loc["WEBFRONT_HELP_COMMAND_DESC_ALIAS"]</div>
|
<tr class="d-none d-lg-table-row bg-dark-dm bg-light-lm">
|
||||||
<div class="mt-5 mb-5">@loc["WEBFRONT_HELP_COMMAND_DESC_DESCRIPTION"]</div>
|
<td class="font-weight-bold">@command.Name</td>
|
||||||
<div class="mt-5 mb-5">@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRES_TARGET"]</div>
|
<td>@command.Alias</td>
|
||||||
<div class="mt-5 mb-5">@loc["WEBFRONT_HELP_COMMAND_DESC_SYNTAX"]</div>
|
<td class="text-muted">@command.Description</td>
|
||||||
<div class="mt-5 mb-5">@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRED_LEVEL"]</div>
|
<td class="@(command.RequiresTarget ? "text-success" : "text-danger")">@command.RequiresTarget</td>
|
||||||
</td>
|
<td class="text-muted">@ViewBag.CommandPrefix@command.Syntax.Split(ViewBag.CommandPrefix)[1]</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="mt-5 mb-5">@command.Name</div>
|
@if (command.SupportedGames is not null && command.SupportedGames.Any())
|
||||||
<div class="mt-5 mb-5">@command.Alias</div>
|
{
|
||||||
<div class="mt-5 mb-5">@command.Description</div>
|
<div class="d-flex">
|
||||||
<div class="mt-5 mb-5">@command.RequiresTarget</div>
|
@foreach (var game in command.SupportedGames)
|
||||||
<div class="mt-5 mb-5">@ViewBag.CommandPrefix@command.Syntax.Split(ViewBag.CommandPrefix)[1]</div>
|
{
|
||||||
<div class="mt-5 mb-5 @($"level-color-{(int)command.Permission}")">@command.Permission.ToLocalizedLevelName()</div>
|
<div class="mr-5" data-toggle="tooltip" data-title="@loc[$"GAME_{game.ToString().ToUpper()}"]">
|
||||||
</td>
|
<div class="badge">@game.ToString()</div>
|
||||||
</tr>
|
</div>
|
||||||
}
|
}
|
||||||
</tbody>
|
</div>
|
||||||
</table>
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="badge">@loc["WEBFRONT_HELP_ALL_GAMES"]</div>
|
||||||
|
}
|
||||||
|
</td>
|
||||||
|
<td class="text-right level-color-@((int)command.Permission)">@command.Permission.ToLocalizedLevelName()</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<!-- mobile -->
|
||||||
|
<table class="table d-lg-none rounded no-cell-divider bg-dark-dm bg-light-lm" style="border-collapse: collapse">
|
||||||
|
@foreach (var command in commandList)
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
<th class="bg-primary text-right text-light first-row" style="width:40%">@loc["WEBFRONT_HELP_COMMAND_DESC_NAME"]</th>
|
||||||
|
<td class="first-row font-weight-bold">@command.Name</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="bg-primary text-right text-light">@loc["WEBFRONT_HELP_COMMAND_DESC_ALIAS"]</th>
|
||||||
|
<td>@command.Alias</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="bg-primary text-right text-light align-top">@loc["WEBFRONT_HELP_COMMAND_DESC_DESCRIPTION"]</th>
|
||||||
|
<td class="text-muted">@command.Description</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="bg-primary text-right text-light">@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRES_TARGET"]</th>
|
||||||
|
<td class="@(command.RequiresTarget ? "text-success" : "text-danger") align-top">@command.RequiresTarget</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="bg-primary text-right text-light align-top">@loc["WEBFRONT_HELP_COMMAND_DESC_SYNTAX"]</th>
|
||||||
|
<td class="text-muted">@ViewBag.CommandPrefix@command.Syntax.Split(ViewBag.CommandPrefix)[1]</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="bg-primary text-right text-light">@loc["WEBFRONT_HELP_SUPPORTED_GAMES"]</th>
|
||||||
|
<td>
|
||||||
|
@if (command.SupportedGames is not null && command.SupportedGames.Any())
|
||||||
|
{
|
||||||
|
<div class="d-flex">
|
||||||
|
@foreach (var game in command.SupportedGames)
|
||||||
|
{
|
||||||
|
<div class="mr-5" data-toggle="tooltip" data-title="@loc[$"GAME_{game.ToString().ToUpper()}"]">
|
||||||
|
<div class="badge">@game.ToString()</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="badge">@loc["WEBFRONT_HELP_ALL_GAMES"]</div>
|
||||||
|
}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="border-bottom">
|
||||||
|
<th class="bg-primary text-right text-light last-row">@loc["WEBFRONT_HELP_COMMAND_DESC_REQUIRED_LEVEL"]</th>
|
||||||
|
<td class="@($"level-color-{(int)command.Permission}") last-row">@command.Permission.ToLocalizedLevelName()</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
@ -452,3 +452,22 @@ img.social-icon {
|
|||||||
min-width: 1.2rem;
|
min-width: 1.2rem;
|
||||||
margin-right: 0.75rem;
|
margin-right: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
table.no-cell-divider tr {
|
||||||
|
//border: none !important;
|
||||||
|
border-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.no-cell-divider td, table.no-cell-divider th {
|
||||||
|
padding: 0.25rem 1.5rem;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.no-cell-divider td.first-row, table.no-cell-divider th.first-row {
|
||||||
|
padding-top: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.no-cell-divider td.last-row, table.no-cell-divider th.last-row {
|
||||||
|
padding-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user