diff --git a/app/models/research/journal/paper/localization.rb b/app/models/research/journal/paper/localization.rb index 64a0397921aee2ca8bc31bee7cf8d7c3283a187a..9b02ae1a08822ad7c68053924adf14939d70d63d 100644 --- a/app/models/research/journal/paper/localization.rb +++ b/app/models/research/journal/paper/localization.rb @@ -69,6 +69,17 @@ class Research::Journal::Paper::Localization < ApplicationRecord contents_dependencies end + # TODO manage real authors (through people) + def authors_l10n_array + return [] if authors_list.blank? + @authors_l10n_array ||= authors_list.gsub(' & ', ',') + .gsub(' and ', ',') + .gsub(' et ', ',') + .split(',') + .collect(&:strip) + .compact_blank + end + def journal_l10n paper.journal.localization_for(language) end diff --git a/app/views/admin/research/journals/papers/static.html.erb b/app/views/admin/research/journals/papers/static.html.erb index ee80853d166471bf41d7de6f59ef5a510a9e2c25..caaf2f7c974c9fad20404d991e34933a98a5bb9a 100644 --- a/app/views/admin/research/journals/papers/static.html.erb +++ b/app/views/admin/research/journals/papers/static.html.erb @@ -9,6 +9,25 @@ language = @l10n.language l10n: @l10n, full_width: false, toc_offcanvas: false %> +metadata: + - name: "citation_title" + content: "<%= prepare_text_for_static @l10n.title %>" +<% @l10n.authors_l10n_array.each do |author| %> + - name: "citation_author" + content: "<%= prepare_text_for_static author %>" +<% end %> + - name: "citation_publication_date" + content: "<%= @l10n.published_at.strftime("%Y/%m/%d") %>" + - name: "citation_journal_title" + content: "<%= prepare_text_for_static paper.journal.to_s_in(language) %>" +<% if @l10n.pdf.attached? %> + - name: "citation_pdf_url" + content: "<%= @l10n.pdf.blob_id %>" +<% end %> +<% if @l10n.volume_l10n %> + - name: "citation_volume" + content: "<%= prepare_text_for_static @l10n.volume_l10n.to_s %>" +<% end %> <% if paper.kind %> paper_kind: "<%= prepare_text_for_static paper.kind %>" <% end %>