diff --git a/Gemfile.lock b/Gemfile.lock
index bc3768dfe..5eee9756a 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -485,3 +485,4 @@ DEPENDENCIES
BUNDLED WITH
2.3.23
+
diff --git a/app/assets/images/empty-box.svg b/app/assets/images/empty-box.svg
new file mode 100644
index 000000000..8174e734c
--- /dev/null
+++ b/app/assets/images/empty-box.svg
@@ -0,0 +1,44 @@
+
diff --git a/app/assets/stylesheets/account.scss b/app/assets/stylesheets/account.scss
new file mode 100644
index 000000000..3112a95d4
--- /dev/null
+++ b/app/assets/stylesheets/account.scss
@@ -0,0 +1,223 @@
+
+.account-page-center{
+ display: flex;
+ justify-content: center;
+ margin: 30px 0;
+
+}
+.account-page-title{
+ font-size: 18px;
+ font-weight: 700;
+}
+
+.account-page-sub-container{
+ display: flex;
+}
+.account-page-first-row{
+ width: 566px;
+ margin-right: 20px;
+}
+
+.account-page-second-row{
+ width: 566px;
+}
+
+#account-page-title-line{
+ width: 93px;
+ margin-top: 3px;
+ border: 0.5px solid var(--primary-color);
+ border-radius: 5px;
+ margin-bottom: 0px !important ;
+}
+.account-page-card{
+ border: 1px solid #DFDFDF;
+ border-radius: 5px;
+ padding: 20px 20px;
+ margin-top: 20px;
+}
+.account-page-card-title{
+ font-size: 16px;
+ font-weight: 600;
+}
+.account-page-personal-informations-title-bar{
+ display: flex;
+ align-items: center;
+ justify-content:space-between;
+}
+.account-page-rounded-button{
+ display: flex;
+ justify-content: center;
+ border: 0.5px solid var(--primary-color);
+ padding: 10px;
+ border-radius: 50px;
+ width: 40px;
+}
+.account-page-info-column{
+ display: flex;
+}
+.account-page-info-column .title{
+ margin-right: 9px;
+ font-size: 15px;
+ color: #666666;
+}
+
+.account-page-info-column .info{
+ font-size: 15px;
+ font-weight: 600;
+}
+.account-page-card-desc{
+ font-size: 13px;
+ color: #666666;
+ margin: 8px 0;
+}
+.apikey{
+ font-size: 17px;
+ font-weight: 600;
+}
+.account-page-card-container{
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+.account-page-no-ontology{
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ padding: 37px;
+}
+.account-page-no-ontology p{
+ color: #bbbbbb;
+ font-size: 16px;
+ margin: 26px 0;
+}
+.account-page-upload-ontology-button{
+ width: 220px;
+ font-size: 16px;
+ font-weight: 500;
+ color: var(--primary-color);
+ background-color: white;
+ padding: 16px;
+ border: 1px solid var(--primary-color);
+ border-radius: 5px;
+ text-align: center;
+}
+.account-page-select-ontology-set-button{
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ width: 200px;
+ border: 1px solid var(--primary-color);
+ padding: 16px;
+ border-radius: 5px;
+ font-size: 16px;
+ font-weight: 500;
+ color: var(--primary-color);
+}
+.account-page-select-ontology-set-button p{
+ margin-bottom: 0 !important;
+}
+.account-page-api-documentation-link{
+ display: flex;
+ margin-top: 10px;
+}
+.account-page-api-documentation-link a{
+ font-size: 15px;
+ font-weight: 500;
+ color: var(--primary-color);
+ text-decoration: none;
+}
+.account-page-api-documentation-link a svg{
+ margin-left: 10px;
+ margin-bottom: 5px;
+}
+svg path{
+ fill: var(--primary-color);
+}
+
+.account-page-subscribe-button{
+ border: 1px solid var(--primary-color);
+ text-decoration: none;
+ color: var(--primary-color);
+ border-radius: 5px;
+ padding: 12px 20px;
+ font-size: 14px;
+ font-weight: 500;
+}
+
+.account-page-subscription{
+ margin-top: 10px;
+ display: flex;
+ justify-content: space-between;
+}
+.account-page-subscription a{
+ font-size: 15px;
+ font-weight: 400;
+ color: var(--primary-color);
+}
+.account-page-subscription div{
+ display: flex;
+}
+.account-page-subscription div .notes{
+ margin-right: 23px;
+ color: #666666 !important;
+ font-weight: 400;
+}
+.account-page-subscription div .subscribe_to_notes{
+ color: #EB4335 !important;
+ font-weight: 400 !important;
+ border: unset !important;
+ background-color: unset !important;
+ vertical-align: top;
+ padding: unset !important;
+ box-shadow: unset !important;
+}
+.account-page-small-cards-container{
+ display: flex;
+ flex-wrap: wrap;
+}
+.account-page-submitted-ontology{
+ background-color: #F6F6F6;
+ padding: 10px;
+ border-radius: 5px;
+ margin-right: 10px;
+ margin-top: 10px;
+}
+
+.account-page-submitted-ontology a{
+ color: #777777 !important;
+ font-weight: 500;
+ font-size: 15px;
+}
+.no-margin{
+ margin: 0 !important;
+}
+.change-password{
+ margin-top: 14px;
+ display: flex;
+ justify-content: center;
+}
+@media only screen and (max-width: 1200px) {
+ .account-page-first-row{
+ width: 47vw;
+ margin-right: 20px;
+ }
+
+ .account-page-second-row{
+ width: 47vw;
+ }
+}
+
+@media only screen and (max-width: 950px) {
+ .account-page-first-row{
+ width: 80vw;
+ margin-right: 20px;
+ }
+
+ .account-page-second-row{
+ width: 80vw;
+ }
+ .account-page-sub-container{
+ display:block;
+ }
+}
\ 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 2aa6ca276..1b70724a0 100644
--- a/app/assets/stylesheets/application.css.scss.erb
+++ b/app/assets/stylesheets/application.css.scss.erb
@@ -48,6 +48,7 @@
@import "feedback";
@import "login";
@import "components/index";
+@import "account";
/* Bootstrap and Font Awesome */
@import "bootstrap";
diff --git a/app/assets/stylesheets/bioportal.scss b/app/assets/stylesheets/bioportal.scss
index 3ccb941b1..1003395d0 100644
--- a/app/assets/stylesheets/bioportal.scss
+++ b/app/assets/stylesheets/bioportal.scss
@@ -1,3 +1,6 @@
+a{
+ text-decoration: none !important;
+}
.alignright {
float:right;
}
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index ec96027e6..319e2dc36 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -5,15 +5,6 @@ class UsersController < ApplicationController
before_action :authorize_admin, only: [:index,:subscribe, :un_subscribe]
layout :determine_layout
- # GET /users
- # GET /users.xml
- def index
- @users = LinkedData::Client::Models::User.all
- respond_to do |format|
- format.html
- format.xml { render xml: @users.to_xml }
- end
- end
# GET /users/1
# GET /users/1.xml
@@ -142,7 +133,7 @@ def custom_ontologies
custom_ontologies = params[:ontology] ? params[:ontology][:ontologyId] : []
custom_ontologies.reject!(&:blank?)
@user.update_from_params(customOntology: custom_ontologies)
- error_response = @user.update
+ error_response = !@user.update
if error_response
flash[:notice] = 'Error saving Custom Ontologies, please try again'
@@ -192,7 +183,7 @@ def user_params
end
def extract_id_from_url(url, pattern)
- if url.include? (pattern)
+ if url && url.include?(pattern)
url.split('/').last
else
url
@@ -235,14 +226,32 @@ def validate(params)
errors << "Please fill in the proper text from the supplied image"
end
end
+ if ((!params[:orcidId].match(/^\d{4}+(-\d{4})+$/)) || (params[:orcidId].length != 19)) && !(params[:orcidId].nil? || params[:orcidId].length < 1)
+ errors << "Please enter a valide orcid id"
+ end
+ if params[:username].nil? || params[:username].length < 1 || !params[:username].match(/^[a-zA-Z0-9]([._-](?![._-])|[a-zA-Z0-9]){3,18}[a-zA-Z0-9]$/)
+ errors << "please enter a valid username"
+ end
return errors
end
def validate_update(params)
errors = []
if params[:email].nil? || params[:email].length < 1 || !params[:email].match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i)
- errors << "Please enter an email address"
+ errors << "Please enter a valid email adresse"
+ end
+ if params[:firstName].nil? || params[:firstName].length < 1
+ errors << "First name field is required"
+ end
+ if params[:lastName].nil? || params[:lastName].length < 1
+ errors << "Last name field is required"
+ end
+ if params[:username].nil? || params[:username].length < 1
+ errors << "Last name field is required"
+ end
+ if ((!params[:orcidId].match(/^\d{4}+(-\d{4})+$/)) || (params[:orcidId].length != 19)) && !(params[:orcidId].nil? || params[:orcidId].length < 1)
+ errors << "Please enter a valide orcide id"
end
if !params[:password].eql?(params[:password_confirmation])
errors << "Your Password and Password Confirmation do not match"
diff --git a/app/helpers/fair_score_helper.rb b/app/helpers/fair_score_helper.rb
index ff95ad4ad..6febe47e6 100644
--- a/app/helpers/fair_score_helper.rb
+++ b/app/helpers/fair_score_helper.rb
@@ -12,7 +12,12 @@ def get_fairness_service_url(apikey = user_apikey)
"#{$FAIRNESS_URL}?portal=#{$HOSTNAME.split('.')[0]}#{apikey.nil? || apikey.empty? ? '' : "&apikey=#{apikey}"}"
end
def get_fairness_json(ontologies_acronyms, apikey = user_apikey)
- MultiJson.load(Faraday.get(get_fairness_service_url(apikey) + "&ontologies=#{ontologies_acronyms}&combined").body.force_encoding('ISO-8859-1').encode('UTF-8'))
+ begin
+ MultiJson.load(Faraday.get(get_fairness_service_url(apikey) + "&ontologies=#{ontologies_acronyms}&combined").body.force_encoding('ISO-8859-1').encode('UTF-8'))
+ rescue
+ Rails.logger.warn "FAIRness service issue unreachable"
+ {}
+ end
end
def get_fair_score(ontologies_acronyms, apikey = user_apikey)
diff --git a/app/views/admin/index.html.haml b/app/views/admin/index.html.haml
index 38bc1a3e5..0b796f2a1 100644
--- a/app/views/admin/index.html.haml
+++ b/app/views/admin/index.html.haml
@@ -13,7 +13,6 @@
%div.row
%div.col
-
%ul.nav.nav-tabs{id: "admin-tabs", role: "tablist"}
%li.nav-item
=link_to("Site Administration", "#site-admin", id: "site-admin-tab", class: "nav-link active", role: "tab", data: { toggle: "tab" }, aria: { controls: "site-admin", selected: "true" })
@@ -54,6 +53,15 @@
%dive.site-admin-page-section
%div#appliance-id
%span
+
+ -# Clear caches
+ %div#site-admin-clear-caches.my-5
+ %div.site-admin-page-header
+ MONITORING LINKS
+ %dive.site-admin-page-section
+ = link_to("Newrelic", "https://login.newrelic.com/login", target: '_blank', id: "newrelic_link", class: "btn btn-outline-secondary btn-sm admin-action-item", role: "button")
+ = link_to("StatusCake", "https://app.statuscake.com/Login", target: '_blank', id: "statuscake_link", class: "btn btn-outline-secondary btn-sm admin-action-item", role: "button")
+
-# Ontology Administration tab
%div.tab-pane.fade{id: "ontology-admin", role: "tabpanel", aria: { labelledby: "ontology-admin-tab" }}
diff --git a/app/views/login/index.html.haml b/app/views/login/index.html.haml
index fccc1d0d7..16d6b495a 100644
--- a/app/views/login/index.html.haml
+++ b/app/views/login/index.html.haml
@@ -9,7 +9,7 @@
.d-flex.justify-content-center
.login-form
%p.login-input-title Username or Email
- = text_field 'user', 'username', class: "login-input email-input", placeholder: "Enter your password"
+ = text_field 'user', 'username', class: "login-input email-input", placeholder: "Enter your email"
%p.login-input-title Password
= password_field 'user','password', :autocomplete => "off", class: "login-input password-input", placeholder: "Enter your password"
%a.login-forgot-password{:href => "/lost_pass"}
diff --git a/app/views/shared/svgs/_copy_icon.haml b/app/views/shared/svgs/_copy_icon.haml
new file mode 100644
index 000000000..3c7148c93
--- /dev/null
+++ b/app/views/shared/svgs/_copy_icon.haml
@@ -0,0 +1,2 @@
+%svg{fill: "none", height: "27", viewbox: "0 0 23 27", width: "23", xmlns: "http://www.w3.org/2000/svg"}
+ %path{d: "M14.0245 26.4965H4.14008C1.85719 26.4965 0 24.6393 0 22.3564V8.33191C0 6.04902 1.85719 4.19183 4.14008 4.19183H14.0245C16.3074 4.19183 18.1646 6.04902 18.1646 8.33191V22.3564C18.1646 24.6393 16.3074 26.4965 14.0245 26.4965ZM4.14008 6.26187C2.99871 6.26187 2.07004 7.19055 2.07004 8.33191V22.3564C2.07004 23.4978 2.99871 24.4265 4.14008 24.4265H14.0245C15.1659 24.4265 16.0946 23.4978 16.0946 22.3564V8.33191C16.0946 7.19055 15.1659 6.26187 14.0245 6.26187H4.14008ZM22.3047 19.7689V4.14008C22.3047 1.85719 20.4475 0 18.1646 0H6.67588C6.10419 0 5.64086 0.463327 5.64086 1.03502C5.64086 1.60671 6.10419 2.07004 6.67588 2.07004H18.1646C19.306 2.07004 20.2346 2.99871 20.2346 4.14008V19.7689C20.2346 20.3406 20.698 20.8039 21.2697 20.8039C21.8414 20.8039 22.3047 20.3406 22.3047 19.7689Z", fill: "#43D112"}
\ No newline at end of file
diff --git a/app/views/shared/svgs/_edit_icon.haml b/app/views/shared/svgs/_edit_icon.haml
new file mode 100644
index 000000000..f4ab54911
--- /dev/null
+++ b/app/views/shared/svgs/_edit_icon.haml
@@ -0,0 +1,3 @@
+%svg{fill: "none", height: "18", viewbox: "0 0 18 18", width: "18", xmlns: "http://www.w3.org/2000/svg"}
+ %path{d: "M11.116 3.00525L1.21212 12.9098C1.16229 12.9598 1.12632 13.0229 1.10918 13.0907L0.0114342 17.4969C-0.0214026 17.6295 0.0175733 17.7705 0.11437 17.8673C0.187611 17.9406 0.287406 17.9811 0.389486 17.9811C0.420752 17.9811 0.452733 17.9773 0.483856 17.9694L4.88999 16.8715C4.95866 16.8544 5.02105 16.8186 5.07087 16.7687L14.9756 6.86486L11.116 3.00525Z", fill: "#31B404"}
+ %path{d: "M17.4292 1.65482L16.3267 0.552355C15.5899 -0.184475 14.3057 -0.183761 13.5697 0.552355L12.2192 1.9028L16.0787 5.76227L17.4292 4.41182C17.7972 4.04391 17.9999 3.55421 17.9999 3.03339C17.9999 2.51257 17.7972 2.02287 17.4292 1.65482Z", fill: "#31B404"}
\ No newline at end of file
diff --git a/app/views/shared/svgs/_external_link_icon.haml b/app/views/shared/svgs/_external_link_icon.haml
new file mode 100644
index 000000000..28d83026a
--- /dev/null
+++ b/app/views/shared/svgs/_external_link_icon.haml
@@ -0,0 +1,2 @@
+%svg{fill: "none", height: "12", viewbox: "0 0 12 12", width: "12", xmlns: "http://www.w3.org/2000/svg"}
+ %path{d: "M8.66665 12H1.99999C1.46573 12 0.963502 11.7919 0.585767 11.4142C0.208033 11.0364 0 10.5342 0 9.99999V3.33333C0 2.7991 0.208057 2.29687 0.585791 1.91913C0.963525 1.5414 1.46576 1.33334 2.00001 1.33334H4.66667C5.03488 1.33334 5.33334 1.6318 5.33334 2.00001C5.33334 2.36822 5.03488 2.66668 4.66667 2.66668H1.99999C1.8219 2.66668 1.65451 2.73603 1.52861 2.86193C1.40272 2.98783 1.33334 3.15524 1.33334 3.33333V9.99999C1.33334 10.1781 1.40269 10.3455 1.52861 10.4714C1.65451 10.5973 1.8219 10.6667 1.99999 10.6667H8.66662C8.84471 10.6667 9.0121 10.5973 9.13802 10.4714C9.26392 10.3455 9.33327 10.1781 9.33327 9.99996V7.33333C9.33327 6.96512 9.63175 6.66668 9.99996 6.66668C10.3682 6.66668 10.6667 6.96514 10.6667 7.33333V9.99999C10.6667 10.5342 10.4586 11.0364 10.0808 11.4142C9.70309 11.7919 9.20083 12 8.66665 12ZM4.66667 7.99998C4.49604 7.99998 4.32543 7.93491 4.19527 7.80473C3.93493 7.54439 3.93493 7.12225 4.19527 6.86191L9.72381 1.33334H7.33333C6.96512 1.33334 6.66668 1.03488 6.66668 0.666671C6.66668 0.298461 6.96512 0 7.33333 0H11.3333C11.4255 0 11.5133 0.0187237 11.5932 0.0525614C11.6678 0.0840936 11.7378 0.129785 11.799 0.189659L11.7991 0.189705C11.7995 0.190148 11.8 0.190567 11.8004 0.19101C11.8005 0.191126 11.8007 0.191266 11.8008 0.191382C11.8011 0.191708 11.8015 0.192058 11.8018 0.192407C11.802 0.19264 11.8022 0.192849 11.8025 0.193082C11.8027 0.193338 11.803 0.193618 11.8032 0.193827C11.8037 0.194293 11.8042 0.194782 11.8047 0.195271C11.8051 0.195737 11.8056 0.196249 11.8061 0.196715C11.8064 0.196948 11.8066 0.197251 11.8068 0.19746C11.8071 0.197693 11.8073 0.197903 11.8075 0.198136C11.8079 0.198485 11.8082 0.198811 11.8085 0.199184C11.8086 0.199277 11.8088 0.19944 11.8089 0.199556C11.8093 0.199999 11.8098 0.200441 11.8102 0.200884L11.8102 0.20093C11.8701 0.262225 11.9158 0.332229 11.9473 0.406751C11.9812 0.48663 11.9999 0.574426 11.9999 0.666647V4.66665C11.9999 5.03486 11.7014 5.33332 11.3332 5.33332C10.965 5.33332 10.6666 5.03486 10.6666 4.66665V2.27616L5.13795 7.80475C5.00789 7.93493 4.83728 7.99998 4.66667 7.99998Z", fill: "#31B404"}
\ No newline at end of file
diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml
index cd3f31a33..da8327ff0 100644
--- a/app/views/users/edit.html.haml
+++ b/app/views/users/edit.html.haml
@@ -1,32 +1,8 @@
-:css
- .required {
- color: black;
- }
- table.form {
- width: auto;
- }
- table.form td {
- width: 500px;
- }
:javascript
/* refer to input fields by name for rules */
/* refer to input fields by id for equalTo */
jQuery(document).ready(function() {
- jQuery("#user_info").validate({
- rules: {
- "user[email]": {
- required: true,
- email: true,
- },
- "user[password]": "required",
- "user[password_confirmation]": {
- required: true,
- equalTo: "#user_password",
- }
- }
- })
-
jQuery('#user_info').on('submit', function (event) {
event.preventDefault()
let admin_checkbox = jQuery('input[id=user_admin]')
@@ -83,63 +59,74 @@
});
}
})
-
-
-
-%div{:style => "padding: 1em;"}
- = form_for(:user, :url => user_path(@user.username), :html => { :id => "user_info", :method => :put }) do |f|
- - unless @errors.nil?
- .enable-lists{:style => "color: red; padding: 1em;"}
- Errors creating your account:
- %ul
- - for error in @errors
- %li= error
- %table.form
+= form_for(:user, :url => user_path(@user.username), :html => { :id => "user_info", :method => :put }) do |f|
+ - unless @errors.nil?
+ .enable-lists{:style => "color: red; padding: 1em;"}
+ Errors creating your account:
+ %ul
+ - for error in @errors
+ %li= error
+ .d-flex.justify-content-center
+ .register-form
+ .d-flex.justify-content-between
+ %a{:href => "javascript:javascript:history.go(-1)"}
+ %img.lost-password-arrowback{:src => "#{asset_path("arrow-back.svg")}"}
+ .register-title-container
+ %h2.register-title
+ Edit personal information
+ %hr#register-title-line/
+ %div
- if @user.validate_password.nil?
- %tr
- %th
- First Name
- %td.top= text_field :user, :firstName, value: @user.firstName
- %tr
- %th
- Last Name
- %td= text_field :user, :lastName, value: @user.lastName
- %tr
- %th
- Email Address *
- %td
- = text_field :user, :email, value: @user.email
+ .register-double-input
+ .register-first-input
+ %p.register-input-title
+ First name
+ %font{:color => "red"} *
+ = text_field :user, :firstName, value: @user.firstName, class: "register-input-short"
+ %div
+ %p.register-input-title
+ Last name
+ %font{:color => "red"} *
+ = text_field :user, :lastName, value: @user.lastName, class: "register-input-short"
+ %p.register-input-title
+ Username
+ %font{:color => "red"} *
+ = text_field :user, :username, value: @user.username, class: "register-input-long"
+ %p.register-input-title
+ Email
+ %font{:color => "red"} *
+ = text_field :user, :email, value: @user.email, class: "register-input-long"
+ %p.register-input-title
+ ORCID ID
+ %font.register-optional (optional)
+ %img.register-input-icon{:src => "#{asset_path("orcid.svg")}"}/
+ = text_field :user, :orcidId, value: @user.orcidId, class: "register-input-long register-input-with-icon"
+ %p.register-input-title
+ Github ID
+ %font.register-optional (optional)
+ %img.register-input-icon{:src => "#{asset_path("github-icon.svg")}"}/
+ = text_field :user, :githubId, value: @user.githubId, class: "register-input-long register-input-with-icon no-margin"
- if session[:user].admin?
- %tr
- %th
- Grant admin privileges
- %td
- = check_box :user, :admin?, { class: (@user.admin? ? 'admin' : '') }
- \
- = hidden_field :user, :username, value: @user.username
+ .d-flex{:style => "margin-top: 10px;"}
+ = check_box :user, :admin?, { class: (@user.admin? ? 'admin' : '') , id: "user_register_mail_list" }
+ %p#register-check-text Grant admin privileges
- else
= hidden_field :user, :username, value: @user.username
= hidden_field :user, :firstName, value: @user.firstName
= hidden_field :user, :lastName, value: @user.lastName
= hidden_field :user, :email, value: @user.email
- %tr
- %th
- Password: *
- %td.top
- = password_field :user, :password
-
- %tr
- %th
- Re-enter Password: *
- %td
- = password_field :user, :password_confirmation
-
+ %p.register-input-title
+ New password
+ %font{:color => "red"} *
+ = password_field :user, :password, class: "register-input-long"
- %tr
- %td{:align => "left", :colspan => "2"}
- = submit_tag "Update", :class=>"greenbtn btn btn-outline-secondary btn-sm "
- \
- - unless params[:password].eql?("true")
- = link_to "Change Password", edit_user_path(@user.username, password: true)
- -# use @user.username unstead of sessions
- %br/
+ %p.register-input-title
+ Confirm password
+ %font{:color => "red"} *
+ = password_field :user, :password_confirmation, class: "register-input-long"
+ %br
+ %input.register-button{:type => "submit", :value => "Save", :name => "Update"}/
+ - unless params[:password].eql?("true")
+ .change-password
+ %a{:href => edit_user_path(@user.username, password: true)}
+ Change password
\ No newline at end of file
diff --git a/app/views/users/index.html.haml b/app/views/users/index.html.haml
deleted file mode 100644
index 816b98d7e..000000000
--- a/app/views/users/index.html.haml
+++ /dev/null
@@ -1,18 +0,0 @@
-%table.zebra{:cellpadding => "0", :cellspacing => "0"}
- %tr
- %th First Name
- %th Last Name
- %th Username
- %th Email
- %th Roles
- %th Id
- %th Actions
- - for user in @users
- %tr{:class => cycle("odd", "even")}
- %td= user.firstName
- %td= user.lastName
- %td= user.username
- %td= user.email
- %td= user.role.join(" | ")
- %td= user.id
- %td View | Edit | Delete
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index 533b5a6bc..ecd788660 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -1,135 +1,139 @@
-- @title = "Account Information"
-
-%div{style: "padding: 1em;"}
- %table.form
- %tr
- %th.top First Name:
- %td.top= @user.firstName
- %tr
- %th Last Name:
- %td= @user.lastName
- %tr
- %th Email Address:
- %td= @user.email
- %tr
- %th Account Name:
- %td= @user.username
- %tr
- %td{colspan: "2", style: "text-align: right;"}
- = link_to "Edit Information", edit_user_path(url_encode(@user.username))
- %br/
- %span{style: "font-size: large; font-weight: bold;"}
- API Key
- %span{style: "font-weight: normal; padding-left: 1em; font-size: x-small; color: gray;"} Your API Key can be used to access the NCBO API (REST) Services
- %p{style: "padding: .5em 0 0 1em;"}
- = session[:user].apikey
- %br/
-
-
- - unless @user.subscription.nil? || @user.subscription.empty?
- %h2{style: "font-size: large;"} Subscriptions
- %table
- - @user.subscription.each do |subscription|
- - ont_id = subscription[:ontology]
- - ont = ont_id.nil? ? nil: subscription[:ontology].split('/').last
- - type = subscription[:notification_type].nil? ? nil : subscription[:notification_type].downcase
- %tr{style: "padding: 5px;"}
- %td{style: "padding: 5px;"}
- %a{href: "/ontologies/#{ont}"}= ont
- %td{style: "padding: 5px;"}
- - if type == "notes"
- %a{href: "/ontologies/#{ont}?p=notes"}= type
+.account-page-center
+ .account-page-container
+ %h3.account-page-title My account
+ %hr#account-page-title-line/
+ .account-page-sub-container
+ .account-page-first-row
+ .account-page-card
+ .account-page-personal-informations-title-bar
+ %h4.account-page-card-title Personal information
+ %a.account-page-rounded-button{:href => edit_user_path(url_encode(@user.username))}
+ = render partial: "shared/svgs/edit_icon"
+ .account-page-info-column
+ %p.title First name:
+ %p.info
+ = @user.firstName
+ .account-page-info-column
+ %p.title Last name:
+ %p.info
+ = @user.lastName
+ .account-page-info-column
+ %p.title Email address:
+ %p.info
+ = @user.email
+ .account-page-info-column
+ %p.title Username:
+ %p.info
+ = @user.username
+ .account-page-info-column
+ %p.title ORCID ID:
+ %p.info
+ =@user.orcidId
+ .account-page-info-column
+ %p.title Github ID:
+ %p.info
+ =@user.githubId
+ .account-page-card
+ .account-page-card-container
+ .account-page-card-sub-container
+ %h4.account-page-card-title Mailing list subscription
+ %p.account-page-card-desc AgroPortal announcements email list
+ - subscribed = false
+ - if subscribed
+ %a.account-page-subscribe-button{:href =>"mailto:#{$ANNOUNCE_SERVICE_HOST}?Subject=unsubscribe%20#{$ANNOUNCE_LIST}"}
+ Unsubscribe
- else
- = type
- %td{style: "padding: 5px;"}
- .subscribe_to_ontology{style: "float: left;"}
- = subscribe_button(ont_id)
- %br/
-
- - unless @user_projects.nil? || @user_projects.empty?
- %h2#user_projects{style: "font-size: large;"}
- Projects Created
- %ul{style: "padding-left: 1em;"}
- - @user_projects.each do |project|
- %li
- %a{href: "/projects/#{project.acronym}"}= project.name
- %br/
-
- - unless @admin_ontologies.nil? || @admin_ontologies.empty?
- %h2#admin_ontologies{style: "font-size: large;"}
- Submitted Ontologies
- %ul{style: "padding-left: 1em;"}
- - @admin_ontologies.each do |ont|
- %li
- %a{href: "/ontologies/#{ont.acronym}"}= ont.name
- %br
-
- :javascript
- jQuery(document).ready(function(){
- jQuery("#edit_custom_ontologies").click(editCustomOntologies);
- });
-
-
- function editCustomOntologies() {
- jQuery("#custom_ontologies_picker").css("left", "").css("position", "");
- jQuery("#custom_ontologies").hide();
- }
-
- %h2#custom_ontology_set{style: "font-size: large;"}
- Custom Ontology Set
- #custom_ontologies.enable-lists
- - if at_slice?
- %p{style: "padding-left: 7px; font-size: 10pt; margin: -3px 0 7px;"}
- Please
- %a{href: "#{$UI_URL}/account"} visit the main site
- to modify your Custom Ontology Set.
- - else
- %p{style: "padding-left: 7px; font-size: 9pt; color: gray; margin: -3px 0 7px;"}
- %b
- Customize your #{$SITE} display:
- Pick the ontologies that you want to see and #{$SITE} will hide all other ontologies.
- %b
- Note:
- this feature works only when you are logged in.
- %p
- %span{style: "font-weight: normal; font-size: 9pt; padding-left: 7px;"}
- %a#edit_custom_ontologies{href: "javascript:void(0);"} select ontologies
- - if @user_ontologies && !@user_ontologies.empty?
- %ul
- - @user_ontologies.each do |ont|
- - ont = LinkedData::Client::Models::Ontology.get(ont)
- %li
- #{ont.name} (#{ont.acronym})
- - else
- %p{style: "padding-left: 7px;"} You haven't picked any ontologies yet
-
- %div
- %h2{style:"margin-top:18px; font-size: large;"} Mailing list service
-
- %div{style:"margin-top:12px"}
- %div
- %button.btn.btn-primary{id: "subscribe"}
+ %a.account-page-subscribe-button{:href => "mailto:#{$ANNOUNCE_SERVICE_HOST}?Subject=subscribe%20#{$ANNOUNCE_LIST}%20#{@user.firstName}%20#{@user.lastName}"}
Subscribe
- %span to the #{$ANNOUNCE_LIST} user mailing list
- %div.mt-1
- %button.btn.btn-primary{id: "unsubscribe"}
- Unsubscribe
- %span from the #{$ANNOUNCE_LIST} user mailing list
-
-
- :javascript
- document.getElementById('subscribe').addEventListener('click', function() {
- window.location.href = "/users/subscribe/" + "#{@user.username}"
-
- });
-
- document.getElementById('unsubscribe').addEventListener('click', function() {
- window.location.href = "/users/un-subscribe/" + "#{@user.email}"
- });
-
- #custom_ontologies_picker{style: "left: -9999px; position: absolute;"}
- = form_tag custom_ontologies_path(url_encode(@user.username)) do
- - selected = @user.customOntology.map {|o| LinkedData::Client::Models::Ontology.get(o).acronym}
- - locals = { custom_ontologies: @all_ontologies, selected_ontologies: selected, sel_text: "Select Custom Ontologies" }
- = render partial: "shared/ontology_picker", locals: locals
- = submit_tag "Save Custom Ontologies", class: "link_button"
+ .account-page-card
+ .account-page-card-container
+ .account-page-card-sub-container
+ %h4.account-page-card-title API Key
+ %p.account-page-card-desc Your API Key can be used to access the NCBO API (REST) Services
+ %p.apikey
+ = session[:user].apikey
+ %a{:href => "javascript:navigator.clipboard.writeText('"+session[:user].apikey+"');"}
+ = render partial: "shared/svgs/copy_icon"
+ .account-page-api-documentation-link
+ %a{href: "https://data.bioportal.lirmm.fr/documentation", target: "_blank"}
+ API documentation
+ = render partial: "shared/svgs/external_link_icon"
+ .account-page-card
+ %h4.account-page-card-title
+ Custom Ontology Set
+ #custom_ontologies.enable-lists
+ - if at_slice?
+ %p{style: "padding-left: 7px; font-size: 10pt; margin: -3px 0 7px;"}
+ Please
+ %a{href: "#{$UI_URL}/account"} visit the main site
+ to modify your Custom Ontology Set.
+ - else
+ %p.account-page-card-desc
+ Customize your AgroPortal display: Pick the ontologies that you want to see on AgroPortal will hide all other ontologies.
+ %p
+ %span{style: "font-weight: normal; font-size: 9pt; padding-left: 7px;"}
+ %a#edit_custom_ontologies{href: "javascript:void(0);"} select ontologies
+ - if @user_ontologies && !@user_ontologies.empty?
+ %ul
+ - @user_ontologies.each do |ont|
+ - ont = LinkedData::Client::Models::Ontology.get(ont)
+ %li
+ #{ont.name} (#{ont.acronym})
+ - else
+ %p{style: "padding-left: 7px;"} You haven't picked any ontologies yet
+ %p.account-page-card-desc Note: This feature works only when you are logged in.
+ #custom_ontologies_picker{style: "left: -9999px; position: absolute;"}
+ = form_tag custom_ontologies_path(url_encode(@user.username)) do
+ - selected = @user.customOntology.map {|o| LinkedData::Client::Models::Ontology.get(o).acronym}
+ - locals = { custom_ontologies: @all_ontologies, selected_ontologies: selected, sel_text: "Select Custom Ontologies" }
+ = render partial: "shared/ontology_picker", locals: locals
+ = submit_tag "Save Custom Ontologies", class: "link_button"
+ .account-page-second-row
+ - unless @user.subscription.nil? || @user.subscription.empty?
+ .account-page-card
+ %h4.account-page-card-title Subscriptions
+ - @user.subscription.each do |subscription|
+ - ont_id = subscription[:ontology]
+ - ont = (!subscription[:ontology].nil? ? subscription[:ontology].split('/').last: nil) # ensure we get the acronym
+ - type = (!subscription[:notification_type].nil? ? subscription[:notification_type].downcase : nil)
+ .account-page-subscription
+ %a{:href => "/ontologies/#{ont}?p=notes"}= ont
+ %div
+ - if type == "notes"
+ %a.notes{:href => "/ontologies/#{ont}?p=notes"} Notes
+ - else
+ = type
+ = subscribe_button(ont_id)
+ - no_ontologies = true
+ - unless @admin_ontologies.nil? || @admin_ontologies.empty?
+ - no_ontologies = false
+ .account-page-card
+ %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
+ - unless @user_projects.nil? || @user_projects.empty?
+ - no_ontologies = false
+ .account-page-card
+ %h4.account-page-card-title Projects Created
+ .account-page-small-cards-container
+ - @user_projects.each do |project|
+ .account-page-submitted-ontology
+ %a{href: "/projects/#{project.acronym}"}= project.name
+ - if no_ontologies
+ .account-page-card
+ .account-page-no-ontology
+ %img{:src => "#{asset_path("empty-box.svg")}"}/
+ %p You didn't upload any ontology yet
+ %a.account-page-upload-ontology-button{href: "/ontologies/new"} Upload ontology
+:javascript
+ jQuery(document).ready(function(){
+ jQuery("#edit_custom_ontologies").click(editCustomOntologies);
+ });
+
+
+ function editCustomOntologies() {
+ jQuery("#custom_ontologies_picker").css("left", "").css("position", "");
+ jQuery("#custom_ontologies").hide();
+ }