2015-06-16 11:11:35 -04:00
|
|
|
<main>
|
2016-01-04 10:53:03 -05:00
|
|
|
<?php if ($auth->is_authenticated()): ?>
|
|
|
|
<a class="bracketed" href="<?= $urlGenerator->url('anime/add', 'anime') ?>">Add Item</a>
|
|
|
|
<?php endif ?>
|
2015-07-02 14:04:04 -04:00
|
|
|
<?php if (empty($sections)): ?>
|
|
|
|
<h3>There's nothing here!</h3>
|
|
|
|
<?php else: ?>
|
2015-06-16 11:11:35 -04:00
|
|
|
<?php foreach ($sections as $name => $items): ?>
|
|
|
|
<h2><?= $name ?></h2>
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2016-01-04 10:53:03 -05:00
|
|
|
<?php if($auth->is_authenticated()): ?>
|
2016-02-01 09:49:18 -05:00
|
|
|
<td class="no_border"> </td>
|
2016-01-04 10:53:03 -05:00
|
|
|
<?php endif ?>
|
2015-06-16 11:11:35 -04:00
|
|
|
<th>Title</th>
|
|
|
|
<th>Airing Status</th>
|
|
|
|
<th>Score</th>
|
|
|
|
<th>Type</th>
|
|
|
|
<th>Progress</th>
|
|
|
|
<th>Rated</th>
|
2016-01-04 10:53:03 -05:00
|
|
|
<th>Attributes</th>
|
2015-10-01 16:01:23 -04:00
|
|
|
<th>Notes</th>
|
2015-07-02 14:04:04 -04:00
|
|
|
<th>Genres</th>
|
2015-06-16 11:11:35 -04:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php foreach($items as $item): ?>
|
2016-01-04 10:53:03 -05:00
|
|
|
<?php if ($item['private'] && ! $auth->is_authenticated()) continue; ?>
|
2015-10-06 11:38:20 -04:00
|
|
|
<tr id="a-<?= $item['id'] ?>">
|
2016-01-04 10:53:03 -05:00
|
|
|
<?php if ($auth->is_authenticated()): ?>
|
|
|
|
<td>
|
|
|
|
<a class="bracketed" href="<?= $urlGenerator->url("/anime/edit/{$item['id']}/{$item['watching_status']}") ?>">Edit</a>
|
|
|
|
</td>
|
|
|
|
<?php endif ?>
|
2016-02-01 09:49:18 -05:00
|
|
|
<td class="justify">
|
2016-01-04 10:53:03 -05:00
|
|
|
<a href="<?= $item['anime']['url'] ?>" target="_blank">
|
2015-06-16 11:11:35 -04:00
|
|
|
<?= $item['anime']['title'] ?>
|
2015-06-11 16:44:52 -04:00
|
|
|
</a>
|
2015-10-09 14:34:55 -04:00
|
|
|
<?= ( ! empty($item['anime']['alternate_title'])) ? " <br /> " . $item['anime']['alternate_title'] : "" ?>
|
2015-06-16 11:11:35 -04:00
|
|
|
</td>
|
2015-10-01 16:01:23 -04:00
|
|
|
<td class="align_left"><?= $item['airing']['status'] ?></td>
|
|
|
|
<td><?= $item['user_rating'] ?> / 10 </td>
|
|
|
|
<td><?= $item['anime']['type'] ?></td>
|
2016-02-01 09:49:18 -05:00
|
|
|
<td class="align_left" id="<?= $item['anime']['slug'] ?>">
|
2016-01-04 10:53:03 -05:00
|
|
|
Episodes: <br />
|
|
|
|
<span class="completed_number"><?= $item['episodes']['watched'] ?></span> / <span class="total_number"><?= $item['episodes']['total'] ?></span>
|
|
|
|
</td>
|
2015-06-16 11:11:35 -04:00
|
|
|
<td><?= $item['anime']['age_rating'] ?></td>
|
2016-01-04 10:53:03 -05:00
|
|
|
<td>
|
2016-01-06 11:08:56 -05:00
|
|
|
<?php if ($item['rewatched'] > 0): ?>
|
|
|
|
Rewatched <?= $item['rewatched'] ?> time(s)<br />
|
|
|
|
<?php endif ?>
|
2016-01-04 10:53:03 -05:00
|
|
|
<?php $attr_list = []; ?>
|
|
|
|
<?php foreach(['private','rewatching'] as $attr): ?>
|
|
|
|
<?php if($item[$attr]): ?>
|
|
|
|
<?php $attr_list[] = ucfirst($attr); ?>
|
|
|
|
<?php endif ?>
|
2015-07-02 14:04:04 -04:00
|
|
|
<?php endforeach ?>
|
2016-01-04 10:53:03 -05:00
|
|
|
<?= implode(', ', $attr_list); ?>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<p><?= $escape->html($item['notes']) ?></p>
|
|
|
|
</td>
|
|
|
|
<td class="align_left">
|
|
|
|
<?php sort($item['anime']['genres']) ?>
|
|
|
|
<?= join(', ', $item['anime']['genres']) ?>
|
2015-07-02 14:04:04 -04:00
|
|
|
</td>
|
2015-06-16 11:11:35 -04:00
|
|
|
</tr>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<?php endforeach ?>
|
2015-07-02 14:04:04 -04:00
|
|
|
<?php endif ?>
|
2015-06-16 11:11:35 -04:00
|
|
|
</main>
|
2016-01-04 10:53:03 -05:00
|
|
|
<?php $group = ($auth->is_authenticated()) ? 'table_edit' : 'table' ?>
|
2016-02-04 21:57:14 -05:00
|
|
|
<script src="<?= $urlGenerator->asset_url("js.php/g/{$group}") ?>"></script>
|