From 0da058e288529edd94c88b2916badf25fea3d0e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com>
Date: Mon, 21 Aug 2023 15:22:37 +0200
Subject: [PATCH] added chicago and harvard citation styles

---
 app/models/concerns/with_citations.rb                     | 8 ++++++++
 app/views/admin/research/hal/publications/static.html.erb | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/app/models/concerns/with_citations.rb b/app/models/concerns/with_citations.rb
index f235a72b2..3e768d495 100644
--- a/app/models/concerns/with_citations.rb
+++ b/app/models/concerns/with_citations.rb
@@ -13,6 +13,14 @@ module WithCitations
     citation_for("modern-language-association", website: website, locale: locale)
   end
 
+  def citation_chicago(website: nil, locale: nil)
+    citation_for("chicago-author-date", website: website, locale: locale)
+  end
+
+  def citation_harvard(website: nil, locale: nil)
+    citation_for("harvard-cite-them-right", website: website, locale: locale)
+  end
+
   protected
 
   def citation_for(style, website: nil, locale: nil)
diff --git a/app/views/admin/research/hal/publications/static.html.erb b/app/views/admin/research/hal/publications/static.html.erb
index 7fdece811..4bd8b531c 100644
--- a/app/views/admin/research/hal/publications/static.html.erb
+++ b/app/views/admin/research/hal/publications/static.html.erb
@@ -32,7 +32,15 @@ citations:
   - label: "MLA"
     content: >-
       <%= prepare_html_for_static @about.citation_mla, @website.university %>
+  - label: "Chicago"
+    content: >-
+      <%= prepare_html_for_static @about.citation_chicago, @website.university %>
+  - label: "Harvard"
+    content: >-
+      <%= prepare_html_for_static @about.citation_harvard, @website.university %>
+  <% if @website.default_language.iso_code == "fr" %>
   - label: "ISO 690"
     content: >-
       <%= prepare_html_for_static @about.citation_iso690, @website.university %>
+  <% end %>
 ---
\ No newline at end of file
-- 
GitLab