Skip to content

Commit 8512f27

Browse files
fix: Adjust formatting in Connected Players Index and Navigation for improved readability
1 parent 459ee8b commit 8512f27

2 files changed

Lines changed: 99 additions & 92 deletions

File tree

src/XtremeIdiots.Portal.Web/Views/ConnectedPlayers/Index.cshtml

Lines changed: 97 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -34,107 +34,113 @@
3434
</div>
3535
<div class="filter-group">
3636
<label class="form-label" for="resetFilters">Reset</label>
37-
<button type="button" id="resetFilters" class="btn btn-outline-secondary btn-sm">Reset Filters</button>
37+
<button type="button" id="resetFilters" class="btn btn-outline-secondary btn-sm">Reset
38+
Filters</button>
39+
</div>
3840
</div>
39-
</div>
4041

41-
<div class="table-responsive">
42-
<table id="dataTable" class="table table-striped table-hover w-100">
43-
<thead>
44-
<tr>
45-
<th scope="col">Game</th>
46-
<th scope="col">Username</th>
47-
<th scope="col">Player Id</th>
48-
<th scope="col">Profile Id</th>
49-
<th scope="col">Method</th>
50-
<th scope="col">Status</th>
51-
<th scope="col" class="table-date-col">Linked At</th>
52-
<th scope="col" class="table-date-col">Unlinked At</th>
53-
<th scope="col" class="table-action-col">Actions</th>
54-
</tr>
55-
</thead>
56-
<tbody>
57-
@foreach (var item in Model.ConnectedPlayers)
58-
{
42+
<div class="table-responsive">
43+
<table id="dataTable" class="table table-striped table-hover w-100">
44+
<thead>
5945
<tr>
60-
<td>@item.GameType</td>
61-
<td>@item.Username</td>
62-
<td><code>@item.PlayerId</code></td>
63-
<td>
64-
<a asp-controller="User" asp-action="ManageProfile" asp-route-id="@item.UserProfileId">@item.UserProfileId</a>
65-
</td>
66-
<td>@item.LinkMethod</td>
67-
<td>
68-
@if (item.IsActive)
69-
{
70-
<span class="badge bg-success">Active</span>
71-
}
72-
else
73-
{
74-
<span class="badge bg-secondary">Inactive</span>
75-
}
76-
</td>
77-
<td><time user-time utc="@item.LinkedAtUtc"></time></td>
78-
<td>
79-
@if (item.UnlinkedAtUtc.HasValue)
80-
{
81-
<time user-time utc="@item.UnlinkedAtUtc.Value"></time>
82-
}
83-
</td>
84-
<td>
85-
@if (Model.IsSeniorAdmin && item.IsActive)
86-
{
87-
<form asp-action="ForceUnlink" method="post" class="d-inline">
88-
@Html.AntiForgeryToken()
89-
<input type="hidden" name="connectedPlayerProfileId" value="@item.ConnectedPlayerProfileId" />
90-
<button type="submit" class="btn btn-outline-danger btn-sm" data-confirm="Are you sure you want to unlink this connected player?">
91-
<i class="fa-solid fa-fw fa-link-slash" aria-hidden="true"></i>
92-
Unlink
93-
</button>
94-
</form>
95-
}
96-
</td>
46+
<th scope="col">Game</th>
47+
<th scope="col">Username</th>
48+
<th scope="col">Player Id</th>
49+
<th scope="col">Profile Id</th>
50+
<th scope="col">Method</th>
51+
<th scope="col">Status</th>
52+
<th scope="col" class="table-date-col">Linked At</th>
53+
<th scope="col" class="table-date-col">Unlinked At</th>
54+
<th scope="col" class="table-action-col">Actions</th>
9755
</tr>
98-
}
99-
</tbody>
100-
</table>
56+
</thead>
57+
<tbody>
58+
@foreach (var item in Model.ConnectedPlayers)
59+
{
60+
<tr>
61+
<td>@item.GameType</td>
62+
<td>@item.Username</td>
63+
<td><code>@item.PlayerId</code></td>
64+
<td>
65+
<a asp-controller="User" asp-action="ManageProfile"
66+
asp-route-id="@item.UserProfileId">@item.UserProfileId</a>
67+
</td>
68+
<td>@item.LinkMethod</td>
69+
<td>
70+
@if (item.IsActive)
71+
{
72+
<span class="badge bg-success">Active</span>
73+
}
74+
else
75+
{
76+
<span class="badge bg-secondary">Inactive</span>
77+
}
78+
</td>
79+
<td><time user-time utc="@item.LinkedAtUtc"></time></td>
80+
<td>
81+
@if (item.UnlinkedAtUtc.HasValue)
82+
{
83+
<time user-time utc="@item.UnlinkedAtUtc.Value"></time>
84+
}
85+
</td>
86+
<td>
87+
@if (Model.IsSeniorAdmin && item.IsActive)
88+
{
89+
<form asp-action="ForceUnlink" method="post" class="d-inline">
90+
@Html.AntiForgeryToken()
91+
<input type="hidden" name="connectedPlayerProfileId"
92+
value="@item.ConnectedPlayerProfileId" />
93+
<button type="submit" class="btn btn-outline-danger btn-sm"
94+
data-confirm="Are you sure you want to unlink this connected player?">
95+
<i class="fa-solid fa-fw fa-link-slash" aria-hidden="true"></i>
96+
Unlink
97+
</button>
98+
</form>
99+
}
100+
</td>
101+
</tr>
102+
}
103+
</tbody>
104+
</table>
105+
</div>
101106
</div>
102107
</div>
103108
</div>
104109
</div>
105-
</div>
106110

