From dcc965ab293655136c251afe4fb6f4f41ac5cb75 Mon Sep 17 00:00:00 2001
From: raylu
Date: Sat, 16 Jul 2011 23:08:10 -0700
Subject: manga/kdrama individual search pages
---
controllers/SearchController.php | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
(limited to 'controllers')
diff --git a/controllers/SearchController.php b/controllers/SearchController.php
index abcaabd..efd25f3 100644
--- a/controllers/SearchController.php
+++ b/controllers/SearchController.php
@@ -25,8 +25,22 @@ class SearchController extends \lithium\action\Controller {
public function anime($by = 'title')
{
- $q = isset($this->request->query['q']) ? '/' . $this->request->query['q'] . '/i' : '';
+ $q = isset($this->request->query['q']) ? $this->request->query['q'] : '';
$page = isset($this->request->query['page']) ? $this->request->query['page'] : 1;
- return Anime::search($q, $page, 'title');
+ return Anime::search("/$q/i", $page, 'title');
+ }
+
+ public function manga($by = 'title')
+ {
+ $q = isset($this->request->query['q']) ? $this->request->query['q'] : '';
+ $page = isset($this->request->query['page']) ? $this->request->query['page'] : 1;
+ return Manga::search("/$q/i", $page, 'title');
+ }
+
+ public function kdrama($by = 'title')
+ {
+ $q = isset($this->request->query['q']) ? $this->request->query['q'] : '';
+ $page = isset($this->request->query['page']) ? $this->request->query['page'] : 1;
+ return Kdrama::search("/$q/i", $page, 'title');
}
}
--
cgit v1.2.3
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
(limited to 'controllers')
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 @@
-= $content->title ?>
+styles($this->html->style('view'));
+?>
+
+= $anime->title ?>
-
+
-
-
-
-
-
-
Synopsis
-
-= $content->synopsis ?>
+
+MAL Stats
+
+Score: = $anime->mal_score ?>
+Votes: = $anime->mal_score_voted ?>
+Ranked: = $anime->mal_rank ?>
+Popularity: = $anime->mal_popularity ?>
+Members: = $anime->mal_score ?>
+
+
+
-
Related Animes
-
+
Synopsis
+
+
+
= $anime->synopsis ?>
-
Characters And VA's
-
-cast as $char): ?>
+
Characters and VA's
+
+
+cast as $char): ?>
= $char->character ?>
= $char->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;
-
+
-
-
-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