From c1e763316a20a1ebc8f33bab5f150687d89c8310 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Fri, 22 Nov 2013 11:51:33 +0100 Subject: [PATCH] Fav and comments are shown only if there are any --- public_html/media/js/post-view.js | 4 ++-- src/Views/post-view.phtml | 32 ++++++++++++++----------------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/public_html/media/js/post-view.js b/public_html/media/js/post-view.js index 5559ee24..7e057335 100644 --- a/public_html/media/js/post-view.js +++ b/public_html/media/js/post-view.js @@ -34,7 +34,7 @@ function onDomUpdate() { $.get(window.location.href, function(data) { - $('.comments.unit').replaceWith($(data).find('.comments.unit')); + $('.comments-wrapper').replaceWith($(data).find('.comments-wrapper')); $('body').trigger('dom-update'); }); }); @@ -133,7 +133,7 @@ $(function() { $.get(window.location.href, function(data) { - $('.comments.unit').replaceWith($(data).find('.comments.unit')); + $('.comments-wrapper').replaceWith($(data).find('.comments-wrapper')); $('body').trigger('dom-update'); }); formDom.find('textarea').val(''); diff --git a/src/Views/post-view.phtml b/src/Views/post-view.phtml index c8fa1998..a748b81a 100644 --- a/src/Views/post-view.phtml +++ b/src/Views/post-view.phtml @@ -146,11 +146,8 @@ -
- context->transport->post->ownFavoritee) == 0): ?> -

favorites

-

None yet.

- + context->transport->post->ownFavoritee) > 0): ?> +

favorites (context->transport->post->ownFavoritee) ?>)

    context->transport->post->via('favoritee')->sharedUser as $user): ?> @@ -161,8 +158,8 @@
- -
+
+ context->transport->post->via('crossref')->sharedPost)): ?>
@@ -296,17 +293,16 @@ renderFile('post-edit') ?> -
- context->transport->post->ownComment)): ?> -

comments

- None yet. - -

comments (context->transport->post->countOwn('comment') ?>)

-
- context->transport->post->ownComment as $comment): ?> - context->comment = $comment ?> - renderFile('comment-small') ?> - +
+ context->transport->post->ownComment)): ?> +
+

comments (context->transport->post->countOwn('comment') ?>)

+
+ context->transport->post->ownComment as $comment): ?> + context->comment = $comment ?> + renderFile('comment-small') ?> + +