From 2baaf56e140a06eed8fe0b1d28d744d34a537d49 Mon Sep 17 00:00:00 2001 From: raylu Date: Sun, 17 Jul 2011 17:35:41 -0700 Subject: cast (chars/VAs) on anime view page there isn't yet a views/anime/cast.html.php for non-JS, but the controller is set up for it --- controllers/AnimeController.php | 11 +++++++-- views/anime/view.html.php | 51 +++++++++++++++++++++++++---------------- webroot/css/view.css | 29 ++++++++++++++++++++++- webroot/js/functions.js | 18 +++++++++++++-- 4 files changed, 84 insertions(+), 25 deletions(-) diff --git a/controllers/AnimeController.php b/controllers/AnimeController.php index 09c0828..3a40cee 100644 --- a/controllers/AnimeController.php +++ b/controllers/AnimeController.php @@ -5,7 +5,7 @@ namespace app\controllers; use app\models\Anime; class AnimeController extends \lithium\action\Controller { - public $publicActions = array('index', 'view'); + public $publicActions = array('index', 'view', 'cast'); public function index() { @@ -34,6 +34,13 @@ class AnimeController extends \lithium\action\Controller { { return $this->redirect(array('controller' => 'search','q' => array('search' => $id))); } - + } + + public function cast($id = null) + { + if (is_numeric($id)) + { + return Anime::search($id, null, 'special_id'); + } } } diff --git a/views/anime/view.html.php b/views/anime/view.html.php index 1b0eb0c..a722935 100644 --- a/views/anime/view.html.php +++ b/views/anime/view.html.php @@ -10,7 +10,7 @@ $this->styles($this->html->style('view')); <?= $anime->title ?> -

+

foreign_titles)): $str = 'Foreign titles:'; for ($i = 0; $i < count($anime->foreign_titles); $i++) { @@ -44,12 +44,13 @@ Genres: genres); $i++) { if ($i > 0) $str .= ','; - $str .= ' ' . $anime->genres[$i] . ''; + $str .= ' ' . $anime->genres[$i] . ''; } ?>
Duration: episode_duration ?>
Rating: rated ?>
Related: -

+

+
-
- -

Synopsis

-
-
-

synopsis ?>

-

Characters and VA's

-
-
+
+

+Cast ↓ +

+

cast as $char): ?> -character ?> -role ?> -Played by: + + + people)): ?> people as $actor): ?> - name ?> - language ?> + + + + + - -
- +
+ character ?> +
name ?>language ?>

+ +
+ +
+ +

Synopsis

+
+
+

synopsis ?>

diff --git a/webroot/css/view.css b/webroot/css/view.css index c973201..4b0a9a1 100644 --- a/webroot/css/view.css +++ b/webroot/css/view.css @@ -6,11 +6,38 @@ aside#img { width: 225px; } -section { +section#info { float: left; width: 470px; } +section#cast { + float: left; + width: 620px; +} +section#cast p { + margin: 0; +} +section#cast table { + table-layout: fixed; + display: none; +} +section#cast td { + padding: 3px; +} +section#cast td:nth-child(1) { + width: 60px; +} +section#cast td:nth-child(2) { + width: 250px; +} +section#cast td:nth-child(3) { + width: 200px; +} +section#cast #castlink { + display: none; +} + aside#malstats { float: right; width: 150px; diff --git a/webroot/js/functions.js b/webroot/js/functions.js index 510b0cf..86f3f3c 100644 --- a/webroot/js/functions.js +++ b/webroot/js/functions.js @@ -10,8 +10,22 @@ jQuery(document).ready(function($) { $('form [title]').tipsy({fade: true, trigger: 'focus', gravity: 'w'}); setTimeout(function() { - $(".flash-message").fadeOut("slow", function () { - $(".flash-message").remove(); + $('.flash-message').fadeOut('slow', function () { + $('.flash-message').remove(); }); }, 2000); }); + +function toggleCast() { + var table = $('#cast table'); + if (table.css('display') == 'inline') { + table.css('display', 'none'); + $('#cast > p > a').text('Cast ↓'); + $('#castlink').css('display', 'none'); + } else { + table.css('display', 'inline'); + $('#cast > p > a').text('Cast ↑'); + $('#castlink').css('display', 'inline'); + } + return false; +} -- cgit v1.2.3