Skip to content

Commit

Permalink
admin game description
Browse files Browse the repository at this point in the history
  • Loading branch information
singharaj-usai committed Oct 1, 2024
1 parent d9e4561 commit 030b04e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/js/admin/games.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ function loadGames() {

function displayGames(games) {
const gamesList = $('#games-list');
gamesList.empty(); // Clear existing games before appending new ones

games.forEach(game => {
gamesList.append(`
<div class="col-md-4 col-sm-6 mb-4">
Expand All @@ -32,6 +34,7 @@ function displayGames(games) {
</div>
<p><strong>Creator:</strong> ${escapeHtml(game.creator.username)}</p>
<p><strong>Created:</strong> ${new Date(game.createdAt).toLocaleString()}</p>
<p><strong>Description:</strong> ${escapeHtml(game.description || 'No description provided.')}</p>
</div>
<div class="panel-footer">
<button class="btn btn-danger btn-block delete-game" data-game-id="${game._id}">
Expand Down

0 comments on commit 030b04e

Please sign in to comment.