Skip to content

Commit 89fbca6

Browse files
committed
Show slot count in roles (#1548)
1 parent 63d2ba3 commit 89fbca6

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/JoinRpg.Portal/Views/GameGroups/_CharacterPartial.cshtml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@
3030
@if (Model.IsAvailable)
3131
{
3232
<text>&nbsp;</text>
33-
@Html.ActionLink("заявиться", "AddForCharacter", "Claim", new { Model.ProjectId, Model.CharacterId }, new { @class = "btn btn-default btn-xs" })
33+
<a asp-controller="Claim" asp-action="AddForCharacter" asp-route-projectid="@Model.ProjectId" asp-route-characterId="@Model.CharacterId" class="btn btn-default btn-xs">
34+
заявиться
35+
@if (Model.SlotLimit is not null)
36+
{
37+
<text>&nbsp; (@Model.SlotLimit мест)</text>
38+
}
39+
</a>
3440
if (Model.IsHot)
3541
{
3642
<span class="label label-warning">Горячая роль</span>

src/JoinRpg.WebPortal.Models/Characters/CharacterGroupListViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ private CharacterViewModel GenerateCharacter(Character arg, CharacterGroup group
126126
CharacterId = arg.CharacterId,
127127
CharacterName = arg.CharacterName,
128128
IsFirstCopy = !AlreadyOutputedChars.Contains(arg.CharacterId),
129-
IsAvailable = arg.IsAvailable,
129+
IsAvailable = arg.IsAvailable && arg.CharacterSlotLimit != 0,
130+
SlotLimit = arg.CharacterSlotLimit,
130131
Description = arg.Description.ToHtmlString(),
131132
IsPublic = arg.IsPublic,
132133
IsActive = arg.IsActive,

src/JoinRpg.WebPortal.Models/Characters/CharacterViewModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public class CharacterViewModel :
1818

1919
public bool IsAvailable { get; set; }
2020

21+
public int? SlotLimit { get; set; }
22+
2123
public JoinHtmlString Description { get; set; }
2224

2325
public bool IsPublic { get; set; }

0 commit comments

Comments
 (0)