Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added check to determine if topic can be replied to

  • Loading branch information...
commit cb7220754ac454f9dbe55b6f9fa1a0aaf09cf20d 1 parent 1375b7b
Joshua Clayton authored
View
2  app/presenters/topic_presenter.rb
@@ -19,7 +19,7 @@ def can_be_stickied_by_current_user?
is_current_user_admin?
end
- def can_be_replied_by_current_user?
+ def can_be_replied_to_by_current_user?
!@topic.locked? && @current_user
end
View
2  app/views/topics/show.html.erb
@@ -3,4 +3,4 @@
<% content :full do %>
<%= render :partial => "posts/recordset", :locals => {:posts => @topic.posts} %>
<% end %>
-<%= render :partial => "posts/reply_slider", :locals => {:forum => @forum, :topic => @topic} %>
+<%= render :partial => "posts/reply_slider", :locals => {:forum => @forum, :topic => @topic} if @topic.can_be_replied_to_by_current_user? %>
Please sign in to comment.
Something went wrong with that request. Please try again.