X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/cba838830cb4b47420573ba0187e0eebbc5b6f1f..8deda2012ea7e25610f2cbd0a271e131d9364503:/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 24bacf3231..3270cfb376 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -164,44 +164,31 @@ class ApplicationController < ActionController::Base def find_objects_for_index @objects ||= model_class @objects = @objects.filter(@filters).limit(@limit).offset(@offset) + @objects.fetch_multiple_pages(false) end def render_index - if params[:partial] - respond_to do |f| - f.json { -=begin - if @filters.andand.any? - search_filters = @filters.select do |attr,op,val| - op == 'ilike' and !val.nil? and !val.eql?('%%') - end - end - if !search_filters || !search_filters.any? # no search filter was used - @next_page_href = next_page_href(partial: params[:partial], filters: @filters.to_json) - else - @next_page_href = nil - end -=end + respond_to do |f| + f.json { + if params[:partial] @next_page_href = next_page_href(partial: params[:partial], filters: @filters.to_json) render json: { - content: render_to_string(partial: "show_#{params[:partial]}.html", formats: [:html]), - next_page_href: @next_page_href - + content: render_to_string(partial: "show_#{params[:partial]}", + formats: [:html]), + next_page_href: @next_page_href } - } - end - else - respond_to do |f| - f.json { render json: @objects } - f.html { - if params[:tab_pane] - render_pane params[:tab_pane] - else - render - end - } - f.js { render } - end + else + render json: @objects + end + } + f.html { + if params[:tab_pane] + render_pane params[:tab_pane] + else + render + end + } + f.js { render } end end