store and display favorite person by tiss_id

This commit is contained in:
Marco Zeisler
2020-04-21 18:06:07 +02:00
parent c32819d819
commit fbfc12e096
31 changed files with 153 additions and 88 deletions
@@ -0,0 +1,6 @@
<h1>Your favorite perople listed here ...</h1>
<p>For now only the tiss_ids are stored and shown</p>
<% @favoritePeople.each do |favPerson| %>
Tiss_id: <%= favPerson.tiss_id %>
<% end %>
+2 -2
View File
@@ -21,8 +21,8 @@
<a href="#" class="logo">tiss2go</a>
<div class="left-menu">
<%= link_to 'Home', root_path %>
<%= link_to 'People', tiss_crawler_people_search_path %>
<%#= link_to 'Courses', courses_index_path %>
<%= link_to 'Search', tiss_crawler_people_search_path %>
<%= link_to 'Favorite People', '/favorites/favorite_person/index' %>
<%#= link_to 'Projects', projects_index_path %>
<%#= link_to 'Theses', theses_index_path %>
</div>
@@ -1,7 +1,4 @@
<%= form_tag('/tiss_crawler/people_show_basic', :method => "get") do %>
<%= hidden_field_tag(:context, 'People') %>
<%= hidden_field_tag(:api, '/api/person/v22/psuche') %>
<%= hidden_field_tag(:search_parameter, 'q') %>
<%= label_tag(:search_term, "Search for people @TU Vienna:") %>
<%= text_field_tag(:search_term) %>
<%= submit_tag("Search") %>
@@ -2,8 +2,9 @@ This is the result for your basic people search:
<% @people.each_with_index do |person, index| %>
<p>
<%= person.first_name %>
<%= person.last_name %>
<%= button_to 'Details', action: :people_show_detail, index: index %>
<%= 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'] %>
</p>
<% end %>
@@ -1,14 +0,0 @@
Chosen person in detail view:
<% if @person != nil %>
<% if @person.picture_uri != nil %>
<%= image_tag @person.base_uri + @person.picture_uri %>
<% end %>
<p><%= @person.preceding_titles %> <%= @person.first_name %> <%= @person.last_name %>,
<%= @person.gender %> <%= @person.postpositioned_titles %></p>
<p>Phone: <%= @person.main_phone_number %></p>
<p>Mail: <%= @person.main_email %></p>
<p>Other mails: <%= @person.other_emails %></p>
<p>Main addresses: <%= @person.main_addresses %></p>
<!-- <p>Employee: <%#= @person.employee %></p>-->
<% end %>
@@ -0,0 +1,14 @@
Chosen person in detail view:
<% if @person != nil %>
<% if @person['picture_uri'] != nil %>
<%= image_tag @host + @person['picture_uri'] %>
<% end %>
<p><%= @person['preceding_titles'] %> <%= @person['first_name'] %> <%= @person['last_name'] %>,
<%= @person['gender'] %> <%= @person['postpositioned_titles'] %></p>
<p>Phone: <%= @person['main_phone_number'] %></p>
<p>Mail: <%= @person['main_email'] %></p>
<p>Other mails: <%= @person['other_emails'] %></p>
<p>Main addresses: <%= @person['main_addresses'] %></p>
<!-- <p>Employee: <%#= @person.employee %></p>-->
<% end %>