From 27879050debaf216dcd771cd0ccce8b2035bbb23 Mon Sep 17 00:00:00 2001 From: albert Date: Wed, 14 Sep 2011 13:18:44 -0400 Subject: [PATCH] fixes #57: Edit button error issue (forum) --- app/views/forum_topics/_secondary_links.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/forum_topics/_secondary_links.html.erb b/app/views/forum_topics/_secondary_links.html.erb index a4aede782..636c1329a 100644 --- a/app/views/forum_topics/_secondary_links.html.erb +++ b/app/views/forum_topics/_secondary_links.html.erb @@ -7,10 +7,10 @@ <% if @forum_topic %>
  • |
  • <%= link_to "Reply", new_forum_post_path(:topic_id => @forum_topic.id) %>
  • - <% unless @forum_topic.new_record? %> -
  • <%= link_to "Edit", edit_forum_topic_path(@forum_topic) %>
  • + <% if !@forum_topic.new_record? && @forum_topic.editable_by?(CurrentUser.user) %> +
  • <%= link_to "Edit topic", edit_forum_topic_path(@forum_topic) %>
  • <% if CurrentUser.is_moderator? %> -
  • <%= link_to "Delete", forum_topic_path(@forum_topic), :remote => true, :method => :delete, :confirm => "Do you want to delete this forum topic?" %>
  • +
  • <%= link_to "Delete topic", forum_topic_path(@forum_topic), :remote => true, :method => :delete, :confirm => "Do you want to delete this forum topic?" %>
  • <% end %> <% end %> <% end %>