diff options
author | augier <christophe@c-henry.fr> | 2015-10-18 19:51:50 +0300 |
---|---|---|
committer | Augier <contact@c-henry.fr> | 2016-01-15 17:54:34 +0300 |
commit | 054971c7de4cb6e7ce9febb4ccec468b5362811f (patch) | |
tree | 53353f9d91d69db3ce05132612b0a49f56abd30c /app/helpers | |
parent | bde3b47c026e8945f5fcb5fa75361b0aa0468115 (diff) |
Big refactor on mobile comments
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/mobile_helper.rb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/app/helpers/mobile_helper.rb b/app/helpers/mobile_helper.rb index d64fdcee0..f16e5e68b 100644 --- a/app/helpers/mobile_helper.rb +++ b/app/helpers/mobile_helper.rb @@ -10,7 +10,11 @@ module MobileHelper link_to "", reshares_path(root_guid: absolute_root.guid), title: t("reshares.reshare.reshare_confirmation", author: absolute_root.author_name), class: "entypo-reshare reshare-action #{klass}" + else + content_tag :div, nil, class: "entypo-reshare reshare-action disabled" end + else + content_tag :div, nil, class: "entypo-reshare reshare-action disabled" end end @@ -26,14 +30,19 @@ module MobileHelper link_to "", new_post_comment_path(post), class: "entypo-comment comment-action inactive" end - def reactions_link(post) + def reactions_link(post, klass="") reactions_count = post.comments_count + post.likes_count + 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)}", + link_to "#{t('reactions', count: reactions_count)} <i class='#{entypo_class}'></i>".html_safe, post_comments_path(post, format: "mobile"), - class: "show_comments" + class: "show-comments #{klass}" else - html = "<span class='show_comments'>" + html = "<span class='show-comments'>" html << "#{t('reactions', count: reactions_count)}" html << "</span>" end |