diff --git a/app/controllers/admin/university/organizations_controller.rb b/app/controllers/admin/university/organizations_controller.rb index bdf31d43785af6cde432ca58abd79ceb77472552..3f56e50328a8d0a8952682f20049316c13b00157 100644 --- a/app/controllers/admin/university/organizations_controller.rb +++ b/app/controllers/admin/university/organizations_controller.rb @@ -71,7 +71,7 @@ class Admin::University::OrganizationsController < Admin::University::Applicatio .permit( :name, :long_name, :slug, :meta_description, :summary, :active, :siren, :kind, :address, :zipcode, :city, :country, :text, - :url, :phone, :email, :linkedin, :twitter, + :url, :phone, :email, :linkedin, :twitter, :mastodon, :logo, :logo_delete, :logo_infos, :logo_on_dark_background, :logo_on_dark_background_delete, :logo_on_dark_background_infos, ) diff --git a/app/controllers/admin/university/people_controller.rb b/app/controllers/admin/university/people_controller.rb index 68c9d699bde64b82035dcdbe7deae904f9151d1e..0fde20c47221f4f77130ce72b000508af047e904 100644 --- a/app/controllers/admin/university/people_controller.rb +++ b/app/controllers/admin/university/people_controller.rb @@ -76,7 +76,7 @@ class Admin::University::PeopleController < Admin::University::ApplicationContro :address, :zipcode, :city, :country, :meta_description, :summary, :biography, :picture, :picture_delete, :picture_infos, - :habilitation, :tenure, :url, :linkedin, :twitter, + :habilitation, :tenure, :url, :linkedin, :twitter, :mastodon, :is_researcher, :is_teacher, :is_administration, :is_alumnus, :user_id ).merge(university_id: current_university.id) diff --git a/app/models/university/organization.rb b/app/models/university/organization.rb index ea328fbc38b3ad07754db97ff45f8e7104566cf0..46a5f668ec2305ea372fa5f3cfd5c28fd44bb9f2 100644 --- a/app/models/university/organization.rb +++ b/app/models/university/organization.rb @@ -11,6 +11,7 @@ # kind :integer default("company") # linkedin :string # long_name :string +# mastodon :string # meta_description :text # name :string # nic :string diff --git a/app/models/university/person.rb b/app/models/university/person.rb index 4a7dc6a74b110671d05dd4fae4f8a8784f2c0946..9fd05ac1e24f30b4c14a2bb1a485b4f887224905 100644 --- a/app/models/university/person.rb +++ b/app/models/university/person.rb @@ -2,38 +2,42 @@ # # 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) -# is_administration :boolean -# is_alumnus :boolean default(FALSE) -# is_author :boolean -# is_researcher :boolean -# is_teacher :boolean -# last_name :string -# linkedin :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 -# 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) +# 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 +# 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 7344064b889d083fb778a272dee969f1392349b0..8532be880cb943b9417e1be51055c9ce2208e583 100644 --- a/app/models/university/person/administrator.rb +++ b/app/models/university/person/administrator.rb @@ -2,38 +2,42 @@ # # 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) -# is_administration :boolean -# is_alumnus :boolean default(FALSE) -# is_author :boolean -# is_researcher :boolean -# is_teacher :boolean -# last_name :string -# linkedin :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 -# 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) +# 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 +# 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 768ca14261fccbad907c4cdf5bc32d7bb8838768..729d7b2125dbbefebf2fd15ee9f4b37237d4d22e 100644 --- a/app/models/university/person/alumnus.rb +++ b/app/models/university/person/alumnus.rb @@ -2,38 +2,42 @@ # # 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) -# is_administration :boolean -# is_alumnus :boolean default(FALSE) -# is_author :boolean -# is_researcher :boolean -# is_teacher :boolean -# last_name :string -# linkedin :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 -# 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) +# 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 +# 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 71dbd704e4a2b25eb04d09b54429685e074461d1..3a875d33f05df556031caa3d72147c657390fcc8 100644 --- a/app/models/university/person/author.rb +++ b/app/models/university/person/author.rb @@ -2,38 +2,42 @@ # # 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) -# is_administration :boolean -# is_alumnus :boolean default(FALSE) -# is_author :boolean -# is_researcher :boolean -# is_teacher :boolean -# last_name :string -# linkedin :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 -# 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) +# 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 +# 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 db8d3308be0db17c636298c3eade541da03c1b16..2a36ac0640951b40e287aa14b93a28e985caffe0 100644 --- a/app/models/university/person/researcher.rb +++ b/app/models/university/person/researcher.rb @@ -2,38 +2,42 @@ # # 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) -# is_administration :boolean -# is_alumnus :boolean default(FALSE) -# is_author :boolean -# is_researcher :boolean -# is_teacher :boolean -# last_name :string -# linkedin :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 -# 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) +# 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 +# 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 6dae6e68a4c8563da453dde91e2655dc0a7010d8..aaf4ac554a2374e8abf196c5bde1f22504106540 100644 --- a/app/models/university/person/teacher.rb +++ b/app/models/university/person/teacher.rb @@ -2,38 +2,42 @@ # # 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) -# is_administration :boolean -# is_alumnus :boolean default(FALSE) -# is_author :boolean -# is_researcher :boolean -# is_teacher :boolean -# last_name :string -# linkedin :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 -# 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) +# 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 +# university_id :uuid not null, indexed +# user_id :uuid indexed # # Indexes # diff --git a/app/services/contact_details/mastodon.rb b/app/services/contact_details/mastodon.rb new file mode 100644 index 0000000000000000000000000000000000000000..51f60f79693bab757ed00bcff6560a41ec307c81 --- /dev/null +++ b/app/services/contact_details/mastodon.rb @@ -0,0 +1,2 @@ +class ContactDetails::Mastodon < ContactDetails::Website +end \ No newline at end of file diff --git a/app/views/admin/university/organizations/_form.html.erb b/app/views/admin/university/organizations/_form.html.erb index 27ff1003ec04b56fe2d0215378d251c549f4e444..2332c6f6e9fc03c433bec16498fd98071ec85a2f 100644 --- a/app/views/admin/university/organizations/_form.html.erb +++ b/app/views/admin/university/organizations/_form.html.erb @@ -38,6 +38,7 @@ <%= f.input :email %> <%= f.input :linkedin %> <%= f.input :twitter %> + <%= f.input :mastodon %> </div> </div> </div> diff --git a/app/views/admin/university/organizations/show.html.erb b/app/views/admin/university/organizations/show.html.erb index 69532f016efea6e4aa51044e46c3c734e7ba3651..3bb0d28adcdaea22ba3b28566c283f7790b0510f 100644 --- a/app/views/admin/university/organizations/show.html.erb +++ b/app/views/admin/university/organizations/show.html.erb @@ -21,7 +21,12 @@ <div class="card-body"> <div class="row"> <div class="col-md-6"> - <% [:address, :zipcode, :city, :country].each do |property| %> + <% [ + :address, + :zipcode, + :city, + :country + ].each do |property| %> <% value = @organization.send property %> <% next if value.blank? %> <h3 class="h5"> @@ -39,7 +44,13 @@ @organization.url, target: :_blank %></p> <% end %> - <% [:phone, :email, :linkedin, :twitter].each do |property| %> + <% [ + :phone, + :email, + :linkedin, + :twitter, + :mastodon + ].each do |property| %> <% value = @organization.send property %> <% next if value.blank? %> <h3 class="h5"> diff --git a/app/views/admin/university/organizations/static.html.erb b/app/views/admin/university/organizations/static.html.erb index 5f3c340a592ea110642faaf60ce098cbc858494f..50fe16931b7282fc64bd02e40628535ac5ee3b8f 100644 --- a/app/views/admin/university/organizations/static.html.erb +++ b/app/views/admin/university/organizations/static.html.erb @@ -36,6 +36,7 @@ contact_details: <%= render 'admin/application/static/contact_detail', variable: :website, data: @about.url, kind: ContactDetails::Website %> <%= render 'admin/application/static/contact_detail', variable: :linkedin, data: @about.linkedin, kind: ContactDetails::Linkedin %> <%= render 'admin/application/static/contact_detail', variable: :twitter, data: @about.twitter, kind: ContactDetails::Twitter %> +<%= render 'admin/application/static/contact_detail', variable: :mastodon, data: @about.mastodon, kind: ContactDetails::Mastodon %> <%= render 'admin/application/static/contact_detail', variable: :phone, data: @about.phone, kind: ContactDetails::Phone %> <%= render 'admin/application/static/contact_detail', variable: :email, data: @about.email, kind: ContactDetails::Email %> <% if @about.logo.attached? %> diff --git a/app/views/admin/university/people/_form.html.erb b/app/views/admin/university/people/_form.html.erb index eb779753b07d82c90ced9616a05f1db067272520..1c96a3da2c6984d3350ab5ddfe775ee13e767e53 100644 --- a/app/views/admin/university/people/_form.html.erb +++ b/app/views/admin/university/people/_form.html.erb @@ -91,6 +91,7 @@ </div> <div class="col-md-6"> <%= f.input :twitter %> + <%= f.input :mastodon %> </div> </div> </div> diff --git a/app/views/admin/university/people/_main_infos.html.erb b/app/views/admin/university/people/_main_infos.html.erb index c5ba7226d311eb98ae327b8a8e8f5f89636fafe1..6ab39d44f189aae92cb461f60af9e395563f513f 100644 --- a/app/views/admin/university/people/_main_infos.html.erb +++ b/app/views/admin/university/people/_main_infos.html.erb @@ -54,7 +54,11 @@ <% end %> <% unless person.twitter.blank? %> <h3 class="h5"><%= University::Person.human_attribute_name('twitter') %></h3> - <%= link_to person.twitter, "https://twitter.com/#{person.twitter}", target: '_blank' %> + <p><%= link_to person.twitter, "https://twitter.com/#{person.twitter}", target: '_blank' %></p> + <% end %> + <% unless person.mastodon.blank? %> + <h3 class="h5"><%= University::Person.human_attribute_name('mastodon') %></h3> + <p><%= link_to person.mastodon, person.mastodon, target: '_blank' %></p> <% end %> </div> </div> diff --git a/app/views/admin/university/people/static.html.erb b/app/views/admin/university/people/static.html.erb index 9aea1854f6a71db5ac097f49d5cfad135878895f..5c3cb9a62b35b7277bcaae1a9817a1384050b6f0 100644 --- a/app/views/admin/university/people/static.html.erb +++ b/app/views/admin/university/people/static.html.erb @@ -27,6 +27,7 @@ contact_details: <%= render 'admin/application/static/contact_detail', variable: :website, data: @about.url, kind: ContactDetails::Website %> <%= render 'admin/application/static/contact_detail', variable: :linkedin, data: @about.linkedin, kind: ContactDetails::Linkedin %> <%= render 'admin/application/static/contact_detail', variable: :twitter, data: @about.twitter, kind: ContactDetails::Twitter %> +<%= render 'admin/application/static/contact_detail', variable: :mastodon, data: @about.mastodon, kind: ContactDetails::Mastodon %> <%= render 'admin/application/static/contact_detail', variable: :phone, data: @about.phone_mobile, kind: ContactDetails::Phone %> <%= render 'admin/application/static/contact_detail', variable: :email, data: @about.email, kind: ContactDetails::Email %> <% if @about.best_picture.attached? %> diff --git a/db/migrate/20230118155630_add_mastodon_to_persons_and_organizations.rb b/db/migrate/20230118155630_add_mastodon_to_persons_and_organizations.rb new file mode 100644 index 0000000000000000000000000000000000000000..200bf80657ce3370ea3add0ba89bae0fa8bcd4dd --- /dev/null +++ b/db/migrate/20230118155630_add_mastodon_to_persons_and_organizations.rb @@ -0,0 +1,6 @@ +class AddMastodonToPersonsAndOrganizations < ActiveRecord::Migration[7.0] + def change + add_column :university_people, :mastodon, :string + add_column :university_organizations, :mastodon, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 042e3b820bbf50485f0917f9fb22c68a9f5e1463..317c9d831a3e1be7975386c68e4ad29d4038bd0d 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_01_12_151136) do +ActiveRecord::Schema[7.0].define(version: 2023_01_18_155630) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -639,6 +639,13 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_12_151136) do t.index ["university_id"], name: "index_research_laboratories_on_university_id" end + create_table "research_laboratories_publications", id: false, force: :cascade do |t| + t.uuid "research_publication_id", null: false + t.uuid "research_laboratory_id", null: false + t.index ["research_laboratory_id", "research_publication_id"], name: "index_laboratory_publication" + t.index ["research_publication_id", "research_laboratory_id"], name: "index_publication_laboratory" + end + create_table "research_laboratory_axes", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "research_laboratory_id", null: false @@ -653,6 +660,27 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_12_151136) do t.index ["university_id"], name: "index_research_laboratory_axes_on_university_id" end + create_table "research_publications", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + t.string "docid" + t.jsonb "data" + t.string "title" + t.string "url" + t.string "ref" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "hal_url" + t.date "publication_date" + t.string "doi" + t.string "slug" + end + + create_table "research_publications_university_people", id: false, force: :cascade do |t| + t.uuid "research_publication_id", null: false + t.uuid "university_person_id", null: false + t.index ["research_publication_id", "university_person_id"], name: "index_publication_person" + t.index ["university_person_id", "research_publication_id"], name: "index_person_publication" + end + create_table "research_theses", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "research_laboratory_id", null: false @@ -719,6 +747,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_12_151136) do t.text "summary" t.string "twitter" t.string "linkedin" + t.string "mastodon" t.index ["university_id"], name: "index_university_organizations_on_university_id" end @@ -754,6 +783,10 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_12_151136) 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.index ["university_id"], name: "index_university_people_on_university_id" t.index ["user_id"], name: "index_university_people_on_user_id" end diff --git a/test/fixtures/university/organizations.yml b/test/fixtures/university/organizations.yml index 7bad432bc294342a1eaf61137235253e05bc8c9a..a684cda0bc2ac7ee17bc8505652fb23c069af8b6 100644 --- a/test/fixtures/university/organizations.yml +++ b/test/fixtures/university/organizations.yml @@ -11,6 +11,7 @@ # kind :integer default("company") # linkedin :string # long_name :string +# mastodon :string # meta_description :text # name :string # nic :string diff --git a/test/models/university/organization_test.rb b/test/models/university/organization_test.rb index 051333211e94bc132746bef850713dab3111021b..56f0523c14d85df0edb489caebaad3ebb0d13d0a 100644 --- a/test/models/university/organization_test.rb +++ b/test/models/university/organization_test.rb @@ -11,6 +11,7 @@ # kind :integer default("company") # linkedin :string # long_name :string +# mastodon :string # meta_description :text # name :string # nic :string