HummingBirdAnimeClient/app/views/manga/list.php

79 lines
2.3 KiB
PHP
Raw Permalink Normal View History

2018-08-10 20:09:28 -04:00
<main class="media-list">
<?php if ($_->isAuthenticated()): ?>
<a class="bracketed" href="<?= $_->urlFromRoute('manga.add.get') ?>">Add Item</a>
2017-02-15 15:56:10 -05:00
<?php endif ?>
<?php if (empty($sections)): ?>
<h3>There's nothing here!</h3>
<?php else: ?>
<br />
<label>Filter: <input type='text' class='media-filter' /></label>
<br />
<?php foreach ($sections as $name => $items): ?>
<h2><?= $name ?></h2>
2017-09-14 17:33:24 -04:00
<?php if (empty($items)): ?>
<h3>There's nothing here!</h3>
<?php else: ?>
<table class='media-wrap'>
2017-09-14 17:33:24 -04:00
<thead>
<tr>
<?php if ($_->isAuthenticated()): ?>
2018-08-10 20:09:28 -04:00
<td>&nbsp;</td>
2017-03-30 14:50:25 -04:00
<?php endif ?>
2017-09-14 17:33:24 -04:00
<th>Title</th>
<th class='numeric'>Score</th>
<th class='numeric'>Completed Chapters</th>
2017-09-14 17:33:24 -04:00
<th>Attributes</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<?php foreach($items as $item): ?>
<tr id="manga-<?= $item['id'] ?>">
<?php if($_->isAuthenticated()): ?>
2017-09-14 17:33:24 -04:00
<td>
<a class="bracketed" href="<?= $_->urlFromRoute('edit', [
2017-09-14 17:33:24 -04:00
'controller' => 'manga',
'id' => $item['id'],
'status' => $name
]) ?>">Edit</a>
</td>
<?php endif ?>
<td class="align-left">
<a href="<?= $_->urlFromRoute('manga.details', ['id' => $item['manga']['slug']]) ?>">
2018-08-08 13:05:38 -04:00
<?= $item['manga']['title'] ?>
2017-09-14 17:33:24 -04:00
</a>
<?php foreach($item['manga']['titles'] as $title): ?>
<br /><?= $title ?>
<?php endforeach ?>
</td>
<td><?= $item['user_rating'] ?> / 10</td>
<td><?= $item['chapters']['read'] ?> / <?= $item['chapters']['total'] ?></td>
<td>
<ul>
2020-05-05 19:12:17 -04:00
<?php if ($item['reread'] == 1): ?>
<li>Reread once</li>
<?php elseif ($item['reread'] == 2): ?>
<li>Reread twice</li>
<?php elseif ($item['reread'] == 3): ?>
<li>Reread thrice</li>
<?php elseif ($item['reread'] > 3): ?>
<li>Reread <?= $item['reread'] ?> times</li>
2017-03-30 14:50:25 -04:00
<?php endif ?>
2017-09-14 17:33:24 -04:00
<?php foreach(['rereading'] as $attr): ?>
<?php if($item[$attr]): ?>
<li><?= ucfirst($attr); ?></li>
<?php endif ?>
<?php endforeach ?>
</ul>
</td>
<td><?= $item['manga']['type'] ?></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif ?>
<?php endforeach ?>
<?php endif ?>
</main>
<script defer="defer" src="<?= $_->assetUrl('js/tables.min.js') ?>"></script>