From ec8e813546d3bed58956c9bc75face1f8ba93957 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 14 Dec 2014 13:31:26 +0100 Subject: [PATCH 1/2] bugfix --- app/models/question.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/question.rb b/app/models/question.rb index 0408a02b..740d59d6 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -7,7 +7,7 @@ class Question < ActiveRecord::Base def can_be_removed? return false if self.answers.count > 0 return false if Inbox.where(question: self).count > 1 - self.user.decrement! :asked_count + self.user.decrement! :asked_count unless self.author_is_anonymous true end end From d963191bd02e38144c2113899da98c1483788308 Mon Sep 17 00:00:00 2001 From: pixeldesu Date: Sun, 14 Dec 2014 15:22:37 +0100 Subject: [PATCH 2/2] added smile display to answerbox --- app/views/shared/_answerbox.html.haml | 1 + app/views/shared/_smiles.html.haml | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 app/views/shared/_smiles.html.haml diff --git a/app/views/shared/_answerbox.html.haml b/app/views/shared/_answerbox.html.haml index c7c51a0c..5229c469 100644 --- a/app/views/shared/_answerbox.html.haml +++ b/app/views/shared/_answerbox.html.haml @@ -46,4 +46,5 @@ .col-md-6.col-md-offset-6.col-sm-8.col-sm-offset-4.col-xs-6.col-xs-offset-6.text-right = render 'shared/answerbox_buttons', a: a .panel-footer{id: "ab-comments-#{a.id}", style: 'display: none'} + = render 'shared/smiles', a: a = render 'shared/comments', a: a diff --git a/app/views/shared/_smiles.html.haml b/app/views/shared/_smiles.html.haml new file mode 100644 index 00000000..5aa62bd1 --- /dev/null +++ b/app/views/shared/_smiles.html.haml @@ -0,0 +1,10 @@ +.media + .pull-left + %i.fa.fa-smile-o + .media-body + - if a.smiles.all.count == 0 + No one smiled this, yet. + - else + - a.smiles.all.each do |smile| + %a{href: show_user_profile_path(smile.user), data: {smile_id: smile.id}} + %img.img-rounded.answerbox--img-small{src: gravatar_url(smile.user)} \ No newline at end of file