refactoring of "abstract" search controller

This commit is contained in:
Marco Zeisler
2020-04-21 18:58:48 +02:00
parent fbfc12e096
commit a36796960f
13 changed files with 44 additions and 23 deletions
-2
View File
@@ -1,2 +0,0 @@
<h1>Courses#index</h1>
<p>Find me in app/views/courses/index.html.erb</p>
@@ -2,5 +2,5 @@
<p>For now only the tiss_ids are stored and shown</p>
<% @favoritePeople.each do |favPerson| %>
Tiss_id: <%= favPerson.tiss_id %>
<p>Tiss_id: <%= favPerson.tiss_id %></p>
<% end %>
+1 -1
View File
@@ -21,7 +21,7 @@
<a href="#" class="logo">tiss2go</a>
<div class="left-menu">
<%= link_to 'Home', root_path %>
<%= link_to 'Search', tiss_crawler_people_search_path %>
<%= link_to 'Search', tiss_crawler_search_path %>
<%= link_to 'Favorite People', '/favorites/favorite_person/index' %>
<%#= link_to 'Projects', projects_index_path %>
<%#= link_to 'Theses', theses_index_path %>
-3
View File
@@ -1,3 +0,0 @@
<h1>People#index</h1>
<p>Find me in app/views/people/index.html.erb</p>
-2
View File
@@ -1,2 +0,0 @@
<h1>Projects#index</h1>
<p>Find me in app/views/projects/index.html.erb</p>
-2
View File
@@ -1,2 +0,0 @@
<h1>Theses#index</h1>
<p>Find me in app/views/theses/index.html.erb</p>
@@ -1,5 +0,0 @@
<%= form_tag('/tiss_crawler/people_show_basic', :method => "get") do %>
<%= label_tag(:search_term, "Search for people @TU Vienna:") %>
<%= text_field_tag(:search_term) %>
<%= submit_tag("Search") %>
<% end %>
@@ -5,6 +5,6 @@ This is the result for your basic people search:
<%= person['first_name'] %>
<%= person['last_name'] %>
<%= button_to 'Details', action: :person_show_detail, tiss_id: person['tiss_id'] %>
<%= button_to 'Add to favs.', action: :person_add_to_fav, tiss_id: person['tiss_id'] %>
<%= button_to 'Add to favorites', action: :person_add_to_fav, tiss_id: person['tiss_id'] %>
</p>
<% end %>
@@ -11,4 +11,5 @@ Chosen person in detail view:
<p>Other mails: <%= @person['other_emails'] %></p>
<p>Main addresses: <%= @person['main_addresses'] %></p>
<!-- <p>Employee: <%#= @person.employee %></p>-->
<%= button_to 'Add to favorites', action: :person_add_to_fav, tiss_id: @person['tiss_id'] %>
<% end %>
+12
View File
@@ -0,0 +1,12 @@
<h1>Search through @TU Vienna Database</h1>
<p>Only People Search is working right now</p>
<%= form_tag('/tiss_crawler/search', :method => "get") do %>
<%= label_tag(:search_term, "Enter your search term") %>
<%= text_field_tag(:search_term) %>
<%= radio_button_tag(:search_context, 'People', true) %> People
<%= radio_button_tag(:search_context, 'Courses', false) %> Courses
<%= radio_button_tag(:search_context, 'Theses', false) %> Theses
<%= radio_button_tag(:search_context, 'Projects', false) %> Projects
<%= submit_tag("Search") %>
<% end %>