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
---
webroot/css/view.css | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 webroot/css/view.css
(limited to 'webroot/css/view.css')
diff --git a/webroot/css/view.css b/webroot/css/view.css
new file mode 100644
index 0000000..c973201
--- /dev/null
+++ b/webroot/css/view.css
@@ -0,0 +1,21 @@
+/* for viewing individual anime/manga/kdrama, rather than table.css */
+
+aside#img {
+ float: left;
+ margin: 0 25px 25px 0;
+ width: 225px;
+}
+
+section {
+ float: left;
+ width: 470px;
+}
+
+aside#malstats {
+ float: right;
+ width: 150px;
+}
+
+p {
+ text-indent: 0;
+}
--
cgit v1.2.3
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(-)
(limited to 'webroot/css/view.css')
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'));
-
+
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] . '';
} ?>= $str ?>
Duration: = $anime->episode_duration ?>
Rating: = $anime->rated ?>
Related: = $related ?>
-
+
+
-
-
-Synopsis
-
-
-= $anime->synopsis ?>
-Characters and VA's
-
-
+
+
+Cast ↓
+
+
cast as $char): ?>
-= $char->character ?>
-= $char->role ?>
-Played by:
+
+
+ = $char->character ?>
+ |
+
people)): ?>
people as $actor): ?>
- = $actor->name ?>
- = $actor->language ?>
+
+ |
+ = $actor->name ?> |
+ = $actor->language ?> |
+
-
-
-
+
+
+Cast ↑
+
+
+
+
+
+Synopsis
+
+
+= $anime->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