From 384834c9fb85d3a408c60dd38e8d1474116793ad Mon Sep 17 00:00:00 2001 From: raylu Date: Sun, 17 Jul 2011 16:41:22 -0700 Subject: some anime view styling --- controllers/AnimeController.php | 18 +++++-- views/anime/view.html.php | 117 +++++++++++++++++++++++----------------- views/layouts/default.html.php | 4 +- webroot/css/base.css | 6 ++- webroot/css/view.css | 21 ++++++++ 5 files changed, 110 insertions(+), 56 deletions(-) create mode 100644 webroot/css/view.css diff --git a/controllers/AnimeController.php b/controllers/AnimeController.php index bd29116..09c0828 100644 --- a/controllers/AnimeController.php +++ b/controllers/AnimeController.php @@ -16,10 +16,22 @@ class AnimeController extends \lithium\action\Controller { public function view($id = null) { - if (is_numeric($id)) { - return Anime::search($id, null, 'special_id'); + if (is_numeric($id)) + { + $data = Anime::search($id, null, 'special_id'); + $related = $data['anime']->related; + $str = ''; + for ($i = 0; $i < count($related); $i++) + { + if ($i > 0) $str .= ', '; + $ra = Anime::search($related[$i], null, 'special_id'); + $str .= '' . $ra['anime']->title . ''; + } + $data['related'] = $str; + return $data; } - else { + else + { return $this->redirect(array('controller' => 'search','q' => array('search' => $id))); } diff --git a/views/anime/view.html.php b/views/anime/view.html.php index 4a3b8c9..1b0eb0c 100644 --- a/views/anime/view.html.php +++ b/views/anime/view.html.php @@ -1,58 +1,77 @@ -

title ?>

+styles($this->html->style('view')); +?> + +

title ?>

-
+
-
- - -
- -

Synopsis

-
-synopsis ?> + +
-

Related Animes

-
+

Synopsis

+
+
+

synopsis ?>

-

Characters And VA's

-
-cast as $char): ?> +

Characters and VA's

+
+
+cast as $char): ?> character ?> role ?> Played by: @@ -65,4 +84,4 @@ Played by:

-
\ No newline at end of file + diff --git a/views/layouts/default.html.php b/views/layouts/default.html.php index 9464d80..9313414 100644 --- a/views/layouts/default.html.php +++ b/views/layouts/default.html.php @@ -69,9 +69,9 @@ use \lithium\security\Auth;
-
+
content() ?> -
+