API client for Kitsu.io, with optional Anime collection, and optional Anilist syncing.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

edit.php 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php if ($auth->isAuthenticated()): ?>
  2. <main>
  3. <h2>Edit Anime Collection Item</h2>
  4. <form action="<?= $action_url ?>" method="post">
  5. <table class="invisible form">
  6. <tbody>
  7. <tr>
  8. <td rowspan="6" class="align-center">
  9. <article class="media">
  10. <?= $helper->img($urlGenerator->assetUrl("images/anime/{$item['hummingbird_id']}.jpg")); ?>
  11. </article>
  12. </td>
  13. </tr>
  14. <tr>
  15. <td class="align-right"><label for="title">Title</label></td>
  16. <td class="align-left">
  17. <input type="text" name="title" value="<?= $item['title'] ?>" />
  18. </td>
  19. </tr>
  20. <tr>
  21. <td class="align-right"><label for="title">Alternate Title</label></td>
  22. <td class="align-left">
  23. <input type="text" name="alternate_title" value="<?= $item['alternate_title'] ?>"/>
  24. </td>
  25. </tr>
  26. <tr>
  27. <td class="align-right"><label for="media_id">Media</label></td>
  28. <td class="align-left">
  29. <select name="media_id" id="media_id">
  30. <?php foreach($media_items as $id => $name): ?>
  31. <option <?= $item['media_id'] === $id ? 'selected="selected"' : '' ?> value="<?= $id ?>"><?= $name ?></option>
  32. <?php endforeach ?>
  33. </select>
  34. </td>
  35. </tr>
  36. <tr>
  37. <td><label for="notes">Notes</label></td>
  38. <td><textarea id="notes" name="notes"><?= $escape->html($item['notes']) ?></textarea></td>
  39. </tr>
  40. <tr>
  41. <td>&nbsp;</td>
  42. <td>
  43. <?php if($action === 'Edit'): ?>
  44. <input type="hidden" name="hummingbird_id" value="<?= $item['hummingbird_id'] ?>" />
  45. <?php endif ?>
  46. <button type="submit">Save</button>
  47. </td>
  48. </tr>
  49. </tbody>
  50. </table>
  51. </form>
  52. <fieldset>
  53. <legend>Danger Zone</legend>
  54. <form class="js-delete" action="<?= $url->generate($collection_type . '.collection.delete') ?>" method="post">
  55. <table class="form invisible">
  56. <tbody>
  57. <tr>
  58. <td>&nbsp;</td>
  59. <td>
  60. <input type="hidden" value="<?= $item['hummingbird_id'] ?>" name="hummingbird_id" />
  61. <button type="submit" class="danger">Delete Entry</button>
  62. </td>
  63. </tr>
  64. </tbody>
  65. </table>
  66. </form>
  67. </fieldset>
  68. </main>
  69. <?php endif ?>