From 30bd3dc2c8e1dea9fb394115138f4f5ef9aedc33 Mon Sep 17 00:00:00 2001 From: raylu Date: Sat, 16 Jul 2011 16:57:53 -0700 Subject: make search index work clean up a lot of code renamed anime.css to table.css --- controllers/SearchController.php | 1 - models/Anime.php | 8 ++--- views/elements/animetable.html.php | 18 +++++------ views/search/anime.html.php | 4 +-- views/search/index.html.php | 64 +++++--------------------------------- webroot/css/anime.css | 39 ----------------------- webroot/css/table.css | 41 ++++++++++++++++++++++++ 7 files changed, 63 insertions(+), 112 deletions(-) delete mode 100644 webroot/css/anime.css create mode 100644 webroot/css/table.css diff --git a/controllers/SearchController.php b/controllers/SearchController.php index a7b0cee..805b981 100644 --- a/controllers/SearchController.php +++ b/controllers/SearchController.php @@ -21,7 +21,6 @@ class SearchController extends \lithium\action\Controller { $kdrama = Kdrama::find('all', compact('conditions', 'limit')); return compact('anime', 'manga', 'kdrama'); - } } diff --git a/models/Anime.php b/models/Anime.php index 8281ea7..71a7fd9 100644 --- a/models/Anime.php +++ b/models/Anime.php @@ -12,7 +12,7 @@ class Anime extends \lithium\data\Model { switch($by) { case 'special_id': - $content = self::find('first', + $anime = self::find('first', array('conditions' => array( $by => $query ), @@ -28,7 +28,7 @@ class Anime extends \lithium\data\Model { if ($query) { $conditions = null; // TODO - $content = self::find('all', array( + $anime = self::find('all', array( 'conditions' => array($by => array('like' => $query)), 'limit' => $limit, 'page' => $page @@ -37,13 +37,13 @@ class Anime extends \lithium\data\Model { } else { - $content = self::find('all', array( + $anime = self::find('all', array( 'limit' => $limit, 'page' => $page )); $total = Anime::count(); } } - return compact('content', 'by', 'limit', 'total', 'page'); + return compact('anime', 'by', 'limit', 'total', 'page'); } } diff --git a/views/elements/animetable.html.php b/views/elements/animetable.html.php index a074c68..0d9f9fb 100644 --- a/views/elements/animetable.html.php +++ b/views/elements/animetable.html.php @@ -2,27 +2,27 @@ Title Date Type - + - title ?> - foreign_titles || $anime->alternative_titles): ?> + title ?> + foreign_titles || $a->alternative_titles): ?> - foreign_titles): ?> - foreign_titles[0] ?> + foreign_titles): ?> + foreign_titles[0] ?> - alternative_titles): ?> + alternative_titles): ?>       - alternative_titles[0] ?> + alternative_titles[0] ?> - aired ?> + aired ?> - view_type ?> + view_type ?> diff --git a/views/search/anime.html.php b/views/search/anime.html.php index 89cc9e9..94acb84 100644 --- a/views/search/anime.html.php +++ b/views/search/anime.html.php @@ -1,6 +1,6 @@ styles($this->html->style('anime')); $this->styles($this->html->style('pagination')); +$this->styles($this->html->style('table')); ?> _render('element', 'search') ?> @@ -10,6 +10,6 @@ $this->styles($this->html->style('pagination')); Paginator->paginate(array('separator' => '')) ?> -_render('element', 'animetable', compact('anime')) ?> +_render('element', 'animetable') ?> Paginator->paginate(array('separator' => '')) ?> diff --git a/views/search/index.html.php b/views/search/index.html.php index a269d01..a05f269 100644 --- a/views/search/index.html.php +++ b/views/search/index.html.php @@ -1,65 +1,15 @@ styles($this->html->style('pagination')); +$this->styles($this->html->style('table')); ?>

Anime

_render('element', 'animetable', compact('anime')) ?> html->link("More", array('controller' => 'search', - 'action' => 'anime')); ?> + 'action' => 'anime')); ?>

Manga

-
- - - - - 0): ?> - - - - - - - -
TitleDateType
- title ?> - - aired ?> - - view_type ?> -
-
- html->link("More", array('controller' => 'search', - 'action' => 'anime')); ?> -
- -

No entries found

- +html->link("More", array('controller' => 'search', + 'action' => 'anime')); ?> -

K Drama

-
- - - - - 0): ?> - - - - - - - -
TitleDateType
- title ?> - - aired ?> - - view_type ?> -
-
- html->link("More", array('controller' => 'search', - 'action' => 'anime')); ?> -
- -

No Entries found

- +

K Drama

+html->link("More", array('controller' => 'search', + 'action' => 'anime')); ?> diff --git a/webroot/css/anime.css b/webroot/css/anime.css deleted file mode 100644 index 03f0883..0000000 --- a/webroot/css/anime.css +++ /dev/null @@ -1,39 +0,0 @@ -span.alt_titles { - font-size: 90%; - opacity: 0.7; -} - -table { - border-collapse: collapse; - width: 898px; - max-width: 898px; - table-layout: fixed; -} -tr { - height: 45px; -} -tr:first-child { /* th row */ - height: 25px; -} -th { - vertical-align: middle; -} -th:nth-child(2) { - width: 240px; -} -th:nth-child(3) { - width: 50px; -} -td { - border: 0px solid #bbb; - border-top-width: 1px; - vertical-align: middle; - white-space: nowrap; - overflow: hidden; -} -td:nth-child(2) { - padding-left: 25px; -} -td a { - display: block; -} diff --git a/webroot/css/table.css b/webroot/css/table.css new file mode 100644 index 0000000..f0a5184 --- /dev/null +++ b/webroot/css/table.css @@ -0,0 +1,41 @@ +/* for search results and anime/manga/kdrama lists */ + +span.alt_titles { + font-size: 90%; + opacity: 0.7; +} + +table { + border-collapse: collapse; + width: 898px; + max-width: 898px; + table-layout: fixed; +} +tr { + height: 45px; +} +tr:first-child { /* th row */ + height: 25px; +} +th { + vertical-align: middle; +} +th:nth-child(2) { + width: 240px; +} +th:nth-child(3) { + width: 50px; +} +td { + border: 0px solid #bbb; + border-top-width: 1px; + vertical-align: middle; + white-space: nowrap; + overflow: hidden; +} +td:nth-child(2) { + padding-left: 25px; +} +td a { + display: block; +} -- cgit v1.2.3