diff --git a/app/controllers/crawlers/courses_crawler_controller.rb b/app/controllers/courses_crawler_controller.rb similarity index 100% rename from app/controllers/crawlers/courses_crawler_controller.rb rename to app/controllers/courses_crawler_controller.rb diff --git a/app/controllers/crawlers/people_crawler_controller.rb b/app/controllers/people_crawler_controller.rb similarity index 100% rename from app/controllers/crawlers/people_crawler_controller.rb rename to app/controllers/people_crawler_controller.rb diff --git a/app/controllers/crawlers/tiss_crawler_controller.rb b/app/controllers/tiss_crawler_controller.rb similarity index 84% rename from app/controllers/crawlers/tiss_crawler_controller.rb rename to app/controllers/tiss_crawler_controller.rb index 8efe580..4dc0869 100644 --- a/app/controllers/crawlers/tiss_crawler_controller.rb +++ b/app/controllers/tiss_crawler_controller.rb @@ -11,7 +11,7 @@ class TissCrawlerController < ApplicationController case $search_context when 'People' # redirect to people_show_basic, propagate the search_term - redirect_to :action => 'people_show_basic', :search_term => params[:search_term] + redirect_to :controller => 'people_crawler', :action => :show_basic, :search_term => params[:search_term] when 'Courses' when 'Theses' when 'Projects' diff --git a/app/views/people_crawler/show_basic.html.erb b/app/views/people_crawler/show_basic.html.erb new file mode 100644 index 0000000..be29455 --- /dev/null +++ b/app/views/people_crawler/show_basic.html.erb @@ -0,0 +1,10 @@ +

This is the result for your basic people search

+ +<% @people.each_with_index do |person, index| %> +

+ <%= person['first_name'] %> + <%= person['last_name'] %> + <%= button_to 'Details', action: :show_detail, tiss_id: person['tiss_id'] %> + <%= button_to 'Add to favorites', action: :add_to_fav, tiss_id: person['tiss_id'] %> +

+<% end %> diff --git a/app/views/tiss_crawler/person_show_detail.html.erb b/app/views/people_crawler/show_detail.html.erb similarity index 84% rename from app/views/tiss_crawler/person_show_detail.html.erb rename to app/views/people_crawler/show_detail.html.erb index 54b2a06..4a04d58 100644 --- a/app/views/tiss_crawler/person_show_detail.html.erb +++ b/app/views/people_crawler/show_detail.html.erb @@ -11,5 +11,5 @@ Chosen person in detail view:

Other mails: <%= @person['other_emails'] %>

Main addresses: <%= @person['main_addresses'] %>

- <%= button_to 'Add to favorites', action: :person_add_to_fav, tiss_id: @person['tiss_id'] %> + <%= button_to 'Add to favorites', action: :add_to_fav, tiss_id: @person['tiss_id'] %> <% end %> \ No newline at end of file diff --git a/app/views/tiss_crawler/people_show_basic.html.erb b/app/views/tiss_crawler/people_show_basic.html.erb deleted file mode 100644 index 7695efd..0000000 --- a/app/views/tiss_crawler/people_show_basic.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -

This is the result for your basic people search

- -<% @people.each_with_index do |person, index| %> -

- <%= person['first_name'] %> - <%= person['last_name'] %> - <%= button_to 'Details', action: :person_show_detail, tiss_id: person['tiss_id'] %> - <%= button_to 'Add to favorites', action: :person_add_to_fav, tiss_id: person['tiss_id'] %> -

-<% end %> diff --git a/config/routes.rb b/config/routes.rb index 350bec2..e047af6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,12 +3,13 @@ Rails.application.routes.draw do devise_for :users, path_names: {sign_in: 'log_in', sign_out: 'log out'} get 'login/index' + get 'tiss_crawler/search' - get 'tiss_crawler/people_show_basic' - get 'tiss_crawler/person_show_detail' - post 'tiss_crawler/person_show_detail' - get 'tiss_crawler/person_add_to_fav' - post 'tiss_crawler/person_add_to_fav' + get 'people_crawler/show_basic' + get 'people_crawler/show_detail' + post 'people_crawler/show_detail' + get 'people_crawler/add_to_fav' + post 'people_crawler/add_to_fav' namespace :favorites do get 'favorite_person/index'