on detail view show stored annotation if available
This commit is contained in:
parent
d59030ffc0
commit
88783ffede
@ -22,6 +22,10 @@ class Crawlers::PeopleCrawlerController < Crawlers::TissCrawlerController
|
||||
params[:api] = '/api/person/v22/id/'
|
||||
params[:tiss_id] = params[:tiss_id]
|
||||
|
||||
if FavoritePerson.exists?(params[:tiss_id])
|
||||
@stored_person = FavoritePerson.find(params[:tiss_id])
|
||||
end
|
||||
|
||||
puts params
|
||||
# TissCrawler fetches the person's detail information
|
||||
@person = TissCrawler.get_details(params)
|
||||
@ -50,4 +54,14 @@ class Crawlers::PeopleCrawlerController < Crawlers::TissCrawlerController
|
||||
redirect_back(fallback_location: crawlers_tiss_crawler_search_path)
|
||||
end
|
||||
|
||||
def add_annotation
|
||||
if FavoritePerson.exists?(params[:id])
|
||||
FavoritePerson.update(params[:id], :personal_annotation => params[:body])
|
||||
flash[:alert] = 'Annotation stored!'
|
||||
else
|
||||
flash[:alert] = 'Person has to be favorited first!'
|
||||
end
|
||||
redirect_back(fallback_location: crawlers_tiss_crawler_search_path)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user