HummingBirdAnimeClient/app/views/manga/list.php

71 lines
2.1 KiB
PHP
Raw Normal View History

<main>
2017-02-15 16:30:14 -05:00
<?php if ($auth->isAuthenticated()): ?>
2017-03-30 16:16:40 -04:00
<a class="bracketed" href="<?= $url->generate('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: ?>
<?php foreach ($sections as $name => $items): ?>
<h2><?= $name ?></h2>
<table>
<thead>
<tr>
2017-02-15 16:30:14 -05:00
<?php if ($auth->isAuthenticated()): ?>
<th>&nbsp;</th>
<?php endif ?>
<th>Title</th>
<th>Rating</th>
2017-01-04 13:16:58 -05:00
<th>Completed Chapters</th>
<th># of Volumes</th>
2017-03-30 14:50:25 -04:00
<th>Attributes</th>
<th>Type</th>
<th>Genres</th>
</tr>
</thead>
<tbody>
<?php foreach($items as $item): ?>
2015-10-06 11:38:20 -04:00
<tr id="manga-<?= $item['id'] ?>">
2017-02-15 16:30:14 -05:00
<?php if($auth->isAuthenticated()): ?>
<td>
2017-03-30 16:16:40 -04:00
<a class="bracketed" href="<?= $url->generate('edit', [
'controller' => 'manga',
'id' => $item['id'],
'status' => $name
]) ?>">Edit</a>
</td>
<?php endif ?>
<td class="align_left">
2016-04-14 17:51:00 -04:00
<a href="<?= $url->generate('manga.details', ['id' => $item['manga']['slug']]) ?>">
<?= array_shift($item['manga']['titles']) ?>
</a>
<?php foreach($item['manga']['titles'] as $title): ?>
<br /><?= $title ?>
<?php endforeach ?>
</td>
2015-10-01 16:01:23 -04:00
<td><?= $item['user_rating'] ?> / 10</td>
<td><?= $item['chapters']['read'] ?> / <?= $item['chapters']['total'] ?></td>
2017-01-04 13:16:58 -05:00
<td><?= $item['volumes']['total'] ?></td>
2017-03-30 14:50:25 -04:00
<td>
<ul>
<?php if ($item['reread'] > 0): ?>
<li>Reread <?= $item['reread'] ?> time(s)</li>
<?php endif ?>
<?php foreach(['rereading'] as $attr): ?>
<?php if($item[$attr]): ?>
<li><?= ucfirst($attr); ?></li>
<?php endif ?>
<?php endforeach ?>
</ul>
</td>
2015-10-01 16:01:23 -04:00
<td><?= $item['manga']['type'] ?></td>
<td class="align_left">
<?= implode(', ', $item['manga']['genres']) ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endforeach ?>
<?php endif ?>
</main>
2017-02-15 15:56:10 -05:00
<script defer="defer" src="<?= $urlGenerator->assetUrl('js.php/g/table') ?>"></script>