From a2e1e2557bd2df587ccf9d4bb9738cfabe766765 Mon Sep 17 00:00:00 2001 From: nilsding Date: Fri, 5 Dec 2014 20:21:15 +0100 Subject: [PATCH] smile count is now in the button itself if the user is signed in --- app/views/shared/_answerbox_buttons.html.haml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/shared/_answerbox_buttons.html.haml b/app/views/shared/_answerbox_buttons.html.haml index c54fd0a6..d0125a86 100644 --- a/app/views/shared/_answerbox_buttons.html.haml +++ b/app/views/shared/_answerbox_buttons.html.haml @@ -1,13 +1,16 @@ %span.hidden-xs.text-muted - %span{id: "ab-smile-count-#{a.id}"}= a.smile_count - users smiled this + - unless user_signed_in? + %span{id: "ab-smile-count-#{a.id}"}= a.smile_count + users smiled this - if user_signed_in? - if current_user.smiled? a %button.btn.btn-info.btn-sm{type: :button, name: 'ab-smile', 'data-a-id' => a.id, 'data-action' => 'unsmile'} %i.fa.fa-frown-o + %span{id: "ab-smile-count-#{a.id}"}= a.smile_count - else %button.btn.btn-info.btn-sm{type: :button, name: 'ab-smile', 'data-a-id' => a.id, 'data-action' => 'smile'} %i.fa.fa-smile-o + %span{id: "ab-smile-count-#{a.id}"}= a.smile_count %button.btn.btn-primary.btn-sm{type: :button, name: 'ab-comments', 'data-a-id' => a.id, 'data-state' => :hidden} %i.fa.fa-comments %span{id: "ab-comment-count-#{a.id}"}= a.comment_count