Remove column sorting

It's not tested, not working, and so it can come later in a separate PR.
This commit is contained in:
Andy Allan 2017-11-29 17:18:05 +00:00
parent 9f65820336
commit 3276063fcf
3 changed files with 8 additions and 20 deletions

View file

@ -8,8 +8,6 @@ class IssuesController < ApplicationController
before_action :find_issue, :only => [:show, :resolve, :reopen, :ignore]
before_action :setup_user_role, :only => [:show, :index]
helper_method :sort_column, :sort_direction
def index
if current_user.moderator?
@issue_types = @moderator_issues
@ -19,7 +17,7 @@ class IssuesController < ApplicationController
@users = User.joins(:roles).where(:user_roles => { :role => "administrator" })
end
@issues = Issue.where(:issue_type => @user_role).order(sort_column + " " + sort_direction)
@issues = Issue.where(:issue_type => @user_role)
# If search
if params[:search_by_user] && params[:search_by_user].present?

View file

@ -47,16 +47,6 @@ module IssuesHelper
end
end
def sortable(column, title = nil)
title ||= column.titleize
direction = column == sort_column && sort_direction == "asc" ? "desc" : "asc"
if column == sort_column
arrow = direction == "desc" ? ["25B2".hex].pack("U") : ["25BC".hex].pack("U")
title += arrow
end
# FIXME: link_to title, params.merge(:sort => column, :direction => direction)
end
def report_type(report_class)
case report_class
when "DiaryEntry"

View file

@ -21,13 +21,13 @@ Search for a particular issue(s): <br/>
<table>
<thead>
<tr>
<td style="width:40px;"><b> <%= sortable("status") %></b></td>
<td style="width:160px;"><b> <%= sortable("reports_count", "Number of Reports") %></b></td>
<td style="width:141px;"><b> <%= sortable("updated_at","Last updated at") %></b></td>
<td style="width:140px;"><b> <%= sortable("updated_by","Last updated by") %></b></td>
<td style="width:203px;"><b> Link to reports </b></td>
<td style="width:128px;"><b> <%= sortable("reported_user_id","Reported User") %> </b></td>
<td style="width:67px;"><b> Link to reported instance</b></td>
<td style="width:40px;"><b>Status</b></td>
<td style="width:160px;"><b>Number of Reports</b></td>
<td style="width:141px;"><b>Last updated at</b></td>
<td style="width:140px;"><b>Last updated by</b></td>
<td style="width:203px;"><b>Link to reports</b></td>
<td style="width:128px;"><b>Reported User</b></td>
<td style="width:67px;"><b>Link to reported instance</b></td>
</tr>
</thead>
<tbody>