summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorraylu <raylu@mixpanel.com>2011-07-17 16:41:22 -0700
committerraylu <raylu@mixpanel.com>2011-07-17 16:41:22 -0700
commit384834c9fb85d3a408c60dd38e8d1474116793ad (patch)
treec237ee1c43b06c779e6188fbc7cb9aac03da0107
parent8fa4bab1dfd166fd567f2b1a3910f0628c6278e7 (diff)
downloadotakuhub-384834c9fb85d3a408c60dd38e8d1474116793ad.tar.xz
some anime view styling
-rw-r--r--controllers/AnimeController.php18
-rw-r--r--views/anime/view.html.php117
-rw-r--r--views/layouts/default.html.php4
-rw-r--r--webroot/css/base.css6
-rw-r--r--webroot/css/view.css21
5 files changed, 110 insertions, 56 deletions
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 .= '<a href="' . $related[$i] . '">' . $ra['anime']->title . '</a>';
+ }
+ $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 @@
-<h2 class="ribbon full"><?= $content->title ?></h2>
+<?php
+$this->styles($this->html->style('view'));
+?>
+
+<h2 class="ribbon full"><?= $anime->title ?></h2>
<div class="triangle-ribbon"></div>
-<br class="cl" />
+<br class="cl">
-<div class="container_12">
-<!-- Start Sidebar -->
-<div class="grid_4" id="sidebar">
-<img src="<?=$content->image ?>" >
+<aside id="img">
+<img src="<?=$anime->image ?>" alt="<?= $anime->title ?>">
+</aside>
-<h2 class="ribbon"> Alternative Titles </h2>
-<hr/>
-<p>
-<?php if(isset($content->alternative_titles)) : ?>
-<?php foreach($content->alternative_titles as $title): ?>
- <?= $title ?>
-<?php endforeach; ?>
+<section><p>
+<?php if(isset($anime->foreign_titles)):
+ $str = 'Foreign titles:';
+ for ($i = 0; $i < count($anime->foreign_titles); $i++) {
+ if ($i > 0) $str .= '<b>,</b>';
+ $str .= ' ' . $anime->foreign_titles[$i];
+ }
+ $str .= '<br>';
+ ?>
+ <?= $str ?>
<?php endif; ?>
-</p>
-<h2> Information </h2>
-<span> Type: <?= $content->view_type ?> </span>
-Episodes: <?= $content->episode_count ?><br/>
-Status: <?= $content->status ?><br/>
-Aired: <?= $content->aired ?><br/>
-Producers: <?php foreach($content->producers as $producer): ?>
-<a href="/producer/view/<?= $producer ?>"><?= $producer ?></a>,
-<?php endforeach; ?><br/>
-Genres: <?php foreach($content->genres as $genres): ?>
-<a href="/genres/view/<?= $genres ?>"><?= $genres ?></a>,
-<?php endforeach ?><br/>
-Duration: <?= $content->episode_duration ?><br/>
-Rating: <?= $content->rating ?><br/>
-
-<h2 class="ribbon">Statistics</h2>
-Score: <br/>
-Ranked: <br/>
-Popularity: <br/>
-Members:<br/>
-Favorited by: over 9000 Users<br/>
+<?php if(isset($anime->alternative_titles)):
+ $str = 'Alternative titles:';
+ for ($i = 0; $i < count($anime->alternative_titles); $i++) {
+ if ($i > 0) $str .= '<b>,</b>';
+ $str .= ' ' . $anime->alternative_titles[$i];
+ }
+ $str .= '<br>';
+ ?>
+ <?= $str ?>
+<?php endif; ?>
+Type: <?= $anime->view_type ?><br>
+Episodes: <?= $anime->episode_count ?><br>
+Aired: <?= $anime->aired ?><br>
+Producers: <?php
+$str = '';
+for ($i = 0; $i < count($anime->producers); $i++) {
+ if ($i > 0) $str .= ',';
+ $str .= ' <a href="/producer/view/' . $anime->producers[$i] . '">' . $anime->producers[$i] . '</a>';
+} ?><?= $str ?><br>
+Genres: <?php
+$str = '';
+for ($i = 0; $i < count($anime->genres); $i++) {
+ if ($i > 0) $str .= ',';
+ $str .= ' <a href="/producer/view/' . $anime->genres[$i] . '">' . $anime->genres[$i] . '</a>';
+} ?><?= $str ?><br>
+Duration: <?= $anime->episode_duration ?><br>
+Rating: <?= $anime->rated ?><br>
+Related: <?= $related ?>
+</p></section>
-<h2 class="ribbon"> My Info </h2>
-<hr/>
-<!-- End Sidebar -->
-</div>
-<div class="grid_8" id="content">
-<!-- Start Content -->
-<h2>Synopsis</h2>
-<hr/>
-<?= $content->synopsis ?>
+<aside id="malstats">
+<h2>MAL Stats</h2>
+<p>
+Score: <?= $anime->mal_score ?><br>
+Votes: <?= $anime->mal_score_voted ?><br>
+Ranked: <?= $anime->mal_rank ?><br>
+Popularity: <?= $anime->mal_popularity ?><br>
+Members: <?= $anime->mal_score ?>
+</p>
+</aside>
+<br class="cl">
-<h2>Related Animes</h2>
-<hr/>
+<h2 class="ribbon">Synopsis</h2>
+<div class="triangle-ribbon"></div>
+<br class="cl">
+<p><?= $anime->synopsis ?></p>
-<h2>Characters And VA's </h2>
-<hr/>
-<?php foreach($content->cast as $char): ?>
+<h2 class="ribbon">Characters and VA's</h2>
+<div class="triangle-ribbon"></div>
+<br class="cl">
+<?php foreach($anime->cast as $char): ?>
<?= $char->character ?>
<?= $char->role ?>
Played by:
@@ -65,4 +84,4 @@ Played by:
<?php endforeach; ?>
</div>
<br class="cl"/>
-</div> \ No newline at end of file
+</div>
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;
<br class="cl" />
</header>
-<div id="page">
+<article>
<?php echo $this->content() ?>
-</div>
+</article>
<footer>
<p>Copyright ©2011, <a href="http://www.melenion.org">Melenion Dev Studios</a></p>
<br class="cl" />
diff --git a/webroot/css/base.css b/webroot/css/base.css
index da366c6..1bbd83c 100644
--- a/webroot/css/base.css
+++ b/webroot/css/base.css
@@ -24,6 +24,8 @@ h2.ribbon {
border-radius: 3px 3px 3px 0px;
-moz-border-radius: 3px 3px 3px 0px;
-webkit-border-radius: 3px 3px 3px 0px;
+}
+h2.full {
width: 890px;
}
.triangle-ribbon {
@@ -146,11 +148,11 @@ footer {
width: 980px;
margin: 25px auto 20px;
}
-#page {
+article {
background: #fff;
color: #191919;
border: 1px solid #d9d9d9;
- padding: 40px;
+ padding: 25px 40px 30px;
position: relative;
width: 898px;
margin: 0 auto;
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;
+}