Skip to content

Commit

Permalink
Add “manual” tab to flag log page
Browse files Browse the repository at this point in the history
  • Loading branch information
j-f1 committed Jun 12, 2017
1 parent f340e3e commit 82eb539
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/controllers/flag_log_controller.rb
Expand Up @@ -21,6 +21,13 @@ def index
when 'failures'
@applicable_flag_logs = @applicable_flag_logs.where(success: false)
end
if params[:filter] == 'manual'
if @individual_user
@applicable_flag_logs = @individual_user.flag_logs.where(:auto => false)
else
@applicable_flag_logs = FlagLog.manual
end
end

@flag_logs = @applicable_flag_logs.order('flag_logs.created_at DESC, flag_logs.id DESC')
.includes(post: [feedbacks: [:user, :api_key]])
Expand Down
1 change: 1 addition & 0 deletions app/views/flag_log/index.html.erb
Expand Up @@ -24,6 +24,7 @@
<% end %>
<li class="<%= 'active' if params[:filter] == 'fps' %>"><%= link_to "False Positives", flag_logs_path(filter: 'fps') %></li>
<li class="<%= 'active' if params[:filter] == 'failures' %>"><%= link_to "Failures", flag_logs_path(filter: 'failures') %></li>
<li class="<%= 'active' if params[:filter] == 'manual' %>"><%= link_to "Manual", flag_logs_path(filter: 'manual') %></li>
</ul>
<% end %>

Expand Down

0 comments on commit 82eb539

Please sign in to comment.