diff options
author | Michael Francis <edude03@gmail.com> | 2011-07-24 23:41:14 -0400 |
---|---|---|
committer | Michael Francis <edude03@gmail.com> | 2011-07-24 23:41:14 -0400 |
commit | dd531d3928c25b1288c9369ce2d9ec5ee6bd24d6 (patch) | |
tree | 5fd55f3e2c365f14ed677d2192595031a93cafbe | |
parent | c1772289909a5886af3454dae3c4cc519879bd68 (diff) | |
parent | bb06d45da99d1a551979f6f694a5bed4d02673c4 (diff) | |
download | otakuhub-dd531d3928c25b1288c9369ce2d9ec5ee6bd24d6.tar.xz |
Merge branch 'master' of git.raylu.net:otakuhub
-rw-r--r-- | controllers/AnimeController.php | 12 | ||||
-rw-r--r-- | views/anime/index.html.php | 2 | ||||
-rw-r--r-- | views/anime/view.html.php | 71 | ||||
-rw-r--r-- | views/anime_list/index.html | 3 | ||||
-rw-r--r-- | views/anime_list/index.html.php | 74 | ||||
-rw-r--r-- | views/pages/home.html.php | 8 | ||||
-rw-r--r-- | webroot/css/search.css | 1 | ||||
-rw-r--r-- | webroot/css/view.css | 5 | ||||
-rw-r--r-- | webroot/js/functions.js | 12 |
9 files changed, 62 insertions, 126 deletions
diff --git a/controllers/AnimeController.php b/controllers/AnimeController.php index 3a40cee..4bdacac 100644 --- a/controllers/AnimeController.php +++ b/controllers/AnimeController.php @@ -19,15 +19,13 @@ class AnimeController extends \lithium\action\Controller { if (is_numeric($id)) { $data = Anime::search($id, null, 'special_id'); - $related = $data['anime']->related; - $str = ''; - for ($i = 0; $i < count($related); $i++) + $related = Array(); + foreach ($data['anime']->related as $rid) { - if ($i > 0) $str .= ', '; - $ra = Anime::search($related[$i], null, 'special_id'); - $str .= '<a href="' . $related[$i] . '">' . $ra['anime']->title . '</a>'; + $ra = Anime::search($rid, null, 'special_id'); + $related[$ra['anime']->title] = $rid; } - $data['related'] = $str; + $data['related'] = $related; return $data; } else diff --git a/views/anime/index.html.php b/views/anime/index.html.php index 270ed76..6b1adc0 100644 --- a/views/anime/index.html.php +++ b/views/anime/index.html.php @@ -1,5 +1,5 @@ <?php -$this->styles($this->html->style('anime')); +$this->styles($this->html->style('table')); $this->styles($this->html->style('pagination')); ?> diff --git a/views/anime/view.html.php b/views/anime/view.html.php index 11ac437..11a1f75 100644 --- a/views/anime/view.html.php +++ b/views/anime/view.html.php @@ -48,8 +48,49 @@ for ($i = 0; $i < count($anime->genres); $i++) { } ?><?= $str ?><br> <b>Duration:</b> <?= $anime->episode_duration ?><br> <b>Rating:</b> <?= $anime->rated ?><br> -<b>Related:</b> <?= $related ?> +<b>Related:</b> <?php +$str = ''; +$keys = array_keys($related); +for ($i = 0; $i < count($keys); $i++) { + if ($i > 0) $str .= ','; + $str .= ' <a href="/anime/view/' . $related[$keys[$i]] . '">' . $keys[$i] . '</a>'; +} ?><?= $str ?> </p> + +<p> +<a href="/animelist/add/<?= $anime->special_id ?>" id="add">Add</a> +</p> + +<?php if (count($anime->cast) > 1): // why is this 1? ?> + <section id="cast"> + <p> + <a href="/anime/cast/<?= $anime->special_id ?>" onclick="return toggleCast()">Cast ↓</a> + </p> + <table> + <?php for ($i = 0; $i < count($anime->cast); $i++): ?> + <tr<? if ($i > 0) echo ' class="char"' ?>> + <td colspan="3"> + <?= $anime->cast[$i]->character ?> + </td> + </tr> + <?php if (isset($anime->cast[$i]->people)): ?> + <?php foreach($anime->cast[$i]->people as $actor): ?> + <tr> + <td></td> + <td><?= $actor->name ?></td> + <td><?= $actor->language ?></td> + </tr> + <?php endforeach; ?> + <?php endif; ?> + <?php endfor; ?> + </table> + <br> + <p id="castlink"> + <a href="" onclick="return toggleCast()">Cast ↑</a> + </p> + </section> +<?php endif; ?> + </section> <aside id="malstats"> @@ -63,34 +104,6 @@ for ($i = 0; $i < count($anime->genres); $i++) { </p> </aside> -<section id="cast"> -<p> -<a href="/anime/cast/<?= $anime->special_id ?>" onclick="return toggleCast()">Cast ↓</a> -</p> -<table> -<?php for ($i = 0; $i < count($anime->cast); $i++): ?> - <tr<? if ($i > 0) echo ' class="char"' ?>> - <td colspan="3"> - <?= $anime->cast[$i]->character ?> - </td> - </tr> - <?php if (isset($anime->cast[$i]->people)): ?> - <?php foreach($anime->cast[$i]->people as $actor): ?> - <tr> - <td></td> - <td><?= $actor->name ?></td> - <td><?= $actor->language ?></td> - </tr> - <?php endforeach; ?> - <?php endif; ?> -<?php endfor; ?> -</table> -<br> -<p id="castlink"> -<a href="" onclick="return toggleCast()">Cast ↑</a> -</p> -</section> - <br class="cl"> <h2 class="ribbon">Synopsis</h2> diff --git a/views/anime_list/index.html b/views/anime_list/index.html deleted file mode 100644 index ad9911a..0000000 --- a/views/anime_list/index.html +++ /dev/null @@ -1,3 +0,0 @@ -<h1><?= $user->username ?>'s AnimeList</h1> - -<?= print_r($watching); ?>
\ No newline at end of file diff --git a/views/anime_list/index.html.php b/views/anime_list/index.html.php deleted file mode 100644 index abe931b..0000000 --- a/views/anime_list/index.html.php +++ /dev/null @@ -1,74 +0,0 @@ -<h1><?= $user->username ?>'s AnimeList</h1> -<hr/> -<table><tr><?= $this->html->link("Completed", "/animelist/view/$user->username/completed"); ?> </tr></table> - -<?php if (isset($watching)): ?> -<h2 class="ribbon">Watching</h2><button value="Add" style="float:right"> -<tr><th>Entry #</th><th>Anime Title</th><th>Score</th><th>Type</th><th>Progress</th></tr> -<?php $i = 1; ?> -<?php foreach ($watching as $anime): ?> - <tr> - <td><?= $i ?></td> - <td><?= $anime->series_title ?></td> - <td><?= ($anime->my_score != 0) ? $anime->my_score : "-"; ?></td> - <td><?= $anime->series_type ?></td> - <td><?= $anime->my_watched_episodes ?>/<?= ($anime->series_episodes != 0) ? $anime->series_episodes : "-"; ?></td> - </tr> -<?php $i += 1; ?> -<?php endforeach; ?> -</table> -<?php endif; ?> - -<?php if (isset($planning)): ?> -<h2 class="ribbon">Plans to Watch</h2> -<table> -<tr><th>Entry #</th><th>Anime Title</th><th>Score</th><th>Type</th><th>Progress</th></tr> -<?php $i = 1; ?> -<?php foreach ($planning as $anime): ?> - <tr> - <td><?= $i ?></td> - <td><?= $anime->series_title ?></td> - <td><?= ($anime->my_score != 0) ? $anime->my_score : "-"; ?></td> - <td><?= $anime->series_type ?></td> - <td><?= $anime->my_watched_episodes ?>/<?= ($anime->series_episodes != 0) ? $anime->series_episodes : "-"; ?></td> - </tr> -<?php $i += 1; ?> -<?php endforeach; ?> -</table> -<?php endif; ?> - -<?php if(isset($paused)): ?> -<h2 class="ribbon">Paused</h2> -<table> -<tr><th>Entry #</th><th>Anime Title</th><th>Score</th><th>Type</th><th>Progress</th></tr> -<?php $i = 1; ?> -<?php foreach ($paused as $anime): ?> - <tr> - <td><?= $i ?></td> - <td><?= $anime->series_title ?></td> - <td><?= ($anime->my_score != 0) ? $anime->my_score : "-"; ?></td> - <td><?= $anime->series_type ?></td> - <td><?= $anime->my_watched_episodes ?>/<?= ($anime->series_episodes != 0) ? $anime->series_episodes : "-"; ?></td> - </tr> -<?php $i += 1; ?> -<?php endforeach; ?> -</table> -<?php endif; ?> - -<?php if (isset($dropped)): ?> -<h2 class="ribbon">Dropped</h2> -<table> -<tr><th>Entry #</th><th>Anime Title</th><th>Score</th><th>Type</th><th>Progress</th></tr> -<?php $i = 1; ?> -<?php foreach ($dropped as $anime): ?> - <tr> - <td><?= $i ?></td> - <td><?= $anime->series_title ?></td> - <td><?= ($anime->my_score != 0) ? $anime->my_score : "-"; ?></td> - <td><?= $anime->series_type ?></td> - <td><?= $anime->my_watched_episodes ?>/<?= ($anime->series_episodes != 0) ? $anime->series_episodes : "-"; ?></td> - </tr> -<?php $i += 1; ?> -<?php endforeach; ?> -</table> -<?php endif; ?>
\ No newline at end of file diff --git a/views/pages/home.html.php b/views/pages/home.html.php index 53cc58d..227a18b 100644 --- a/views/pages/home.html.php +++ b/views/pages/home.html.php @@ -69,13 +69,13 @@ $this->styles($this->html->style("/css/home.css")); <h2 class="ribbon">Why you'll ♡ OtakuHub~</h2> <div class="triangle-ribbon"></div> <br class="cl" /> -<h3>For Us By Us</h3> +<h3>For us by us</h3> <p> - Built by Otakus for Otakus, we know what you want, and we work tirelessly to give it to you. + Built by otakus for otakus. We know what you want and we work tirelessly to give it to you. </p> -<h3>Data Portability</h3> +<h3>Data portability</h3> <p> - Move your data between AnimePlanet AnimeDB or MAL or export your list for your own records + Move your data between AnimePlanet AnimeDB or MAL or export your list for your own records. </p> <h3>Meet others</h3> <p> diff --git a/webroot/css/search.css b/webroot/css/search.css index 20ea164..6ac8596 100644 --- a/webroot/css/search.css +++ b/webroot/css/search.css @@ -19,6 +19,7 @@ p.more a { background: -webkit-linear-gradient(top, #ddd, #bbb); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dddddd', endColorstr='#bbbbbb'); color: #111; + outline: none; } p.more a:hover { background: #eee; diff --git a/webroot/css/view.css b/webroot/css/view.css index 7d10164..5d5db7d 100644 --- a/webroot/css/view.css +++ b/webroot/css/view.css @@ -15,7 +15,7 @@ section#cast { float: left; width: 620px; } -section#cast a { +section#cast a, #add { padding: 4px 7px; border: 1px solid #aaa; -moz-border-radius: 3px; @@ -26,8 +26,9 @@ section#cast a { background: -webkit-linear-gradient(top, #ddd, #bbb); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dddddd', endColorstr='#bbbbbb'); color: #111; + outline: none; } -section#cast a:hover { +section#cast a:hover, #add:hover { background: #eee; background: -moz-linear-gradient(top, #eee, #ccc); background: -webkit-linear-gradient(top, #eee, #ccc); diff --git a/webroot/js/functions.js b/webroot/js/functions.js index 5f7d7ae..19cef9b 100644 --- a/webroot/js/functions.js +++ b/webroot/js/functions.js @@ -18,14 +18,14 @@ jQuery(document).ready(function($) { function toggleCast() { var table = $('#cast table'); - if (table.css('display') == 'block') { - table.css('display', 'none'); - $('#cast > p > a').text('Cast ↓'); - $('#castlink').css('display', 'none'); - } else { - table.css('display', 'block'); + if (table.css('display') == 'none') { + table.show(500); $('#cast > p > a').text('Cast ↑'); $('#castlink').css('display', 'block'); + } else { + table.hide(500); + $('#cast > p > a').text('Cast ↓'); + $('#castlink').css('display', 'none'); } return false; } |