I rightly do not know what this all is

This commit is contained in:
Michel 2024-10-30 19:40:26 +01:00
parent af6b2b752e
commit 287c1f67c5
78 changed files with 3484 additions and 3365 deletions

View file

@ -1,143 +1,153 @@
<?php
declare(strict_types=1);
use GamesShop\Entities\Games\KeyAttribute;
use GamesShop\Entities\GamesList;
use League\Plates\Template\Template;
assert($this instanceof Template);
/** @var GamesList[] $usersLists */
$this->layout('layout/main', [ 'resourceEntry' => 'keys' ]);
?>
<meta name="key-attributes" content="<?= htmlspecialchars(json_encode(KeyAttribute::casesAsAssociative())) ?>" />
<div class="row">
<div class="col-sm-6">
<h1>My Keys</h1>
</div>
<div class="col-sm-6 align-self-center">
<?php if (!empty($usersLists)): ?>
<select name="lists" id="list-select" class="form-select w-100">
<?php foreach ($usersLists as $list): ?>
<option value="<?= $list->getId() ?>"><?= $list->getName() ?></option>
<?php endforeach; ?>
<option value="_create">+ Create New</option>
</select>
<?php endif; ?>
</div>
</div>
<?php if (empty($usersLists)): ?>
<div class="text-center">
<p class="fs-4 mb-4">You don't have a key list. Create one here.</p>
<button class="btn btn-primary btn-lg js--create-list-button">
Create
</button>
</div>
<?php else: ?>
<ul id="key-tab" class="nav nav-tabs">
<li class="nav-item">
<button class="nav-link active" data-bs-toggle="tab" data-bs-target="#keys-tab-pane" role="tab">
Keys
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#import-tab-pane" role="tab">
Import
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#share-tab-pane" role="tab">
Share
</button>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade show active" id="keys-tab-pane" role="tabpanel">
<table class="table table-striped key-table">
<thead>
<tr>
<td></td>
<td>Game Name</td>
<td>Amount Keys</td>
<td>IGDB State</td>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="tab-pane fade" id="import-tab-pane" role="tabpanel">
<h2>Importer</h2>
<label for="formFile" class="form-label mt-3">Insert import file:</label>
<div class="mb-3 input-group">
<input class="form-control" type="file" id="import" accept="text/csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
<button class="btn btn-primary js--send-import">Send</button>
</div>
<div class="d-none" id="import-info-container">
<h3>Import Details:</h3>
<table class="table table-striped w-100" id="import-attribute-table">
<thead>
<tr>
<td>Column</td>
<td>Header</td>
<td>Attribute</td>
</tr>
</thead>
<tbody></tbody>
</table>
<button class="btn btn-primary js--do-import">
Import
</button>
</div>
</div>
<div class="tab-pane fade" id="share-tab-pane" role="tabpanel">
<h2>
Share your list
</h2>
<label for="share-user-search">Search for a user...</label>
<div class="input-group">
<input type="text" class="form-control" id="share-user-search" placeholder="">
<button class="btn btn-primary js--search-shared-user">Search</button>
</div>
</div>
</div>
<?php endif; ?>
<?php $this->start('modal') ?>
<div class="modal" id="create-list-modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title h3">
Create list
</h1>
</div>
<div class="modal-body">
<div class="form-floating">
<input class="form-control" type="text" id="createListName" placeholder="">
<label for="createListName">Name</label>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary js--create-list">Create</button>
</div>
</div>
</div>
</div>
<?php $this->end() ?>
<?php
declare(strict_types=1);
use GamesShop\Entities\Games\KeyAttribute;
use GamesShop\Entities\GamesList;
use League\Plates\Template\Template;
assert($this instanceof Template);
/** @var GamesList[] $usersLists */
$this->layout('layout/main', [ 'resourceEntry' => 'keys' ]);
?>
<meta name="key-attributes" content="<?= htmlspecialchars(json_encode(KeyAttribute::casesAsAssociative())) ?>" />
<div class="row">
<div class="col-sm-6">
<h1>My Keys</h1>
</div>
<div class="col-sm-6 align-self-center">
<?php if (!empty($usersLists)): ?>
<select name="lists" id="list-select" class="form-select w-100">
<?php foreach ($usersLists as $list): ?>
<option value="<?= $list->getId() ?>"><?= $list->getName() ?></option>
<?php endforeach; ?>
<option value="_create">+ Create New</option>
</select>
<?php endif; ?>
</div>
</div>
<?php if (empty($usersLists)): ?>
<div class="text-center">
<p class="fs-4 mb-4">You don't have a key list. Create one here.</p>
<button class="btn btn-primary btn-lg js--create-list-button">
Create
</button>
</div>
<?php else: ?>
<ul id="key-tab" class="nav nav-tabs">
<li class="nav-item">
<button class="nav-link active" data-bs-toggle="tab" data-bs-target="#keys-tab-pane" role="tab">
Keys
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#import-tab-pane" role="tab">
Import
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#share-tab-pane" role="tab">
Share
</button>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade show active" id="keys-tab-pane" role="tabpanel">
<table class="table table-striped key-table">
<thead>
<tr>
<th></th>
<th>Game Name</th>
<th>Amount Keys</th>
<th>IGDB State</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="tab-pane fade" id="import-tab-pane" role="tabpanel">
<h2>Importer</h2>
<label for="formFile" class="form-label mt-3">Insert import file:</label>
<div class="mb-3 input-group">
<input class="form-control" type="file" id="import" accept="text/csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
<button class="btn btn-primary js--send-import">Send</button>
</div>
<div class="d-none" id="import-info-container">
<h3>Import Details:</h3>
<table class="table table-striped w-100" id="import-attribute-table">
<thead>
<tr>
<th>Column</th>
<th>Header</th>
<th>Attribute</th>
</tr>
</thead>
<tbody></tbody>
</table>
<button class="btn btn-primary js--do-import">
Import
</button>
</div>
</div>
<div class="tab-pane fade" id="share-tab-pane" role="tabpanel">
<h2>
Share your list
</h2>
<label for="share-user-search">Search for a user...</label>
<div class="input-group mb-3">
<input type="text" class="form-control" id="share-user-search" placeholder="">
<button class="btn btn-primary js--search-shared-user">Search</button>
</div>
<h3>Users shared to</h3>
<table id="shared-users-table" class="table table-striped w-100">
<thead>
<tr>
<th width="2.4rem"></th>
<th>Name</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<?php endif; ?>
<?php $this->start('modal') ?>
<div class="modal" id="create-list-modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title h3">
Create list
</h1>
</div>
<div class="modal-body">
<div class="form-floating">
<input class="form-control" type="text" id="createListName" placeholder="">
<label for="createListName">Name</label>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary js--create-list">Create</button>
</div>
</div>
</div>
</div>
<?php $this->end() ?>