add link to mod+ topics
This commit is contained in:
@@ -71,6 +71,10 @@ class ForumTopic < ActiveRecord::Base
|
||||
q = permitted
|
||||
return q if params.blank?
|
||||
|
||||
if params[:mod_only].present?
|
||||
q = q.where("min_level >= ?", MIN_LEVELS[:Moderator])
|
||||
end
|
||||
|
||||
if params[:title_matches].present?
|
||||
q = q.title_matches(params[:title_matches])
|
||||
end
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
|
||||
<p>
|
||||
Categories:
|
||||
<%= link_to "All", forum_topics_path %>, <%= ForumTopic::CATEGORIES.map {|id, name| link_to_unless_current(name, forum_topics_path(:search => {:category_id => id}))}.join(", ").html_safe %>
|
||||
<%= link_to "All", forum_topics_path %>,
|
||||
<% if CurrentUser.is_moderator? %>
|
||||
<%= link_to "Mod+", forum_topics_path(:search => {:mod_only => true}) %>,
|
||||
<% end %>
|
||||
<%= ForumTopic::CATEGORIES.map {|id, name| link_to_unless_current(name, forum_topics_path(:search => {:category_id => id}))}.join(", ").html_safe %>
|
||||
</p>
|
||||
|
||||
<%= render "listing", :forum_topics => @forum_topics %>
|
||||
|
||||
Reference in New Issue
Block a user