diff --git a/app/models/communication/website/page.rb b/app/models/communication/website/page.rb index a58825dc58e7315e23063c414b40fe19454c62ed..1a3317f754900d41953edc7c38ebcd6b7bd61d52 100644 --- a/app/models/communication/website/page.rb +++ b/app/models/communication/website/page.rb @@ -61,6 +61,8 @@ class Communication::Website::Page < ApplicationRecord include WithPermalink include WithTranslations + has_summernote :text # TODO: Remove text attribute + belongs_to :website, foreign_key: :communication_website_id belongs_to :parent, diff --git a/app/models/communication/website/post.rb b/app/models/communication/website/post.rb index 8a94a8b759d167e677dbc4176ed814f88e0f264b..e2095f2f03f9a44b105a3600b4417bfaa345bb8b 100644 --- a/app/models/communication/website/post.rb +++ b/app/models/communication/website/post.rb @@ -49,6 +49,8 @@ class Communication::Website::Post < ApplicationRecord include WithSlug # We override slug_unavailable? method include WithTranslations + has_summernote :text # TODO: Remove text attribute + has_one :imported_post, class_name: 'Communication::Website::Imported::Post', dependent: :destroy diff --git a/app/models/concerns/with_inheritance.rb b/app/models/concerns/with_inheritance.rb index a9398bd311cc8efc4bf5ddc52586b2ee9d11e6c9..9df918dddedd5369dc6e92db76966d85bbe8c0ca 100644 --- a/app/models/concerns/with_inheritance.rb +++ b/app/models/concerns/with_inheritance.rb @@ -4,6 +4,8 @@ module WithInheritance included do def self.rich_text_areas_with_inheritance(*properties) properties.each do |property| + has_summernote property + class_eval <<-CODE, __FILE__, __LINE__ + 1 def best_#{property} best("#{property}") diff --git a/app/models/research/journal/paper.rb b/app/models/research/journal/paper.rb index 017e87f3ba73822b5dcbac4f7e3b6ab814ed7055..1b0e1502fe7eaa5055af5dae71727c212363ba48 100644 --- a/app/models/research/journal/paper.rb +++ b/app/models/research/journal/paper.rb @@ -47,6 +47,7 @@ class Research::Journal::Paper < ApplicationRecord include WithPosition include WithSlug + has_summernote :text has_one_attached :pdf belongs_to :journal, foreign_key: :research_journal_id diff --git a/app/models/research/journal/volume.rb b/app/models/research/journal/volume.rb index ac61537dc8b274dd0f54c2cb1e3f1622451431f3..ea545dcd8db282f43e66bfdc90345fd6eded2fd9 100644 --- a/app/models/research/journal/volume.rb +++ b/app/models/research/journal/volume.rb @@ -38,6 +38,8 @@ class Research::Journal::Volume < ApplicationRecord include WithPermalink include WithSlug + has_summernote :text + belongs_to :journal, foreign_key: :research_journal_id has_many :papers, foreign_key: :research_journal_volume_id, dependent: :nullify has_many :websites, -> { distinct }, through: :journal diff --git a/app/models/research/laboratory/axis.rb b/app/models/research/laboratory/axis.rb index ef568cf06a5f517dd466c293e0565376a55e306d..69b47c682830bd9a8d28a9cbed60aca5896e4ed4 100644 --- a/app/models/research/laboratory/axis.rb +++ b/app/models/research/laboratory/axis.rb @@ -28,6 +28,8 @@ class Research::Laboratory::Axis < ApplicationRecord include WithUniversity include WithPosition + has_summernote :text + belongs_to :laboratory, foreign_key: :research_laboratory_id def to_s diff --git a/app/models/university/organization.rb b/app/models/university/organization.rb index eaac9b6b8b7b7bb9d7b721313d9ee007b9199e53..4f58c17bd550a052f7570028aee0df3f774a72be 100644 --- a/app/models/university/organization.rb +++ b/app/models/university/organization.rb @@ -45,6 +45,8 @@ class University::Organization < ApplicationRecord attr_accessor :created_from_extranet + has_summernote :text + has_many :experiences, class_name: 'University::Person::Experience', dependent: :destroy diff --git a/app/models/university/person.rb b/app/models/university/person.rb index 79fa067b96e993e0dbdc0f4bdbd2c986d129f667..6a84914ad3c419103ca7ee7817b8f3548ff9e03f 100644 --- a/app/models/university/person.rb +++ b/app/models/university/person.rb @@ -80,6 +80,8 @@ class University::Person < ApplicationRecord enum gender: { male: 0, female: 1, non_binary: 2 } + has_summernote :biography + belongs_to :user, optional: true has_and_belongs_to_many :research_journal_papers,