HummingBirdAnimeClient/app/views/manga/list.php

50 lines
1.5 KiB
PHP
Raw Normal View History

<main>
2017-02-15 15:56:10 -05:00
<?php if ($auth->is_authenticated()): ?>
2016-02-02 11:34:03 -05:00
<a class="bracketed" href="<?= $urlGenerator->url('manga/add') ?>">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>
<?php if ($auth->is_authenticated()): ?>
<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>
<th>Type</th>
</tr>
</thead>
<tbody>
<?php foreach($items as $item): ?>
2015-10-06 11:38:20 -04:00
<tr id="manga-<?= $item['id'] ?>">
<?php if($auth->is_authenticated()): ?>
<td>
<a class="bracketed" href="<?= $urlGenerator->url("manga/edit/{$item['id']}/{$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>
2015-10-01 16:01:23 -04:00
<td><?= $item['manga']['type'] ?></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>