diff --git a/app/models/ability.rb b/app/models/ability.rb index c926276058f5f30fa4903246573c466c638918b4..0873c6403d2908751df0a614f9c3049914489062 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -6,10 +6,17 @@ class Ability def initialize(user) @user = user ||= User.new # guest user (not logged in) send @user.role.to_sym + common_abilities end protected + def common_abilities + can :read, Research::Hal + can :read, Research::Hal::Publication + can :read, Research::Hal::Author + end + def visitor end diff --git a/app/models/concerns/with_university.rb b/app/models/concerns/with_university.rb index d0433b792e1c729e9ff536588c720bd4b22f3a16..bf2fc0ee577c1c310c3b538ec2da5a38657ac37d 100644 --- a/app/models/concerns/with_university.rb +++ b/app/models/concerns/with_university.rb @@ -4,5 +4,7 @@ module WithUniversity included do belongs_to :university validates_presence_of :university + + scope :in_university, -> (university) { where(university: university) } end end diff --git a/app/models/research.rb b/app/models/research.rb index ed1172dce7c2d99f16eaa0bde1125704123ad6e7..633d16d2a16491cdedca12166d8213be2f894dd7 100644 --- a/app/models/research.rb +++ b/app/models/research.rb @@ -12,7 +12,7 @@ module Research [Research::Laboratory, :admin_research_laboratories_path], [Research::Thesis, :admin_research_theses_path], [Research::Journal, :admin_research_journals_path], - [Research::Hal::Publication, :admin_research_hal_publications_path], + [Research::Hal, :admin_research_hal_root_path], ] end end diff --git a/app/models/research/hal/author.rb b/app/models/research/hal/author.rb index ed35b86de3452edc77b0d1b67baa8e8943525745..726c98e5450b49ece0fa9ab86cfecbc5f5f0049e 100644 --- a/app/models/research/hal/author.rb +++ b/app/models/research/hal/author.rb @@ -63,17 +63,23 @@ class Research::Hal::Author < ApplicationRecord end def import_research_hal_publications! - # Do not use the API if no researcher is concerned + publications.clear + # Do not overuse the API if no researcher is concerned return if researchers.none? - Research::Hal::Publication.import_from_hal_for_author(self) + Research::Hal::Publication.import_from_hal_for_author(self).each do |publication| + publications << publication + end + publications end def connect_researcher(researcher) researchers << researcher + researcher.import_research_hal_publications! end def disconnect_researcher(researcher) researchers.delete researcher + researcher.import_research_hal_publications! end def to_s diff --git a/app/models/research/hal/publication.rb b/app/models/research/hal/publication.rb index 1fbbbbb250611e95bde0d3fb8c5363bd62be15a2..75d03b57a5ab888c0e34e7a871a9d206f9ab2933 100644 --- a/app/models/research/hal/publication.rb +++ b/app/models/research/hal/publication.rb @@ -22,15 +22,17 @@ class Research::Hal::Publication < ApplicationRecord include WithGit include WithSlug + + DOI_PREFIX = 'http://dx.doi.org/'.freeze has_and_belongs_to_many :researchers, class_name: 'University::Person', foreign_key: 'university_person_id', association_foreign_key: 'research_hal_publication_id' - DOI_PREFIX = 'http://dx.doi.org/'.freeze - - before_destroy { research_people.clear } + has_and_belongs_to_many :authors, + foreign_key: 'research_hal_author_id', + association_foreign_key: 'research_hal_publication_id' validates_presence_of :docid @@ -47,11 +49,13 @@ class Research::Hal::Publication < ApplicationRecord 'linkExtUrl_s', # '*', ] - response = HalOpenscience::Document.search "authIdForm_i:#{author.form_identifier}", fields: fields, limit: 1000 + publications = [] + response = HalOpenscience::Document.search "authIdFormPerson_s:#{author.docid}", fields: fields, limit: 1000 response.results.each do |doc| - publication = Research::Hal::Publication.create_from doc - author.publications << publication unless publication.in?(author.publications) + publication = create_from doc + publications << publication end + publications end def self.create_from(doc) @@ -77,7 +81,7 @@ class Research::Hal::Publication < ApplicationRecord end def best_url - doi_url || url || hal_url + url || doi_url || hal_url end def to_s diff --git a/app/models/university/person.rb b/app/models/university/person.rb index 6a84914ad3c419103ca7ee7817b8f3548ff9e03f..59a9e253f76cc059df0e179dbfeccaf13e0dff9b 100644 --- a/app/models/university/person.rb +++ b/app/models/university/person.rb @@ -2,44 +2,41 @@ # # Table name: university_people # -# id :uuid not null, primary key -# address :string -# biography :text -# birthdate :date -# city :string -# country :string -# email :string -# first_name :string -# gender :integer -# habilitation :boolean default(FALSE) -# hal_doc_identifier :string -# hal_form_identifier :string -# hal_person_identifier :string -# is_administration :boolean -# is_alumnus :boolean default(FALSE) -# is_author :boolean -# is_researcher :boolean -# is_teacher :boolean -# last_name :string -# linkedin :string -# mastodon :string -# meta_description :text -# name :string -# phone_mobile :string -# phone_personal :string -# phone_professional :string -# slug :string -# summary :text -# tenure :boolean default(FALSE) -# twitter :string -# url :string -# zipcode :string -# created_at :datetime not null -# updated_at :datetime not null -# language_id :uuid not null, indexed -# original_id :uuid indexed -# university_id :uuid not null, indexed -# user_id :uuid indexed +# id :uuid not null, primary key +# address :string +# biography :text +# birthdate :date +# city :string +# country :string +# email :string +# first_name :string +# gender :integer +# habilitation :boolean default(FALSE) +# is_administration :boolean +# is_alumnus :boolean default(FALSE) +# is_author :boolean +# is_researcher :boolean +# is_teacher :boolean +# last_name :string +# linkedin :string +# mastodon :string +# meta_description :text +# name :string +# phone_mobile :string +# phone_personal :string +# phone_professional :string +# slug :string +# summary :text +# tenure :boolean default(FALSE) +# twitter :string +# url :string +# zipcode :string +# created_at :datetime not null +# updated_at :datetime not null +# language_id :uuid not null, indexed +# original_id :uuid indexed +# university_id :uuid not null, indexed +# user_id :uuid indexed # # Indexes # diff --git a/app/models/university/person/administrator.rb b/app/models/university/person/administrator.rb index c0978fc99478aea49b40d70e86cd82845c2c2dcc..0e2fcd0e1efbd1400755ce5eee1d88dbf43451c7 100644 --- a/app/models/university/person/administrator.rb +++ b/app/models/university/person/administrator.rb @@ -2,44 +2,41 @@ # # Table name: university_people # -# id :uuid not null, primary key -# address :string -# biography :text -# birthdate :date -# city :string -# country :string -# email :string -# first_name :string -# gender :integer -# habilitation :boolean default(FALSE) -# hal_doc_identifier :string -# hal_form_identifier :string -# hal_person_identifier :string -# is_administration :boolean -# is_alumnus :boolean default(FALSE) -# is_author :boolean -# is_researcher :boolean -# is_teacher :boolean -# last_name :string -# linkedin :string -# mastodon :string -# meta_description :text -# name :string -# phone_mobile :string -# phone_personal :string -# phone_professional :string -# slug :string -# summary :text -# tenure :boolean default(FALSE) -# twitter :string -# url :string -# zipcode :string -# created_at :datetime not null -# updated_at :datetime not null -# language_id :uuid not null, indexed -# original_id :uuid indexed -# university_id :uuid not null, indexed -# user_id :uuid indexed +# id :uuid not null, primary key +# address :string +# biography :text +# birthdate :date +# city :string +# country :string +# email :string +# first_name :string +# gender :integer +# habilitation :boolean default(FALSE) +# is_administration :boolean +# is_alumnus :boolean default(FALSE) +# is_author :boolean +# is_researcher :boolean +# is_teacher :boolean +# last_name :string +# linkedin :string +# mastodon :string +# meta_description :text +# name :string +# phone_mobile :string +# phone_personal :string +# phone_professional :string +# slug :string +# summary :text +# tenure :boolean default(FALSE) +# twitter :string +# url :string +# zipcode :string +# created_at :datetime not null +# updated_at :datetime not null +# language_id :uuid not null, indexed +# original_id :uuid indexed +# university_id :uuid not null, indexed +# user_id :uuid indexed # # Indexes # diff --git a/app/models/university/person/alumnus.rb b/app/models/university/person/alumnus.rb index 4bd99ef4673019367c3dca60ca436edc512faa85..9d0679e9203a30413d4d9e7ebfbe9d0ac818494d 100644 --- a/app/models/university/person/alumnus.rb +++ b/app/models/university/person/alumnus.rb @@ -2,44 +2,41 @@ # # Table name: university_people # -# id :uuid not null, primary key -# address :string -# biography :text -# birthdate :date -# city :string -# country :string -# email :string -# first_name :string -# gender :integer -# habilitation :boolean default(FALSE) -# hal_doc_identifier :string -# hal_form_identifier :string -# hal_person_identifier :string -# is_administration :boolean -# is_alumnus :boolean default(FALSE) -# is_author :boolean -# is_researcher :boolean -# is_teacher :boolean -# last_name :string -# linkedin :string -# mastodon :string -# meta_description :text -# name :string -# phone_mobile :string -# phone_personal :string -# phone_professional :string -# slug :string -# summary :text -# tenure :boolean default(FALSE) -# twitter :string -# url :string -# zipcode :string -# created_at :datetime not null -# updated_at :datetime not null -# language_id :uuid not null, indexed -# original_id :uuid indexed -# university_id :uuid not null, indexed -# user_id :uuid indexed +# id :uuid not null, primary key +# address :string +# biography :text +# birthdate :date +# city :string +# country :string +# email :string +# first_name :string +# gender :integer +# habilitation :boolean default(FALSE) +# is_administration :boolean +# is_alumnus :boolean default(FALSE) +# is_author :boolean +# is_researcher :boolean +# is_teacher :boolean +# last_name :string +# linkedin :string +# mastodon :string +# meta_description :text +# name :string +# phone_mobile :string +# phone_personal :string +# phone_professional :string +# slug :string +# summary :text +# tenure :boolean default(FALSE) +# twitter :string +# url :string +# zipcode :string +# created_at :datetime not null +# updated_at :datetime not null +# language_id :uuid not null, indexed +# original_id :uuid indexed +# university_id :uuid not null, indexed +# user_id :uuid indexed # # Indexes # diff --git a/app/models/university/person/author.rb b/app/models/university/person/author.rb index 2abf6521682dbc795a30ef64c16fecc3f92b27f1..a19bc5d64fb2f6f6cadc4f7f19e8f6c10be85611 100644 --- a/app/models/university/person/author.rb +++ b/app/models/university/person/author.rb @@ -2,44 +2,41 @@ # # Table name: university_people # -# id :uuid not null, primary key -# address :string -# biography :text -# birthdate :date -# city :string -# country :string -# email :string -# first_name :string -# gender :integer -# habilitation :boolean default(FALSE) -# hal_doc_identifier :string -# hal_form_identifier :string -# hal_person_identifier :string -# is_administration :boolean -# is_alumnus :boolean default(FALSE) -# is_author :boolean -# is_researcher :boolean -# is_teacher :boolean -# last_name :string -# linkedin :string -# mastodon :string -# meta_description :text -# name :string -# phone_mobile :string -# phone_personal :string -# phone_professional :string -# slug :string -# summary :text -# tenure :boolean default(FALSE) -# twitter :string -# url :string -# zipcode :string -# created_at :datetime not null -# updated_at :datetime not null -# language_id :uuid not null, indexed -# original_id :uuid indexed -# university_id :uuid not null, indexed -# user_id :uuid indexed +# id :uuid not null, primary key +# address :string +# biography :text +# birthdate :date +# city :string +# country :string +# email :string +# first_name :string +# gender :integer +# habilitation :boolean default(FALSE) +# is_administration :boolean +# is_alumnus :boolean default(FALSE) +# is_author :boolean +# is_researcher :boolean +# is_teacher :boolean +# last_name :string +# linkedin :string +# mastodon :string +# meta_description :text +# name :string +# phone_mobile :string +# phone_personal :string +# phone_professional :string +# slug :string +# summary :text +# tenure :boolean default(FALSE) +# twitter :string +# url :string +# zipcode :string +# created_at :datetime not null +# updated_at :datetime not null +# language_id :uuid not null, indexed +# original_id :uuid indexed +# university_id :uuid not null, indexed +# user_id :uuid indexed # # Indexes # diff --git a/app/models/university/person/researcher.rb b/app/models/university/person/researcher.rb index ede0bf421f31f36a451762c44c1fcf5433759516..70847b670240e2ba561b80c85c23a265ad671cbe 100644 --- a/app/models/university/person/researcher.rb +++ b/app/models/university/person/researcher.rb @@ -2,44 +2,41 @@ # # Table name: university_people # -# id :uuid not null, primary key -# address :string -# biography :text -# birthdate :date -# city :string -# country :string -# email :string -# first_name :string -# gender :integer -# habilitation :boolean default(FALSE) -# hal_doc_identifier :string -# hal_form_identifier :string -# hal_person_identifier :string -# is_administration :boolean -# is_alumnus :boolean default(FALSE) -# is_author :boolean -# is_researcher :boolean -# is_teacher :boolean -# last_name :string -# linkedin :string -# mastodon :string -# meta_description :text -# name :string -# phone_mobile :string -# phone_personal :string -# phone_professional :string -# slug :string -# summary :text -# tenure :boolean default(FALSE) -# twitter :string -# url :string -# zipcode :string -# created_at :datetime not null -# updated_at :datetime not null -# language_id :uuid not null, indexed -# original_id :uuid indexed -# university_id :uuid not null, indexed -# user_id :uuid indexed +# id :uuid not null, primary key +# address :string +# biography :text +# birthdate :date +# city :string +# country :string +# email :string +# first_name :string +# gender :integer +# habilitation :boolean default(FALSE) +# is_administration :boolean +# is_alumnus :boolean default(FALSE) +# is_author :boolean +# is_researcher :boolean +# is_teacher :boolean +# last_name :string +# linkedin :string +# mastodon :string +# meta_description :text +# name :string +# phone_mobile :string +# phone_personal :string +# phone_professional :string +# slug :string +# summary :text +# tenure :boolean default(FALSE) +# twitter :string +# url :string +# zipcode :string +# created_at :datetime not null +# updated_at :datetime not null +# language_id :uuid not null, indexed +# original_id :uuid indexed +# university_id :uuid not null, indexed +# user_id :uuid indexed # # Indexes # diff --git a/app/models/university/person/teacher.rb b/app/models/university/person/teacher.rb index 515a4f47e697bd4c04a30b1f9a2aaae2abad1f46..48cf9b6ad66ed27815450df7384f834d2a3d19a8 100644 --- a/app/models/university/person/teacher.rb +++ b/app/models/university/person/teacher.rb @@ -2,44 +2,41 @@ # # Table name: university_people # -# id :uuid not null, primary key -# address :string -# biography :text -# birthdate :date -# city :string -# country :string -# email :string -# first_name :string -# gender :integer -# habilitation :boolean default(FALSE) -# hal_doc_identifier :string -# hal_form_identifier :string -# hal_person_identifier :string -# is_administration :boolean -# is_alumnus :boolean default(FALSE) -# is_author :boolean -# is_researcher :boolean -# is_teacher :boolean -# last_name :string -# linkedin :string -# mastodon :string -# meta_description :text -# name :string -# phone_mobile :string -# phone_personal :string -# phone_professional :string -# slug :string -# summary :text -# tenure :boolean default(FALSE) -# twitter :string -# url :string -# zipcode :string -# created_at :datetime not null -# updated_at :datetime not null -# language_id :uuid not null, indexed -# original_id :uuid indexed -# university_id :uuid not null, indexed -# user_id :uuid indexed +# id :uuid not null, primary key +# address :string +# biography :text +# birthdate :date +# city :string +# country :string +# email :string +# first_name :string +# gender :integer +# habilitation :boolean default(FALSE) +# is_administration :boolean +# is_alumnus :boolean default(FALSE) +# is_author :boolean +# is_researcher :boolean +# is_teacher :boolean +# last_name :string +# linkedin :string +# mastodon :string +# meta_description :text +# name :string +# phone_mobile :string +# phone_personal :string +# phone_professional :string +# slug :string +# summary :text +# tenure :boolean default(FALSE) +# twitter :string +# url :string +# zipcode :string +# created_at :datetime not null +# updated_at :datetime not null +# language_id :uuid not null, indexed +# original_id :uuid indexed +# university_id :uuid not null, indexed +# user_id :uuid indexed # # Indexes # diff --git a/app/models/university/person/with_research.rb b/app/models/university/person/with_research.rb index a2eb612027119deaf96ba10df9b6d5f18d8000d4..521441ff5ce9bd9246599d8494db00a6fc845d78 100644 --- a/app/models/university/person/with_research.rb +++ b/app/models/university/person/with_research.rb @@ -10,7 +10,7 @@ module University::Person::WithResearch has_and_belongs_to_many :research_hal_publications, class_name: 'Research::Hal::Publication', - foreign_key: 'research_publication_id', + foreign_key: 'research_hal_publication_id', association_foreign_key: 'university_person_id' alias :hal_publications :research_hal_publications alias :publications :research_hal_publications @@ -19,17 +19,11 @@ module University::Person::WithResearch end def import_research_hal_publications! + publications.clear hal_authors.each do |author| - author.import_research_hal_publications! - end - response = HalOpenscience::Document.search "authIdForm_i:#{hal_form_identifier}", - fields: ["*"], - limit: 1000 - response.results.each do |doc| - publication = Research::Hal::Publication.create_from doc - publications << publication unless publication.in?(publications) + # TODO manage same researcher in different universities + publications.concat author.import_research_hal_publications! end end - handle_asynchronously :import_research_hal_publications! end diff --git a/app/services/icon.rb b/app/services/icon.rb index 9d92105857bffc4bb4780d4d3896fcd89b0a8f84..debcd5881b509255b8fc91a4c6596110019b4f0d 100644 --- a/app/services/icon.rb +++ b/app/services/icon.rb @@ -33,6 +33,7 @@ class Icon UNIVERSITY_PERSON_RESEARCHER = RESEARCH_RESEARCHER RESEARCH_THESIS = RESEARCH_THESE RESEARCH_HAL_PUBLICATION = RESEARCH_PUBLICATION + RESEARCH_HAL = RESEARCH_PUBLICATION ADMINISTRATION_CAMPUS = 'fas fa-map-marker-alt' ADMINISTRATION_ADMISSIONS = 'fas fa-door-open' diff --git a/app/views/admin/dashboard/namespace.html.erb b/app/views/admin/dashboard/namespace.html.erb index 28069ead43796cfa701bd096beb96a36673ee555..9521b0e0988dab33369764028a44af76a8c76faa 100644 --- a/app/views/admin/dashboard/namespace.html.erb +++ b/app/views/admin/dashboard/namespace.html.erb @@ -15,6 +15,7 @@ description = class_name.human_attribute_name('description') # TODO description = t 'administration.qualiopi.description' if class_name == Administration::Qualiopi + description = t 'activerecord.attributes.research/hal.description' if class_name == Research::Hal %> <div class="col-lg-6 mt-5"> <%= osuny_panel title do %> diff --git a/app/views/admin/research/hal/authors/_list.html.erb b/app/views/admin/research/hal/authors/_list.html.erb index a510036420558c26a08124b1717efd76bb4fbfab..00855e7f1b521d28098dd078148f9a993da660d1 100644 --- a/app/views/admin/research/hal/authors/_list.html.erb +++ b/app/views/admin/research/hal/authors/_list.html.erb @@ -5,7 +5,6 @@ <th><%= Research::Hal::Author.human_attribute_name('full_name') %></th> <th><%= Research::Hal::Publication.human_attribute_name('docid') %></th> <th><%= Research::Hal::Publication.human_attribute_name('publications') %></th> - <th><%= Research::Hal::Publication.human_attribute_name('researchers') %></th> </tr> </thead> <tbody> @@ -14,7 +13,6 @@ <td><%= link_to author, [:admin, author] %></td> <td><%= author.docid %></td> <td><%= author.publications.count %></td> - <td><%= author.researchers.count %></td> </tr> <% end %> </tbody> diff --git a/app/views/admin/research/hal/authors/show.html.erb b/app/views/admin/research/hal/authors/show.html.erb index 364d41d5edae611a5b3191cdd289efe4c9cade51..f3b2e937108f883f95d4236f55b2bcb67443e024 100644 --- a/app/views/admin/research/hal/authors/show.html.erb +++ b/app/views/admin/research/hal/authors/show.html.erb @@ -1,5 +1,23 @@ <% content_for :title, @author %> +<div class="row"> + <div class="col-lg-8"> + <%= osuny_label Research::Hal::Author.human_attribute_name :docid %> + <p><%= @author.docid %></p> + </div> + <div class="col-lg-4"> + <%= osuny_panel University::Person::Researcher.model_name.human do %> + <% @author.researchers.in_university(current_university).each do |researcher| %> + <%= render 'admin/university/people/researchers/researcher', researcher: researcher %> + <% end %> + <% end %> + </div> +</div> + +<%= osuny_panel Research::Hal::Publication.model_name.human(count: 2), subtitle: @author.publications.count do %> + <%= render 'admin/research/hal/publications/list', publications: @author.publications.ordered %> +<% end %> + <% content_for :action_bar_left do %> <%= destroy_link @author %> <% end %> diff --git a/app/views/admin/research/hal/publications/_list.html.erb b/app/views/admin/research/hal/publications/_list.html.erb index 259490a5403921ccd9279cc12e274c3d322fea8a..62de27ec44b9d0e21a83de09d625017c3afeaaf1 100644 --- a/app/views/admin/research/hal/publications/_list.html.erb +++ b/app/views/admin/research/hal/publications/_list.html.erb @@ -3,8 +3,8 @@ <thead> <tr> <th><%= Research::Hal::Publication.human_attribute_name('title') %></th> - <th><%= Research::Hal::Publication.human_attribute_name('publication_date') %></th> - <th><%= University::Person::Researcher.model_name.human(count: 2) %></th> + <th width="150"><%= Research::Hal::Publication.human_attribute_name('publication_date') %></th> + <th width="200"><%= University::Person::Researcher.model_name.human(count: 2) %></th> </tr> </thead> <tbody> @@ -13,8 +13,7 @@ <td><%= link_to publication, admin_research_hal_publication_path(publication) %></td> <td><%= l publication.publication_date %></td> <td> - <% publication.researchers.each do |researcher| %> - <% next if researcher.university != current_university %> + <% publication.researchers.in_university(current_university).each do |researcher| %> <%= link_to_if researcher.university == current_university, researcher, admin_research_researcher_path(researcher) %> diff --git a/app/views/admin/research/hal/publications/show.html.erb b/app/views/admin/research/hal/publications/show.html.erb index bd3db6861925f1ffd2d2b9b8e163a28616b3e288..5c84a479d4022d96e45562ce5a8e1e5905371664 100644 --- a/app/views/admin/research/hal/publications/show.html.erb +++ b/app/views/admin/research/hal/publications/show.html.erb @@ -12,31 +12,36 @@ <%= osuny_label Research::Hal::Publication.human_attribute_name('publication_date') %> <p><%= l @publication.publication_date %></p> </div> - <% [:url, :hal_url, :doi_url].each do |key| %> - <% value = @publication.send key %> - <% next if value.blank? %> - <div class="col-lg-6"> - <%= osuny_label Research::Hal::Publication.human_attribute_name(key) %> - <p><%= link_to value, value, target: :_blank %></p> - </div> - <% end %> </div> </div> <div class="col-lg-4"> - <% @publication.researchers.each do |researcher| %> - <% next if researcher.university != current_university %> - <article class="mb-4 d-flex align-items-center position-relative"> - <div style="width: 80px"> - <%= kamifusen_tag researcher.best_picture, width: 80, class: 'img-circle' if researcher.best_picture.attached? %> - </div> - <div class="ms-3"> - <%= link_to researcher, admin_research_researcher_path(researcher), class: 'stretched-link' %> - </div> - </article> + <%= osuny_panel University::Person::Researcher.model_name.human(count: 2) do %> + <% @publication.researchers.in_university(current_university).each do |researcher| %> + <%= render 'admin/university/people/researchers/researcher', researcher: researcher %> + <% end %> + <% end %> + <%= osuny_panel Research::Hal::Author.model_name.human(count: 2) do %> + <ul class="list-unstyled"> + <% @publication.authors.each do |author| %> + <li> + <%= link_to [:admin, author] do %> + <%= author %> + (<%= author.docid %>) + <% end %> + </li> + <% end %> + </ul> <% end %> </div> </div> +<% [:url, :hal_url, :doi_url].each do |key| %> + <% value = @publication.send key %> + <% next if value.blank? %> + <%= osuny_label Research::Hal::Publication.human_attribute_name(key) %> + <p><%= link_to value, value, target: :_blank %></p> +<% end %> + <% content_for :action_bar_left do %> <% if current_user.server_admin? %> <%= link_to t('delete'), diff --git a/app/views/admin/research/researchers/show.html.erb b/app/views/admin/research/researchers/show.html.erb index 1a8630be86c455d16f9cb68e59cbb7957f3b893f..25b69cf655a24353ebb92146f59fe56b81a08a92 100644 --- a/app/views/admin/research/researchers/show.html.erb +++ b/app/views/admin/research/researchers/show.html.erb @@ -17,8 +17,10 @@ <% @hal_authors_with_same_name.each do |author| %> <tr> <td width="300"> - <%= Research::Hal::Author.human_attribute_name('docid') %> : <%= author.docid %><br> - <small><%= author.full_name %></small> + <%= link_to [:admin, author] do %> + <%= Research::Hal::Author.human_attribute_name('docid') %> : <%= author.docid %><br> + <small><%= author.full_name %></small> + <% end %> </td> <td class="ps-3" width="200"> <% path = researcher_admin_research_hal_author_path author, researcher_id: @researcher %> diff --git a/app/views/admin/university/people/researchers/_researcher.html.erb b/app/views/admin/university/people/researchers/_researcher.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..d79fa151e8ef1e81602c753dd175c591f542e032 --- /dev/null +++ b/app/views/admin/university/people/researchers/_researcher.html.erb @@ -0,0 +1,8 @@ +<article class="mb-4 d-flex align-items-center position-relative"> + <div style="width: 80px"> + <%= kamifusen_tag researcher.best_picture, width: 80, class: 'img-circle' if researcher.best_picture.attached? %> + </div> + <div class="ms-3"> + <%= link_to researcher, admin_research_researcher_path(researcher), class: 'stretched-link' %> + </div> +</article> diff --git a/config/locales/research/en.yml b/config/locales/research/en.yml index e66d575718aba5bd80da0d53427b01ee70790d57..b38348b1a9b70aee63a4ce9d23a155e249e7527c 100644 --- a/config/locales/research/en.yml +++ b/config/locales/research/en.yml @@ -9,11 +9,11 @@ en: one: Researcher other: Researchers research/hal/author: - one: HAL author - other: HAL authors + one: Author + other: Authors research/hal/publication: - one: HAL publication - other: HAL publications + one: Publication + other: Publications research/journal: one: Journal other: Journals @@ -36,11 +36,13 @@ en: one: Thesis other: Theses attributes: + research/hal: + description: Publications et auteur·e·s dans la base de données HAL research/hal/author: docid: HAL identifier first_name: First name - last_name: Last name full_name: Full name + last_name: Last name research/hal/publication: description: Publications scientifiques importées automatiquement de HAL docid: Identifier @@ -96,6 +98,10 @@ en: laboratory: Laboratory started_at: Started at title: Title + research/hal: + description: + text: "HAL signifie Hyper Article en Ligne. C’est une plateforme pluridisciplinaire nationale pour le dépôt et la consultation des écrits, travaux et résultats de recherches scientifiques des chercheur·e·s et enseignant·e·s-chercheur·e·s. HAL est un bien commun pour la recherche : Les plus grands organismes de recherche et la majorité des universités françaises ont choisi et soutiennent HAL, une infrastructure publique, pérenne et responsable." + source: HAL.science research: description: text: La recherche scientifique est, à la fois, une démarche créatrice de connaissances motivée par la curiosité pure et une activité génératrice d’innovations qui augmentent les moyens d’action et de diagnostic sur la nature, l’homme et la société. Ces deux aspects de la recherche, le fondamental et l’appliqué, loin de s’opposer, sont complémentaires l’un de l’autre. La recherche fondamentale crée le socle de connaissances à partir duquel naissent les applications et, inversement, les avancées technologiques procurent les outils d’investigation de plus en plus perfectionnés qui conduisent à approfondir nos connaissances fondamentales. diff --git a/config/locales/research/fr.yml b/config/locales/research/fr.yml index 6b9872882d0ae6c8322f53d64f0cc2100ebc52b5..2300469731efd1a7152fbbc3d2107f6d49d34800 100644 --- a/config/locales/research/fr.yml +++ b/config/locales/research/fr.yml @@ -9,11 +9,11 @@ fr: one: Chercheur·e other: Chercheur·e·s research/hal/author: - one: Auteur·e HAL - other: Auteur·e·s HAL + one: Auteur·e + other: Auteur·e·s research/hal/publication: - one: Publication HAL - other: Publications HAL + one: Publication + other: Publications research/journal: one: Revue scientifique other: Revues scientifiques @@ -36,11 +36,14 @@ fr: one: Thèse other: Thèses attributes: + research/hal: + description: Publications et auteur·e·s dans la base de données HAL research/hal/author: + description: Profils des chercheur·e·s dans la base de données HAL docid: Identifiant HAL first_name: Prénom - last_name: Nom full_name: Nom complet + last_name: Nom research/hal/publication: description: Publications scientifiques importées automatiquement de HAL docid: Identifiant @@ -96,6 +99,10 @@ fr: laboratory: Laboratoire started_at: Commencée le title: Titre + research/hal: + description: + text: "HAL signifie Hyper Article en Ligne. C’est une plateforme pluridisciplinaire nationale pour le dépôt et la consultation des écrits, travaux et résultats de recherches scientifiques des chercheur·e·s et enseignant·e·s-chercheur·e·s. HAL est un bien commun pour la recherche : Les plus grands organismes de recherche et la majorité des universités françaises ont choisi et soutiennent HAL, une infrastructure publique, pérenne et responsable." + source: HAL.science research: description: text: La recherche scientifique est, à la fois, une démarche créatrice de connaissances motivée par la curiosité pure et une activité génératrice d’innovations qui augmentent les moyens d’action et de diagnostic sur la nature, l’homme et la société. Ces deux aspects de la recherche, le fondamental et l’appliqué, loin de s’opposer, sont complémentaires l’un de l’autre. La recherche fondamentale crée le socle de connaissances à partir duquel naissent les applications et, inversement, les avancées technologiques procurent les outils d’investigation de plus en plus perfectionnés qui conduisent à approfondir nos connaissances fondamentales. diff --git a/db/migrate/20230218162239_remove_hal_from_researchers.rb b/db/migrate/20230218162239_remove_hal_from_researchers.rb new file mode 100644 index 0000000000000000000000000000000000000000..4680da7842ea65e8a7755bf4305944edf40598a1 --- /dev/null +++ b/db/migrate/20230218162239_remove_hal_from_researchers.rb @@ -0,0 +1,7 @@ +class RemoveHalFromResearchers < ActiveRecord::Migration[7.0] + def change + remove_column :university_people, :hal_person_identifier + remove_column :university_people, :hal_doc_identifier + remove_column :university_people, :hal_form_identifier + end +end diff --git a/db/schema.rb b/db/schema.rb index 50d6e446f3514f52ff90060234b64932d8505235..bb44937d4eecde690f534d257470ca8fed11d389 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_02_18_074127) do +ActiveRecord::Schema[7.0].define(version: 2023_02_18_162239) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -845,9 +845,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_18_074127) do t.string "zipcode" t.string "city" t.string "country" - t.string "hal_person_identifier" - t.string "hal_doc_identifier" - t.string "hal_form_identifier" t.string "mastodon" t.uuid "language_id", null: false t.uuid "original_id" diff --git a/test/fixtures/university/people.yml b/test/fixtures/university/people.yml index 877859d4d94742760c90f50e7b90ccbbb02a6b27..c8c32545e279d6cfb5e84d066c31f4f3f6588c9b 100644 --- a/test/fixtures/university/people.yml +++ b/test/fixtures/university/people.yml @@ -2,44 +2,41 @@ # # Table name: university_people # -# id :uuid not null, primary key -# address :string -# biography :text -# birthdate :date -# city :string -# country :string -# email :string -# first_name :string -# gender :integer -# habilitation :boolean default(FALSE) -# hal_doc_identifier :string -# hal_form_identifier :string -# hal_person_identifier :string -# is_administration :boolean -# is_alumnus :boolean default(FALSE) -# is_author :boolean -# is_researcher :boolean -# is_teacher :boolean -# last_name :string -# linkedin :string -# mastodon :string -# meta_description :text -# name :string -# phone_mobile :string -# phone_personal :string -# phone_professional :string -# slug :string -# summary :text -# tenure :boolean default(FALSE) -# twitter :string -# url :string -# zipcode :string -# created_at :datetime not null -# updated_at :datetime not null -# language_id :uuid not null, indexed -# original_id :uuid indexed -# university_id :uuid not null, indexed -# user_id :uuid indexed +# id :uuid not null, primary key +# address :string +# biography :text +# birthdate :date +# city :string +# country :string +# email :string +# first_name :string +# gender :integer +# habilitation :boolean default(FALSE) +# is_administration :boolean +# is_alumnus :boolean default(FALSE) +# is_author :boolean +# is_researcher :boolean +# is_teacher :boolean +# last_name :string +# linkedin :string +# mastodon :string +# meta_description :text +# name :string +# phone_mobile :string +# phone_personal :string +# phone_professional :string +# slug :string +# summary :text +# tenure :boolean default(FALSE) +# twitter :string +# url :string +# zipcode :string +# created_at :datetime not null +# updated_at :datetime not null +# language_id :uuid not null, indexed +# original_id :uuid indexed +# university_id :uuid not null, indexed +# user_id :uuid indexed # # Indexes #