Skip to content

Commit

Permalink
Merge branch 'release/0.5.8_patch.4'
Browse files Browse the repository at this point in the history
* release/0.5.8_patch.4:
  #FIX comments
  • Loading branch information
kalashnikovisme committed Jan 22, 2016
2 parents d380974 + cba216b commit e911cca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/web/news_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def show
@next_news = News.published.next @news.id
@same_events = ::EventDecorator.decorate_collection same_events
@popular_news = NewsDecorator.decorate_collection News.popular.first 6
@comments = @news.comments.published
@comments = @news.comments.published.decorate
@banner = Banner.active.with_vertical.actual.last
end

Expand Down
4 changes: 1 addition & 3 deletions app/decorators/comment_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
class CommentDecorator < ApplicationDecorator
delegate_all

def short_name
object.user.decorate.short_name
end
decorates_association :user
end
4 changes: 3 additions & 1 deletion app/views/web/comments/_index.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
= stylesheet_link_tag 'web/comments'
= javascript_include_tag 'web/comments'
- comments.each do |comment|
.row.comment
.small-2.columns
Expand All @@ -7,7 +9,7 @@
= image_tag comment.user.default_avatar(:image_url)
.columns.text{ class: (signed_in? && (current_user.id == comment.user.id || current_user.role.admin?)) ? 'small-9' : 'small-10' }
%h4
= comment.short_name
= comment.user.short_name
= comment.text
- if signed_in? && (current_user.id == comment.user.id || current_user.role.admin?)
.small-1.columns
Expand Down

0 comments on commit e911cca

Please sign in to comment.