diff --git a/app/controllers/admin/research/journal/volumes_controller.rb b/app/controllers/admin/research/journal/volumes_controller.rb index c009f7059676c247bc60607eeced184d5bf8e386..2c983673198d57a9b6f9fc8b7e29cfd3c6e6da79 100644 --- a/app/controllers/admin/research/journal/volumes_controller.rb +++ b/app/controllers/admin/research/journal/volumes_controller.rb @@ -55,6 +55,6 @@ class Admin::Research::Journal::VolumesController < Admin::Research::Journal::Ap end def volume_params - params.require(:research_journal_volume).permit(:title, :number, :cover, :published_at, :description) + params.require(:research_journal_volume).permit(:title, :number, :cover, :keywords, :published_at, :description) end end diff --git a/app/controllers/admin/research/journals_controller.rb b/app/controllers/admin/research/journals_controller.rb index 0ded5136e6e54c3e286ff812f1810f05f1188919..26bb67f185a763b3c6d0a0a22114cda9aa118676 100644 --- a/app/controllers/admin/research/journals_controller.rb +++ b/app/controllers/admin/research/journals_controller.rb @@ -52,6 +52,6 @@ class Admin::Research::JournalsController < Admin::Research::ApplicationControll end def journal_params - params.require(:research_journal).permit(:title, :description, :access_token, :repository) + params.require(:research_journal).permit(:title, :description, :issn, :access_token, :repository) end end diff --git a/app/models/research/journal.rb b/app/models/research/journal.rb index 5cdc09b6417dc974c1b628367be92c7b05e3bf9d..6515a0eb9f411951c7800c618515a792490eb3ba 100644 --- a/app/models/research/journal.rb +++ b/app/models/research/journal.rb @@ -5,6 +5,7 @@ # id :uuid not null, primary key # access_token :string # description :text +# issn :string # repository :string # title :string # created_at :datetime not null diff --git a/app/models/research/journal/volume.rb b/app/models/research/journal/volume.rb index 7b1322bf7cf753cd1824f47dec945b088f0ecf51..b8521454eed345c158089404b5293ba9c2782cb5 100644 --- a/app/models/research/journal/volume.rb +++ b/app/models/research/journal/volume.rb @@ -4,6 +4,7 @@ # # id :uuid not null, primary key # description :text +# keywords :text # number :integer # published_at :date # title :string diff --git a/app/views/admin/research/journal/volumes/_form.html.erb b/app/views/admin/research/journal/volumes/_form.html.erb index 60013fe3390836e0f5dde350cc3fd6c4bba06687..f7e1627a9c092f08ee3a603917df7e20e04b4af0 100644 --- a/app/views/admin/research/journal/volumes/_form.html.erb +++ b/app/views/admin/research/journal/volumes/_form.html.erb @@ -20,6 +20,7 @@ <div class="card-body"> <%= f.input :number %> <%= f.input :published_at, html5: true %> + <%= f.input :keywords %> </div> </div> </div> diff --git a/app/views/admin/research/journal/volumes/jekyll.html.erb b/app/views/admin/research/journal/volumes/jekyll.html.erb index 50a3c146da8f2272f8f92460b7c20ea2c95d8a15..9619bed7f938118f85aff351af57cd70aff76d63 100644 --- a/app/views/admin/research/journal/volumes/jekyll.html.erb +++ b/app/views/admin/research/journal/volumes/jekyll.html.erb @@ -1,19 +1,13 @@ --- title: "<%= @volume.title %>" number: <%= @volume.number %> -issn: "-" -tags: - - "Andy Stirling" - - "anti-imperialism" - - "de colonial degrowth" - - "degrowth" - - "economic growth" -lang: Français +issn: "<%= @volume.journal.issn %>" +keywords: "<%= @volume.keywords %>" date: "<%= @volume.published_at %>" image: "<%= @volume.cover_path %>" articles: <% @volume.articles.each do |article| %> - - <%= article.id %> +- <%= article.id %> <% end %> --- <%= @volume.description %> diff --git a/app/views/admin/research/journals/_form.html.erb b/app/views/admin/research/journals/_form.html.erb index b212e3573c95879bc6fddc0cffc2d6322705d03d..6292941b2082d0a764e5ae5c4978c46cb07db086 100644 --- a/app/views/admin/research/journals/_form.html.erb +++ b/app/views/admin/research/journals/_form.html.erb @@ -2,6 +2,7 @@ <div class="row"> <div class="col-md-6"> <%= f.input :title %> + <%= f.input :issn %> </div> </div> <% content_for :buttons do %> diff --git a/app/views/admin/research/journals/show.html.erb b/app/views/admin/research/journals/show.html.erb index ef3c87c8d6fb44d4c00f0e2e658b3a6f4689eb34..a195684694268337d07d4bde959f6fe57d64c477 100644 --- a/app/views/admin/research/journals/show.html.erb +++ b/app/views/admin/research/journals/show.html.erb @@ -1,5 +1,7 @@ <% content_for :title, @journal %> +<p>ISSN : <%= @journal.issn %></p> + <% if @journal.website %> <p> Site : diff --git a/db/migrate/20210921170648_add_fields_to_journals.rb b/db/migrate/20210921170648_add_fields_to_journals.rb new file mode 100644 index 0000000000000000000000000000000000000000..71f29ca4e54fcff61d67ac99e928a31de8929862 --- /dev/null +++ b/db/migrate/20210921170648_add_fields_to_journals.rb @@ -0,0 +1,6 @@ +class AddFieldsToJournals < ActiveRecord::Migration[6.1] + def change + add_column :research_journals, :issn, :string + add_column :research_journal_volumes, :keywords, :text + end +end diff --git a/db/schema.rb b/db/schema.rb index c5a77d03379c957240c54c6ba14fc1f123f471cb..f5d9441172ebbbba42898a99072abaad02814cef 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_21_124220) do +ActiveRecord::Schema.define(version: 2021_09_21_170648) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -172,6 +172,7 @@ ActiveRecord::Schema.define(version: 2021_09_21_124220) do t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false t.text "description" + t.text "keywords" 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 @@ -184,6 +185,7 @@ ActiveRecord::Schema.define(version: 2021_09_21_124220) do t.datetime "updated_at", precision: 6, null: false t.string "access_token" t.string "repository" + t.string "issn" t.index ["university_id"], name: "index_research_journals_on_university_id" end diff --git a/docs/research/journals.md b/docs/research/journals.md new file mode 100644 index 0000000000000000000000000000000000000000..29e8ea36ba2974db364c57e3c2ab994259d3ee16 --- /dev/null +++ b/docs/research/journals.md @@ -0,0 +1,5 @@ +# Journals + +## References + +http://infolit.be/CoMLiS/ch02s03.html diff --git a/test/fixtures/research/journal/volumes.yml b/test/fixtures/research/journal/volumes.yml index f459cdca88ad4513616531780c56bbeafa2b535d..d2a9cbd2b712afb6b1bf8502bb23d760163393f4 100644 --- a/test/fixtures/research/journal/volumes.yml +++ b/test/fixtures/research/journal/volumes.yml @@ -4,6 +4,7 @@ # # id :uuid not null, primary key # description :text +# keywords :text # number :integer # published_at :date # title :string diff --git a/test/fixtures/research/journals.yml b/test/fixtures/research/journals.yml index 1fa62f29ecfa676fa07a0ee0f3b934efa8be1a58..5f957817330ef37b9489c1f26f6c3ecc4cc99261 100644 --- a/test/fixtures/research/journals.yml +++ b/test/fixtures/research/journals.yml @@ -5,6 +5,7 @@ # id :uuid not null, primary key # access_token :string # description :text +# issn :string # repository :string # title :string # created_at :datetime not null diff --git a/test/models/research/journal/volume_test.rb b/test/models/research/journal/volume_test.rb index d86b12e99ae81428f8e35c36cd0808ef984e62c5..724487fd617edb6d374fa48f9d468f23ae9eb532 100644 --- a/test/models/research/journal/volume_test.rb +++ b/test/models/research/journal/volume_test.rb @@ -4,6 +4,7 @@ # # id :uuid not null, primary key # description :text +# keywords :text # number :integer # published_at :date # title :string diff --git a/test/models/research/journal_test.rb b/test/models/research/journal_test.rb index 7326e54168ec8ceda7e367a43c8ea42a79a3808d..cf4b545b2a1e78819fd6b4fbb6c2968702957826 100644 --- a/test/models/research/journal_test.rb +++ b/test/models/research/journal_test.rb @@ -5,6 +5,7 @@ # id :uuid not null, primary key # access_token :string # description :text +# issn :string # repository :string # title :string # created_at :datetime not null