From c82ba7977689ffeb88cbea05bcf17957ad03cf73 Mon Sep 17 00:00:00 2001 From: Pfingstfrosch Date: Thu, 4 Jun 2020 20:14:45 +0200 Subject: [PATCH] Add input field for personal annotations --- app/assets/stylesheets/tiss_crawler.scss | 5 +++++ app/views/crawlers/_personal_annotations.html.erb | 11 +++++++++++ .../crawlers/courses_crawler/show_detail.html.erb | 2 ++ .../crawlers/people_crawler/show_detail.html.erb | 4 +++- .../crawlers/projects_crawler/show_detail.html.erb | 2 ++ .../crawlers/theses_crawler/show_detail.html.erb | 2 ++ 6 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 app/views/crawlers/_personal_annotations.html.erb diff --git a/app/assets/stylesheets/tiss_crawler.scss b/app/assets/stylesheets/tiss_crawler.scss index 00b82ff..dfc467c 100644 --- a/app/assets/stylesheets/tiss_crawler.scss +++ b/app/assets/stylesheets/tiss_crawler.scss @@ -1,3 +1,8 @@ // Place all the styles related to the tiss_crawler controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: https://sass-lang.com/ + +.annotationField { + width: 99.5%; + height: 8em; +} \ No newline at end of file diff --git a/app/views/crawlers/_personal_annotations.html.erb b/app/views/crawlers/_personal_annotations.html.erb new file mode 100644 index 0000000..d19c197 --- /dev/null +++ b/app/views/crawlers/_personal_annotations.html.erb @@ -0,0 +1,11 @@ +<%= form_tag "submit", :id => "my_form" do -%> +

+ Add an annotation: +

+

+ <%= text_area_tag 'body', nil, class: 'annotationField' %> +

+

+ <%= submit_tag "Save annotation" %> +

+<% end -%> \ No newline at end of file diff --git a/app/views/crawlers/courses_crawler/show_detail.html.erb b/app/views/crawlers/courses_crawler/show_detail.html.erb index 23c85ba..1b5efb8 100644 --- a/app/views/crawlers/courses_crawler/show_detail.html.erb +++ b/app/views/crawlers/courses_crawler/show_detail.html.erb @@ -13,4 +13,6 @@

Inhalt

<%= raw @course['objective']['de'] %> <% end %> + + <%= render :partial => "crawlers/personal_annotations" %> <% end %> diff --git a/app/views/crawlers/people_crawler/show_detail.html.erb b/app/views/crawlers/people_crawler/show_detail.html.erb index ce54c90..391a4bf 100644 --- a/app/views/crawlers/people_crawler/show_detail.html.erb +++ b/app/views/crawlers/people_crawler/show_detail.html.erb @@ -17,5 +17,7 @@

Address: <%= @person['main_addresses'][0]['street'] %>, <%= @person['main_addresses'][0]['zip_code'] %> <%= @person['main_addresses'][0]['city'] %>

<% end %> - <%= button_to 'Add to favorites', action: :add_to_fav, tiss_id: @person['tiss_id'] %> + <%= button_to 'Add to favorites', action: :add_to_fav, tiss_id: @person['tiss_id'], class: 'button' %> + + <%= render :partial => "crawlers/personal_annotations" %> <% end %> \ No newline at end of file diff --git a/app/views/crawlers/projects_crawler/show_detail.html.erb b/app/views/crawlers/projects_crawler/show_detail.html.erb index 7321c2c..74d6674 100644 --- a/app/views/crawlers/projects_crawler/show_detail.html.erb +++ b/app/views/crawlers/projects_crawler/show_detail.html.erb @@ -11,4 +11,6 @@

<%= raw @project['abstractEn'] %>

<% end %> <% end %> + + <%= render :partial => "crawlers/personal_annotations" %> <% end %> diff --git a/app/views/crawlers/theses_crawler/show_detail.html.erb b/app/views/crawlers/theses_crawler/show_detail.html.erb index 24f1a83..6880bf2 100644 --- a/app/views/crawlers/theses_crawler/show_detail.html.erb +++ b/app/views/crawlers/theses_crawler/show_detail.html.erb @@ -10,4 +10,6 @@

Assistant

<%= @thesis['assistant']['familyName'] %> <%= @thesis['assistant']['givenName'] %>

<% end %> + + <%= render :partial => "crawlers/personal_annotations" %> <% end %>