Loading app/assets/javascripts/mobile/mobile_comments.js +3 −5 Original line number Diff line number Diff line Loading @@ -189,11 +189,11 @@ increaseReactionCount: function(bottomBar) { var toggleReactionsLink = bottomBar.find(".show-comments").first(); var count = toggleReactionsLink.text().match(/.*(\d+).*/); var text = ""; count = parseInt(count, 10); var text = Diaspora.I18n.t("stream.comments", {count: count + 1}); // No previous comment if(!count){ text = Diaspora.I18n.t("stream.reactions", {count: 1}); if (count === 0) { var parent = toggleReactionsLink.parent(); var postGuid = bottomBar.parents(".stream-element").data("guid"); Loading @@ -204,8 +204,6 @@ bottomBar.removeClass("inactive").addClass("active"); } else { count = parseInt(count, 10) + 1; text = Diaspora.I18n.t("stream.reactions", {count: count}); toggleReactionsLink.html(text + "<i class='entypo-chevron-up'/>"); } }, Loading app/assets/stylesheets/mobile/comments.scss +10 −12 Original line number Diff line number Diff line Loading @@ -38,29 +38,25 @@ } .post-stats { top: -5px; float: right; position: relative; display: flex; margin-bottom: -15px; .count { background-color: $background-grey; text-align: center; line-height: 22px; margin-left: 5px; z-index: 2; } .icon-count-group { display: flex; flex-flow: column; justify-content: center; margin: 0 7px; } [class^="entypo"] { color: $text-grey; font-size: 24px; height: 28px; line-height: 24px; margin: 0; width: 100%; } Loading @@ -77,21 +73,23 @@ } .post-action { height: 28px; .disabled { color: $medium-gray; } } .add-comment-switcher { padding-top: 10px; } &.inactive .post-stats .count, &.inactive .comment-container { &.inactive { padding-bottom: 8px; .comment-container { display: none; } } } .stream-element .comments { margin: 0; margin-top: 10px; padding: 0; width: 100%; Loading app/helpers/mobile_helper.rb +5 −5 Original line number Diff line number Diff line Loading @@ -36,20 +36,20 @@ module MobileHelper link_to "", new_post_comment_path(post), class: "entypo-comment comment-action inactive" end def reactions_link(post, klass="") reactions_count = post.comments_count + post.likes_count def show_comments_link(post, klass="") if klass == "active" entypo_class = "entypo-chevron-up" else entypo_class = "entypo-chevron-down" end if reactions_count > 0 link_to "#{t('reactions', count: reactions_count)}<i class='#{entypo_class}'></i>".html_safe, if post.comments_count > 0 link_to "#{t('admins.stats.comments', count: post.comments_count)}<i class='#{entypo_class}'></i>".html_safe, post_comments_path(post, format: "mobile"), class: "show-comments #{klass}" else html = "<span class='show-comments'>" html << "#{t('reactions', count: reactions_count)}" html << t("admins.stats.comments", count: post.comments_count) html << "</span>" end end Loading app/views/shared/_stream_element.mobile.haml +2 −2 Original line number Diff line number Diff line Loading @@ -23,13 +23,13 @@ = render partial: "comments/post_stats", locals: {post: post} - if defined?(expanded_info) && expanded_info != reactions_link(post, "active") != show_comments_link(post, "active") .comment-container %ul.comments = render partial: "comments/comment", collection: post.comments.for_a_stream, locals: {post: post} - else != reactions_link(post) != show_comments_link(post) .ajax-loader.hidden .loader Loading config/locales/diaspora/en.yml +0 −5 Original line number Diff line number Diff line Loading @@ -246,11 +246,6 @@ en: comment: "Comment" commenting: "Commenting..." reactions: zero: "No reactions" one: "1 reaction" other: "%{count} reactions" contacts: index: start_a_conversation: "Start a conversation" Loading Loading
app/assets/javascripts/mobile/mobile_comments.js +3 −5 Original line number Diff line number Diff line Loading @@ -189,11 +189,11 @@ increaseReactionCount: function(bottomBar) { var toggleReactionsLink = bottomBar.find(".show-comments").first(); var count = toggleReactionsLink.text().match(/.*(\d+).*/); var text = ""; count = parseInt(count, 10); var text = Diaspora.I18n.t("stream.comments", {count: count + 1}); // No previous comment if(!count){ text = Diaspora.I18n.t("stream.reactions", {count: 1}); if (count === 0) { var parent = toggleReactionsLink.parent(); var postGuid = bottomBar.parents(".stream-element").data("guid"); Loading @@ -204,8 +204,6 @@ bottomBar.removeClass("inactive").addClass("active"); } else { count = parseInt(count, 10) + 1; text = Diaspora.I18n.t("stream.reactions", {count: count}); toggleReactionsLink.html(text + "<i class='entypo-chevron-up'/>"); } }, Loading
app/assets/stylesheets/mobile/comments.scss +10 −12 Original line number Diff line number Diff line Loading @@ -38,29 +38,25 @@ } .post-stats { top: -5px; float: right; position: relative; display: flex; margin-bottom: -15px; .count { background-color: $background-grey; text-align: center; line-height: 22px; margin-left: 5px; z-index: 2; } .icon-count-group { display: flex; flex-flow: column; justify-content: center; margin: 0 7px; } [class^="entypo"] { color: $text-grey; font-size: 24px; height: 28px; line-height: 24px; margin: 0; width: 100%; } Loading @@ -77,21 +73,23 @@ } .post-action { height: 28px; .disabled { color: $medium-gray; } } .add-comment-switcher { padding-top: 10px; } &.inactive .post-stats .count, &.inactive .comment-container { &.inactive { padding-bottom: 8px; .comment-container { display: none; } } } .stream-element .comments { margin: 0; margin-top: 10px; padding: 0; width: 100%; Loading
app/helpers/mobile_helper.rb +5 −5 Original line number Diff line number Diff line Loading @@ -36,20 +36,20 @@ module MobileHelper link_to "", new_post_comment_path(post), class: "entypo-comment comment-action inactive" end def reactions_link(post, klass="") reactions_count = post.comments_count + post.likes_count def show_comments_link(post, klass="") if klass == "active" entypo_class = "entypo-chevron-up" else entypo_class = "entypo-chevron-down" end if reactions_count > 0 link_to "#{t('reactions', count: reactions_count)}<i class='#{entypo_class}'></i>".html_safe, if post.comments_count > 0 link_to "#{t('admins.stats.comments', count: post.comments_count)}<i class='#{entypo_class}'></i>".html_safe, post_comments_path(post, format: "mobile"), class: "show-comments #{klass}" else html = "<span class='show-comments'>" html << "#{t('reactions', count: reactions_count)}" html << t("admins.stats.comments", count: post.comments_count) html << "</span>" end end Loading
app/views/shared/_stream_element.mobile.haml +2 −2 Original line number Diff line number Diff line Loading @@ -23,13 +23,13 @@ = render partial: "comments/post_stats", locals: {post: post} - if defined?(expanded_info) && expanded_info != reactions_link(post, "active") != show_comments_link(post, "active") .comment-container %ul.comments = render partial: "comments/comment", collection: post.comments.for_a_stream, locals: {post: post} - else != reactions_link(post) != show_comments_link(post) .ajax-loader.hidden .loader Loading
config/locales/diaspora/en.yml +0 −5 Original line number Diff line number Diff line Loading @@ -246,11 +246,6 @@ en: comment: "Comment" commenting: "Commenting..." reactions: zero: "No reactions" one: "1 reaction" other: "%{count} reactions" contacts: index: start_a_conversation: "Start a conversation" Loading