From b10a8fc3a8fdf3b47e0a1090363f770c26a00105 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com>
Date: Fri, 7 Jul 2023 18:22:29 +0200
Subject: [PATCH] static

---
 app/models/concerns/with_citations.rb              |  2 +-
 .../research/hal/publications/static.html.erb      | 10 ++++++++++
 .../admin/research/journals/papers/static.html.erb | 14 ++++++++++++--
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/app/models/concerns/with_citations.rb b/app/models/concerns/with_citations.rb
index ace51af13..f235a72b2 100644
--- a/app/models/concerns/with_citations.rb
+++ b/app/models/concerns/with_citations.rb
@@ -17,7 +17,7 @@ module WithCitations
 
   def citation_for(style, website: nil, locale: nil)
     citeproc = to_citeproc(website: website)
-    processor = CiteProc::Processor.new style: style, format: 'text', locale: locale
+    processor = CiteProc::Processor.new style: style, format: 'html', locale: locale
     processor.import([citeproc])
     processor.render(:bibliography, id: citeproc["id"]).first
   end
diff --git a/app/views/admin/research/hal/publications/static.html.erb b/app/views/admin/research/hal/publications/static.html.erb
index e40b213db..2cbb04c70 100644
--- a/app/views/admin/research/hal/publications/static.html.erb
+++ b/app/views/admin/research/hal/publications/static.html.erb
@@ -25,4 +25,14 @@ researchers:
 <% @about.researchers.in_university(@website.university).each do |researcher| %>
   - <%= researcher.slug %>
 <% end %>
+citations:
+  - label: "APA"
+    content: >-
+      <%= prepare_html_for_static @about.citation_apa, @website.university %>
+  - label: "MLA"
+    content: >-
+      <%= prepare_html_for_static @about.citation_mla, @website.university %>
+  - label: "ISO 690"
+    content: >-
+      <%= prepare_html_for_static @about.citation_iso690, @website.university %>
 ---
diff --git a/app/views/admin/research/journals/papers/static.html.erb b/app/views/admin/research/journals/papers/static.html.erb
index f9ec19ac9..b959ac7df 100644
--- a/app/views/admin/research/journals/papers/static.html.erb
+++ b/app/views/admin/research/journals/papers/static.html.erb
@@ -6,7 +6,7 @@ title: >-
 <% if @about.kind %>
 paper_kind: >-
   <%= prepare_text_for_static @about.kind %>
-paper_kinds: 
+paper_kinds:
   - "<%= @about.kind.slug %>"
 <% end %>
 <% if @about.volume && @about.volume.path %>
@@ -15,7 +15,7 @@ volumes:
 <% end %>
 weight: <%= @about.position %>
 date: "<%= @about.published_at&.to_date&.iso8601 %>"
-dates: 
+dates:
   published: "<%= @about.published_at&.to_date&.iso8601 %>"
   accepted: "<%= @about.accepted_at&.to_date&.iso8601 %>"
   received: "<%= @about.received_at&.to_date&.iso8601 %>"
@@ -38,5 +38,15 @@ authors_list: >
 <%= render 'admin/application/summary/static' %>
 abstract: >
   <%= prepare_text_for_static @about.abstract %>
+citations:
+  - label: "APA"
+    content: >-
+      <%= prepare_html_for_static @about.citation_apa(website: @website), @website.university %>
+  - label: "MLA"
+    content: >-
+      <%= prepare_html_for_static @about.citation_mla(website: @website), @website.university %>
+  - label: "ISO 690"
+    content: >-
+      <%= prepare_html_for_static @about.citation_iso690(website: @website), @website.university %>
 <%= render 'admin/communication/blocks/content/static', about: @about %>
 ---
-- 
GitLab