diff --git a/app/config/routes.php b/app/config/routes.php
index aa138002..956eaa31 100644
--- a/app/config/routes.php
+++ b/app/config/routes.php
@@ -87,6 +87,13 @@ return [
'action' => 'delete',
'verb' => 'post',
],
+ 'manga.details' => [
+ 'path' => '/manga/details/{id}',
+ 'action' => 'details',
+ 'tokens' => [
+ 'id' => '[a-z0-9\-]+',
+ ],
+ ],
// ---------------------------------------------------------------------
// Anime Collection Routes
// ---------------------------------------------------------------------
diff --git a/app/views/manga/cover.php b/app/views/manga/cover.php
index 0677ff34..2bb8498e 100644
--- a/app/views/manga/cover.php
+++ b/app/views/manga/cover.php
@@ -19,7 +19,7 @@
-
+
= $escape->html($item['manga']['title']) ?>
= (isset($item['manga']['alternate_title'])) ? "
({$item['manga']['alternate_title']})" : ""; ?>
diff --git a/app/views/manga/details.php b/app/views/manga/details.php
new file mode 100644
index 00000000..986fca43
--- /dev/null
+++ b/app/views/manga/details.php
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+ Manga Type |
+ = $data['manga_type'] ?> |
+
+
+ Volume Count |
+ = $data['volume_count'] ?> |
+
+
+ Chapter Count |
+ = $data['chapter_count'] ?> |
+
+
+ Genres |
+
+ = implode(', ', $data['genres']); ?>
+ |
+
+
+
+
+
+
+
= $data['english_title'] ?>
+
+
+
+
= nl2br($data['synopsis']) ?>
+
+
+
\ No newline at end of file
diff --git a/app/views/manga/list.php b/app/views/manga/list.php
index 92593abe..a0b35bd2 100644
--- a/app/views/manga/list.php
+++ b/app/views/manga/list.php
@@ -29,7 +29,7 @@
-
+
= $item['manga']['title'] ?>
= ( ! is_null($item['manga']['alternate_title'])) ? " · " . $item['manga']['alternate_title'] : "" ?>
diff --git a/src/Aviat/AnimeClient/AnimeClient.php b/src/Aviat/AnimeClient/AnimeClient.php
index 431e9a89..435afc86 100644
--- a/src/Aviat/AnimeClient/AnimeClient.php
+++ b/src/Aviat/AnimeClient/AnimeClient.php
@@ -38,7 +38,8 @@ class AnimeClient {
'update',
'update_form',
'login',
- 'logout'
+ 'logout',
+ 'details'
];
/**
diff --git a/src/Aviat/AnimeClient/Controller/Anime.php b/src/Aviat/AnimeClient/Controller/Anime.php
index dd6d4acb..47512258 100644
--- a/src/Aviat/AnimeClient/Controller/Anime.php
+++ b/src/Aviat/AnimeClient/Controller/Anime.php
@@ -287,7 +287,7 @@ class Anime extends BaseController {
$data = $this->model->get_anime($anime_id);
$this->outputHTML('anime/details', [
- 'title' => $data['title'],
+ 'title' => 'Anime · ' . $data['title'],
'data' => $data,
]);
}
diff --git a/src/Aviat/AnimeClient/Controller/Manga.php b/src/Aviat/AnimeClient/Controller/Manga.php
index ad836699..47aeffdd 100644
--- a/src/Aviat/AnimeClient/Controller/Manga.php
+++ b/src/Aviat/AnimeClient/Controller/Manga.php
@@ -253,5 +253,21 @@ class Manga extends Controller {
$this->session_redirect();
}
+
+ /**
+ * View details of an manga
+ *
+ * @param string $manga_id
+ * @return void
+ */
+ public function details($manga_id)
+ {
+ $data = $this->model->get_manga($manga_id);
+
+ $this->outputHTML('manga/details', [
+ 'title' => 'Manga · ' . $data['manga']['romaji_title'],
+ 'data' => $data['manga'],
+ ]);
+ }
}
// End of MangaController.php
\ No newline at end of file
diff --git a/src/Aviat/AnimeClient/Model/Manga.php b/src/Aviat/AnimeClient/Model/Manga.php
index 24334239..6a6e3c94 100644
--- a/src/Aviat/AnimeClient/Model/Manga.php
+++ b/src/Aviat/AnimeClient/Model/Manga.php
@@ -224,6 +224,18 @@ class Manga extends API {
return $transformed_data;
}
+ /**
+ * Get the details of a manga
+ *
+ * @param string $manga_id
+ * @return array
+ */
+ public function get_manga($manga_id)
+ {
+ $raw = $this->_manga_api_call('get', "manga/{$manga_id}.json");
+ return Json::decode($raw['body'], TRUE);
+ }
+
/**
* Map transformed anime data to be organized by reading status
*
|