From 50f519947e526eb5b5acc122d119ac12b8922f0c Mon Sep 17 00:00:00 2001
From: George Katsikas <giorgakis.katsikas@gmail.com>
Date: Tue, 1 Aug 2023 11:10:24 +0300
Subject: [PATCH] add src button to publication card for codeb

fixes #106
---
 .../templates/journals/_publication_card_content.html      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scipost_django/journals/templates/journals/_publication_card_content.html b/scipost_django/journals/templates/journals/_publication_card_content.html
index f65d21ad7..54bef9072 100644
--- a/scipost_django/journals/templates/journals/_publication_card_content.html
+++ b/scipost_django/journals/templates/journals/_publication_card_content.html
@@ -15,7 +15,12 @@
         </span>
         <span class="mx-1">|</span>
         <button type="button" class="btn btn-link border-0 m-0 p-0" style="line-height: 1rem;" data-bs-toggle="toggle" data-bs-target="#abstract-pub-{{ publication.id }}"><small class="border-0 m-0 p-0">Toggle abstract</small></button>
-        &middot; <a href="{{ publication.get_absolute_url }}/pdf" target="_blank">pdf</a>
+        {% if publication.pdf_file %}
+          &middot; <a href="{{ publication.get_absolute_url }}/pdf" target="_blank">pdf</a>
+        {% endif %}
+        {% if publication.resources.release.first %}
+          &middot; <a href="{{ publication.resources.release.first.url }}">src</a>
+        {% endif %}
       </p>
       <p class="abstract mb-0 mt-2 py-2" id="abstract-pub-{{ publication.id }}" style="display:none;">{{ publication.abstract }}</p>
     </div>
-- 
GitLab