From ed38c3f83dfe22f2194f7080c6d0bec84c4f8452 Mon Sep 17 00:00:00 2001
From: alexisben <alex@noesya.coop>
Date: Thu, 18 Apr 2024 11:58:39 +0200
Subject: [PATCH] fix publi modal

---
 layouts/partials/papers/actions.html | 30 ++++++++++++++++------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/layouts/partials/papers/actions.html b/layouts/partials/papers/actions.html
index 2a2f7ed9..ab2ecaf7 100644
--- a/layouts/partials/papers/actions.html
+++ b/layouts/partials/papers/actions.html
@@ -1,18 +1,12 @@
 {{ $only_file := .only_file | default false }}
+{{ $with_modal := and (not $only_file) .paper.Params.abstract }}
+{{ $modalId := printf "modal-%s" .paper.Slug }}
+
 {{ with .paper }}
-  {{ $modalId := printf "modal-%s" .Slug }}
   <div class="paper-actions" role="group">
-    {{ if not $only_file }}
-      {{- if .Params.abstract -}}
-        <button class="squared-button" type="button" data-open-modal="{{ $modalId }}">{{ i18n "volumes.abstract" }}</button>
-        {{ partial "papers/modal.html"
-          (dict
-            "modalId" $modalId
-            "title" .Title
-            "abstract" .Params.abstract
-          ) }}
-      {{- end -}}
-    {{- end -}}
+    {{- if $with_modal }}
+      <button class="squared-button" type="button" data-open-modal="{{ $modalId }}">{{ i18n "volumes.abstract" }}</button>
+    {{ end -}}
     {{- if .Params.pdf -}}
       {{- $file := partial "GetMedia" .Params.pdf -}}
       {{- $size := partial "GetHumanSize" $file.size -}}
@@ -35,4 +29,14 @@
       {{ end }}
     {{- end -}}
   </div>
-{{ end }}
\ No newline at end of file
+
+  {{- if $with_modal }}
+    {{ partial "papers/modal.html"
+      (dict
+        "modalId" $modalId
+        "title" .Title
+        "abstract" .Params.abstract
+      ) }}
+  {{ end -}}
+
+{{ end }}
-- 
GitLab