Skip to content

Commit 0f5c583

Browse files
committed
style(ui): enhance game listing UI with improved layout and formatting
1 parent 8020bd8 commit 0f5c583

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

html/assets/js/index.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
var entityMap = {
32
'&': '&',
43
'<': '&lt;',
@@ -240,16 +239,16 @@ function renderGamesPage() {
240239
for (var i in res) {
241240
var game_info = res[i];
242241
// console.log("game_info", game_info);
243-
gamesHtml += '<div href="#" class="list-group-item list-group-item-action flex-column align-items-start">';
244-
gamesHtml += ' <div class="d-flex w-100 justify-content-between">';
245-
gamesHtml += ' <h5 class="mb-1">#' + game_info.id + '</h5>';
246-
gamesHtml += ' <button type="button" class="btn btn-info">' + tr('Результаты игры') + '</button>';
247-
gamesHtml += ' <small>' + getHumanTimeHasPassed(new Date(game_info.end_time)) + '</small>';
242+
gamesHtml += '<div class="list-group-item list-group-item-action flex-column align-items-start mb-3 p-3 shadow-sm rounded">';
243+
gamesHtml += ' <div class="d-flex w-100 justify-content-between align-items-center mb-2">';
244+
gamesHtml += ' <h5 class="mb-0 fw-bold">#' + game_info.id + '</h5>';
245+
gamesHtml += ' <button type="button" class="btn btn-info btn-sm">' + tr('Результаты игры') + '</button>';
246+
gamesHtml += ' <small class="text-muted">' + getHumanTimeHasPassed(new Date(game_info.end_time)) + '</small>';
248247
gamesHtml += ' </div>';
249-
gamesHtml += ' <p class="mb-1">' + escapeHtml(game_info.description) + '</p>';
250-
gamesHtml += ' <small>Начало: ' + new Date(game_info.start_time) + '</small><br>';
251-
gamesHtml += ' <small>Конец: ' + new Date(game_info.end_time) + '</small><br><br>';
252-
gamesHtml += ' <div id="game_teams_' + game_info.id + '"> ' + new Date(game_info.end_time) + '</div>';
248+
gamesHtml += ' <p class="mb-2">' + escapeHtml(game_info.description) + '</p>';
249+
gamesHtml += ' <div class="mb-1"><span class="fw-bold">Начало:</span> <span class="text-muted">' + new Date(game_info.start_time).toLocaleString() + '</span></div>';
250+
gamesHtml += ' <div class="mb-2"><span class="fw-bold">Конец:</span> <span class="text-muted">' + new Date(game_info.end_time).toLocaleString() + '</span></div>';
251+
gamesHtml += ' <div id="game_teams_' + game_info.id + '" class="mt-2"></div>';
253252
gamesHtml += '</div>';
254253
updateGameTeams('game_teams_' + game_info.id, game_info.id)
255254
}

internal/model/result.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package model
22

33
import (
44
"ctf01d/internal/httpserver"
5+
56
openapi_types "github.com/oapi-codegen/runtime/types"
67
)
78

0 commit comments

Comments
 (0)