Skip to content

Commit

Permalink
cleanup Submissions/View a bit, show submitted game version, and show…
Browse files Browse the repository at this point in the history
… submitted rom under game version, when game version exists
  • Loading branch information
adelikat committed Aug 31, 2024
1 parent 5f7d9fb commit ca43991
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions TASVideos/Pages/Submissions/View.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
@Model.Submission.GameVersion
</a>
</div>
<div condition="!Model.Submission.GameVersionId.HasValue">@Model.Submission.GameVersion</div>
(Submitted: @Model.Submission.RomName @Model.Submission.SubmittedGameVersion)
</div>
<div class="sub-info-cell">
<label>Emulator</label>
Expand Down Expand Up @@ -171,10 +171,14 @@
</small>
</div>
</div>
<div condition="!string.IsNullOrWhiteSpace(Model.Submission.RomName) && Model.Submission.RomName != Model.Submission.GameVersion" class="sub-info-cell">
<div condition="!string.IsNullOrWhiteSpace(Model.Submission.RomName) && !(Model.Submission.GameVersionId > 0)" class="sub-info-cell">
<label>Submitted ROM</label>
<div>@Model.Submission.RomName</div>
</div>
<div condition="!string.IsNullOrWhiteSpace(Model.Submission.SubmittedGameVersion) && !(Model.Submission.GameVersionId > 0)" class="sub-info-cell">
<label>Submitted Game Version</label>
<div>@Model.Submission.SubmittedGameVersion</div>
</div>
</div>

<div condition="!string.IsNullOrWhiteSpace(Model.Submission.Annotations)" class="sub-info-cell mb-2">
Expand Down
4 changes: 3 additions & 1 deletion TASVideos/Pages/Submissions/View.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public async Task<IActionResult> OnGet()
SystemDisplayName = s.System!.DisplayName,
GameName = s.GameId != null ? s.Game!.DisplayName : null,
SubmittedGameName = s.GameName,
GameVersion = s.GameVersionId != null ? s.GameVersion!.Name : s.SubmittedGameVersion,
GameVersion = s.GameVersionId != null ? s.GameVersion!.Name : "",
SubmittedGameVersion = s.SubmittedGameVersion,
RomName = s.RomName,
Branch = s.Branch,
Goal = s.GameGoal != null
Expand Down Expand Up @@ -107,6 +108,7 @@ public class SubmissionDisplay : ISubmissionDisplay
public string? GameName { get; init; }
public string? SubmittedGameName { get; init; }
public string? GameVersion { get; init; }
public string? SubmittedGameVersion { get; init; }
public string? RomName { get; init; }
public string? Branch { get; init; }
public string? Goal { get; init; }
Expand Down

0 comments on commit ca43991

Please sign in to comment.