107-
@if (Model.IsSeniorAdmin)
108-
{
109-
<div class="row">
110-
<div class="col-lg-12">
111-
<div class="ibox">
112-
<div class="ibox-title">
113-
<h5>Manual Link (Senior Admin)</h5>
114-
</div>
115-
<div class="ibox-content">
116-
<form asp-action="CreateManualLink" method="post">
117-
@Html.AntiForgeryToken()
118-
<div class="mb-3">
119-
<label class="form-label" for="PlayerId">Player Id</label>
120-
<input class="form-control" id="PlayerId" name="PlayerId" placeholder="00000000-0000-0000-0000-000000000000" />
121-
</div>
122-
<div class="mb-3">
123-
<label class="form-label" for="UserProfileId">User Profile Id</label>
124-
<input class="form-control" id="UserProfileId" name="UserProfileId" placeholder="00000000-0000-0000-0000-000000000000" />
125-
</div>
126-
<button type="submit" class="btn btn-primary">
127-
<i class="fa-solid fa-fw fa-link" aria-hidden="true"></i>
128-
Create Manual Link
129-
</button>
130-
</form>
111+
@if (Model.IsSeniorAdmin)
112+
{
113+
<div class="row">
114+
<div class="col-lg-12">
115+
<div class="ibox">
116+
<div class="ibox-title">
117+
<h5>Manual Link (Senior Admin)</h5>
118+
</div>
119+
<div class="ibox-content">
120+
<form asp-action="CreateManualLink" method="post">
121+
@Html.AntiForgeryToken()
122+
<div class="mb-3">
123+
<label class="form-label" for="PlayerId">Player Id</label>
124+
<input class="form-control" id="PlayerId" name="PlayerId"
125+
placeholder="00000000-0000-0000-0000-000000000000" />
126+
</div>
127+
<div class="mb-3">
128+
<label class="form-label" for="UserProfileId">User Profile Id</label>
129+
<input class="form-control" id="UserProfileId" name="UserProfileId"
130+
placeholder="00000000-0000-0000-0000-000000000000" />
131+
</div>
132+
<button type="submit" class="btn btn-primary">
133+
<i class="fa-solid fa-fw fa-link" aria-hidden="true"></i>
134+
Create Manual Link
135+
</button>
136+
</form>
137+
</div>
131138
</div>
132139
</div>
133140
</div>
134-
</div>
135-
}
136-
</div>
141+
}
142+
</div>
137143

138-
@section Scripts {
139-
<script src="~/js/connected-players-index.js" asp-append-version="true"></script>
140-
}
144+
@section Scripts {
145+
<script src="~/js/connected-players-index.js" asp-append-version="true"></script>
146+
}

src/XtremeIdiots.Portal.Web/Views/Shared/_Navigation.cshtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@
134134
<i class="fa-solid fa-fw fa-shield" aria-hidden="true"></i> Admin Actions
135135
<i class="fa-solid fa-fw fa-chevron-down float-end" aria-hidden="true"></i>
136136
</a>
137-
<div class="collapse @(IsAnyControllerSelected("AdminActions", "ConnectedPlayers") ? "show" : "")" id="adminActionsMenu">
137+
<div class="collapse @(IsAnyControllerSelected("AdminActions", "ConnectedPlayers") ? "show" : "")"
138+
id="adminActionsMenu">
138139
<nav class="nav flex-column ms-3">
139140
<a class="nav-link text-white-50 @Html.IsSelected("AdminActions", "MyActions")"
140141
asp-controller="AdminActions" asp-action="MyActions">

0 commit comments

Comments
 (0)