Skip to content

Commit

Permalink
Add a comma separator between multiple GameGroups in the Search (#2024)
Browse files Browse the repository at this point in the history
  • Loading branch information
Masterjun3 authored Nov 3, 2024
1 parent a3e5301 commit 7a5b654
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions TASVideos/Pages/Search/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
<td>
<a asp-page="/Games/Index" asp-route-id="@result.Id">@result.DisplayName</a>
</td>
<td>@string.Join(",", result.Systems.Distinct())</td>
<td>@string.Join(", ", result.Systems.Distinct())</td>
<td>
@foreach (var group in result.Groups)
{
<a asp-page="/GameGroups/Index" asp-route-id="@group.Id">@group.Name</a>
<span><a asp-page="/GameGroups/Index" asp-route-id="@group.Id">@group.Name</a><span condition="group != result.Groups.Last()">, </span></span>
}
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions TASVideos/Pages/Search/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public async Task<IActionResult> OnGet()
g.Id,
g.DisplayName,
g.GameVersions.Select(v => v.System!.Code),
g.GameGroups.Select(gg => new GameGroupEntry(gg.GameGroupId, gg.GameGroup!.Name))))
g.GameGroups.Select(gg => new GameGroupEntry(gg.GameGroupId, gg.GameGroup!.Name)).ToList()))
.ToListAsync();

PublicationResults = await db.Publications
Expand All @@ -91,7 +91,7 @@ public async Task<IActionResult> OnGet()

public record PageSearch(string Highlight, string PageName);
public record PostSearch(string Highlight, string TopicName, int PostId);
public record GameSearch(int Id, string DisplayName, IEnumerable<string> Systems, IEnumerable<GameGroupEntry> Groups);
public record GameSearch(int Id, string DisplayName, IEnumerable<string> Systems, List<GameGroupEntry> Groups);
public record GameGroupEntry(int Id, string Name);
public record PublicationSearch(int Id, string Title, bool IsObsolete);
}

0 comments on commit 7a5b654

Please sign in to comment.