From: Andy Allan Date: Wed, 29 Nov 2017 17:18:05 +0000 (+0000) Subject: Remove column sorting X-Git-Tag: live~3002^2~81 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/3276063fcfba982b7bbb886f5ef18d7ae67c46f5 Remove column sorting It's not tested, not working, and so it can come later in a separate PR. --- diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index e156ea004..edf8f1121 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -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? diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 715696445..27a51c0fb 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -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" diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index a490223ae..6c72dcc12 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -21,13 +21,13 @@ Search for a particular issue(s):
- - - - - - - + + + + + + +
<%= sortable("status") %> <%= sortable("reports_count", "Number of Reports") %> <%= sortable("updated_at","Last updated at") %> <%= sortable("updated_by","Last updated by") %> Link to reports <%= sortable("reported_user_id","Reported User") %> Link to reported instanceStatusNumber of ReportsLast updated atLast updated byLink to reportsReported UserLink to reported instance