From 2dde6f8a7df56d704953114942b1bfef298cb7bb Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Tue, 29 Mar 2016 11:30:51 -0400 Subject: [PATCH] Fix issue with cover not being hidden on last episode --- app/bootstrap.php | 1 + public/css/base.css | 4 +++- public/css/base.myth.css | 2 +- public/css/marx.css | 3 --- public/css/marx.myth.css | 2 -- public/js/anime_edit.js | 6 ++---- src/Aviat/AnimeClient/Controller/Anime.php | 12 +++++++----- src/Aviat/AnimeClient/Controller/Manga.php | 1 - src/Aviat/AnimeClient/Model/AnimeCollection.php | 2 -- 9 files changed, 14 insertions(+), 19 deletions(-) diff --git a/app/bootstrap.php b/app/bootstrap.php index 9b354c2f..e4958ca7 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -30,6 +30,7 @@ return function(array $config_array = []) { $app_logger = new Logger('animeclient'); $app_logger->pushHandler(new RotatingFileHandler(__DIR__ . '/logs/app.log', Logger::NOTICE)); + $app_logger->pushHandler(new BrowserConsoleHandler(Logger::INFO)); $container->setLogger($app_logger, 'default'); // ------------------------------------------------------------------------- diff --git a/public/css/base.css b/public/css/base.css index 65ac1e7d..0887a1c9 100644 --- a/public/css/base.css +++ b/public/css/base.css @@ -1,4 +1,6 @@ -template { +template, +[hidden="hidden"], +.media[hidden] { display: none; } diff --git a/public/css/base.myth.css b/public/css/base.myth.css index ba3fa8a3..23e86327 100644 --- a/public/css/base.myth.css +++ b/public/css/base.myth.css @@ -9,7 +9,7 @@ --edit-link-color: #12db18; } -template {display:none} +template, [hidden="hidden"], .media[hidden] {display:none} body {margin: 0.5em;} diff --git a/public/css/marx.css b/public/css/marx.css index 6d93551b..d7c215a3 100644 --- a/public/css/marx.css +++ b/public/css/marx.css @@ -17,9 +17,6 @@ details { display: block; } -/*input[type="number"] { - width: auto; }*/ - input[type="search"] { -webkit-appearance: textfield; } diff --git a/public/css/marx.myth.css b/public/css/marx.myth.css index e1fa55bd..9303f342 100644 --- a/public/css/marx.myth.css +++ b/public/css/marx.myth.css @@ -15,8 +15,6 @@ audio:not([controls]) { details { display: block; } -/*input[type="number"] { - width: auto; }*/ input[type="search"] { -webkit-appearance: textfield; } input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { diff --git a/public/js/anime_edit.js b/public/js/anime_edit.js index 61235b09..8ce99863 100755 --- a/public/js/anime_edit.js +++ b/public/js/anime_edit.js @@ -7,9 +7,7 @@ // Action to increment episode count _.on('body.anime.list', 'click', '.plus_one', function(e) { - let this_sel = this; let parent_sel = _.closestParent(this, 'article'); - let watched_count = parseInt(_.$('.completed_number', parent_sel)[0].textContent, 10); let total_count = parseInt(_.$('.total_number', parent_sel)[0].textContent, 10); let title = _.$('.name a', parent_sel)[0].textContent; @@ -27,7 +25,7 @@ } // If you increment at the last episode, mark as completed - if (( ! isNaN(watched_count)) && (watched_count + 1) === total_count) { + if (( ! isNaN(watched_count)) && (watched_count + 1) == total_count) { delete data.increment_episodes; data.status = 'completed'; } @@ -39,7 +37,7 @@ type: 'POST', mimeType: 'application/json', success: (res) => { - if (res.status === 'completed') { + if (data.status == 'completed') { _.hide(parent_sel); } diff --git a/src/Aviat/AnimeClient/Controller/Anime.php b/src/Aviat/AnimeClient/Controller/Anime.php index d6c5b51a..53e75261 100644 --- a/src/Aviat/AnimeClient/Controller/Anime.php +++ b/src/Aviat/AnimeClient/Controller/Anime.php @@ -1,4 +1,5 @@ string($status_item) + $statuses[$status_item] = (string) $this->string($status_item) ->underscored() ->humanize() ->titleize(); @@ -180,7 +180,7 @@ class Anime extends BaseController { foreach ($raw_status_list as $status_item) { - $statuses[$status_item] = (string)$this->string($status_item) + $statuses[$status_item] = (string) $this->string($status_item) ->underscored() ->humanize() ->titleize(); @@ -216,12 +216,12 @@ class Anime extends BaseController { */ public function form_update() { - $post_data = $this->request->getParsedBody(); + $data = $this->request->getParsedBody(); // Do some minor data manipulation for // large form-based updates $transformer = new AnimeListTransformer(); - $post_data = $transformer->untransform($post_data); + $post_data = $transformer->untransform($data); $full_result = $this->model->update($post_data); $result = $full_result['body']; @@ -275,5 +275,7 @@ class Anime extends BaseController { 'data' => $data, ]); } + } + // End of AnimeController.php \ No newline at end of file diff --git a/src/Aviat/AnimeClient/Controller/Manga.php b/src/Aviat/AnimeClient/Controller/Manga.php index d0080544..56377d93 100644 --- a/src/Aviat/AnimeClient/Controller/Manga.php +++ b/src/Aviat/AnimeClient/Controller/Manga.php @@ -15,7 +15,6 @@ namespace Aviat\AnimeClient\Controller; use Aviat\Ion\Json; use Aviat\Ion\Di\ContainerInterface; use Aviat\AnimeClient\Controller; -use Aviat\AnimeClient\Config; use Aviat\AnimeClient\Model\Manga as MangaModel; use Aviat\AnimeClient\Hummingbird\Enum\MangaReadingStatus; use Aviat\AnimeClient\Hummingbird\Transformer\MangaListTransformer; diff --git a/src/Aviat/AnimeClient/Model/AnimeCollection.php b/src/Aviat/AnimeClient/Model/AnimeCollection.php index 905ccf87..cf7e32d4 100644 --- a/src/Aviat/AnimeClient/Model/AnimeCollection.php +++ b/src/Aviat/AnimeClient/Model/AnimeCollection.php @@ -15,8 +15,6 @@ namespace Aviat\AnimeClient\Model; use Aviat\Ion\Json; use Aviat\Ion\Di\ContainerInterface; -use Aviat\AnimeClient\AnimeClient; -use Aviat\AnimeClient\Model\Anime as AnimeModel; /** * Model for getting anime collection data