refactored crawler controllers and bundled them in crawlers namespace
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<h1>Results for "<%= params[:search_term] %>"</h1>
|
||||
|
||||
<ul class="courses-list">
|
||||
<% @courses.each_with_index do |course| %>
|
||||
<li class="course">
|
||||
<%= link_to crawlers_courses_crawler_show_detail_url(:title => course['title'], :detail_url => course['detail_url']) do %>
|
||||
<span class="list-link">
|
||||
<span class="course-title">
|
||||
<%= course['title'] %>
|
||||
</span>
|
||||
</span>
|
||||
<% end %>
|
||||
<span class="add-to-fav">
|
||||
<%= link_to crawlers_courses_crawler_add_to_fav_url(:title => course['title'], :detail_url => course['detail_url']) do %>
|
||||
<%= show_svg('favorite-24px.svg') %>
|
||||
<% end %>
|
||||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
@@ -0,0 +1,16 @@
|
||||
<% if @course != nil %>
|
||||
<%-# TODO parse more fields and style them appropriately -%>
|
||||
<h2><%= @course['title']['de'] %></h2>
|
||||
<h5><%= @course['courseType'] %> <%= @course['semesterCode'] %>, <%= @course['weeklyHours'] %> SWS, <%= @course['instituteCode'] %> <%= @course['instituteName']['de'] %> </h5>
|
||||
<%= button_to 'Add to favorites', action: :add_to_fav, number: @course['courseNumber'], semester: @course['semesterCode'] %>
|
||||
<% if @lecturers_names != nil %>
|
||||
<h3>Vortragende</h3>
|
||||
<% @lecturers_names.each_with_index do |name| %>
|
||||
<p><%= name %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @course['objective']['de'] != nil %>
|
||||
<h3>Inhalt</h3>
|
||||
<%= raw @course['objective']['de'] %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,28 @@
|
||||
<h1>Results for "<%= params[:search_term] %>"</h1>
|
||||
|
||||
<ul class="people-list">
|
||||
<% @people.each_with_index do |person| %>
|
||||
<li class="person">
|
||||
<%= link_to crawlers_people_crawler_show_detail_url(:tiss_id => person['tiss_id']) do %>
|
||||
<span class="list-link">
|
||||
<span class="person-icon">
|
||||
<% if person['picture_uri'] != nil %>
|
||||
<%= image_tag @host + person['picture_uri'] %>
|
||||
<% else %>
|
||||
<%= show_svg('account_circle-black-48dp.svg') %>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="person-name">
|
||||
<%= person['first_name'] %>
|
||||
<%= person['last_name'] %>
|
||||
</span>
|
||||
</span>
|
||||
<% end %>
|
||||
<span class="add-to-fav">
|
||||
<%= link_to crawlers_people_crawler_add_to_fav_url(:tiss_id => person['tiss_id']) do %>
|
||||
<%= show_svg('favorite-24px.svg') %>
|
||||
<% end %>
|
||||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
@@ -0,0 +1,21 @@
|
||||
<% if @person != nil %>
|
||||
<h2><%= @person['first_name'] %> <%= @person['last_name'] %></h2>
|
||||
<div class="profile-picture">
|
||||
<% if @person['picture_uri'] != nil %>
|
||||
<%= image_tag @host + @person['picture_uri'] %>
|
||||
<% end %>
|
||||
</div>
|
||||
<h5><%= @person['preceding_titles'] %> <%= @person['postpositioned_titles'] %></h5>
|
||||
<% if @person['main_phone_number'] != nil %>
|
||||
<p>Phone: <%= @person['main_phone_number'] %></p>
|
||||
<% end %>
|
||||
<p>E-Mail: <%= @person['main_email'] %></p>
|
||||
<% if @person['other_emails'] != [] %>
|
||||
<p>Other E-Mails: <%= @person['other_emails'] %></p>
|
||||
<% end %>
|
||||
<% if @person['main_addresses'] != nil %>
|
||||
<p>Address: <%= @person['main_addresses'][0]['street'] %>, <%= @person['main_addresses'][0]['zip_code'] %> <%= @person['main_addresses'][0]['city'] %></p>
|
||||
<% end %>
|
||||
<!-- <p>Employee: <%#= @person.employee %></p>-->
|
||||
<%= button_to 'Add to favorites', action: :add_to_fav, tiss_id: @person['tiss_id'] %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,12 @@
|
||||
<h1>Search through @TU Vienna Database</h1>
|
||||
<p>Only people can be searched right now</p>
|
||||
|
||||
<%= form_tag(crawlers_tiss_crawler_search_path, :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 %>
|
||||
Reference in New Issue
Block a user