From fc2ed520168292269635dc28d920f91b589ec6ef Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Thu, 10 Oct 2013 00:12:27 +0200 Subject: [PATCH] Changed post list outlook --- config.ini | 4 +- public_html/media/css/core.css | 4 +- public_html/media/css/paginator.css | 33 +++++++++++++++++ public_html/media/css/post-list.css | 37 +++---------------- ...t-list-endless.js => paginator-endless.js} | 3 +- src/Controllers/PostController.php | 3 +- src/Views/post-list.phtml | 2 +- 7 files changed, 47 insertions(+), 39 deletions(-) create mode 100644 public_html/media/css/paginator.css rename public_html/media/js/{post-list-endless.js => paginator-endless.js} (86%) diff --git a/config.ini b/config.ini index 9d98d65a..50d7159a 100644 --- a/config.ini +++ b/config.ini @@ -11,8 +11,8 @@ title=szurubooru [browsing] postsPerPage=20 -thumbWidth=150 -thumbHeight=150 +thumbWidth=140 +thumbHeight=140 thumbStyle=outside endlessScrolling=1 diff --git a/public_html/media/css/core.css b/public_html/media/css/core.css index bed1ac8f..df7b8079 100644 --- a/public_html/media/css/core.css +++ b/public_html/media/css/core.css @@ -23,7 +23,7 @@ body { #content { padding: 0; - margin: 1.5em 0.75em; + margin: 1.5em 0; } #top-nav { @@ -32,7 +32,7 @@ body { } #top-nav ul { - margin: 0; + margin: 0 -0.75em; padding: 0; list-style-type: none; } diff --git a/public_html/media/css/paginator.css b/public_html/media/css/paginator.css new file mode 100644 index 00000000..d128d9f9 --- /dev/null +++ b/public_html/media/css/paginator.css @@ -0,0 +1,33 @@ +.paginator-wrapper { + text-align: center; +} + +.paginator { + margin: 2em auto 0 auto; + padding: 0; + list-style-type: none; +} + +.paginator li { + display: inline-block; +} + +.paginator li a { + display: inline-block; + padding: 0.2em 0.5em; + margin-right: 0.5em; + background: #eee; + border: 1px solid silver; + color: black; + text-decoration: none; +} + +.paginator li.active a { + color: red; + background: mistyrose; + border-color: red; +} + +.paginator li.inactive a { + color: gray; +} diff --git a/public_html/media/css/post-list.css b/public_html/media/css/post-list.css index d128d9f9..12355593 100644 --- a/public_html/media/css/post-list.css +++ b/public_html/media/css/post-list.css @@ -1,33 +1,8 @@ -.paginator-wrapper { - text-align: center; -} - -.paginator { - margin: 2em auto 0 auto; +.posts img { + border: 1px solid #ddd; + box-shadow: 0.25em 0.25em #eee; + margin: 0.5em; padding: 0; - list-style-type: none; -} - -.paginator li { - display: inline-block; -} - -.paginator li a { - display: inline-block; - padding: 0.2em 0.5em; - margin-right: 0.5em; - background: #eee; - border: 1px solid silver; - color: black; - text-decoration: none; -} - -.paginator li.active a { - color: red; - background: mistyrose; - border-color: red; -} - -.paginator li.inactive a { - color: gray; + width: 140px; + height: 140px; } diff --git a/public_html/media/js/post-list-endless.js b/public_html/media/js/paginator-endless.js similarity index 86% rename from public_html/media/js/post-list-endless.js rename to public_html/media/js/paginator-endless.js index 94265f0b..ee3dfcc8 100644 --- a/public_html/media/js/post-list-endless.js +++ b/public_html/media/js/paginator-endless.js @@ -17,8 +17,7 @@ function scrolled() var dom = $(response); var nextPage = dom.find('.paginator .next:not(.inactive) a').attr('href'); $(document).data('page-next', nextPage); - $('.posts').append($(response).find('.posts').children().fadeIn('slow')); - $('body').trigger('postsLoaded'); + $('.paginator-content').append($(response).find('.paginator-content').children().fadeIn('slow')); }); } } diff --git a/src/Controllers/PostController.php b/src/Controllers/PostController.php index 295ac772..0f4882d7 100644 --- a/src/Controllers/PostController.php +++ b/src/Controllers/PostController.php @@ -21,8 +21,9 @@ class PostController public function listAction($query = null, $page = 1) { $this->context->stylesheets []= 'post-list.css'; + $this->context->stylesheets []= 'paginator.css'; if ($this->config->browsing->endlessScrolling) - $this->context->scripts []= 'post-list-endless.js'; + $this->context->scripts []= 'paginator-endless.js'; #redirect requests in form of /posts/?query=... to canonical address $formQuery = InputHelper::get('query'); diff --git a/src/Views/post-list.phtml b/src/Views/post-list.phtml index 51ce461e..f74bb0b7 100644 --- a/src/Views/post-list.phtml +++ b/src/Views/post-list.phtml @@ -3,7 +3,7 @@ context->transport->posts)): ?>

No posts to show.

-
+
context->transport->posts as $post): ?> @<?php echo $post['id'] ?>