diff --git a/app/controllers/admin/research/journals/volumes_controller.rb b/app/controllers/admin/research/journals/volumes_controller.rb index 5d693ca975adc44de6a0424e4f8ac50cd4c48aa4..f8395fa9e4b26030e03aada3affe0c50cb8f0b69 100644 --- a/app/controllers/admin/research/journals/volumes_controller.rb +++ b/app/controllers/admin/research/journals/volumes_controller.rb @@ -58,7 +58,7 @@ class Admin::Research::Journals::VolumesController < Admin::Research::Journals:: def volume_params params.require(:research_journal_volume) .permit( - :title, :slug, :number, :keywords, :published, :published_at, :meta_description, :text, + :title, :slug, :number, :keywords, :published, :published_at, :meta_description, :summary, :text, :featured_image, :featured_image_infos, :featured_image_delete, :featured_image_alt, :featured_image_credit ) .merge(university_id: current_university.id) diff --git a/app/controllers/admin/research/journals_controller.rb b/app/controllers/admin/research/journals_controller.rb index b05662b967515c579312fd9cc08e11d8c7d9d98f..6ccc4ead71e421ea263a734aa51386caeadff3fd 100644 --- a/app/controllers/admin/research/journals_controller.rb +++ b/app/controllers/admin/research/journals_controller.rb @@ -53,7 +53,7 @@ class Admin::Research::JournalsController < Admin::Research::ApplicationControll def journal_params params.require(:research_journal) - .permit(:title, :meta_description, :issn, :access_token, :repository) + .permit(:title, :meta_description, :summary, :issn) .merge(university_id: current_university.id) end end diff --git a/app/models/research/journal.rb b/app/models/research/journal.rb index e20d9e60bd5fdcd2242b253dff90fdaf72cf8bde..2cf68b7922040236d1c417deb01a3ed36976d67d 100644 --- a/app/models/research/journal.rb +++ b/app/models/research/journal.rb @@ -5,6 +5,7 @@ # id :uuid not null, primary key # issn :string # meta_description :text +# summary :text # title :string # created_at :datetime not null # updated_at :datetime not null diff --git a/app/models/research/journal/volume.rb b/app/models/research/journal/volume.rb index 858aad6addbdfb9439075d0f8cb7ebbb66302006..7954879f64c50607d1a5c0b6ccf18ae3eb2599e0 100644 --- a/app/models/research/journal/volume.rb +++ b/app/models/research/journal/volume.rb @@ -11,6 +11,7 @@ # published :boolean default(FALSE) # published_at :datetime # slug :string +# summary :text # text :text # title :string # created_at :datetime not null diff --git a/app/views/admin/research/journals/_form.html.erb b/app/views/admin/research/journals/_form.html.erb index 3573f57b2c8a2b305f81d3eded484ac0e16f8508..1d9fbaa4ad4500cc869a78755a9fc6cc350d7b1d 100644 --- a/app/views/admin/research/journals/_form.html.erb +++ b/app/views/admin/research/journals/_form.html.erb @@ -7,6 +7,7 @@ <div class="card flex-fill w-100"> <div class="card-body"> <%= f.input :title %> + <%= render 'admin/application/summary/form', f: f, about: journal %> <%= f.input :issn %> </div> </div> diff --git a/app/views/admin/research/journals/show.html.erb b/app/views/admin/research/journals/show.html.erb index be32a34b38d55e410e7cc1b3bc59db929bdb7024..4cf2893c0aabc906c5052480805a21efce60aa54 100644 --- a/app/views/admin/research/journals/show.html.erb +++ b/app/views/admin/research/journals/show.html.erb @@ -11,6 +11,7 @@ <% if @journal.issn %><%= Research::Journal.human_attribute_name('issn') %> <%= @journal.issn %><% end %> <% end %> +<%= render 'admin/application/summary/show', about: @journal %> <div class="card mt-5"> <div class="card-header"> <div class="float-end"> diff --git a/app/views/admin/research/journals/static.html.erb b/app/views/admin/research/journals/static.html.erb index 278021cc4d71c3261f878527995c083d3f06fd59..51381c1943e09469651d7946b8adc2bc363481df 100644 --- a/app/views/admin/research/journals/static.html.erb +++ b/app/views/admin/research/journals/static.html.erb @@ -4,4 +4,5 @@ title: > issn: > <%= @about.issn %> <%= render 'admin/application/meta_description/static' %> +<%= render 'admin/application/summary/static' %> --- diff --git a/app/views/admin/research/journals/volumes/_form.html.erb b/app/views/admin/research/journals/volumes/_form.html.erb index 3bcfdafabf5fbee101692ea5532772df5e732d13..7d39bfe89911ab1eda2c2dd64151cc649f4afc48 100644 --- a/app/views/admin/research/journals/volumes/_form.html.erb +++ b/app/views/admin/research/journals/volumes/_form.html.erb @@ -10,6 +10,7 @@ </div> <div class="card-body"> <%= f.input :title %> + <%= render 'admin/application/summary/form', f: f, about: volume %> <%= f.input :text, as: :summernote %> </div> </div> diff --git a/app/views/admin/research/journals/volumes/show.html.erb b/app/views/admin/research/journals/volumes/show.html.erb index 9d58f2d987330b67ef766cb39c56dab37d46d7a4..3294c87dc9f948c429d38adb63cf23e119dff031 100644 --- a/app/views/admin/research/journals/volumes/show.html.erb +++ b/app/views/admin/research/journals/volumes/show.html.erb @@ -2,6 +2,7 @@ <div class="row"> <div class="col-md-9"> + <%= render 'admin/application/summary/show', about: @volume %> <div class="card flex-fill w-100"> <div class="card-header"> <h2 class="card-title mb-0 h5"><%= t('content') %></h2> diff --git a/app/views/admin/research/journals/volumes/static.html.erb b/app/views/admin/research/journals/volumes/static.html.erb index ca58770310ba3c07db7278d6e9b0db78921f00b0..284cefba7cc7a2268aa2ad1271fa97c9d65798f9 100644 --- a/app/views/admin/research/journals/volumes/static.html.erb +++ b/app/views/admin/research/journals/volumes/static.html.erb @@ -8,5 +8,6 @@ keywords: > date: "<%= @about.published_at.iso8601 %>" <%= render 'admin/application/featured_image/static' %> <%= render 'admin/application/meta_description/static' %> +<%= render 'admin/application/summary/static' %> --- <%= prepare_html_for_static @about.text, @about.university %> diff --git a/db/migrate/20230112145505_add_summary_to_research_models.rb b/db/migrate/20230112145505_add_summary_to_research_models.rb new file mode 100644 index 0000000000000000000000000000000000000000..6d46d872c00438ad4cca352153a8733b8d72b810 --- /dev/null +++ b/db/migrate/20230112145505_add_summary_to_research_models.rb @@ -0,0 +1,6 @@ +class AddSummaryToResearchModels < ActiveRecord::Migration[7.0] + def change + add_column :research_journals, :summary, :text + add_column :research_journal_volumes, :summary, :text + end +end diff --git a/db/schema.rb b/db/schema.rb index 9f2c0bc74b1e8204fd5a3370369303017be832b3..15dd27a1bc3f610fbe38167c255d6ee9b4c94107 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_131744) do +ActiveRecord::Schema[7.0].define(version: 2023_01_12_145505) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -610,6 +610,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_12_131744) do t.boolean "published", default: false t.text "text" t.text "featured_image_credit" + t.text "summary" t.index ["research_journal_id"], name: "index_research_journal_volumes_on_research_journal_id" t.index ["university_id"], name: "index_research_journal_volumes_on_university_id" end @@ -621,6 +622,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_12_131744) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "issn" + t.text "summary" t.index ["university_id"], name: "index_research_journals_on_university_id" end