diff --git a/app/controllers/admin/research/journal/articles_controller.rb b/app/controllers/admin/research/journal/articles_controller.rb index 9db0bdb8d386986d48ca699e48c6cb9855cfb6df..51cc02d2e73e40b98527ec5e3aaf31318edb4e5b 100644 --- a/app/controllers/admin/research/journal/articles_controller.rb +++ b/app/controllers/admin/research/journal/articles_controller.rb @@ -56,6 +56,6 @@ class Admin::Research::Journal::ArticlesController < Admin::Research::Journal::A end def article_params - params.require(:research_journal_article).permit(:title, :text, :published_at, :research_journal_volume_id, researcher_ids: []) + params.require(:research_journal_article).permit(:title, :text, :published_at, :abstract, :references, :research_journal_volume_id, researcher_ids: []) end end diff --git a/app/models/research/journal/article.rb b/app/models/research/journal/article.rb index 5ed69141c6cf5dc21855684c2a320bb2a66ea404..f3627ed7652566caa7f64c2e83e72b4d57e9be9b 100644 --- a/app/models/research/journal/article.rb +++ b/app/models/research/journal/article.rb @@ -3,7 +3,9 @@ # Table name: research_journal_articles # # id :uuid not null, primary key +# abstract :text # published_at :date +# references :text # text :text # title :string # created_at :datetime not null diff --git a/app/views/admin/research/journal/articles/_form.html.erb b/app/views/admin/research/journal/articles/_form.html.erb index e471857e131cdb5c84b0c85305dd57ff34d71efa..92e78c5edcffec79764348b0c7ae562a210e978e 100644 --- a/app/views/admin/research/journal/articles/_form.html.erb +++ b/app/views/admin/research/journal/articles/_form.html.erb @@ -1,13 +1,15 @@ <%= simple_form_for [:admin, article] do |f| %> <div class="row"> <div class="col-md-4"> - <%= f.input :title %> + <%= f.input :title, as: :text, input_html: { rows: 3 } %> <%= f.association :volume, collection: @journal.volumes %> <%= f.input :published_at, html5: true %> <%= f.association :researchers %> </div> <div class="col-md-8"> - <%= f.input :text, input_html: { rows: 30 } %> + <%= f.input :abstract, as: :text, input_html: { rows: 6 } %> + <%= f.input :text, input_html: { rows: 20 } %> + <%= f.input :references, as: :text, input_html: { rows: 10 } %> </div> </div> <% content_for :buttons do %> diff --git a/app/views/admin/research/journal/articles/jekyll.html.erb b/app/views/admin/research/journal/articles/jekyll.html.erb index a1a7693219e7c52419e15ce03939661aa6184b86..084ca62a91b537c1e98c8af1ad4c6b48008a0d23 100644 --- a/app/views/admin/research/journal/articles/jekyll.html.erb +++ b/app/views/admin/research/journal/articles/jekyll.html.erb @@ -2,7 +2,9 @@ title: "<%= @article.title %>" volume: "<%= @article.volume.id %>" publication: "<%= @article.published_at %>" -description: "" +abstract: "<%= @article.abstract %>" +description: "<%= @article.abstract %>" +references: "<%= @article.references %>" authors: <% @article.researchers.each do |researcher| %> - "<%= researcher.id %>" diff --git a/app/views/admin/research/journal/articles/show.html.erb b/app/views/admin/research/journal/articles/show.html.erb index aec520be18be788858ffbdcfd66e3305dddaa080..72a6417a344c43f55002c63cf033e985a786d1c2 100644 --- a/app/views/admin/research/journal/articles/show.html.erb +++ b/app/views/admin/research/journal/articles/show.html.erb @@ -14,7 +14,7 @@ </ul> </p> -<%= @article.text %> +<%= @article.abstract %> <% content_for :buttons do %> <%= edit_link @article %> diff --git a/db/migrate/20210908094427_add_abstract_and_references_to_research_journal_articles.rb b/db/migrate/20210908094427_add_abstract_and_references_to_research_journal_articles.rb new file mode 100644 index 0000000000000000000000000000000000000000..97cb73e61e17f538e019d39d5341c80b57266970 --- /dev/null +++ b/db/migrate/20210908094427_add_abstract_and_references_to_research_journal_articles.rb @@ -0,0 +1,6 @@ +class AddAbstractAndReferencesToResearchJournalArticles < ActiveRecord::Migration[6.1] + def change + add_column :research_journal_articles, :abstract, :text + add_column :research_journal_articles, :references, :text + end +end diff --git a/db/schema.rb b/db/schema.rb index d2bf788cf6c29579ce525c8f65fe5a5bb08be4c4..89830e39fbacb312ee0e70c0155b64de4e5c03f9 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.define(version: 2021_09_07_162252) do +ActiveRecord::Schema.define(version: 2021_09_08_094427) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -103,6 +103,8 @@ ActiveRecord::Schema.define(version: 2021_09_07_162252) do t.datetime "created_at", precision: 6, null: false t.date "updated_at", null: false t.uuid "updated_by_id" + t.text "abstract" + t.text "references" t.index ["research_journal_id"], name: "index_research_journal_articles_on_research_journal_id" t.index ["research_journal_volume_id"], name: "index_research_journal_articles_on_research_journal_volume_id" t.index ["university_id"], name: "index_research_journal_articles_on_university_id" diff --git a/test/fixtures/research/journal/articles.yml b/test/fixtures/research/journal/articles.yml index e5212c680d4b79941dfe8d5f5a4df558364bc742..11c00dd4540b124a5109e31f5ea6f894ff03d104 100644 --- a/test/fixtures/research/journal/articles.yml +++ b/test/fixtures/research/journal/articles.yml @@ -3,7 +3,9 @@ # Table name: research_journal_articles # # id :uuid not null, primary key +# abstract :text # published_at :date +# references :text # text :text # title :string # created_at :datetime not null diff --git a/test/models/research/journal/article_test.rb b/test/models/research/journal/article_test.rb index efa6c283ada1f1a11dbfe9c9f6f28e7c48745de5..6582f865d5f9b2e333e51e80d23bf4c0bd36be9f 100644 --- a/test/models/research/journal/article_test.rb +++ b/test/models/research/journal/article_test.rb @@ -3,7 +3,9 @@ # Table name: research_journal_articles # # id :uuid not null, primary key +# abstract :text # published_at :date +# references :text # text :text # title :string # created_at :datetime not null