Skip to content

Commit

Permalink
Add [module:PublicationsByPlatform]
Browse files Browse the repository at this point in the history
  • Loading branch information
YoshiRulz committed Aug 25, 2024
1 parent deca44d commit 182f89d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions TASVideos.WikiEngine/ModuleNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public static class ModuleNames
public const string PlayerPointsTable = "playerpointstable";
public const string PublicationHistory = "publicationhistory";
public const string PublicationPoints = "publicationpoints";
public const string PublicationsByPlatform = "publicationsbyplatform";
public const string Screenshots = "screenshots";
public const string SupportedMovieTypes = "supportedmovietypes";
public const string TabularMovieList = "tabularmovielist";
Expand Down
13 changes: 13 additions & 0 deletions TASVideos/WikiModules/PublicationsByPlatform.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@model PublicationsByPlatform
<standard-table>
@foreach (var platform in Model.Platforms.OrderBy(res => res.DisplayName))
{
<tr>
<td>@platform.DisplayName</td>
<td><a href="/[email protected]">All Publications</a></td>
<td><a href="/[email protected]">Standard</a></td>
<td><a href="/[email protected]">Stars</a></td>
<td><a href="/[email protected]">Alternative</a></td>
</tr>
}
</standard-table>
15 changes: 15 additions & 0 deletions TASVideos/WikiModules/PublicationsByPlatform.cshtml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using TASVideos.WikiEngine;

namespace TASVideos.WikiModules;

[WikiModule(ModuleNames.PublicationsByPlatform)]
public class PublicationsByPlatform(IGameSystemService platforms) : WikiViewComponent
{
public IReadOnlyList<SystemsResponse> Platforms { get; private set; } = null!;

public async Task<IViewComponentResult> InvokeAsync()
{
Platforms = (await platforms.GetAll()).ToArray();
return View();
}
}

0 comments on commit 182f89d

Please sign in to comment.