refactored favorites:

instead of using a fav page for each content, use a general favorites pane where the user can select which favs shall be shown
This commit is contained in:
Pfingstfrosch
2020-05-12 19:19:04 +02:00
parent a8f4d4a9db
commit 92eff82f1a
13 changed files with 88 additions and 9 deletions
@@ -1,6 +0,0 @@
class Favorites::FavoritePersonController < ApplicationController
def index
@favoritePeople = FavoritePerson.all
@host = 'https://tiss.tuwien.ac.at'
end
end
+23
View File
@@ -0,0 +1,23 @@
class FavoritesController < ApplicationController
def index
end
def people
@favoritePeople = FavoritePerson.all
@host = 'https://tiss.tuwien.ac.at'
end
def courses
end
def theses
end
def projects
end
end
+1 -1
View File
@@ -30,7 +30,7 @@ class PeopleCrawlerController < TissCrawlerController
if FavoritePerson.create(tiss_id: @person['tiss_id'], first_name: @person['first_name'], last_name: @person['last_name'], picture_uri: @person['picture_uri']).valid?
FavoritePerson.create(tiss_id: @person['tiss_id'], first_name: @person['first_name'], last_name: @person['last_name'], picture_uri: @person['picture_uri'])
respond_to do |format|
format.html { redirect_to favorites_favorite_person_index_url, notice: 'Favorite person stored' }
format.html { redirect_to favorite_person_index_url, notice: 'Favorite person stored' }
end
else
flash[:alert] = "Person is already favorited!"