Skip to content

Commit

Permalink
Update header comments, add start of manga editing functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
timw4mail committed Jan 4, 2016
1 parent 6455541 commit 205c7ac
Show file tree
Hide file tree
Showing 64 changed files with 332 additions and 134 deletions.
2 changes: 1 addition & 1 deletion app/config/base_config.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion app/config/config.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion app/config/database.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion app/config/menus.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion app/config/minify_config.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion app/config/minify_css_groups.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion app/config/minify_js_groups.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion app/config/routes.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
4 changes: 2 additions & 2 deletions app/config/routing.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand All @@ -28,7 +28,7 @@

// Default pages for anime/manga
'default_anime_list_path' => "watching", // watching|plan_to_watch|on_hold|dropped|completed|all
'default_manga_list_path' => "all", // reading|plan_to_read|on_hold|dropped|completed|all
'default_manga_list_path' => "reading", // reading|plan_to_read|on_hold|dropped|completed|all

// Default view type (cover_view/list_view)
'default_view_type' => 'cover_view',
Expand Down
4 changes: 2 additions & 2 deletions app/views/anime/cover.php
Expand Up @@ -26,13 +26,13 @@
<?php if ($auth->is_authenticated()): ?>
<div class="row">
<span class="edit">
<a class="bracketed" title="Edit information about this anime" href="<?= $urlGenerator->url("anime/edit/{$item['id']}/{$item['watching_status']}", "anime") ?>">Edit</a>
<a class="bracketed" title="Edit information about this anime" href="<?= $urlGenerator->url("anime/edit/{$item['id']}/{$item['watching_status']}") ?>">Edit</a>
</span>
</div>
<?php endif ?>
<?php if ($item['private'] || $item['rewatching']): ?>
<div class="row">
<?php foreach(['private', 'rewatching'] as $attr): ?>
<?php foreach(['private', 'rereading'] as $attr): ?>
<?php if($item[$attr]): ?>
<span class="item-<?= $attr ?>"><?= ucfirst($attr) ?></span>
<?php endif ?>
Expand Down
Empty file added app/views/manga/add.php
Empty file.
7 changes: 7 additions & 0 deletions app/views/manga/cover.php
Expand Up @@ -22,6 +22,13 @@
</a>
</div>
<div class="table">
<?php if ($auth->is_authenticated()): ?>
<div class="row">
<span class="edit">
<a class="bracketed" title="Edit information about this manga" href="<?= $urlGenerator->url("manga/edit/{$item['id']}/{$name}") ?>">Edit</a>
</span>
</div>
<?php endif ?>
<div class="row">
<div class="user_rating">Rating: <?= $item['user_rating'] ?> / 10</div>
</div>
Expand Down
97 changes: 97 additions & 0 deletions app/views/manga/edit.php
@@ -0,0 +1,97 @@
<?php if ($auth->is_authenticated()): ?>
<main>
<h1>
Edit <?= $item['manga']['title'] ?>
<?= ($item['manga']['alternate_title'] != "") ? "({$item['manga']['alternate_title']})" : ""; ?>
</h1>
<form action="<?= $action ?>" method="post">
<table class="form">
<thead>
<tr>
<th>
<h3><?= $escape->html($item['manga']['title']) ?></h3>
<?php if($item['manga']['alternate_title'] != ""): ?>
<h4><?= $escape->html($item['manga']['alternate_title']) ?></h4>
<?php endif ?>
</th>
<th>
<article class="media">
<?= $helper->img($item['manga']['image']); ?>
</article>
</th>
</tr>
</thead>
<tbody>
<tr>
<td><label for="private">Is Private?</label></td>
<td>
<input type="checkbox" name="private" id="private"
<?php if($item['private']): ?>checked="checked"<?php endif ?>
/>
</td>
</tr>
<tr>
<td><label for="status">Reading Status</label></td>
<td>
<select name="status" id="status">
<?php foreach($status_list as $status): ?>
<option <?php if($item['reading_status'] === $status): ?>selected="selected"<?php endif ?>
value="<?= $status ?>"><?= $status ?></option>
<?php endforeach ?>
</select>
</td>
</tr>
<tr>
<td><label for="series_rating">Rating</label></td>
<td>
<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>
<input type="number" min="0" name="chapters_read" id="chapters_read" value="<?= $item['chapters']['read'] ?>" /> / <?= $item['chapters']['total'] ?>
</td>
</tr>
<tr>
<td><label for="volumes_read">Volumes Read</label></td>
<td>
<input type="number" min="0" name="volumes_read" id="volumes_read" value="<?= $item['volumes']['read'] ?>" /> / <?= $item['volumes']['total'] ?>
</td>
</tr>
<tr>
<td><label for="rereading_flag">Rereading?</label></td>
<td>
<input type="checkbox" name="reareading" id="rereading_flag"
<?php if($item['rereading'] === TRUE): ?>checked="checked"<?php endif ?>
/>
</td>
</tr>
<tr>
<td><label for="reread_count">Reread Count</label></td>
<td>
<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>
<input type="hidden" value="<?= $item['id'] ?>" name="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>
</tbody>
</table>
</form>
</main>
<script src="<?= $urlGenerator->asset_url('js.php?g=edit') ?>"></script>
<?php endif ?>
8 changes: 8 additions & 0 deletions app/views/manga/list.php
Expand Up @@ -7,6 +7,9 @@
<table>
<thead>
<tr>
<?php if ($auth->is_authenticated()): ?>
<th>&nbsp;</th>
<?php endif ?>
<th>Title</th>
<th>Rating</th>
<th>Chapters</th>
Expand All @@ -17,6 +20,11 @@
<tbody>
<?php foreach($items as $item): ?>
<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">
<a href="<?= $item['manga']['url'] ?>">
<?= $item['manga']['title'] ?>
Expand Down
2 changes: 1 addition & 1 deletion build/animeclient_header_comment.txt
Expand Up @@ -5,7 +5,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
2 changes: 1 addition & 1 deletion build/ion_header_comment.txt
Expand Up @@ -5,6 +5,6 @@
*
* @package Ion
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @license MIT
*/
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion public/css.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion public/js.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Aviat/AnimeClient/AnimeClient.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Aviat/AnimeClient/Auth/HummingbirdAuth.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Aviat/AnimeClient/Config.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Aviat/AnimeClient/Controller.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down
6 changes: 3 additions & 3 deletions src/Aviat/AnimeClient/Controller/Anime.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down Expand Up @@ -173,7 +173,7 @@ public function add()
*/
public function edit($id, $status = "all")
{
$item = $this->model->get_library_anime($id, $status);
$item = $this->model->get_library_item($id, $status);
$raw_status_list = AnimeWatchingStatus::getConstList();

$statuses = [];
Expand Down Expand Up @@ -224,7 +224,7 @@ public function form_update()
$post_data = $transformer->untransform($post_data);

$full_result = $this->model->update($post_data);
$result = $result['body'];
$result = $full_result['body'];

if (array_key_exists('anime', $result))
{
Expand Down
2 changes: 1 addition & 1 deletion src/Aviat/AnimeClient/Controller/Collection.php
Expand Up @@ -6,7 +6,7 @@
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren
* @copyright Copyright (c) 2015
* @copyright Copyright (c) 2015 - 2016
* @link https://github.com/timw4mail/HummingBirdAnimeClient
* @license MIT
*/
Expand Down

0 comments on commit 205c7ac

Please sign in to comment.