add.html.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php $this->form->config(array('templates' => array(
  2. 'error' => '<div class="notification error">{:content}</div>'))); ?>
  3. <?php if (empty($anime)): ?>
  4. <h2 class="ribbon full">Find an Anime:</h2>
  5. <div class="triangle-ribbon"></div>
  6. <br class="clear" />
  7. <?php else: ?>
  8. <h2 class="ribbon full"><?= $anime->title ?></h2>
  9. <div class="triangle-ribbon"></div>
  10. <br class="clear" />
  11. <?php endif; ?>
  12. <script type="text/javascript">
  13. $(function() {
  14. $('#tags').tagsInput();
  15. });
  16. </script>
  17. <?php
  18. echo $this->form->create($entry);
  19. //Hidden because the user can't change these.
  20. //These are stored in the anime list for faster lookup times,
  21. //So we can avoid getting this data live for every anime.
  22. if (isset($anime)) {
  23. echo $this->form->hidden('series_animedb_id', array('value' => $anime->special_id));
  24. echo $this->form->hidden('series_title', array('value' => $anime->title));
  25. echo $this->form->hidden('series_type', array('value' => $anime->view_type));
  26. echo $this->form->hidden('series_episodes', array('value' => $anime->episode_count));
  27. }
  28. echo $this->form->field('my_watched_episodes', array('label' => 'Watched Episodes'));
  29. echo $this->form->field('my_start_date', array('label' => 'Start Date'));
  30. echo $this->form->field('my_finish_date', array('label' => 'Finish Date'));
  31. echo $this->form->field('my_score', array('label' => 'Score'));
  32. echo $this->form->label('my_status', 'Status');
  33. echo $this->form->select('my_status', array('Plan to Watch' => 'Plan to Watch',
  34. 'On-Hold' => 'On-Hold',
  35. 'Completed' => 'Completed',
  36. 'Watching' => 'Watching',
  37. 'Dropped' => 'Dropped'));
  38. echo $this->form->field('my_comments', array('label' => 'Comments'));
  39. echo $this->form->field('my_times_watched', array('label' => 'Times Watched'));
  40. echo $this->form->label('rewatch_value', 'Rewatch Value');
  41. echo $this->form->select('rewatch_value', array('High', 'Medium', 'Low', 'None'), array('value' => 0));
  42. echo $this->form->field('tags', array('type' => 'textarea', 'id' => 'tags'));
  43. echo $this->form->checkbox('rewatching', array('label' =>'Rewatching?', 'value' => false));
  44. echo $this->form->submit('Save!');
  45. ?>