diff --git a/Gemfile b/Gemfile index af11624c9..12069fa20 100644 --- a/Gemfile +++ b/Gemfile @@ -72,6 +72,7 @@ gem 'thin' gem 'view_component', '~> 2.72' gem 'turnout' gem 'will_paginate', '~> 3.0' +gem 'inline_svg' gem 'ontologies_api_client', git: 'https://github.com/ontoportal-lirmm/ontologies_api_ruby_client.git', branch: 'development' diff --git a/Gemfile.lock b/Gemfile.lock index 85862836c..1b6b17dff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -99,7 +99,7 @@ GEM sassc-rails (>= 2.0.0) brakeman (5.4.1) builder (3.2.4) - capistrano (3.17.2) + capistrano (3.17.3) airbrussh (>= 1.0.0) i18n rake (>= 10.0.0) @@ -115,7 +115,7 @@ GEM capistrano-bundler (>= 1.1, < 3) capistrano-yarn (2.0.2) capistrano (~> 3.0) - capybara (3.39.0) + capybara (3.39.1) addressable matrix mini_mime (>= 0.1.3) @@ -135,7 +135,7 @@ GEM daemons (1.4.1) dalli (3.2.4) date (3.3.3) - debug (1.7.2) + debug (1.8.0) irb (>= 1.5.0) reline (>= 0.3.1) diff-lcs (1.5.0) @@ -160,7 +160,7 @@ GEM flamegraph (0.9.5) globalid (1.1.0) activesupport (>= 5.0) - graphql (2.0.21) + graphql (2.0.22) graphql-client (0.18.0) activesupport (>= 3.0) graphql @@ -201,9 +201,9 @@ GEM listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.20.0) + loofah (2.21.3) crass (~> 1.0.2) - nokogiri (>= 1.5.9) + nokogiri (>= 1.12.0) lookbook (1.5.5) actioncable activemodel @@ -232,7 +232,7 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.2) minitest (5.18.0) - msgpack (1.7.0) + msgpack (1.7.1) multi_json (1.15.0) multipart-post (2.3.0) mysql2 (0.5.3) @@ -256,8 +256,10 @@ GEM netrc (0.11.0) newrelic_rpm (9.2.2) nio4r (2.5.9) - nokogiri (1.14.3) - mini_portile2 (~> 2.8.0) + nokogiri (1.14.2-x86_64-linux) + racc (~> 1.4) + nokogiri (1.15.2) + mini_portile2 (~> 2.8.2) racc (~> 1.4) oj (3.14.3) open_uri_redirections (0.2.1) @@ -297,9 +299,10 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) - rails-i18n (7.0.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + rails-i18n (7.0.7) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) rails_autolink (1.1.8) @@ -323,7 +326,7 @@ GEM json redcarpet (3.6.0) regexp_parser (2.8.0) - reline (0.3.3) + reline (0.3.4) io-console (~> 0.5) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) @@ -331,7 +334,7 @@ GEM mime-types (>= 1.16, < 4.0) netrc (~> 0.8) rexml (3.2.5) - rouge (4.1.0) + rouge (4.1.2) rspec-core (3.12.2) rspec-support (~> 3.12.0) rspec-expectations (3.12.3) @@ -340,7 +343,7 @@ GEM rspec-mocks (3.12.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-rails (6.0.2) + rspec-rails (6.0.3) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) @@ -349,7 +352,7 @@ GEM rspec-mocks (~> 3.12) rspec-support (~> 3.12) rspec-support (3.12.0) - rubocop (1.50.2) + rubocop (1.51.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) @@ -359,11 +362,11 @@ GEM rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.28.1) + rubocop-ast (1.29.0) parser (>= 3.2.1.0) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - ruby_parser (3.20.0) + ruby_parser (3.20.1) sexp_processor (~> 4.16) rubyzip (2.3.2) sassc (2.4.0) @@ -394,14 +397,14 @@ GEM stackprof (0.2.25) stimulus-rails (1.2.1) railties (>= 6.0.0) - temple (0.10.0) - terser (1.1.14) + temple (0.10.2) + terser (1.1.16) execjs (>= 0.3.0, < 3) thin (1.8.2) daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0, >= 1.0.4) rack (>= 1, < 3) - thor (1.2.1) + thor (1.2.2) tilt (2.1.0) time (0.2.2) date @@ -443,10 +446,11 @@ GEM xpath (3.2.0) nokogiri (~> 1.8) yard (0.9.34) - zeitwerk (2.6.8) + zeitwerk (2.6.7) PLATFORMS ruby + x86_64-linux DEPENDENCIES bcrypt_pbkdf (>= 1.0, < 2.0) diff --git a/app/assets/images/arrow-right-outlined.svg b/app/assets/images/arrow-right-outlined.svg new file mode 100644 index 000000000..5161a4b17 --- /dev/null +++ b/app/assets/images/arrow-right-outlined.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/assets/images/arrow-right.svg b/app/assets/images/arrow-right.svg new file mode 100644 index 000000000..21ce5092c --- /dev/null +++ b/app/assets/images/arrow-right.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/app/assets/images/check-outlined.svg b/app/assets/images/check-outlined.svg new file mode 100644 index 000000000..db2866523 --- /dev/null +++ b/app/assets/images/check-outlined.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/assets/images/home-random-bubbles.svg b/app/assets/images/home-random-bubbles.svg new file mode 100644 index 000000000..52eee7a98 --- /dev/null +++ b/app/assets/images/home-random-bubbles.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/images/logo-white.svg b/app/assets/images/logo-white.svg new file mode 100644 index 000000000..f920cd7de --- /dev/null +++ b/app/assets/images/logo-white.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/app/assets/images/logos/collaboration/cnrs_logo.jpg b/app/assets/images/logos/collaboration/cnrs_logo.jpg deleted file mode 100644 index a3aeb1d74..000000000 Binary files a/app/assets/images/logos/collaboration/cnrs_logo.jpg and /dev/null differ diff --git a/app/assets/images/logos/collaboration/d2kab.png b/app/assets/images/logos/collaboration/d2kab.png new file mode 100644 index 000000000..a2f0d4578 Binary files /dev/null and b/app/assets/images/logos/collaboration/d2kab.png differ diff --git a/app/assets/images/logos/collaboration/d2kab_logo.png b/app/assets/images/logos/collaboration/d2kab_logo.png deleted file mode 100644 index c1cc4d20a..000000000 Binary files a/app/assets/images/logos/collaboration/d2kab_logo.png and /dev/null differ diff --git a/app/assets/images/logos/collaboration/inrae.png b/app/assets/images/logos/collaboration/inrae.png new file mode 100644 index 000000000..150cf3773 Binary files /dev/null and b/app/assets/images/logos/collaboration/inrae.png differ diff --git a/app/assets/images/logos/collaboration/inrae_logo.jpg b/app/assets/images/logos/collaboration/inrae_logo.jpg deleted file mode 100644 index 2bbf48ea4..000000000 Binary files a/app/assets/images/logos/collaboration/inrae_logo.jpg and /dev/null differ diff --git a/app/assets/images/logos/collaboration/lirmm.png b/app/assets/images/logos/collaboration/lirmm.png new file mode 100644 index 000000000..ea972bbd5 Binary files /dev/null and b/app/assets/images/logos/collaboration/lirmm.png differ diff --git a/app/assets/images/logos/collaboration/lirmm_logo.png b/app/assets/images/logos/collaboration/lirmm_logo.png deleted file mode 100644 index a177adc5a..000000000 Binary files a/app/assets/images/logos/collaboration/lirmm_logo.png and /dev/null differ diff --git a/app/assets/images/logos/collaboration/sifr_logo.jpg b/app/assets/images/logos/collaboration/sifr_logo.jpg deleted file mode 100644 index 88cdd39e3..000000000 Binary files a/app/assets/images/logos/collaboration/sifr_logo.jpg and /dev/null differ diff --git a/app/assets/images/logos/collaboration/stanford-university_logo.png b/app/assets/images/logos/collaboration/stanford-university_logo.png deleted file mode 100644 index b9abb4b7f..000000000 Binary files a/app/assets/images/logos/collaboration/stanford-university_logo.png and /dev/null differ diff --git a/app/assets/images/logos/collaboration/stanford.png b/app/assets/images/logos/collaboration/stanford.png new file mode 100644 index 000000000..e53d39f25 Binary files /dev/null and b/app/assets/images/logos/collaboration/stanford.png differ diff --git a/app/assets/images/logos/collaboration/um_logo.png b/app/assets/images/logos/collaboration/um_logo.png deleted file mode 100644 index a13075073..000000000 Binary files a/app/assets/images/logos/collaboration/um_logo.png and /dev/null differ diff --git a/app/assets/images/logos/supports/agropolisfondation_logo.png b/app/assets/images/logos/supports/agropolisfondation_logo.png deleted file mode 100644 index 35ec92829..000000000 Binary files a/app/assets/images/logos/supports/agropolisfondation_logo.png and /dev/null differ diff --git a/app/assets/images/logos/supports/anr.png b/app/assets/images/logos/supports/anr.png new file mode 100644 index 000000000..ebf81e5cb Binary files /dev/null and b/app/assets/images/logos/supports/anr.png differ diff --git a/app/assets/images/logos/supports/anr_logo.png b/app/assets/images/logos/supports/anr_logo.png deleted file mode 100644 index 28c17f6d4..000000000 Binary files a/app/assets/images/logos/supports/anr_logo.png and /dev/null differ diff --git a/app/assets/images/logos/supports/eu.png b/app/assets/images/logos/supports/eu.png new file mode 100644 index 000000000..bda2c51f0 Binary files /dev/null and b/app/assets/images/logos/supports/eu.png differ diff --git a/app/assets/images/logos/supports/ibc_logo.jpg b/app/assets/images/logos/supports/ibc_logo.jpg deleted file mode 100644 index 0a85ae75f..000000000 Binary files a/app/assets/images/logos/supports/ibc_logo.jpg and /dev/null differ diff --git a/app/assets/images/logos/supports/msca_eu_logo.jpg b/app/assets/images/logos/supports/msca_eu_logo.jpg deleted file mode 100644 index 942659888..000000000 Binary files a/app/assets/images/logos/supports/msca_eu_logo.jpg and /dev/null differ diff --git a/app/assets/images/logos/supports/numev.png b/app/assets/images/logos/supports/numev.png new file mode 100644 index 000000000..8f3e33df2 Binary files /dev/null and b/app/assets/images/logos/supports/numev.png differ diff --git a/app/assets/images/logos/supports/numev_logo.png b/app/assets/images/logos/supports/numev_logo.png deleted file mode 100644 index 148f6346e..000000000 Binary files a/app/assets/images/logos/supports/numev_logo.png and /dev/null differ diff --git a/app/assets/images/loop.svg b/app/assets/images/loop.svg new file mode 100644 index 000000000..8bf624de0 --- /dev/null +++ b/app/assets/images/loop.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/assets/images/ontoportal-icon.svg b/app/assets/images/ontoportal-icon.svg new file mode 100644 index 000000000..2cb02a8df --- /dev/null +++ b/app/assets/images/ontoportal-icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/app/assets/images/orange-warning.svg b/app/assets/images/orange-warning.svg new file mode 100644 index 000000000..bebb56764 --- /dev/null +++ b/app/assets/images/orange-warning.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/assets/images/play-white.svg b/app/assets/images/play-white.svg new file mode 100644 index 000000000..6da00b8a8 --- /dev/null +++ b/app/assets/images/play-white.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/assets/images/play.svg b/app/assets/images/play.svg new file mode 100644 index 000000000..2f97673d3 --- /dev/null +++ b/app/assets/images/play.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/assets/images/update.svg b/app/assets/images/update.svg new file mode 100644 index 000000000..29d1f5bcb --- /dev/null +++ b/app/assets/images/update.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/assets/images/upload.svg b/app/assets/images/upload.svg new file mode 100644 index 000000000..e3c73d56c --- /dev/null +++ b/app/assets/images/upload.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/app/assets/stylesheets/application.css.scss.erb b/app/assets/stylesheets/application.css.scss.erb index 1b70724a0..03a6c9d11 100644 --- a/app/assets/stylesheets/application.css.scss.erb +++ b/app/assets/stylesheets/application.css.scss.erb @@ -50,6 +50,8 @@ @import "components/index"; @import "account"; +@import "nav_bar"; + /* Bootstrap and Font Awesome */ @import "bootstrap"; @import "bootstrap_overrides"; diff --git a/app/assets/stylesheets/components/card_message.scss b/app/assets/stylesheets/components/card_message.scss index 0201775d3..9d3332a1c 100644 --- a/app/assets/stylesheets/components/card_message.scss +++ b/app/assets/stylesheets/components/card_message.scss @@ -34,6 +34,10 @@ color: #EE404C !important; border: 1px solid #EE404C; } +.card-message-button-warning { + color: #ff6700 !important; + border: 1px solid #ff6700; +} .card-message-has-title{ color: #666666; font-weight: 400; diff --git a/app/assets/stylesheets/components/chip_button.scss b/app/assets/stylesheets/components/chip_button.scss new file mode 100644 index 000000000..943bb48bb --- /dev/null +++ b/app/assets/stylesheets/components/chip_button.scss @@ -0,0 +1,18 @@ +.chip_button_container { + background-color: #F6F6F6; + padding: 10px; + border-radius: 5px; + color: #777777 !important; + font-weight: 500; + font-size: 15px; +} +.chip_button_container_clickable{ + background-color: var(--light-color); + padding: 10px; + border-radius: 5px; + color: var(--primary-color); + font-weight: 500; + font-size: 15px; +} + + diff --git a/app/assets/stylesheets/components/index.scss b/app/assets/stylesheets/components/index.scss index c61d4d8dc..7e1a2f4d6 100644 --- a/app/assets/stylesheets/components/index.scss +++ b/app/assets/stylesheets/components/index.scss @@ -1,2 +1,4 @@ @import 'chips'; -@import 'card_message' \ No newline at end of file +@import 'card_message'; +@import 'chip_button'; +@import 'rounded_button'; \ No newline at end of file diff --git a/app/assets/stylesheets/components/rounded_button.scss b/app/assets/stylesheets/components/rounded_button.scss new file mode 100644 index 000000000..41e2b7695 --- /dev/null +++ b/app/assets/stylesheets/components/rounded_button.scss @@ -0,0 +1,17 @@ +.rounded-button { + border: 1px solid var(--primary-color); + display: flex; + align-items: center; + justify-content: center; + right: 40px; + transition: background-color ease 0.3s; +} + +.rounded-button:hover { + background-color: var(--primary-color); + +} + +.rounded-button:hover svg path { + fill: white; +} \ No newline at end of file diff --git a/app/assets/stylesheets/home.scss b/app/assets/stylesheets/home.scss index f26409b71..562a5575c 100644 --- a/app/assets/stylesheets/home.scss +++ b/app/assets/stylesheets/home.scss @@ -2,3 +2,460 @@ i.fa.fa-caret-square-o-down { vertical-align: middle; margin-left: 2px; } + + + +.home-header-container{ + height: 310px; +} + +.home-header-background{ + background-color: var(--primary-color);; + width: 100%; + height: 309px; + position: absolute; + z-index: 0; +} + +.home-bubbles{ + display: flex; + justify-content: center; +} +.home-bubble{ + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + background-color: rgba(255, 255, 255, 0.4); + position: absolute; + box-shadow: 2px 30px 60px rgba(0, 0, 0, 0.05); + transform: scale(0.1); + animation: scale-up 1s ease forwards; +} +.home-bubble-one{ + width: 232px; + height: 232px; + border-radius: 116px; + z-index: 1; + margin-left: 622px; +} +.home-bubble-two{ + width: 194px; + height: 194px; + border-radius: 97px; + z-index: 2; + margin-left: 387px; + margin-top: 161px; +} +.home-bubble-three{ + width: 130px; + height: 130px; + border-radius: 65px; + z-index: 3; + margin-left: 656px; + margin-top: 192px; +} +.home-bubble-four{ + width: 70px; + height: 70px; + border-radius: 35px; + z-index: 4; + margin-left: 815px; + margin-top: 189px; + transform: scale(1); + +} + +.home-bubble h5{ + color: white; + font-size: 18px; + margin: 0; + font-weight: 600; +} +.home-bubble p{ + color: white; + font-size: 15px; + margin: 0; +} +.home-random-bubbles{ + position: absolute; + transform: scale(0.1); + animation: scale-up-random 1s ease forwards; +} +.home-header-title-container{ + display: flex; + justify-content: center; +} +.home-header-title{ + position: absolute; + z-index: 4; + width: 481px; + margin-right: 664px; + margin-top: 123px; + opacity: 0; + transform: translateY(-100%); + animation: slide-and-fade 1s ease forwards; +} +.home-header-title h4{ + font-size: 40px; + font-weight: 800; + color: white; +} + +.home-header-title > p{ + font-size: 20px; + font-weight: 400; + color: white; +} + +.home-header-title input{ + font-size: 16px; + outline: none; + padding: 20px; + width: 100%; + margin-top: 20px; + border-radius: 14px; + border: none; + box-shadow: 2px 30px 60px rgba(0, 0, 0, 0.1); +} +.home-header-title input:focus{ + box-shadow: 2px 30px 60px rgba(0, 0, 0, 0.15); +} + + +.home-body-container{ + display: flex; + flex-direction: column; + align-items: center; +} +.home-section{ + margin-top: 70px; + width: 1138px; +} +.home-section > h4{ + font-size: 20px; + margin-bottom: 5px; + font-weight: 700; +} + +.home-section-line{ + width: 60px; + margin-top: 3px; + border: 0.5px solid var(--primary-color);; + border-radius: 5px; + margin-bottom: 20px; +} +.home-statistics{ + display: flex; + justify-content: space-between; +} +.home-statistics-container{ + border-radius: 8px; + box-shadow: 2px 0px 60px rgba(0, 0, 0, 0.10); + padding: 30px 40px; + +} +.home-statistics-container > div { + display: flex; + align-items: center; + +} +.home-agroportal-figures{ + margin-bottom: 20px; +} + +.home-statistics-container > div > p { + font-size: 20px; + font-weight: 600; + margin-left: 18px; + margin-bottom: 0; +} +.home-statistics-item{ + display: flex; + align-items: center; + +} +.home-statistics-item hr{ + height: 83px; + width: 0px; + border: 2px solid var(--primary-color);; + border-radius: 5px; + margin-right: 15px; + margin-top: 0; + margin-bottom: 0; +} +.home-statistics-item h4{ + font-size: 30px; + font-weight: 600; + line-height: 1.2; + margin: 0; +} +.home-statistics-item p{ + font-size: 18px; + font-weight: 400; + margin: 0; + color: #888; +} +.home-section > p { + font-size: 16px; + color: #888888; + margin-bottom: 9px; +} +.home-upload-benifits{ + display: flex; + flex-wrap: wrap; +} +.home-upload-benifits div{ + display: flex; + width: 455px; + align-items: flex-start; + margin-right: 57px; + margin-top: 15px +} + +.home-upload-benifits div p{ + margin-left: 17px; + font-size: 16px; + color: #888888; + margin-bottom: 0; +} +.home-upload-benifits div img{ + margin-top: 3px +} +.home-upload-ontology-button{ + margin-top: 30px; + text-decoration: none; + color: var(--primary-color); + display: flex; + justify-content: space-between; + align-items: center; + width: 193px; + padding: 15px 25px; + border: 1px solid var(--primary-color); + border-radius: 8px; + font-size: 15px; + transition: background-color 0.3s ease; +} +.home-upload-ontology-button:hover{ + color: white !important; + background-color: var(--primary-color); +} +.home-upload-ontology-button:hover .home-upload-icon path{ + fill: white; +} + + +.home-recommendations-and-annotations{ + font-size: 16px; + outline: none; + padding: 20px; + width: 100%; + resize: none; + border-radius: 14px; + border: none; + +} +.home-services-buttons{ + background-color: white; + border-radius: 8px; + padding: 20px; + display: flex; + justify-content: flex-end; + align-items: center; +} +.home-card{ + border-radius: 8px; + box-shadow: 2px 30px 60px rgba(0, 0, 0, 0.1); +} +.home-get-annotations{ + cursor: pointer; + color: white; + background-color: var(--primary-color); + display: flex; + width: fit-content; + align-items: center; + padding: 15px 20px; + border-radius: 8px; + margin-left: 10px; + transition: background-color 0.3s ease; +} +.home-get-annotations:hover{ + background-color: var(--hover-color); +} +.home-get-annotations p{ + margin-right: 20px; + margin-bottom: 0; +} +.home-get-recommendations{ + cursor: pointer; + color: var(--primary-color); + display: flex; + width: fit-content; + height: fit-content; + align-items: center; + padding: 15px 20px; + border-radius: 8px; + border: 1px solid var(--primary-color); + transition: background-color 0.3s ease; +} +.home-get-recommendations:hover{ + color: white !important; + background-color: var(--primary-color); +} +.home-get-recommendations:hover .home-play-icon path{ + fill: white; +} +.home-get-recommendations p{ + margin-right: 20px; + margin-bottom: 0; +} +.home-section-sub-sections-container{ + display: flex; + justify-content: space-between; +} +.home-sub-section-left{ + width: 533px; +} +.home-sub-section-right{ + width: 533px; +} +.home-sub-section-left h4, .home-sub-section-right h4{ + font-size: 20px; + margin-bottom: 5px; + font-weight: 700; +} +.home-fair-scores{ + height: 349px; + padding-top: 35px; +} +.home-twitter-news{ + height: 349px; +} +.home-fair-scores a{ + text-decoration: none; + +} +.home-fair-details{ + margin-right: 25px !important; +} +.home-fair-scores div{ + display: flex; + justify-content: flex-end; + align-items: center; + margin-right: 20px; + margin-left: 27px; + margin-bottom: 14px; + color: var(--primary-color); +} +.home-fair-scores div p{ + margin-right: 10px; + margin-bottom: 0; +} +.home-logos{ + height: 138px; + display: flex; + align-items: center; + overflow: auto; + +} +.home-logos img{ + margin-left: 60px; +} + +#home-search-drop-down{ + display: none; + font-size: 16px; + background: white; + width: 100%; + border-radius: 0 0 14px 14px; + border: none; + box-shadow: 2px 30px 60px rgba(0, 0, 0, 0.1); +} + +.home-search-ontology-content{ + display: flex; + color: #777777 !important; + justify-content: space-between; + padding: 20px 20px; + cursor: pointer; + border-top: 1px solid #f7f7f7 +} +.home-search-ontology-content:hover{ + background-color: rgba(0, 0, 0, 0.01); +} +.home-search-ontology-content div{ + display: flex; + margin-left: 20px; +} +.home-search-ontology-content div img{ + width: 12px; +} +.home-search-ontology-content div p{ + font-weight: 300; + margin-left: 10px; + margin-bottom: 0; +} + +.home-dropdown-active{ + box-shadow: none !important; +} +#seached-ontology{ + margin-bottom: 0; +} +#seached-ontologies{ + margin-bottom: 0; +} + +.home-support-title{ + display: flex; + justify-content: center; + flex-direction: column; + +} +.home-support-items{ + display: flex; + justify-content: center; + flex-wrap: wrap; + +} +.home-support-items > *:not(:first-child){ + margin-left: 40px; +} +.home-support-items a{ + margin-bottom: 40px; + opacity: 85%; + transition: opacity 0.3s ease; +} +.home-support-items a:hover{ + opacity: 100%; +} +.home-result-type{ + font-weight: 300; + margin-bottom: 0; +} + +.home-searched-ontology{ + margin-bottom: 0; + word-wrap: break-word; + max-width: 400px; + margin-right: 20px; + +} + +@keyframes scale-up { + from { transform: scale(0.1); } + to { transform: scale(1); } +} + +@keyframes scale-up-random { + from { transform: scale(0.1); } + to { transform: scale(1.06); } +} + +@keyframes slide-and-fade { + from { opacity: 0; transform: translateY(-100%); } + to { opacity: 1; transform: translateY(0); } +} + + + diff --git a/app/assets/stylesheets/nav_bar.scss b/app/assets/stylesheets/nav_bar.scss new file mode 100644 index 000000000..88ebf0b1c --- /dev/null +++ b/app/assets/stylesheets/nav_bar.scss @@ -0,0 +1,172 @@ +.nav-container{ + display: flex; + justify-content: center; + background-color: var(--primary-color); +} +.top-nav{ + display: flex !important; + background-color: var(--primary-color); + align-items: center; + height: 62px; + padding: 8px 50px; + width: 60%; +} +.nav-responsiveness-container{ + display: flex; + justify-content: space-between; +} +.nav-logo{ + display: flex; + align-items: center; +} +.nav-logo p{ + margin-left: 10px; + color: white; + font-size: 16px; + font-weight: 700; + margin-bottom: 0; +} +.nav-items{ + display: flex; + justify-content: space-between; + align-items:center; + width: 85%; +} +.nav-items > ul { + display: flex; + list-style: none; + margin-bottom: 0; +} + +.nav-items > ul > li { + margin-left: 20px; +} + +.nav-items > ul > li > a { + color: white !important; + font-size: 15px; + opacity: 60%; + font-weight: 300; + transition: opacity 0.2s ease-in-out; +} +.nav-items > ul > li > a:hover{ + opacity: 100%; +} +.nav-items > ul > li > a.active{ + opacity: 100%; + font-weight: 500; +} + +.nav-search-container { + width: 50% ; +} +.nav-search-container > input { + height: 33px; + width: 100%; + outline: none; + opacity: 60%; + border: 1px solid white; + background-color: var(--primary-color); + color: white; + border-radius: 5px; + font-size: 14px; + padding: 0 10px; +} +.nav-search-container > input:focus{ + opacity: 100%; + border-radius: 5px 5px 0 0; +} +.nav-search-container > input::placeholder{ + color: white; + opacity: 60%; +} +.nav-search-container > input::-ms-input-placeholder{ + color: white; + opacity: 60%; +} +.nav-language{ + background-color: transparent; + width: 47px; + color: white; + border: none; + outline: none; + cursor: pointer; + +} +.nav-language option{ + background-color: white; + color: black; +} +.nav-items .nav-a{ + padding: 3px 34px; + border: 1px solid white; + border-radius: 5px; + color: white !important; + transition: background-color 0.2s ease-in-out; +} +.nav-items .nav-a:hover{ + background-color: rgba(255, 255, 255, 0.1); +} + +.top-nav .menu-btn i{ + color: #fff; + font-size: 22px; + cursor: pointer; + display: none; +} +.top-nav input[type="checkbox"]{ + display: none; +} + +.nav-link{ + color: white !important; + padding: 0 !important; +} + +.nav-search-drop-down{ + position: absolute; + z-index: 9999; + font-size: 12px !important; + width: 228px !important; +} + +@media (max-width: 1200px){ + .top-nav .menu-btn i{ + display: block; + } + #nav-menu:checked ~ .menu-btn i:before{ + content: "\f00d"; + } + .nav-items{ + display: none; + } + .menu-btn{ + position: absolute; + right: 40px; + } + +} +.top-nav.show-responsive { + display: block !important; + background-color: var(--primary-color); + height: unset; +} + +.top-nav-ul.show-responsive { + display: block; +} + +.nav-items.show-responsive { + flex-direction: column; + width: unset; + display: flex; + align-items: flex-start; +} + +.show-responsive { + margin: 15px 0 !important; +} + +.supportMenuDropdownLink.show-responsive { + margin-bottom: 15px; +} diff --git a/app/assets/stylesheets/theme-variables.scss.erb b/app/assets/stylesheets/theme-variables.scss.erb index 4a7c79a68..d442f5a8f 100644 --- a/app/assets/stylesheets/theme-variables.scss.erb +++ b/app/assets/stylesheets/theme-variables.scss.erb @@ -6,24 +6,28 @@ --primary-color: #31B404; --hover-color: #40C811; --secondary-color: #ffc107; + --light-color: #F1FAED; } <% when "stageportal" %> :root{ --primary-color: #76A7CC; --hover-color: #6B96B7; --secondary-color: #ffc107; + --light-color: #F1F6FA; } <% when "bioportal" %> :root{ --primary-color: #76A7CC; --hover-color: #6B96B7; --secondary-color: #ffc107; + --light-color: #F1F6FA; } <% when "ontoportal" %> :root{ --primary-color: #6E98A2; --hover-color: #7BABB6; --secondary-color: #ffc107; + --light-color: #F0F5F6; } <%# Here to add a new theme ... %> <% end %> diff --git a/app/components/alert_message_component.rb b/app/components/alert_message_component.rb index f2175b7e0..1ef3b185c 100644 --- a/app/components/alert_message_component.rb +++ b/app/components/alert_message_component.rb @@ -2,8 +2,10 @@ class AlertMessageComponent < ViewComponent::Base include Turbo::FramesHelper - def initialize(id: '', type: 'info') + def initialize(id: '', message: '', type: 'info', closeable: true) @id = id + @message = message @type = "alert-#{type}" + @closeable = closeable end end diff --git a/app/components/alert_message_component/alert_message_component.html.haml b/app/components/alert_message_component/alert_message_component.html.haml index 19c0e89f0..107ab14ac 100644 --- a/app/components/alert_message_component/alert_message_component.html.haml +++ b/app/components/alert_message_component/alert_message_component.html.haml @@ -1,4 +1,8 @@ -.alert.alert-dismissible.fade.show{:role => "alert", class: "#{@type}"} - = content - %button.close{"aria-label": "Close", "data-dismiss": "alert", type: "button", style: "background: transparent"} - %span{"aria-hidden" => "true"} × \ No newline at end of file +.alert.alert-dismissible.fade.show{:role => "alert", class: "#{@type}", style: "text-align: left"} + = @message + + - if @closeable + %button.close{"aria-label": "Close", "data-dismiss": "alert", type: "button", style: "background: transparent"} + %span{"aria-hidden" => "true"} × + + \ No newline at end of file diff --git a/app/components/card_message_component.rb b/app/components/card_message_component.rb index d4b10b4d4..d0f15d062 100644 --- a/app/components/card_message_component.rb +++ b/app/components/card_message_component.rb @@ -21,6 +21,8 @@ def icon "green-check.svg" when "failure" "red-warning.svg" + when "warning" + "orange-warning.svg" end end end diff --git a/app/components/card_message_component/card_message_component.html.haml b/app/components/card_message_component/card_message_component.html.haml index 587869335..bc7641ee1 100644 --- a/app/components/card_message_component/card_message_component.html.haml +++ b/app/components/card_message_component/card_message_component.html.haml @@ -18,3 +18,7 @@ - when "failure" %a.card-message-button.card-message-button-failure{:href => @button_link} = @button_text + - when "warning" + %a.card-message-button.card-message-button-warning{:href => @button_link} + = @button_text + diff --git a/app/components/chip_button_component.rb b/app/components/chip_button_component.rb new file mode 100644 index 000000000..059e80379 --- /dev/null +++ b/app/components/chip_button_component.rb @@ -0,0 +1,7 @@ +class ChipButtonComponent < ViewComponent::Base + def initialize(url: nil, text:, type: "static") + @url = url + @text = text + @type = type + end +end \ No newline at end of file diff --git a/app/components/chip_button_component/chip_button_component.html.haml b/app/components/chip_button_component/chip_button_component.html.haml new file mode 100644 index 000000000..36d14bdf9 --- /dev/null +++ b/app/components/chip_button_component/chip_button_component.html.haml @@ -0,0 +1,5 @@ +- if @type == "static" + .chip_button_container + = @text +- else + %a.chip_button_container_clickable{href: @url}= @text diff --git a/app/components/dropdown_button_component.rb b/app/components/dropdown_button_component.rb new file mode 100644 index 000000000..08c97795c --- /dev/null +++ b/app/components/dropdown_button_component.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class DropdownButtonComponent < ViewComponent::Base + + renders_one :header + renders_many :sections, DropdownSectionButtonComponent + + def initialize(css_class: '') + super + @component_classes = css_class + end +end diff --git a/app/components/dropdown_button_component/dropdown_button_component.html.haml b/app/components/dropdown_button_component/dropdown_button_component.html.haml new file mode 100644 index 000000000..952e03ceb --- /dev/null +++ b/app/components/dropdown_button_component/dropdown_button_component.html.haml @@ -0,0 +1,8 @@ +.dropdown{class:@component_classes} + %div.d-flex.align-items-center{data: {toggle: "dropdown"}} + %div + = header + %i.fas.fa-chevron-down.ml-1 + %div.dropdown-menu + - sections.each do |s| + = s \ No newline at end of file diff --git a/app/components/dropdown_section_button_component.rb b/app/components/dropdown_section_button_component.rb new file mode 100644 index 000000000..c46074f75 --- /dev/null +++ b/app/components/dropdown_section_button_component.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class DropdownSectionButtonComponent < ViewComponent::Base + + renders_one :header + renders_many :items + + def initialize(divide: true) + super + @divide = divide + end + + def show_divider? + @divide + end +end diff --git a/app/components/dropdown_section_button_component/dropdown_section_button_component.html.haml b/app/components/dropdown_section_button_component/dropdown_section_button_component.html.haml new file mode 100644 index 000000000..3070f75de --- /dev/null +++ b/app/components/dropdown_section_button_component/dropdown_section_button_component.html.haml @@ -0,0 +1,7 @@ +- if show_divider? + %div.dropdown-divider +- if header? + %h6.dropdown-header= header +- items.each do |i| + %span.dropdown-item + = i \ No newline at end of file diff --git a/app/components/rounded_button_component.rb b/app/components/rounded_button_component.rb new file mode 100644 index 000000000..65a11dd0a --- /dev/null +++ b/app/components/rounded_button_component.rb @@ -0,0 +1,19 @@ +class RoundedButtonComponent < ViewComponent::Base + def initialize(icon: "json.svg", link: "#", size: "small") + @icon = icon + @link = link + @size = size + end + + def size + case @size + when "small" + ["32px", "1", "16px"] + when "medium" + ["64px", "2", "32px"] + when "big" + ["100px", "2.5", "50px"] + end + end + +end \ No newline at end of file diff --git a/app/components/rounded_button_component/rounded_button_component.html.haml b/app/components/rounded_button_component/rounded_button_component.html.haml new file mode 100644 index 000000000..7eb803aff --- /dev/null +++ b/app/components/rounded_button_component/rounded_button_component.html.haml @@ -0,0 +1,2 @@ +%a.rounded-button{:href => @link, style: "height:"+size[0]+"; width:"+size[0]+"; border-radius:"+size[2]+";"} + = inline_svg_tag @icon, style: "transform: scale("+size[1]+");" diff --git a/app/controllers/annotator_controller.rb b/app/controllers/annotator_controller.rb index 0e4e53fdd..ae05a3a31 100644 --- a/app/controllers/annotator_controller.rb +++ b/app/controllers/annotator_controller.rb @@ -29,6 +29,7 @@ def index @recognizers = [] end @annotator_ontologies = LinkedData::Client::Models::Ontology.all + @text = params[:text] end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 2c7b8065c..c56da890e 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -7,60 +7,36 @@ class HomeController < ApplicationController include FairScoreHelper def index - @ontologies_views = LinkedData::Client::Models::Ontology.all(include_views: true) - @ontologies = @ontologies_views.select {|o| !o.viewOf} - @ontologies_hash = Hash[@ontologies_views.map {|o| [o.acronym, o]}] - @groups = LinkedData::Client::Models::Group.all - @notes = LinkedData::Client::Models::Note.all - @last_notes = [] - unless @notes.empty? - @notes.sort! {|a,b| b.created <=> a.created } - @notes[0..20].each do |n| - ont_uri = n.relatedOntology.first - ont = LinkedData::Client::Models::Ontology.find(ont_uri) - next if ont.nil? - username = n.creator.split("/").last - note = { - :uri => n.links['ui'], - :id => n.id, - :subject => n.subject, - :body => n.body, - :created => n.created, - :author => username, - :ont_name => ont.name - } - @last_notes.push note - break if @last_notes.length >= [$HOME_LATEST_NOTES_COUNT.to_i, 5].max - end - end - # Get the latest manual mappings - # All mapping classes are bidirectional. - # Each class in the list maps to all other classes in the list. - if $DISPLAY_RECENT.nil? || $DISPLAY_RECENT == true - @recent_mappings = get_recent_mappings # application_controller + @analytics = LinkedData::Client::Analytics.last_month + # Calculate BioPortal summary statistics + @ont_count = @analytics.onts.size + metrics = LinkedData::Client::Models::Metrics.all + metrics = metrics.each_with_object(Hash.new(0)) do |h, sum| + h.to_hash.slice(:classes, :properties, :individuals).each { |k, v| sum[k] += v } end - - organize_groups - # Calculate BioPortal summary statistics - @ont_count = @ontologies.length - @cls_count = LinkedData::Client::Models::Metrics.all.map { |m| m.classes.to_i }.sum - @individuals_count = LinkedData::Client::Models::Metrics.all.map {|m| m.individuals.to_i}.sum - @prop_count = 36286 + @cls_count = metrics[:classes] + @individuals_count = metrics[:individuals] + @prop_count = metrics[:properties] @map_count = total_mapping_count - @analytics = LinkedData::Client::Analytics.last_month - - @ontology_names = @ontologies.map { |ont| ["#{ont.name} (#{ont.acronym})", ont.acronym] } - - @anal_ont_names = {} + @projects_count = LinkedData::Client::Models::Project.all.length + @users_count = LinkedData::Client::Models::User.all.length + + @upload_benefits = [ + 'Discover new insights and connections by exploring other ontologies in the repository.', + 'Contribute to the growth and development of your domain by adding new concepts and categories.', + 'Use version control to manage the changes to your ontology over time and collaborate with other users.', + 'Get feedback and suggestions from other users who can review and comment on your ontology.', + 'Get the FAIR score and metrics for your ontology.' + ] + + @anal_ont_names = [] @anal_ont_numbers = [] @analytics.onts[0..4].each do |visits| - ont = @ontologies_hash[visits[:ont].to_s] - @anal_ont_names[ont.acronym] = ont.name + @anal_ont_names << visits[:ont] @anal_ont_numbers << visits[:views] end - end def render_layout_partial @@ -177,6 +153,14 @@ def validate_ontology_file @process_id = response.process_id end + def annotator_recommender_form + if params[:submit_button] == "annotator" + redirect_to "/annotator?text=#{params[:text]}" + elsif params[:submit_button] == "recommender" + redirect_to "/recommender?text=#{params[:text]}" + end + end + private # Dr. Musen wants 5 specific groups to appear first, sorted by order of importance. diff --git a/app/controllers/ontologies_controller.rb b/app/controllers/ontologies_controller.rb index f37a0e2a3..c8d38d335 100644 --- a/app/controllers/ontologies_controller.rb +++ b/app/controllers/ontologies_controller.rb @@ -451,8 +451,12 @@ def widgets render partial: 'ontologies/sections/widgets', layout: 'ontology_viewer' end end - - + def ajax_ontologies + + + render json: LinkedData::Client::Models::Ontology.all(include_views: true, + display: 'acronym,name', display_links: false, display_context: false) + end private diff --git a/app/controllers/recommender_controller.rb b/app/controllers/recommender_controller.rb index 591ffc326..256fee3e4 100644 --- a/app/controllers/recommender_controller.rb +++ b/app/controllers/recommender_controller.rb @@ -5,6 +5,7 @@ class RecommenderController < ApplicationController RECOMMENDER_URI = "/recommender" def index + @text = params[:text] end # def create diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 45d630567..0944b6d93 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -193,7 +193,7 @@ def tree_link_to_concept(child:, ontology_acronym:, active_style:, node: nil) data-active-collections-value='#{child.isInActiveCollection || []}' data-skos-collection-colors-target='collection' class='#{muted_style} #{active_style}'> - #{child.prefLabel ? child.prefLabel({ use_html: true }) : child.id} + #{child.prefLabel ? child.prefLabel({ use_html: true }) : child.id.split('/').last} EOS @@ -604,10 +604,23 @@ def skos? submission = @submission || @submission_latest submission&.hasOntologyLanguage === 'SKOS' end + + def current_page?(path) + request.path.eql?(path) + end def request_lang lang = params[:language] || params[:lang] lang = 'EN' unless lang lang.upcase end + + def portal_name + $SITE + end + + def navitems + items = [["/ontologies", "Browse"],["/mappings", "Mappings"],["/recommender", "Recommender"],["/annotator", "Annotator"], ["/landscape", "Landscape"]] + end + end diff --git a/app/javascript/controllers/home_search_controller.js b/app/javascript/controllers/home_search_controller.js new file mode 100644 index 000000000..f2db88044 --- /dev/null +++ b/app/javascript/controllers/home_search_controller.js @@ -0,0 +1,154 @@ +import { Controller } from "@hotwired/stimulus" +import useAjax from "../../javascript/mixins/useAjax"; +// Connects to data-controller="home-search" +export default class extends Controller { + static targets = [ "input", "dropDown", "ontology", "searchedOntologies", "searchOntologyContent", "homeSearchOntologies" ] + static values = { + ontologies: Array + } + connect() { + + this.input = this.inputTarget + this.dropDown = this.dropDownTarget + this.ontology = this.ontologyTarget + this.searchedOntologies = this.searchedOntologiesTarget + this.searchOntologyContent = this.searchOntologyContentTarget + this.homeSearchOntologies = this.homeSearchOntologiesTarget + } + + search(){ + this.#searchInput() + } + + prevent(event){ + event.preventDefault(); + } + blur(){ + this.dropDown.style.display = "none"; + this.input.classList.remove("home-dropdown-active"); + } + + + #scrollDown(currentScroll) { + const startPosition = window.pageYOffset; + const distance = 300 - currentScroll; + const duration = 1000; + let start = null; + + function scrollAnimation(timestamp) { + if (!start) start = timestamp; + const progress = timestamp - start; + const scrollPosition = startPosition + easeInOutCubic(progress, 0, distance, duration); + window.scrollTo(0, scrollPosition); + if (progress < duration) { + window.requestAnimationFrame(scrollAnimation); + } + } + + function easeInOutCubic(t, b, c, d) { + t /= d / 2; + if (t < 1) return c / 2 * t * t * t + b; + t -= 2; + return c / 2 * (t * t * t + 2) + b; + } + + window.requestAnimationFrame(scrollAnimation); + } + #fetchOntologies(){ + + if(this.ontologies !== undefined){ + this.#renderLines() + } else{ + useAjax({ + type: "GET", + url: "/ajax/ontologies", + dataType: "json", + success: (data) => { + + + this.ontologies = data.map(ont => [`${ont.name} (${ont.acronym})`, ont.acronym]); + this.#renderLines() + + }, + error: () => { + console.log("error") + } + }) + } + + + } + + + #renderLines(){ + const inputValue = this.input.value.trim(); + let results_list = [] + const class_search_path = "/search?query=" + const browse_search_path = "/ontologies?search=" + if (inputValue.length > 0) { + + this.ontology.innerHTML = inputValue; + this.searchedOntologies.innerHTML = inputValue; + this.searchOntologyContent.href = class_search_path+inputValue; + this.homeSearchOntologies.href = browse_search_path+inputValue; + this.dropDown.innerHTML = "" + let breaker = 0 + for (var i = 0; i < this.ontologies.length; i++) { + if (breaker == 4){ + break; + } + // Get the current item from the ontologies array + var item = this.ontologies[i]; + + // Check if the item contains the substring + if (item[0].toLowerCase().includes(inputValue.toLowerCase()) || item[1].toLowerCase().includes(inputValue.toLowerCase())) { + results_list.push(item); + breaker = breaker + 1 + } + } + + results_list.forEach((item)=> { + let link = document.createElement("a"); + link.href = "/ontologies/"+item[1]; + link.className = "home-search-ontology-content"; + + let p1 = document.createElement("p"); + p1.id = "seached-ontology"; + p1.className = "home-searched-ontology"; + p1.textContent = item[0]; + + let p2 = document.createElement("p"); + p2.className = "home-result-type"; + p2.textContent = "Ontology"; + + link.appendChild(p1); + link.appendChild(p2); + + this.dropDown.appendChild(link); + + }); + this.dropDown.appendChild(this.homeSearchOntologies); + this.dropDown.appendChild(this.searchOntologyContent); + this.dropDown.style.display = "block"; + this.input.classList.add("home-dropdown-active"); + if ((window.scrollY < 300) && (!this.input.className.includes("nav-input"))) { + this.#scrollDown(window.scrollY); + } + + + + + + } else { + this.dropDown.style.display = "none"; + this.input.classList.remove("home-dropdown-active"); + } + + + + } + + #searchInput() { + this.#fetchOntologies() + } +} diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js index 21c0817b8..da9148d6b 100644 --- a/app/javascript/controllers/index.js +++ b/app/javascript/controllers/index.js @@ -19,6 +19,9 @@ application.register("form-auto-complete", FormAutoCompleteController) import HistoryController from "./history_controller" application.register("history", HistoryController) +import HomeSearchController from "./home_search_controller" +application.register("home-search", HomeSearchController) + import LabelAjaxController from "./label_ajax_controller" application.register("label-ajax", LabelAjaxController) @@ -55,6 +58,9 @@ application.register("skos-collection-colors", SkosCollectionColorsController) import TooltipController from "./tooltip_controller" application.register("tooltip", TooltipController) +import TopnavResponsivenessController from "./topnav_responsiveness_controller" +application.register("topnav-responsiveness", TopnavResponsivenessController) + import TurboFrameController from "./turbo_frame_controller" application.register("turbo-frame", TurboFrameController) diff --git a/app/javascript/controllers/language_change_controller.js b/app/javascript/controllers/language_change_controller.js index 144b5fa36..e4d891317 100644 --- a/app/javascript/controllers/language_change_controller.js +++ b/app/javascript/controllers/language_change_controller.js @@ -1,11 +1,10 @@ import { Controller } from "@hotwired/stimulus" // Connects to data-controller="language-change" -// This controller is used to change the language of the Concepts, Schemes and Collections export default class extends Controller { dispatchLangChangeEvent() { - debugger + this.element.dispatchEvent(new CustomEvent('lang_changed', { bubbles: true, cancelable: true, @@ -15,6 +14,6 @@ export default class extends Controller { } } })); - } + } } diff --git a/app/javascript/controllers/topnav_responsiveness_controller.js b/app/javascript/controllers/topnav_responsiveness_controller.js new file mode 100644 index 000000000..218919ff8 --- /dev/null +++ b/app/javascript/controllers/topnav_responsiveness_controller.js @@ -0,0 +1,22 @@ +import { Controller } from "@hotwired/stimulus" + +// Connects to data-controller="topnav-responsiveness" +export default class extends Controller { + static targets = ['navMenu'] + + connect() { + let checkbox = this.navMenuTarget + let divs = document.querySelectorAll('.top-nav, .top-nav-ul, .nav-items, .nav-ul-li, .nav-input, .nav-a, .nav-language, .supportMenuDropdownLink'); + checkbox.addEventListener('change', function() { + if (this.checked) { + divs.forEach(function(div) { + div.classList.add('show-responsive'); + }); + } else { + divs.forEach(function(div) { + div.classList.remove('show-responsive'); + }); + } + }); + } +} diff --git a/app/views/annotator/index.html.haml b/app/views/annotator/index.html.haml index e4e72566c..c84c22ab1 100644 --- a/app/views/annotator/index.html.haml +++ b/app/views/annotator/index.html.haml @@ -17,7 +17,7 @@ %form %div.form-group = hidden_field_tag :annotation_sample_text, t('annotator.index.sample_text') - = text_area_tag("annotation_text", nil, rows: 10, class: "form-control", placeholder: t('annotator.enter_or_paste_text'), "aria-describedby": "annotateTextHelpBlock") + = text_area_tag("annotation_text", @text, rows: 10, class: "form-control", placeholder: "Enter or paste text to be annotated", "aria-describedby": "annotateTextHelpBlock") %small#annotateTextHelpBlock.form-text %a#insert_text_link{href: "javascript:void(0);"}= t('shared.insert_sample_text') @@ -170,3 +170,11 @@ %div.mb-4 = t('additional_parameters') = link_to('Annotator API documentation', "#{$REST_URL}/documentation#nav_annotator", target: "_blank") + +:javascript + window.addEventListener("load", function() { + if(document.getElementById("annotation_text").value != ''){ + document.getElementById("annotator_button").click() + window.scrollBy(0, 1080); + } + }); \ No newline at end of file diff --git a/app/views/concepts/_details.html.haml b/app/views/concepts/_details.html.haml index b122f67e7..d2edabb3f 100644 --- a/app/views/concepts/_details.html.haml +++ b/app/views/concepts/_details.html.haml @@ -1,23 +1,29 @@ = turbo_frame_tag 'concept_details' do - schemes_keys = %w[hasTopConcept topConceptOf] - label_xl_set = %w[skos-xl#prefLabel skos-xl#altLabel skos-xl#hiddenLabel] + + - if @concept.prefLabel.nil? + %div.py-3.px-2 + = render(AlertMessageComponent.new(message: t('ontology_details.concept.no_preferred_name_for_selected_language'), type: "warning", closeable: true)) + = render ConceptDetailsComponent.new(id:'concept-details', acronym: @ontology.acronym, - properties: @concept.properties, - top_keys: %w[description comment], - bottom_keys: %w[disjoint subclass is_a has_part], - exclude_keys: schemes_keys + label_xl_set + ['inScheme']) do |c| + properties: @concept.properties, + top_keys: %w[description comment], + bottom_keys: %w[disjoint subclass is_a has_part], + exclude_keys: schemes_keys + label_xl_set + ['inScheme']) do |c| + - c.header do %tr - %td{nowrap: ""} ID + %td{nowrap: ""}= t('ontology_details.concept.id') %td = @concept.id %tr - %td{nowrap: ""} Preferred Name + %td{nowrap: ""}= t('ontology_details.concept.preferred_name') %td = @concept.prefLabel({:use_html => true}).html_safe - unless @concept.synonym.nil? || @concept.synonym.empty? %tr - %td{nowrap: ""} Synonyms + %td{nowrap: ""}= t('ontology_details.concept.synonyms') %td - for synonym in @concept.synonym = synonym @@ -25,33 +31,35 @@ %div.synonym-change-request = add_synonym_button = remove_synonym_button + + - unless @concept.definition.nil? || @concept.definition.empty? %tr - %td{nowrap: ""} Definitions + %td{nowrap: ""}= t('ontology_details.concept.definitions') %td = @concept.definition.join(" ") - if @concept.obsolete? %tr - %td{nowrap: ""} Obsolete + %td{nowrap: ""}= t('ontology_details.concept.obsolete') %td true - if skos? - unless @concept.memberOf.nil? || @concept.memberOf.empty? %tr - %td{nowrap: ""} Member of + %td{nowrap: ""}= t('ontology_details.concept.member_of') %td %div.my-1 - @concept.memberOf.each do |v| = raw get_link_for_collection_ajax(v, @ontology.acronym, '_blank') - unless @concept.inScheme.nil? || @concept.inScheme.empty? %tr - %td{nowrap: ""} In Schemes + %td{nowrap: ""}= t('ontology_details.concept.in_schemes') %td %div.my-1 - @concept.inScheme.each do |v| = raw get_link_for_scheme_ajax(v, @ontology.acronym, '_blank') %tr - %td{nowrap: ""} Type + %td{nowrap: ""}= t('ontology_details.concept.type') %td = @concept.type diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 74cdb1b4d..2d999efcc 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -3,10 +3,10 @@ - unless $FRONT_NOTICE.nil? || $FRONT_NOTICE.empty? || cookies[:front_page_notice_closed].eql?("true") :javascript function close_message(){ - var exdate = new Date(); - exdate.setDate(exdate.getDate() + 7); - document.cookie="front_page_notice_closed=true; expires="+exdate.toGMTString(); - jQuery("#notice_message").hide(); + var exdate = new Date(); + exdate.setDate(exdate.getDate() + 7); + document.cookie="front_page_notice_closed=true; expires="+exdate.toGMTString(); + jQuery("#notice_message").hide(); } %p#notice_message{:style => "padding: 10px; margin: 10px; border:1px solid #EFEFEF; background-color: #F9F9F9;"} @@ -14,125 +14,177 @@ \   %a{:href => "#", :onclick => "close_message(); return false;", :style => "font-size: small; color: darkGray;"} [close] -%div.container.pb-4.pb-md-5 - %div.row - %div.col - %div.px-2.py-2.pt-md-5.border-bottom.text-center - %h2 - = t("home.index.welcome", site: "#{$SITE}") - %small.text-muted - = t("home.index.tagline") - %div.row.search.pt-4 - %div.col - %div.card-deck - -# Search for a class across ontologies - %div.card - %div.card-header= t('home.search_class') - %div.card-body - = form_tag("/search", method: "get") do - %div.input-group.mb-3 - - placeholder = t("home.index.query_placeholder") - = text_field_tag("query", nil, class: "form-control", placeholder: placeholder) - %div.input-group-append - = button_tag(type: "submit", class: "btn btn-primary", aria: {label: "Search for a class"}) do - %i{class: "fas fa-search fa-lg", aria: {hidden: "true"}} - %a{:href => "/search?opt=advanced"}= t("home.advanced_search") - -# Search for an ontology - %div.card - %div.card-header= t('home.find_ontology') - %div.card-body - %input#find_ontology_id{:type => "hidden"} - %div.input-group.mb-3 - = text_field_tag("ontology", nil, id: "find_ontology", class: "form-control", data: {ontologynames: @ontology_names}, placeholder: t(".find_ontology_placeholder")) - %div.input-group-append - = button_tag(class: "btn btn-primary", onclick: "jumpToValueOntology()", aria: {label: "Find an ontology"}) do - %i{class: "fas fa-search fa-lg", aria: {hidden: "true"}} - %div.dropdown - = button_tag(t('home.browse_ontologies'), type: "button", id: "ontologyGroupsDropdown", class: "btn btn-info dropdown-toggle", data: {toggle: "dropdown", offset: "0,10"}, aria: {haspopup: "true", expanded: "false"}) - %div.dropdown-menu{"aria-labelledby": "ontologyGroupsDropdown"} - = link_to(t('all'), ontologies_path(), class: "dropdown-item") - %div.dropdown-divider - %h6.dropdown-header= t("home.browse_by_group") - - @groups.each do |group| - = link_to(group[:name], ontologies_path(filter: group[:acronym]), class: "dropdown-item") - %div.row.pt-3.statistics - %div.col - %div.card-deck - -# Ontology visits - %div.card - %div.card-header #{t('home.ontology_visits')} #{"in full #{$SITE} " if at_slice?} (#{@analytics.date.strftime("%B %Y")}) - = content_tag(:div, nil, id: "ontology-visits-chart", class: "card-body", data: {ontnames: @anal_ont_names, ontnumbers: @anal_ont_numbers}) do - %canvas#myChart - = link_to(t('more'), visits_path()) - -# Ontology statistics - %div.card - %div.card-header #{$SITE} #{t('statistics')} #{"in full #{$SITE}" if at_slice?} - %ul.list-group.list-group-flush - %li.list-group-item - %div.d-flex.justify-content-between.align-items-center - %span= t('home.ontologies') - %span= number_with_delimiter(@ont_count) - %li.list-group-item - %div.d-flex.justify-content-between.align-items-center - %span= t('home.classes') - %span= number_with_delimiter(@cls_count, :delimiter => ",") - %li.list-group-item - %div.d-flex.justify-content-between.align-items-center - %span= t('home.individuals') - %span= number_with_delimiter(@individuals_count, :delimiter => ",") - %li.list-group-item - %div.d-flex.justify-content-between.align-items-center - %span= t('home.projects') - %span= LinkedData::Client::Models::Project.all.length - %li.list-group-item - %div.d-flex.justify-content-between.align-items-center - %span= t('home.users') - %span= LinkedData::Client::Models::User.all.length - - if fairness_service_enabled? - %div#fair-home.row.mt-3 - = render partial: "fair_score_home" - %div.row.pt-3.extra - %div.col - %div.card-deck - -# Latest Notes - %div.card - %div.card-header= t('home.latest_notes') - %ul.list-group.list-group-flush - - if @last_notes.nil? || @last_notes.empty? - %li.list-group-item - %span= t('home.no_recent_notes') - - else - - for note in @last_notes - %li.list-group-item - - begin - = link_to "#{note[:subject]} (#{note[:ont_name]})", note_path(CGI.escape(note[:id])) - %br/ - %span{:style => "color: #AAAAAA"} - = "#{time_ago_in_words(note[:created])} ago" - by #{note[:author]} - - if note[:body] - %p - = truncate(strip_tags(note[:body]), :length => 100) - \  - - rescue - - if !$ENABLE_SLICES.nil? && $ENABLE_SLICES == true && !at_slice? - -# Slices - %div.card - %div.card-header= t("slices") - %ul.list-group.list-group-flush - - LinkedData::Client::Models::Slice.all.each_with_index do |slice, index| - - break if index == 10 - - slice_name = "#{slice.name} (#{slice.acronym})" - - slice_link = "http://#{slice.acronym}.#{$UI_URL.sub("http://", "")}" - %li.list-group-item - = link_to slice_name, slice_link +.home-header-container + .home-header-background + .home-bubbles + .home-random-bubbles + %img{:src => asset_path("home-random-bubbles.svg")}/ + .home-bubble.home-bubble-one + %h5 + = @anal_ont_names[0] + %p + = @anal_ont_numbers[0].to_s + " visits" + .home-bubble.home-bubble-two + %h5 + = @anal_ont_names[1] + %p + = @anal_ont_numbers[1].to_s + " visits" + .home-bubble.home-bubble-three + %h5 + = @anal_ont_names[2] + %p + = @anal_ont_numbers[2].to_s + " visits" + %a.home-bubble.home-bubble-four{:href => "/visits"} + %h5 ... + + .home-header-title-container{'data-controller': "home-search"} + .home-header-title + %h4 + = t('.welcome', site: $SITE) + %p + = t('.tagline') + %input#home-search{:name => "search", :placeholder => "Search for an ontology or concept (Ex: Agrovoc ...)", :type => "text", 'data-home-search-target': 'input', 'data-action': 'input->home-search#search blur->home-search#blur'} + #home-search-drop-down{'data-home-search-target': 'dropDown', 'data-action': 'mousedown->home-search#prevent'} + %a.home-search-ontology-content#home-search-ontology-content{href: "#", 'data-home-search-target': 'searchOntologyContent'} + %p#seached-ontology{'data-home-search-target': 'ontology'} + %div + %img{src: asset_path("loop.svg")}/ + %p Search ontology content + %a.home-search-ontology-content#home-search-ontologies{href: "#", 'data-home-search-target': 'homeSearchOntologies'} + %p#seached-ontologies{'data-home-search-target': 'searchedOntologies'} + %div + %img{src: asset_path("loop.svg")}/ + %p See all ontologies +.home-body-container + .home-section + %h4 Wanna upload an ontology? + %hr.home-section-line/ + %p Uploading an ontology is a way of sharing your domain knowledge with others. + %p By uploading your ontology to #{$SITE}, you can: + .home-upload-benifits + - @upload_benefits.each do |benefit| + %div + %img{:src => asset_path("check-outlined.svg")}/ + %p + = benefit + - if session[:user].nil? + %a.home-upload-ontology-button{:href => "/login?redirect=/ontologies/new"} + = inline_svg_tag "upload.svg", class: "home-upload-icon" + upload ontology + - else + %a.home-upload-ontology-button{:href => "/ontologies/new"} + = inline_svg_tag "upload.svg", class: "home-upload-icon" + Upload ontology + .home-section + %h4 + = portal_name+" services" + %hr.home-section-line/ + .home-card + %form{action: "/annotator_recommender_form", method: "post"} + %textarea.home-recommendations-and-annotations{rows: "6" , placeholder: "Paste a paragraph of text or some keywords ...", name: "text"} + %input.d-none{type: "submit", name: "submit_button" ,value: "annotator", id: "annotator_submit"}/ + %input.d-none{type: "submit" , name: "submit_button" ,value: "recommender", id: "recommender_submit"}/ + .home-services-buttons + .home-get-recommendations{onclick: "submitRecommender()"} + %p Get recommendations + = inline_svg_tag "play.svg", class: "home-play-icon" + .home-services-buttons + .home-get-annotations{onclick: "submitAnnotator()"} + %p Get annotations + %img{:src => asset_path("play-white.svg")}/ + .home-section + .home-section-sub-sections-container + .home-sub-section-left + %h4 FAIR scores + %hr.home-section-line/ + .home-card.home-fair-scores + - if fairness_service_enabled? + %div#fair-home + = render partial: "shared/fair_score_bars", locals: {data: nil} + %a{:href => "#fairDetails"} + %div.home-fair-details + %p See details + = inline_svg_tag "arrow-right.svg" + .home-sub-section-right + %h4 News + %hr.home-section-line + .home-card.home-twitter-news + %a.twitter-timeline{"data-height" => "349", "data-width" => "533", :href => "https://twitter.com/lagroportal?ref_src=twsrc%5Etfw"} Tweets by lagroportal + %script{:async => "", :charset => "utf-8", :src => "https://platform.twitter.com/widgets.js"} + + .home-section + .home-statistics-container + .home-agroportal-figures + = inline_svg_tag "ontoportal-icon.svg" + %p + = portal_name+" in figures:" + .home-statistics + .home-statistics-item + %hr/ + %div + %h4 + = number_with_delimiter(@ont_count, :delimiter => ",") + %p Ontologies + .home-statistics-item + %hr/ + %div + %h4 + = number_with_delimiter(@cls_count, :delimiter => ",") + %p Classes + .home-statistics-item + %hr/ + %div + %h4 + = number_with_delimiter(@individuals_count, :delimiter => ",") + %p Individuals + .home-statistics-item + %hr/ + %div + %h4 + = number_with_delimiter(@prop_count, :delimiter => ",") + %p Properties + .home-statistics-item + %hr/ + %div + %h4 + = number_with_delimiter(@projects_count, :delimiter => ",") + %p Projects + .home-statistics-item + %hr/ + %div + %h4 + = number_with_delimiter(@map_count, :delimiter => ",") + %p Mappings + .home-statistics-item + %hr/ + %div + %h4 + = number_with_delimiter(@users_count, :delimiter => ",") + %p Users + .home-section + .home-statistics-container + .home-support-title + %p Supported by + %hr.home-section-line/ + .home-support-items + - $HOME_PAGE_LOGOS[:supported_by].each do |logo| + %a{href:logo[:url], target: "_blanc"} + %img{src: asset_path(logo[:img_src])} + .home-support-title + %p With the collaboration of + %hr.home-section-line/ + .home-support-items + - $HOME_PAGE_LOGOS[:with_the_collaboration_of].each do |logo| + %a{href:logo[:url], target: "_blanc"} + %img{src: asset_path(logo[:img_src])} + + + +:javascript + function submitAnnotator(){ + document.getElementById("annotator_submit").click() + } + function submitRecommender(){ + document.getElementById("recommender_submit").click() + } - - $HOME_PAGE_LOGOS.each do |key, home_page_logos_row| - %div.row.pt-3 - %div.col - %div.card-deck - %div.card - %div.card-header= t("home.#{key}") - %div.logos - - home_page_logos_row.each do |logo| - = link_to(image_tag(logo[:img_src]), logo[:url], target: logo[:target]) diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 0530d3209..111fc1b69 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -43,5 +43,5 @@ <%=render partial: 'layouts/topnav'%> -
+
<%=render partial: 'layouts/notices'%> \ No newline at end of file diff --git a/app/views/layouts/_topnav.html.haml b/app/views/layouts/_topnav.html.haml index 4ae87baeb..8ce7afe78 100644 --- a/app/views/layouts/_topnav.html.haml +++ b/app/views/layouts/_topnav.html.haml @@ -1,61 +1,74 @@ -%nav.navbar.navbar-expand-lg.navbar-dark.navbar-custom - = link_to(image_tag("logos/ontoportal-logo.png") + content_tag(:span, $SITE, class: 'site-name'), root_path(), class: "navbar-brand") - = button_tag(type: "button", class: "navbar-toggler", data: {toggle: "collapse", target: "#topNavigationToggler"}, aria: {controls: "topNavigationToggler", expanded: "false", label: "Toggle navigation"}) do - %span.navbar-toggler-icon +.nav-container.text-white{data: {controller:"topnav-responsiveness"}} + %nav.top-nav + .nav-responsiveness-container + %a.nav-logo{href: "/"} + %img{:src => asset_path("logo-white.svg")}/ + %p + = portal_name + %input#nav-menu{:type => "checkbox", 'data-topnav-responsiveness-target': 'navMenu'} + %label.menu-btn{:for => "nav-menu"} + %i.fas.fa-bars + .nav-items + %ul.top-nav-ul + - navitems.each do |navItem| + %li.nav-ul-li + %a{href: navItem[0], class: ("active" if current_page?(navItem[0]))} #{navItem[1]} + %div.d-flex.align-items-center.justify-content-between{style:'min-width: 40%'} + - if current_page?('/') + .nav-search-container{style:'visibility: hidden'} + %input + - else + .nav-search-container{'data-controller': "home-search"} + %input.nav-input{:placeholder => "Search in "+portal_name+" ...", :type => "text", :name => "search", 'data-home-search-target': 'input', 'data-action': 'input->home-search#search blur->home-search#blur'} + #home-search-drop-down.nav-search-drop-down{'data-home-search-target': 'dropDown', 'data-action': 'mousedown->home-search#prevent'} + %a.home-search-ontology-content#home-search-ontology-content{href: "#", 'data-home-search-target': 'searchOntologyContent'} + %p#seached-ontology{'data-home-search-target': 'ontology'} + %div + %img{src: asset_path("loop.svg")}/ + %p Search ontology content + %a.home-search-ontology-content#home-search-ontologies{href: "#", 'data-home-search-target': 'homeSearchOntologies'} + %p#seached-ontologies{'data-home-search-target': 'searchedOntologies'} + %div + %img{src: asset_path("loop.svg")}/ + %p See all ontologies - %div#topNavigationToggler.navbar-collapse.collapse.justify-content-between - %ul.navbar-nav - %li.nav-item - = link_to(t('layout.header.browse'), ontologies_path(), class: "nav-link") - %li.nav-item - = link_to(t('layout.header.search'), "/search", class: "nav-link") - %li.nav-item - = link_to(t('layout.header.mappings'), mappings_path(), class: "nav-link") - %li.nav-item - = link_to(t('layout.header.recommender'), recommender_index_path, class: "nav-link") - %li.nav-item - = link_to(t('layout.header.annotator'), annotator_index_path(), class: "nav-link") - - if $NCBO_ANNOTATORPLUS_ENABLED == true - %li.nav-item - = link_to(t('layout.header.ncbo_annotator_plus'), '/ncbo_annotatorplus', class: "nav-link") - %li.nav-item - = link_to(t('layout.header.projects'), projects_path(), class: "nav-link") - %li.nav-item - = link_to(t('layout.header.landscape'), '/landscape', class: "nav-link") - -if (!session[:user].nil? && session[:user].admin?) - %li.nav-item - = link_to(t('layout.header.admin'), admin_index_path, class: "nav-link") - %ul.navbar-nav - %li.nav-item{ style: "margin-right: 10px;" } - %select#language-select.form-control{ data: { controller: "platform-language", action: "change->platform-language#handleLangChanged" } } - %option{ value: "en" } English - %option{ value: "fr" } Français - - - if session[:user].nil? - %li.nav-item - = link_to(t(:_login), login_index_path(redirect: request.original_url), class: "btn btn-bp-login mr-md-2") - - else - -# Account menu - %li.nav-item.dropdown - = link_to("#", id: "accountMenuDropdownLink", class: "nav-link dropdown-toggle", role: "button", data: {toggle: "dropdown"}, aria: {haspopup: "true", expanded: "false"}) do - = session[:user].username - %div.dropdown-menu.dropdown-menu-right{aria: {labelledby: "accountMenuDropdownLink"}} - = link_to(t(:_account_setting), "/account", class: "dropdown-item") - - unless session[:ontologies].nil? - %div.dropdown-divider - %h6.dropdown-header Recently Viewed + - if session[:user].nil? + %a.nav-a{:href => "/login"} Login + - else + = render DropdownButtonComponent.new do |d| + - d.header do + = session[:user].username + - d.with_section(divide: false) do |s| + - s.item do + = link_to(t(:_account_setting), "/account") + - d.with_section do |s| + - s.header do + Recently Viewed - for ont in session[:ontologies] - = link_to(ont.ontology_name, "/ontologies/#{ont.ontology_acronym}/?p=classes&conceptid=#{CGI.escape(ont.concept)}", class: "dropdown-item") - %div.dropdown-divider - = link_to("Logout", logout_path, class: "dropdown-item") - -# Support menu - %li.nav-item.dropdown - = link_to("#", id: "supportMenuDropdownLink", class: "nav-link dropdown-toggle", role: "button", data: {toggle: "dropdown"}, aria: {haspopup: "true", expanded: "false"}) do - Support - %div.dropdown-menu.dropdown-menu-right{aria: {labelledby: "supportMenuDropdownLink"}} - = link_to(t(:submit_feedback), feedback_path(location: encode_param(request.url)), id: "submitFeedbackMenuItem", class: "dropdown-item pop_window") - %div.dropdown-divider - %h6.dropdown-header Documentation - = link_to(t(:_help), "#{$WIKI_HELP_PAGE}", target: "_blank", class: "dropdown-item") - = link_to(t(:_release_notes), "#{$RELEASE_NOTES}", target: "_blank", class: "dropdown-item") - = link_to(t(:_publications), $PUBLICATIONS_URL, target: "_blank", class: "dropdown-item") + - s.item do + = link_to(ont.ontology_name, "/ontologies/#{ont.ontology_acronym}/?p=classes&conceptid=#{CGI.escape(ont.concept)}") + - d.with_section do |s| + - s.item do + = link_to("Logout", logout_path) + + = select_tag('language', options_for_select([['EN','en'],['FR','fr']]), id: 'language-select', class: 'nav-language', + data: { controller: "platform-language", action: "change->platform-language#handleLangChanged" }) + + = render DropdownButtonComponent.new do |d| + - d.header do + = link_to("#", id: "supportMenuDropdownLink", class: "nav-link top-nav-nav-link supportMenuDropdownLink", role: "button") do + Support + - d.with_section(divide: false) do |s| + - s.item do + = link_to(t(:submit_feedback), feedback_path(location: encode_param(request.url)), id: "submitFeedbackMenuItem", class: "pop_window") + - d.with_section do |s| + - s.header do + Documentation + - s.item do + = link_to(t(:_help), "#{$WIKI_HELP_PAGE}", target: "_blank") + - s.item do + = link_to(t(:_release_notes), "#{$RELEASE_NOTES}", target: "_blank") + - s.item do + = link_to(t(:_publications), $PUBLICATIONS_URL, target: "_blank") + + diff --git a/app/views/recommender/index.html.haml b/app/views/recommender/index.html.haml index 8dddc3846..0cb71e46e 100644 --- a/app/views/recommender/index.html.haml +++ b/app/views/recommender/index.html.haml @@ -31,7 +31,7 @@ -# Input text or keywords %div.form-group.mt-4 - = text_area_tag("inputText", nil, rows: 10, class: "form-control default", placeholder: t('paste_input_text'), aria: {describedby: "inputTextHelpBlock"}) + = text_area_tag("inputText", @text, rows: 10, class: "form-control default", placeholder: "Paste a paragraph of text or some keywords to use in calculating ontology recommendations", aria: {describedby: "inputTextHelpBlock"}) %div.card#inputTextHighlighted %div.card-body %small#inputTextHelpBlock.form-text @@ -107,3 +107,14 @@ %div.col %h5#resultsHeader %div#recommender-results.mb-5 + +:javascript + window.addEventListener("load", function() { + const value = document.getElementById("inputText").value + document.getElementById("inputText").click(); + document.getElementById("inputText").value = value + if(document.getElementById("inputText").value != ''){ + document.getElementById("recommenderButton").click() + window.scrollBy(0, 1080); + } + }); \ No newline at end of file diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index ecd788660..bf3657498 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -111,8 +111,8 @@ %h4.account-page-card-title Submitted ontologies .account-page-small-cards-container - @admin_ontologies.each do |ont| - .account-page-submitted-ontology - %a{href: "/ontologies/#{ont.acronym}"}= ont.name + .account-page-submitted-ontology{data: {controller: 'tooltip'}, title: ont.name} + %a{href: "/ontologies/#{ont.acronym}"}= ont.acronym - unless @user_projects.nil? || @user_projects.empty? - no_ontologies = false .account-page-card diff --git a/config/locales/en.yml b/config/locales/en.yml index b19e00522..ae4ebeeae 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -184,9 +184,9 @@ en: index: find_ontology_placeholder: Start typing the ontology name, then choose from query_placeholder: Enter a class, eg Melanoma - tagline: the world's most comprehensive repository of biomedical ontologies + tagline: The home of vocabularies and ontologies in agronomy and related fields. title: Welcome to the %{organization} - welcome: Welcome to the %{site}, + welcome: Welcome to %{site}, help: welcome: Welcome to the %{site} of the National Center for Biomedical Ontology. %{site} is a web application for accessing and sharing biomedical ontologies. getting_started: > @@ -270,61 +270,63 @@ en: sample_text: Melanoma is a malignant tumor of melanocytes found mainly in the skin but also in the intestine and the eye. ontology_details: - header: - last_uploaded: "Last uploaded:" - sections: - summary: "Summary" - concepts: "Concepts" - classes: "Classes" - properties: "Properties" - notes: "Notes" - mappings: "Mappings" - schemes: "Schemes" - collections: "Collections" - widgets: "Widgets" - metadata: - details: "Details" - acronym: "Acronym" - visibility: "Visibility" - viewing_restriction: "Viewing Restriction" - view_of_ontology: "View of ontology" - description: "Description" - status: "Status" - format: "Format" - contact: "Contact" - categories: "Categories" - groups: "Groups" - pull_url: "Pull URL" - submissions: "Submissions" - links: "Links" - add_submission: "Add Submission" - views_of: "Views of" - create_new_view: "Create a new view" - no_views_of: "No views of %{name} available" - go_to_rest_api_json_entry: "Go to REST API JSON Entry" - get_my_metadata_back: "Get my metadata back" - n_triple: "N-Triple" - json_ld: "JSON-LD" - rdf_xml: "RDF/XML" - view_individual_metrics_definitions: "View individual metrics definitions" - metrics: "Metrics" - metrics_not_calculated_yet: "We have not yet calculated metrics for" - classes: "Classes" - individuals: "Individuals" - properties: "Properties" - max_depth: "Maximum depth" - max_children: "Maximum number of children" - avg_children: "Average number of children" - single_child_classes: "Classes with a single child" - many_children_classes: "Classes with more than 25 children" - no_definition_classes: "Classes without definition" - visits: "Visits" - download_as_csv: "Download as CSV" - projects_using: "Projects Using" - no_projects_using: "No projects are using" - create_new_project: "Create a new project" - additional_metadata: "Additional Metadata" + metadata: + details: "Details" + acronym: "Acronym" + visibility: "Visibility" + viewing_restriction: "Viewing Restriction" + view_of_ontology: "View of ontology" + description: "Description" + status: "Status" + format: "Format" + contact: "Contact" + categories: "Categories" + groups: "Groups" + pull_url: "Pull URL" + submissions: "Submissions" + links: "Links" + add_submission: "Add Submission" + views_of: "Views of" + create_new_view: "Create a new view" + no_views_of: "No views of %{name} available" + go_to_rest_api_json_entry: "Go to REST API JSON Entry" + get_my_metadata_back: "Get my metadata back" + n_triple: "N-Triple" + json_ld: "JSON-LD" + rdf_xml: "RDF/XML" + view_individual_metrics_definitions: "View individual metrics definitions" + metrics: "Metrics" + metrics_not_calculated_yet: "We have not yet calculated metrics for" + classes: "Classes" + individuals: "Individuals" + properties: "Properties" + max_depth: "Maximum depth" + max_children: "Maximum number of children" + avg_children: "Average number of children" + single_child_classes: "Classes with a single child" + many_children_classes: "Classes with more than 25 children" + no_definition_classes: "Classes without definition" + visits: "Visits" + download_as_csv: "Download as CSV" + projects_using: "Projects Using" + no_projects_using: "No projects are using" + create_new_project: "Create a new project" + additional_metadata: "Additional Metadata" + concept: + no_preferred_name_for_selected_language: "No preferred name for selected language." + no_synonym_name_for_selected_language: "No Synonym for selected language." + no_definitions_for_selected_language: "No Definitions for selected language." + preferred_name: "Preferred name" + id: "ID" + synonyms: "Synonyms" + definitions: "Definitions" + obsolete: "Obsolete" + member_of: "Member of" + in_schemes: "In Schemes" + type: "Type" + no_value_for_selected_language: "No value for selected language." + layout: header: browse: "Browse" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 95940640f..3992efa92 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1,4 +1,5 @@ fr: + nbco_annotatosplus: score_help: "Annotations de score suivant la mesure NCBO 2009 précédente (ancienne) ou Annotations de score suivant la mesure C-Value (cvalue) ou Annotations de score suivant la mesure C-Value avec expansion de la hiérarchie (cvalueh)" start_typing_to_select: "Commencez à taper pour sélectionner %{type} ou laissez vide pour tout utiliser" @@ -190,8 +191,7 @@ fr: projects: "Projets" users: "Utilisateurs" no_recent_notes: "Aucune note récente n'a été soumise" - supported_by: "Avec le soutien de" - with_collaboration: "Avec la collaboration de" + index: find_ontology_placeholder: Commencez à taper le nom de l'ontologie, puis choisissez dans query_placeholder: Entrez une classe, par exemple Melanoma @@ -281,22 +281,9 @@ fr: sample_text: Le mélanome est une tumeur maligne des mélanocytes qui se trouvent principalement dans la peau mais aussi dans l'intestin et l'œil. ontology_details: - header: - last_uploaded: "Dernière mise à jour:" - sections: - summary: "Résumé" - concepts: "Concepts" - classes: "Classes" - properties: "Propriétés" - notes: "Notes" - mappings: "Mappings" - schemes: "Schemes" - collections: "Collections" - widgets: "Widgets" - metadata: details: "Détails" - acronym: "Acronyme" + acronym: "Acronym" visibility: "Visibilité" viewing_restriction: "Restriction de visualisation" view_of_ontology: "Vue de l'ontologie" @@ -337,6 +324,23 @@ fr: create_new_project: "Créer un nouveau projet" additional_metadata: "Métadonnées supplémentaires" + concept: + no_preferred_name_for_selected_language: "Pas de nom préféré pour la langue sélectionnée." + no_synonym_name_for_selected_language : "Aucun synonyme pour la langue sélectionnée." + no_definitions_for_selected_language : "Aucune définition pour la langue sélectionnée." + preferred_name: "Nom préféré" + id: "Identifiant" + synonyms: "Synonymes" + definitions: "Définitions" + obsolete: "Obsolète" + member_of: "Membre de" + in_schemes: "Dans les schémas" + type: "Type" + no_value_for_selected_language: "Pas de valeur pour la langue sélectionnée." + + + + layout: header: browse: "Parcourir" @@ -354,24 +358,7 @@ fr: release_notes: "Notes de version" publications: "Publications" footer: - products: Produits - ontoportal: OntoPortal - release_notes: Notes de version - api: API - sparql: SPARQL - support: Support - contact_us: Nous contacter - wiki: Wiki - documentation: Documentation - agreements: Accords - terms: Conditions d'utilisation - privacy_policy: Politique de confidentialité - cite_us: Nous citer - acknowledgments: Remerciements - about: À propos - about_us: À propos de nous - projects: Projets - team: Équipe + products: "Produits" copyright_html: Droit d'auteur &copie; 2005‑2022, Conseil d'administration de l'Université Leland Stanford Junior. Tous les droits sont réservés. grant_html: > %{site} est actuellement développé dans le cadre du projet ANR D2KAB (ANR-18-CE23-0017). Il reçoit ou a également reçu le soutien du projet ANR SIFR (ANR-12-JS02-0010), Union Européenne Projet H2020-MSCA SIFRm ( N° 701771), le Labex NUMEV (ANR-10-LABX-20), le projet IBC de Montpellier (ANR-11-BINF0002) , l'Agro Labex (ANR-10-LABX-0001) ainsi que de l'Université de Montpellier et du CNRS. @@ -448,8 +435,8 @@ fr: formats: year_month_day_concise: "%Y-%m-%d" # 2017-03-01 month_day_year: "%b %-d, %Y" # Mar 1, 2017 - monthfull_day_year: "%-d %B %Y" # March 1, 2017 - + monthfull_day_year: "%B %-d, %Y" # March 1, 2017 + ontologies: self: "Ontologies" loading: Chargement des ontologies @@ -571,3 +558,5 @@ fr: paste_input_text: "Collez un paragraphe de texte ou des mots-clés à utiliser dans le calcul des recommandations d'ontologie" get_recommendations: "Obtenir des recommandations" select_ontologies_list: "Sélectionnez les ontologies" + + \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 4862b94cc..5090016ec 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -89,6 +89,7 @@ get '/about' => 'home#about' get '/site_config' => 'home#site_config' get '/validate_ontology_file' => 'home#validate_ontology_file_show' + post '/annotator_recommender_form' => 'home#annotator_recommender_form' match '/validate_ontology_file' => 'home#validate_ontology_file', via: [:get, :post] get '/layout_partial/:partial' => 'home#render_layout_partial' match '/visits', to: 'visits#index', via: :get @@ -151,6 +152,7 @@ get '/ajax/fair_score/json' => 'fair_score#details_json' get '/ajax/:ontology/instances' => 'instances#index_by_ontology' get '/ajax/:ontology/classes/:conceptid/instances' => 'instances#index_by_class', :constraints => { conceptid: /[^\/?]+/ } + get '/ajax/ontologies' , to:"ontologies#ajax_ontologies" # User get '/logout' => 'login#destroy', :as => :logout diff --git a/test/components/previews/alert_message_component_preview.rb b/test/components/previews/alert_message_component_preview.rb new file mode 100644 index 000000000..4efb845e9 --- /dev/null +++ b/test/components/previews/alert_message_component_preview.rb @@ -0,0 +1,10 @@ +class AlertMessageComponentPreview < ViewComponent::Preview + + # @param message text + # @param type select [error, info, success, warning] + + def default(message: "Here we can type a success or failure message to the user", type: "info", closeable: true ) + render(AlertMessageComponent.new(message: message, type: type, closeable: closeable)) + end + +end \ No newline at end of file diff --git a/test/components/previews/card_message_component_preview.rb b/test/components/previews/card_message_component_preview.rb index 02c17f200..522031669 100644 --- a/test/components/previews/card_message_component_preview.rb +++ b/test/components/previews/card_message_component_preview.rb @@ -2,11 +2,29 @@ class CardMessageComponentPreview < ViewComponent::Preview # @param message text # @param button_text text - # @param type select [success, failure] # @param button_link text - def default(message: "Here we can type a success or failure message to the user", button_text: "Do action", type: "success", button_link: "/" ) - render(CardMessageComponent.new(message: message, button_text: button_text, type: type, button_link: button_link)) + def default(message: "Here we can type a success or failure message to the user", button_text: "Do action", button_link: "/" ) + render(CardMessageComponent.new(message: message, button_text: button_text, type: "success", button_link: button_link)) end - end \ No newline at end of file + + # @param message text + # @param button_text text + # @param button_link text + + def warning(message: "Here we can type a success or failure message to the user", button_text: "Do action", button_link: "/" ) + render(CardMessageComponent.new(message: message, button_text: button_text, type: "warning", button_link: button_link)) + end + + + # @param message text + # @param button_text text + # @param button_link text + + def failure(message: "Here we can type a success or failure message to the user", button_text: "Do action", button_link: "/" ) + render(CardMessageComponent.new(message: message, button_text: button_text, type: "failure", button_link: button_link)) + end + + +end \ No newline at end of file diff --git a/test/components/previews/chip_button_component_preview.rb b/test/components/previews/chip_button_component_preview.rb new file mode 100644 index 000000000..ab5dedab2 --- /dev/null +++ b/test/components/previews/chip_button_component_preview.rb @@ -0,0 +1,19 @@ +class ChipButtonComponentPreview < ViewComponent::Preview + + # @param url text + # @param text text + + def standard(url: "nil", text: "text") + render(ChipButtonComponent.new(url: url, text: text, type: "static")) + end + + # @param url text + # @param text text + + def clickable(url: "nil", text: "text") + render(ChipButtonComponent.new(url: url, text: text, type: "clickable")) + end + + + +end \ No newline at end of file diff --git a/test/components/previews/chips_component_preview.rb b/test/components/previews/chips_component_preview.rb index 55ff1b5bc..8f806211c 100644 --- a/test/components/previews/chips_component_preview.rb +++ b/test/components/previews/chips_component_preview.rb @@ -7,4 +7,4 @@ def default(name: "name", value: "value") render(ChipsComponent.new(name: name, value: value)) end - end \ No newline at end of file +end \ No newline at end of file diff --git a/test/components/previews/rounded_button_component_preview.rb b/test/components/previews/rounded_button_component_preview.rb new file mode 100644 index 000000000..1ba6584f1 --- /dev/null +++ b/test/components/previews/rounded_button_component_preview.rb @@ -0,0 +1,14 @@ +class RoundedButtonComponentPreview < ViewComponent::Preview + + # @param icon text + # @param link text + # @param size select [small, medium, big] + + def default(icon: "json.svg", link: "text", size: "small") + render(RoundedButtonComponent.new(icon: icon, link: link, size: size)) + end + + + + +end \ No newline at end of file