Merge remote-tracking branches 'remotes/origin/master' and 'remotes/origin/users-smiled' into notifications

This commit is contained in:
nilsding 2014-12-14 15:29:32 +01:00
commit 3eec44f422
3 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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)}