HummingBirdAnimeClient/app/views/manga/edit.php

111 lines
3.5 KiB
PHP
Raw Normal View History

2017-02-15 16:30:14 -05:00
<?php if ($auth->isAuthenticated()): ?>
<main>
2018-08-10 20:09:28 -04:00
<h2>
Edit Manga List Item
</h2>
<form action="<?= $action ?>" method="post">
2018-08-13 15:13:20 -04:00
<table class="invisible form">
<thead>
<tr>
<th>
2018-08-13 15:13:20 -04:00
<h3><?= $escape->html($item['manga']['title']) ?></h3>
<?php foreach ($item['manga']['titles'] as $title): ?>
<h4><?= $escape->html($title) ?></h4>
<?php endforeach ?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="9">
2019-05-08 14:18:18 -04:00
<?= $helper->picture("images/manga/{$item['manga']['id']}-original.webp", "jpg", [], ["width" => "390"]) ?>
2018-08-13 15:13:20 -04:00
</td>
</tr>
<tr>
<td><label for="status">Reading Status</label></td>
<td>
<select name="status" id="status">
2018-08-13 15:13:20 -04:00
<?php foreach ($status_list as $val => $status): ?>
<option <?php if ($item['reading_status'] === $val): ?>selected="selected"<?php endif ?>
value="<?= $val ?>"><?= $status ?></option>
<?php endforeach ?>
</select>
</td>
</tr>
<tr>
<td><label for="series_rating">Rating</label></td>
<td>
2018-08-13 15:13:20 -04:00
<input type="number" min="0" max="10" maxlength="2" name="new_rating"
value="<?= $item['user_rating'] ?>" id="series_rating" size="2"/> / 10
</td>
</tr>
<tr>
<td><label for="chapters_read">Chapters Read</label></td>
<td>
2018-08-13 15:13:20 -04:00
<input type="number" min="0" name="chapters_read" id="chapters_read"
value="<?= $item['chapters']['read'] ?>"/> / <?= $item['chapters']['total'] ?>
</td>
</tr>
2018-08-08 13:05:38 -04:00
<tr>
<td><label for="volumes_read">Volumes Read</label></td>
<td>
2018-08-13 15:13:20 -04:00
<?php /*<input type="number" disabled="disabled" min="0" name="volumes_read" id="volumes_read" value="" /> */ ?>
- / <?= $item['volumes']['total'] ?>
</td>
2018-08-08 13:05:38 -04:00
</tr>
<tr>
<td><label for="rereading_flag">Rereading?</label></td>
<td>
2017-01-31 12:52:43 -05:00
<input type="checkbox" name="rereading" id="rereading_flag"
2018-08-13 15:13:20 -04:00
<?php if ($item['rereading'] === TRUE): ?>checked="checked"<?php endif ?>
/>
</td>
</tr>
<tr>
<td><label for="reread_count">Reread Count</label></td>
<td>
2018-08-13 15:13:20 -04:00
<input type="number" min="0" id="reread_count" name="reread_count"
value="<?= $item['reread'] ?>"/>
</td>
</tr>
<tr>
<td><label for="notes">Notes</label></td>
<td>
<textarea name="notes" id="notes"><?= $escape->html($item['notes']) ?></textarea>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
2018-08-13 15:13:20 -04:00
<input type="hidden" value="<?= $item['id'] ?>" name="id"/>
<input type="hidden" value="<?= $item['mal_id'] ?>" name="mal_id"/>
<input type="hidden" value="<?= $item['manga']['slug'] ?>" name="manga_id"/>
<input type="hidden" value="<?= $item['user_rating'] ?>" name="old_rating"/>
<input type="hidden" value="true" name="edit"/>
<button type="submit">Submit</button>
</td>
</tr>
2018-08-13 15:13:20 -04:00
</tbody>
</table>
</form>
<fieldset>
<legend>Danger Zone</legend>
<form class="js-delete" action="<?= $url->generate('manga.delete') ?>" method="post">
<table class="form invisible">
<tbody>
<tr>
2019-05-08 14:18:18 -04:00
<td class="danger">
<strong>Permanently</strong> remove this list item and <strong>all</strong> its data?
</td>
<td>
2018-08-13 15:13:20 -04:00
<input type="hidden" value="<?= $item['id'] ?>" name="id"/>
<input type="hidden" value="<?= $item['mal_id'] ?>" name="mal_id"/>
<button type="submit" class="danger">Delete Entry</button>
</td>
</tr>
</tbody>
</table>
</form>
</fieldset>
</main>
<?php endif ?>