From 250c75de2a28d5bd7b724fd170e75e5910c79ddc Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Mon, 3 Dec 2012 21:19:28 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20design=20(issue=20#6),=20d=C3=A9bu?= =?UTF-8?q?t=20correction=20bug=20#16=20(=C3=A0=20voir=20o=C3=B9=20=C3=A7a?= =?UTF-8?q?=20en=20est)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/configureController.php | 2 + app/views/index/index.phtml | 16 +++--- app/views/javascript/main.phtml | 7 +-- public/data/Configuration.array.php | 2 +- public/scripts/endless_mode.js | 28 ++++++---- public/theme/base.css | 69 +++++++++++++++---------- 6 files changed, 74 insertions(+), 50 deletions(-) diff --git a/app/controllers/configureController.php b/app/controllers/configureController.php index d86cda14c..721ff1e95 100755 --- a/app/controllers/configureController.php +++ b/app/controllers/configureController.php @@ -9,6 +9,8 @@ class configureController extends ActionController { ); } } + + public function indexAction () { } public function categorizeAction () { $catDAO = new CategoryDAO (); diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 08c3aa721..2e6d75ae8 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -15,18 +15,21 @@
- author (); ?> +

title (); ?>

+
- feed (true); ?> - - le date (); ?> - sur name (); ?> ,
-

title (); ?>

content (); ?>
+ author (); ?> + feed (true); ?> + Le date (); ?> + + sur name (); ?> , + +
conf) || is_logged ()) { ?> isRead ()) { ?> J'ai fini de lire l'articleRetirer l'article de mes favoris +
diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml index e416cad95..a9ce2c5b1 100644 --- a/app/views/javascript/main.phtml +++ b/app/views/javascript/main.phtml @@ -24,7 +24,7 @@ function slide (new_active, old_active) { old_active.children (".content").slideUp (200); new_active.children (".content").slideDown (200, function () { $.smoothScroll({ - offset: new_active.position ().top + 25 + offset: new_active.position ().top }); }); } else { @@ -32,11 +32,6 @@ function slide (new_active, old_active) { offset: new_active.position ().top + 25 }); } - - // si le dernier post est actif, on charge les suivants - if (new_active.attr ("id") == $(".post.flux:last").attr ("id")) { - load_more_posts (); - } } function add_not_read (nb) { diff --git a/public/data/Configuration.array.php b/public/data/Configuration.array.php index ca5af0a01..93e089c9e 100644 --- a/public/data/Configuration.array.php +++ b/public/data/Configuration.array.php @@ -1,6 +1,6 @@ 10, + 'posts_per_page' => 50, 'default_view' => 'all', 'display_posts' => 'no', 'sort_order' => 'low_to_high', diff --git a/public/scripts/endless_mode.js b/public/scripts/endless_mode.js index a05da97db..30b91822c 100644 --- a/public/scripts/endless_mode.js +++ b/public/scripts/endless_mode.js @@ -1,24 +1,34 @@ -var url = ""; +var url_next_page = ""; +var load = false; + +function load_more_refresh () { + if (url_next_page === undefined) { + $("#load_more").html ("Il n'y a rien à charger"); + $("#load_more").addClass ("disable"); + } else { + $("#load_more").html ("Charger plus d'articles"); + } +} function load_more_posts () { - $.get (url, function (data) { + load = true; + $.get (url_next_page, function (data) { $("#load_more").before ($("#stream .post", data)); - url = $(".pagination:last li.pager-next a", data).attr ("href"); - if (url === undefined) { - $("#load_more").html ("Il n'y a plus rien à charger"); - $("#load_more").addClass ("disable"); - } + url_next_page = $(".pagination:last li.pager-next a", data).attr ("href"); init_posts (); + load_more_refresh (); + load = false; }); } $(document).ready (function () { - url = $(".pagination:last li.pager-next a").attr ("href"); + url_next_page = $(".pagination:last li.pager-next a").attr ("href"); $(".pagination:last").remove (); - $("#stream").append ("Charger plus d'articles"); + $("#stream").append (""); + load_more_refresh (); $("#load_more").click (function () { load_more_posts (); diff --git a/public/theme/base.css b/public/theme/base.css index bc7042fae..f3225f218 100644 --- a/public/theme/base.css +++ b/public/theme/base.css @@ -216,7 +216,7 @@ form { text-decoration: none; } #stream { - padding: 20px 0; + padding: 0; } #main .table { display: table; @@ -232,29 +232,38 @@ form { } .post { - width: 90%; - margin: 0 auto; } .post.flux { - margin: 40px auto; font-family: Palatino, "Times New Roman", serif; line-height: 170%; - border-left: 5px solid #aaa; - background: #eee; - border-radius: 5px; - box-shadow: 0 1px 3px #aaa; + border-left: 10px solid #aaa; + background: #fafafa; } - .post.flux .before { - padding: 20px; - color: #666; - font-size: 80%; - text-align: center; + .post.flux:hover { + background: #fff; } .post.flux .after { - margin: 50px 0 0; + padding: 10px 20px; + color: #aaa; + font-size: 80%; + font-style: italic; + } + .post.flux .after a { + color: #96BDE2; + } + .post.flux .after .options { + float: right; + } + .post.flux .after .options a { + padding: 0 20px; + } + /*.post.flux .after { + margin: 20px 0 0; + background: #fff; font-size: 80%; text-align: center; border-top: 1px solid #aaa; + border-bottom: 1px solid #aaa; } .post.flux .after a { display: inline-block; @@ -262,17 +271,18 @@ form { line-height: 50px; width: 50%; } - .post.flux .after a:hover { - background: #fff; + .post.flux .after a:hover { + background: #f6f6f6; text-decoration: none; - border-radius: 0 0 5px 5px; - box-shadow: 0 1px 3px #aaa; - } + }*/ .post.flux > h1 { + min-height: 0; padding: 10px 20px; + font-size: 130%; + line-height: 150%; } .post.flux .content { - padding: 10px 20px; + padding: 10px 100px; } .post.flux .content h1, .post.flux .content h2, .post.flux .content h3 { margin: 20px 0; @@ -303,15 +313,16 @@ form { color: #666; } .post.flux.not_read { - border-left: 5px solid #FF5300; + border-left: 10px solid #FF5300; background: #FFF3ED; } .post.flux.favorite { - border-left: 5px solid #FFC300; + border-left: 10px solid #FFC300; background: #FFF6DA; } .post.flux.active { - border-left: 5px solid #0062BE; + border-left: 10px solid #0062BE; + background: #fff; } /*** PAGINATION ***/ @@ -338,18 +349,20 @@ form { } a#load_more { display: block; - width: 90%; height: 50px; - margin: 0 auto; background: #eee; - border-radius: 5px; - box-shadow: 0 0 3px #aaa; line-height: 50px; text-align: center; font-weight: bold; + border-top: 1px solid #aaa; } + a#load_more:hover { + background: #fff; + text-decoration: none; + } a#load_more.disable { - text-decoration: none !important; + cursor: default; + background: #eee; color: #666; }