diff --git a/app/assets/images/account_circle-black-48dp.svg b/app/assets/images/account_circle-black-48dp.svg new file mode 100644 index 0000000..9f8c878 --- /dev/null +++ b/app/assets/images/account_circle-black-48dp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/images/favorite-24px.svg b/app/assets/images/favorite-24px.svg new file mode 100644 index 0000000..c65bba3 --- /dev/null +++ b/app/assets/images/favorite-24px.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/stylesheets/people_crawler.scss b/app/assets/stylesheets/people_crawler.scss index 4c45939..6c2d8b9 100644 --- a/app/assets/stylesheets/people_crawler.scss +++ b/app/assets/stylesheets/people_crawler.scss @@ -1,3 +1,65 @@ // Place all the styles related to the PeopleCrawler controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: https://sass-lang.com/ + +.people-list { + list-style: none; + padding: 0; + margin: 0; + + a { + text-decoration: none; + color: black; + } + + .person { + line-height: 72px; + width: 100%; + padding: 8px 0 8px 0; + + .list-link { + float: left; + width: 89%; + } + + .person-icon { + display: inline-block; + max-width: 48px; + height: auto; + margin-right: 8px; + + img { + vertical-align: middle; + width: 48px; + height: 48px; + border-radius: 50%; + object-fit: cover; + } + + svg { + vertical-align: middle; + width: 48px; + height: auto; + } + } + + .person-name { + text-align: center; + width: 100%; + } + + .add-to-fav { + display: inline-block; + vertical-align: middle; + float: right; + width: 36px; + height: 36px; + + svg { + width: 100%; + height: auto; + vertical-align: middle; + } + } + } +} diff --git a/app/controllers/people_crawler_controller.rb b/app/controllers/people_crawler_controller.rb index 10c483b..e892d48 100644 --- a/app/controllers/people_crawler_controller.rb +++ b/app/controllers/people_crawler_controller.rb @@ -4,6 +4,7 @@ class PeopleCrawlerController < TissCrawlerController params[:api] = '/api/person/v22/psuche' params[:search_parameter] = 'q' puts params[:search_context] + @host = TissCrawler.get_host # TissCrawler performs general search over the available people @people = TissCrawler.search(params) @@ -11,7 +12,9 @@ class PeopleCrawlerController < TissCrawlerController def show_detail params[:api] = '/api/person/v22/id/' + params[:tiss_id] = params[:tiss_id] + puts params # TissCrawler fetches the person's detail information @person = TissCrawler.get_details(params) # Host is needed for image rendering diff --git a/app/views/people_crawler/show_basic.html.erb b/app/views/people_crawler/show_basic.html.erb index be29455..594209e 100644 --- a/app/views/people_crawler/show_basic.html.erb +++ b/app/views/people_crawler/show_basic.html.erb @@ -1,10 +1,28 @@ -

This is the result for your basic people search

+

Results for "<%= params[:search_term] %>"

-<% @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 %> + \ No newline at end of file