Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions app/assets/javascripts/components/side_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ function setActiveMenuItem() {
link = $('.js-resources');
}
break;
case '/resources/search':
link = $('.js-resources');
break;
case '/resources/' + digit(path):
link = $('.js-resources');
break;
Expand All @@ -61,9 +58,6 @@ function setActiveMenuItem() {
case '/workshops/' + digit(path):
link = $('.js-search');
break;
case '/workshops/search':
link = $('.js-search');
break;
case '/workshops/new':
case '/workshop_logs/new':
subMenu = $('.js-report');
Expand Down
17 changes: 0 additions & 17 deletions app/controllers/resources_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,6 @@ def destroy
redirect_to resources_path, notice: "Resource was successfully destroyed."
end

def search
authorize!
process_search
@sortable_fields = Resource::PUBLISHED_KINDS
render :index
end

def download
@resource = Resource.find(params[:resource_id])
authorize! @resource
Expand Down Expand Up @@ -180,12 +173,6 @@ def assign_associations(resource)
resource.save!
end

def process_search
@params = search_params
@query = search_params[:query]
@resources = Search.new.search(search_params, current_user).paginate(page: params[:search][:page])
end

def resource_id_param
params[:id]
end
Expand All @@ -211,8 +198,4 @@ def load_forms
end
end
end

def search_params
params[:search]
end
end
35 changes: 0 additions & 35 deletions app/controllers/workshops_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,25 +173,6 @@ def update
end


def search
@params = params[:search]
@query = params[:search][:query] if @params
@workshops = Search.new.search(@params, current_user)

if @workshops.paginate(page: params[:search][:page], per_page: workshops_per_page).empty?
@workshops = @workshops.paginate(page: 1, per_page: workshops_per_page)
else
@workshops = @workshops.paginate(page: params[:search][:page], per_page: workshops_per_page)
end

authorize! @workshops

load_sortable_fields
load_metadata

render :index
end

private

def set_show
Expand Down Expand Up @@ -241,14 +222,6 @@ def log_workshop_error(action, error)
Rails.logger.error "Workshop #{action} failed: #{error.class} - #{error.message}\n#{error.backtrace.join("\n")}"
end

def workshops_per_page
view_all_workshops? ? @workshops.published.size : 12
end

def view_all_workshops?
params[:search][:view_all] == "1"
end

def workshop_params
params.require(:workshop).permit(
:title, :featured, :published,
Expand Down Expand Up @@ -323,12 +296,4 @@ def workshop_params
:position, :_destroy ]
)
end

def load_sortable_fields
@sortable_fields = WindowsType.where(short_name: "COMBINED")
end

def load_metadata
@metadata = CategoryType.includes(:categories).published.decorate
end
end
70 changes: 0 additions & 70 deletions app/services/search.rb

This file was deleted.

9 changes: 1 addition & 8 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@

resources :resources do
get :download
collection do
post :search
end
end
resources :sectors do
collection do
Expand All @@ -145,11 +142,7 @@
resources :workshop_log_creation_wizard
resources :workshop_variation_ideas
resources :workshop_variations
resources :workshops do
collection do
post :search
end
end
resources :workshops

resources :workshop_mentions, only: [ :index ]
resources :resource_mentions, only: [ :index ]
Expand Down