Skip to content

Commit 65b879e

Browse files
authored
Показывать значения для полей, привязанных к заявке (#3313)
1 parent 2da8dc5 commit 65b879e

File tree

1 file changed

+52
-48
lines changed

1 file changed

+52
-48
lines changed

src/JoinRpg.Portal/Views/Shared/Components/FieldRow/FieldRow.cshtml

Lines changed: 52 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,68 @@
1-
@using JoinRpg.Web.Models
1+
@using JoinRpg.Web.Models
22
@using JoinRpg.Web.ProjectCommon.Fields
33
@model JoinRpg.Web.Models.FieldSetup.GameFieldEditViewModel
44

55
@{
66
var item = Model;
77
}
8-
<tr>
9-
<td>
10-
<b class="@(item.IsActive ? "" : "deleted")">@Html.DisplayFor(modelItem => item.Name)</b>@Html.DisplayFor(modelItem => item.MandatoryStatus)
11-
<br />
12-
@Html.DisplayFor(modelItem => item.FieldViewType)
13-
<br />
14-
@if (item.FieldBoundTo == FieldBoundToViewModel.Claim)
15-
{
16-
<span class="label label-primary">Привязано к заявке</span>
17-
}
18-
</td>
19-
<td>
20-
@if (item.IsPublic)
21-
{
8+
<tr>
9+
<td>
10+
<b class="@(item.IsActive ? "" : "deleted")">@Html.DisplayFor(modelItem => item.Name)</b>@Html.DisplayFor(modelItem => item.MandatoryStatus)
11+
<br />
12+
@Html.DisplayFor(modelItem => item.FieldViewType)
13+
<br />
14+
@if (item.FieldBoundTo == FieldBoundToViewModel.Claim)
15+
{
16+
<span class="label label-primary">Привязано к заявке</span>
17+
}
18+
</td>
19+
<td>
20+
@if (item.IsPublic)
21+
{
2222
<span class="label label-success">Публичное</span>
23-
}
24-
else if (item.CanPlayerView)
25-
{
23+
}
24+
else if (item.CanPlayerView)
25+
{
2626
<span class="label label-info">Видно игроку</span>
27-
}
28-
else
29-
{
27+
}
28+
else
29+
{
3030
<span class="label label-default">Только мастерам</span>
31-
}
32-
<br />
33-
@if (item.CanPlayerEdit)
34-
{
31+
}
32+
<br />
33+
@if (item.CanPlayerEdit)
34+
{
3535
<span class="label label-warning">Игрок может менять</span>
36-
}
37-
</td>
38-
<td class="price-table">@(item.FieldViewType.SupportsPricingOnField() && item.Price != 0 ? item.Price.ToString() : "")</td>
39-
<td>@item.DescriptionDisplay @item.MasterDescriptionDisplay</td>
40-
<td>
41-
@if (item.HasValueList)
42-
{
36+
}
37+
</td>
38+
<td class="price-table">@(item.FieldViewType.SupportsPricingOnField() && item.Price != 0 ? item.Price.ToString() : "")</td>
39+
<td>@item.DescriptionDisplay @item.MasterDescriptionDisplay</td>
40+
<td>
41+
@if (item.HasValueList)
42+
{
4343
<ul>
4444
@foreach (var value in item.DropdownValues)
45-
{
46-
<li>
47-
@if (value.CharacterGroupId is not null)
48-
{
49-
<a asp-controller="CharacterList" asp-action="ByGroup" asp-route-ProjectId="@item.ProjectId" asp-route-CharacterGroupId="@value.CharacterGroupId">
50-
@if (!value.IsActive)
51-
{
52-
<del>@value.Label</del>
53-
}
54-
else
55-
{
56-
@value.Label
57-
}
45+
{
46+
<li>
47+
@if (value.CharacterGroupId is not null)
48+
{
49+
<a asp-controller="CharacterList" asp-action="ByGroup" asp-route-ProjectId="@item.ProjectId" asp-route-CharacterGroupId="@value.CharacterGroupId">
50+
@if (!value.IsActive)
51+
{
52+
<del>@value.Label</del>
53+
}
54+
else
55+
{
56+
@value.Label
57+
}
5858

59-
</a>
60-
}
61-
</li>
59+
</a>
60+
}
61+
else
62+
{
63+
@value.Label
64+
}
65+
</li>
6266
}
6367
@if (item.MandatoryStatus != MandatoryStatusViewType.Optional && item.IsActive)
6468
{

0 commit comments

Comments
 (0)