Commit c9d49c89 authored by Steffen van Bergerem's avatar Steffen van Bergerem Committed by Benjamin Neff
Browse files

Always show mobile reaction counts

fixes #5829
parent 5efb4a91
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -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");

@@ -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'/>");
      }
    },
+10 −12
Original line number Diff line number Diff line
@@ -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%;
    }
@@ -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%;

+5 −5
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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
+0 −5
Original line number Diff line number Diff line
@@ -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