diff --git a/archive-comic.php b/archive-comic.php
index d0cb5f8..0c8470d 100644
--- a/archive-comic.php
+++ b/archive-comic.php
@@ -3,11 +3,11 @@
Template Name: Comic Archive
*/
- global $comicpress;
+global $comicpress;
- $comicpress->additional_stylesheets[] = '/style/archive-comic-calendar.css';
- get_header();
+
+get_header();
?>
diff --git a/classes/ComicPress.inc b/classes/ComicPress.inc
index 1856428..06700da 100644
--- a/classes/ComicPress.inc
+++ b/classes/ComicPress.inc
@@ -210,26 +210,28 @@ class ComicPress {
* Get the first comic in a category.
*/
function get_first_comic() {
- return $this->get_terminal_post_in_category($this->get_all_comic_categories_as_cat_string());
+ return $this->get_terminal_post_in_category($category);
}
/**
* Get the last comic in a category.
*/
- function get_last_comic() {
- return $this->get_terminal_post_in_category($this->get_all_comic_categories_as_cat_string(), false);
+ function get_last_comic($category) {
+ return $this->get_terminal_post_in_category($category, false);
}
/**
* Get the comics necessary to build the navigation.
* @tested
*/
- function get_nav_comics() {
+ function get_nav_comics($override_category_id = null) {
global $post;
+ $category = is_numeric($override_category_id) ? $override_category_id : $this->comicpress_options['comic_category_id'];
+
$comic_posts = array();
foreach (array('first', 'last', 'previous', 'next') as $which) {
- $comic_posts[$which] = $this->{"get_${which}_comic"}();
+ $comic_posts[$which] = $this->{"get_${which}_comic"}($category);
}
$comic_posts['show_first'] = (trim($post->ID) != trim($comic_posts['first']->ID));
diff --git a/single.php b/single.php
index 0badb74..cc37c34 100644
--- a/single.php
+++ b/single.php
@@ -1,37 +1,39 @@
-get_nav_comics();
-?>
-
-
- comicpress_options['comic_space'] == "comic_only") {
- include(get_template_directory() . '/partials/single-comic-post.inc');
- }
- } else {
- include(get_template_directory() . '/partials/single-blog-post.inc');
+
+ if (have_posts()) {
+ while (have_posts()) { the_post();
+ if (in_comic_category()) {
+ if ($comicpress->comicpress_options['comic_space'] == "comic_only") {
+ include_partial('single-comic-post');
}
-
- comments_template();
+ } else {
+ include_partial('single-blog-post');
}
- } else {
- include(get_template_directory() . '/partials/single-no-matches.inc');
+
+ comments_template();
}
- ?>
-
-
-
-
-
\ No newline at end of file
+ } else {
+ include_partial('single-no-matches');
+ }
+
+ $content = ob_get_clean();
+
+ include(get_template_directory() . '/layouts/' . $comicpress->comicpress_options['layout']);
+?>
\ No newline at end of file
diff --git a/style/archive-comic-storyline-thumbs.css b/style/archive-comic-storyline-thumbs.css
new file mode 100644
index 0000000..3da5c3d
--- /dev/null
+++ b/style/archive-comic-storyline-thumbs.css
@@ -0,0 +1,63 @@
+#storyline, #storyline ul {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+}
+
+#storyline li {
+ padding: 0;
+ margin: 0;
+}
+
+#storyline li img {
+ height: 50px;
+ display: none;
+}
+
+#storyline li li img {
+ display: block;
+ float: right;
+ padding: 0 0 0 10px;
+}
+
+#storyline ul ul {
+ margin: 0 0 0 20px;
+}
+
+#storyline li li .storyline-title {
+ font-size: 24px;
+ font-weight: bold;
+ display: block;
+ color: #000;
+}
+
+#storyline li li .storyline-title:hover {
+ color: #900;
+}
+
+#storyline li li li a.storyline-title {
+ font-size: 18px;
+}
+
+#storyline li li li li a.storyline-title {
+ font-size: 14px;
+}
+
+.storyline-description {
+ font-size: 11px;
+}
+
+.storyline-foot {
+ clear: both;
+ margin: 0 0 10px 0;
+ height: 10px;
+ border-bottom: 4px solid #000;
+}
+
+#storyline li li .storyline-foot {
+ border-bottom: 2px solid #000;
+}
+
+#storyline li li li .storyline-foot {
+ border-bottom: 1px solid #000;
+}
diff --git a/test/ComicPressTest.php b/test/ComicPressTest.php
index d077992..c4bef1d 100644
--- a/test/ComicPressTest.php
+++ b/test/ComicPressTest.php
@@ -171,6 +171,75 @@ class ComicPressTest extends PHPUnit_Framework_TestCase {
$this->assertEquals($expected, $comic_posts["show_${show}"], $show);
}
}
+
+ function providerTestGetStorylineNavComics() {
+ return array(
+ array(
+ array(
+ '1' => array(
+ 'first' => 8,
+ 'previous' => 9,
+ 'next' => 11,
+ 'last' => 12
+ ),
+ '2' => array(
+ 'first' => 10,
+ 'previous' => false,
+ 'next' => 15,
+ 'last' => 15
+ ),
+ '3' => array(
+ 'first' => 20,
+ 'previous' => 20,
+ 'next' => false,
+ 'last' => 21
+ )
+ )
+ ),
+ array(
+ '1' => array(
+ 'first' => true,
+ 'previous' => true,
+ 'next' => true,
+ 'last' => true
+ ),
+ '2' => array(
+ 'first' => true,
+ 'previous' => false,
+ 'next' => false,
+ 'last' => true
+ ),
+ '3' => array(
+ 'first' => true,
+ 'previous' => false,
+ 'next' => false,
+ 'last' => true
+ )
+ )
+ );
+ }
+
+ /**
+ * @dataProvider providerTestGetStorylineNavComics
+ */
+ function testGetStorylineNavComics($category_info, $expected_category_results) {
+ $cp = $this->getMock('ComicPress', array('get_first_comic', 'get_last_comic', 'get_previous_comic', 'get_next_comic'));
+ foreach ($category_info as $category => $nav_comics) {
+ foreach ($nav_comics as $key => $result) {
+ $return = (is_numeric($result)) ? (object)array('ID' => $result) : false;
+ $cp->expects($this->once())->method("get_${key}_comic")->with($category)->will($this->returnValue($return));
+ }
+ }
+
+ $post = (is_numeric($given_post)) ? (object)array('ID' => $given_post) : false;
+
+ $comic_posts = $cp->get_nav_comics();
+
+ foreach ($expected_shows as $show => $expected) {
+ $this->assertEquals($expected, $comic_posts["show_${show}"], $show);
+ }
+
+ }
function providerTestGetLayoutChoices() {