diff --git a/app/controllers/courses_controller.rb b/app/controllers/favorites/courses_controller.rb similarity index 100% rename from app/controllers/courses_controller.rb rename to app/controllers/favorites/courses_controller.rb diff --git a/app/controllers/people_controller.rb b/app/controllers/favorites/people_controller.rb similarity index 100% rename from app/controllers/people_controller.rb rename to app/controllers/favorites/people_controller.rb diff --git a/app/controllers/projects_controller.rb b/app/controllers/favorites/projects_controller.rb similarity index 100% rename from app/controllers/projects_controller.rb rename to app/controllers/favorites/projects_controller.rb diff --git a/app/controllers/theses_controller.rb b/app/controllers/favorites/theses_controller.rb similarity index 100% rename from app/controllers/theses_controller.rb rename to app/controllers/favorites/theses_controller.rb diff --git a/app/controllers/tiss_crawler_controller.rb b/app/controllers/tiss_crawler_controller.rb index 5289d42..95b9f1c 100644 --- a/app/controllers/tiss_crawler_controller.rb +++ b/app/controllers/tiss_crawler_controller.rb @@ -5,33 +5,19 @@ class TissCrawlerController < ApplicationController def index end - def show_basic + def people_search end - def show_detail - end - - def search - context = params[:context] - case context - when "People" - result = TissCrawler.search(params) - @people = result.map { |person| Tiss::Person.new(person) } - # render(people_show_path, detail: false) - render template: people_show_basic_path - else - flash.write[:alert] = "Unknown search context" - end - - end - - require 'tiss/tiss_crawler' - - def show_basic + def people_show_basic result = TissCrawler.search(params) - @people = result.map { |person| Tiss::Person.new(person) } - # render(people_show_path, detail: false) - render template: people_show_basic_path + $people = result.map { |person| Tiss::Person.new(person) } + @people = $people + end + + def people_show_detail + people = $people + index = params[:index] + @person = people[Integer(index)] end end diff --git a/app/services/tiss.rb b/app/services/tiss.rb index 3d64c9f..03251a4 100644 --- a/app/services/tiss.rb +++ b/app/services/tiss.rb @@ -1,6 +1,10 @@ module Tiss class Base + def base_uri + 'https://tiss.tuwien.ac.at/' + end + def initialize(args = {}) args.each do |name, value| attr_name = name.to_s.underscore diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7f24372..1fef818 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -21,10 +21,10 @@ tiss2go