X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/96fe9fc822c2270cb6e4212798d61e61481ec2e0..4898ba78d5cc0783a319f0742bb8bc0b4c15d7be:/apps/workbench/app/controllers/application_controller.rb diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb index 7d7ea9534b..83cb261381 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -14,6 +14,7 @@ class ApplicationController < ActionController::Base around_filter :require_thread_api_token, except: ERROR_ACTIONS before_filter :check_user_agreements, except: ERROR_ACTIONS before_filter :check_user_notifications, except: ERROR_ACTIONS + before_filter :load_filters_and_paging_params, except: ERROR_ACTIONS before_filter :find_object_by_uuid, except: [:index, :choose] + ERROR_ACTIONS theme :select_theme @@ -86,7 +87,7 @@ class ApplicationController < ActionController::Base end end - def find_objects_for_index + def load_filters_and_paging_params @limit ||= 200 if params[:limit] @limit = params[:limit].to_i @@ -105,7 +106,9 @@ class ApplicationController < ActionController::Base end @filters += filters end + end + def find_objects_for_index @objects ||= model_class @objects = @objects.filter(@filters).limit(@limit).offset(@offset) end @@ -258,7 +261,7 @@ class ApplicationController < ActionController::Base if @object.name and @object.name != '' @object.name = "Copy of #{@object.name}" else - @object.name = "Copy of unnamed #{@object.class_for_display.downcase}" + @object.name = "" end end @object.save!