Version 5.1 - All the GraphQL #32

Closed
timw4mail wants to merge 1160 commits from develop into master
8 changed files with 68 additions and 53 deletions
Showing only changes of commit bbd375e464 - Show all commits

View File

@ -19,7 +19,7 @@
<tr> <tr>
<td class="align-right"><label for="media_id">Media</label></td> <td class="align-right"><label for="media_id">Media</label></td>
<td class='align-left'> <td class='align-left'>
<?php include '_media-list.php' ?> <?php include '_media-select-list.php' ?>
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@ -18,7 +18,9 @@
</div> </div>
<?php endif ?> <?php endif ?>
<div class="row"> <div class="row">
<?php if ($item['episode_count'] > 1): ?>
<div class="completion">Episodes: <?= $item['episode_count'] ?></div> <div class="completion">Episodes: <?= $item['episode_count'] ?></div>
<?php endif ?>
<div class="media_type"><?= $item['show_type'] ?></div> <div class="media_type"><?= $item['show_type'] ?></div>
<div class="age-rating"><?= $item['age_rating'] ?></div> <div class="age-rating"><?= $item['age_rating'] ?></div>
</div> </div>

View File

@ -11,7 +11,7 @@
<div class="tabs"> <div class="tabs">
<?php $i = 0; ?> <?php $i = 0; ?>
<?php foreach ($sections as $name => $items): ?> <?php foreach ($sections as $name => $items): ?>
<input <?= $i === 0 ? 'checked="checked"' : '' ?> type="radio" id="collection-tab-<?= $i ?>" name="collection-tabs" /> <input type="radio" id="collection-tab-<?= $i ?>" name="collection-tabs" />
<label for="collection-tab-<?= $i ?>"><h2><?= $name ?></h2></label> <label for="collection-tab-<?= $i ?>"><h2><?= $name ?></h2></label>
<div class="content full-height"> <div class="content full-height">
<section class="media-wrap"> <section class="media-wrap">
@ -23,17 +23,14 @@
<?php $i++; ?> <?php $i++; ?>
<?php endforeach ?> <?php endforeach ?>
<!-- All Tab --> <!-- All Tab -->
<input type='radio' id='collection-tab-<?= $i ?>' name='collection-tabs' /> <input type='radio' checked='checked' id='collection-tab-<?= $i ?>' name='collection-tabs' />
<label for='collection-tab-<?= $i ?>'><h2>All</h2></label> <label for='collection-tab-<?= $i ?>'><h2>All</h2></label>
<div class='content full-height'> <div class='content full-height'>
<?php foreach ($sections as $name => $items): ?>
<h3><?= $name ?></h3>
<section class="media-wrap"> <section class="media-wrap">
<?php foreach ($items as $item): ?> <?php foreach ($all as $item): ?>
<?php include __DIR__ . '/cover-item.php'; ?> <?php include __DIR__ . '/cover-item.php'; ?>
<?php endforeach ?> <?php endforeach ?>
</section> </section>
<?php endforeach ?>
</div> </div>
</div> </div>
<?php endif ?> <?php endif ?>

View File

@ -24,7 +24,7 @@
<tr> <tr>
<td class="align-right"><label for="media_id">Media</label></td> <td class="align-right"><label for="media_id">Media</label></td>
<td class="align-left"> <td class="align-left">
<?php include '_media-list.php' ?> <?php include '_media-select-list.php' ?>
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@ -0,0 +1,44 @@
<input type='radio' checked='checked' id='collection-tab-<?= $i ?>' name='collection-tabs' />
<label for='collection-tab-<?= $i ?>'><h2>All</h2></label>
<div class="content full-height">
<table class="full-width media-wrap">
<thead>
<tr>
<?php if ($auth->isAuthenticated()): ?><td>&nbsp;</td><?php endif ?>
<th>Title</th>
<th>Media</th>
<th>Episode Count</th>
<th>Episode Length</th>
<th>Show Type</th>
<th>Age Rating</th>
<th>Notes</th>
<th>Genres</th>
</tr>
</thead>
<tbody>
<?php foreach ($all as $item): ?>
<?php $editLink = $url->generate($collection_type . '.collection.edit.get', ['id' => $item['hummingbird_id']]); ?>
<tr>
<?php if ($auth->isAuthenticated()): ?>
<td>
<a class="bracketed" href="<?= $editLink ?>">Edit</a>
</td>
<?php endif ?>
<td class="align-left">
<a href="<?= $url->generate('anime.details', ['id' => $item['slug']]) ?>">
<?= $item['title'] ?>
</a>
<?= ! empty($item['alternate_title']) ? ' <br /><small> ' . $item['alternate_title'] . '</small>' : '' ?>
</td>
<td><?= implode(', ', $item['media']) ?></td>
<td><?= ($item['episode_count'] > 1) ? $item['episode_count'] : '-' ?></td>
<td><?= $item['episode_length'] ?></td>
<td><?= $item['show_type'] ?></td>
<td><?= $item['age_rating'] ?></td>
<td class="align-left"><?= $item['notes'] ?></td>
<td class="align-left"><?= implode(', ', $item['genres']) ?></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>

