Skip to content

Commit 1a2a3af

Browse files
authored
Минорные визуальные изменения (#2834)
* Добавим плюсиков * Меньше полей в списке персонажей * Пофиксить проблему с редиректом
1 parent bfbaffd commit 1a2a3af

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

src/JoinRpg.Portal/Controllers/CharacterController.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public async Task<ActionResult> Create(int projectid, int? charactergroupid, boo
144144
{
145145
ProjectId = projectid,
146146
ProjectName = characterGroup.Project.ProjectName,
147-
ParentCharacterGroupIds = new[] { characterGroup.CharacterGroupId },
147+
ParentCharacterGroupIds = [characterGroup.CharacterGroupId],
148148
ContinueCreating = continueCreating,
149149
CharacterTypeInfo = CharacterTypeInfo.Default(),
150150
}.Fill(characterGroup, CurrentUserId, projectInfo));
@@ -170,7 +170,10 @@ await CharacterService.AddCharacter(new AddCharacterRequest(
170170
return RedirectToAction("Create",
171171
new { viewModel.ProjectId, characterGroupId, viewModel.ContinueCreating });
172172
}
173-
173+
else if (characterGroupId == 0)
174+
{
175+
return RedirectToAction("Active", "CharacterList", new { viewModel.ProjectId });
176+
}
174177

175178
return RedirectToIndex(viewModel.ProjectId, characterGroupId);
176179
}

src/JoinRpg.Portal/Views/CharacterList/_CharacterList.cshtml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@
2323
<th>
2424
@Html.DisplayNameFor(model => firstItem!.Player)
2525
</th>
26-
<th>
27-
@Html.DisplayNameFor(model => firstItem!.Groups)
28-
</th>
26+
@if (Model.Items.Any(x => x.Groups.HasAnyGroups))
27+
{
28+
<th>
29+
@Html.DisplayNameFor(model => firstItem!.Groups)
30+
</th>
31+
}
2932

3033
<th>@Html.DisplayNameFor(model => firstItem!.Problems)</th>
31-
@foreach (var field in Model.Fields)
34+
@foreach (var field in Model.Fields.Where(f => !f.IsName))
3235
{
3336
if (!field.CanHaveValue)
3437
{
@@ -77,9 +80,12 @@
7780
}
7881
}
7982
</td>
80-
<td>
81-
@Html.DisplayFor(model => item.Groups)
82-
</td>
83+
@if (Model.Items.Any(x => x.Groups.HasAnyGroups))
84+
{
85+
<td>
86+
@Html.DisplayFor(model => item.Groups)
87+
</td>
88+
}
8389
<td>
8490
@foreach (var pr in item.Problems)
8591
{
@@ -120,7 +126,7 @@
120126
}
121127
</td>
122128

123-
@foreach (var field in Model.Fields)
129+
@foreach (var field in Model.Fields.Where(f => !f.IsName))
124130
{
125131
var fieldValueViewModel = item.Fields.SingleOrDefault(f => f.Field.Id.ProjectFieldId == field.Id.ProjectFieldId);
126132
if (!field.CanHaveValue)

src/JoinRpg.Portal/Views/GameField/Edit.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
class="btn btn-default"><i class="glyphicon glyphicon-plus"></i>Добавить значение</a>
174174
@if (Model.SupportsMassAdding)
175175
{
176-
<button class="btn btn-default" data-toggle="modal" data-target="#massAddValueModal">Добавить несколько значений</button>
176+
<button class="btn btn-default" data-toggle="modal" data-target="#massAddValueModal"><i class="glyphicon glyphicon-plus"></i><i class="glyphicon glyphicon-plus"></i>Добавить несколько значений</button>
177177
}
178178
<form asp-action="SortVariants" asp-route-projectId="@Model.ProjectId" asp-route-projectFieldId="@Model.ProjectFieldId" method="POST" style="display:inline">
179179
<button type="submit" class="btn btn-default" onclick="return confirm('Отсортировать варианты по алфавиту?')">

0 commit comments

Comments
 (0)