View File

@ -12,9 +12,9 @@
<?= ! empty($item['alternate_title']) ? ' <br /><small> ' . $item['alternate_title'] . '</small>' : '' ?> <?= ! empty($item['alternate_title']) ? ' <br /><small> ' . $item['alternate_title'] . '</small>' : '' ?>
</td> </td>
<td><?= $item['episode_count'] ?></td> <td><?= $item['episode_count'] ?></td>
<td><?= $item['episode_length'] ?></td> <td><?= ($item['episode_count'] > 1) ? $item['episode_count'] : '-' ?></td>
<td><?= $item['show_type'] ?></td> <td><?= $item['show_type'] ?></td>
<td><?= $item['age_rating'] ?></td> <td><?= $item['age_rating'] ?></td>
<?php if ($hasNotes): ?><td class="align-left"><?= $item['notes'] ?></td><?php endif ?>
<td class="align-left"><?= implode(', ', $item['genres']) ?></td> <td class="align-left"><?= implode(', ', $item['genres']) ?></td>
<td class="align-left"><?= $item['notes'] ?></td>
</tr> </tr>

View File

@ -1,3 +1,4 @@
<?php use function Aviat\AnimeClient\col_not_empty; ?>
<main> <main>
<?php if ($auth->isAuthenticated()): ?> <?php if ($auth->isAuthenticated()): ?>
<a class="bracketed" href="<?= $url->generate($collection_type . '.collection.add.get') ?>">Add Item</a> <a class="bracketed" href="<?= $url->generate($collection_type . '.collection.add.get') ?>">Add Item</a>
@ -11,28 +12,26 @@
<?php $i = 0; ?> <?php $i = 0; ?>
<div class="tabs"> <div class="tabs">
<?php foreach ($sections as $name => $items): ?> <?php foreach ($sections as $name => $items): ?>
<input <?= $i === 0 ? 'checked="checked"' : '' ?> type="radio" id="collection-tab-<?= $i ?>" <?php $hasNotes = col_not_empty($items, 'notes') ?>
name="collection-tabs"/> <input type="radio" id="collection-tab-<?= $i ?>" name="collection-tabs" />
<label for="collection-tab-<?= $i ?>"><h2><?= $name ?></h2></label> <label for="collection-tab-<?= $i ?>"><h2><?= $name ?></h2></label>
<div class="content full-height"> <div class="content full-height">
<table class="full-width media-wrap"> <table class="full-width media-wrap">
<thead> <thead>
<tr> <tr>
<?php if ($auth->isAuthenticated()): ?> <?php if ($auth->isAuthenticated()): ?><td>&nbsp;</td><?php endif ?>
<td>Actions</td> <th>Title</th>
<?php endif ?> <th>Episode Count</th>
<th>Title</th> <th>Episode Length</th>
<th>Episode Count</th> <th>Show Type</th>
<th>Episode Length</th> <th>Age Rating</th>
<th>Show Type</th> <?php if ($hasNotes): ?><th>Notes</th><?php endif ?>
<th>Age Rating</th> <th>Genres</th>
<th>Genres</th> </tr>
<th>Notes</th>
</tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($items as $item): ?> <?php foreach ($items as $item): ?>
<?php include __DIR__ . '/list-item.php' ?> <?php include 'list-item.php' ?>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
@ -40,34 +39,7 @@
<?php $i++ ?> <?php $i++ ?>
<?php endforeach ?> <?php endforeach ?>
<!-- All --> <!-- All -->
<input type='radio' id='collection-tab-<?= $i ?>' name='collection-tabs' /> <?php include 'list-all.php' ?>
<label for='collection-tab-<?= $i ?>'><h2>All</h2></label>
<div class="content full-height">
<?php foreach ($sections as $name => $items): ?>
<h3><?= $name ?></h3>
<table class="full-width media-wrap">
<thead>
<tr>
<?php if ($auth->isAuthenticated()): ?>
<td>Actions</td>
<?php endif ?>
<th>Title</th>
<th>Episode Count</th>
<th>Episode Length</th>
<th>Show Type</th>
<th>Age Rating</th>
<th>Genres</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<?php foreach ($items as $item): ?>
<?php include __DIR__ . '/list-item.php' ?>
<?php endforeach ?>
</tbody>
</table>
<?php endforeach; ?>
</div>
</div> </div>
<?php endif ?> <?php endif ?>
</main> </main>