From 58ef623a1d2714838815f4d1f33d9e2442670858 Mon Sep 17 00:00:00 2001 From: George Katsikas <giorgakis.katsikas@gmail.com> Date: Wed, 27 Nov 2024 12:04:35 +0100 Subject: [PATCH] hide specialties section in journal if none exist --- .../journals/templates/journals/about.html | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/scipost_django/journals/templates/journals/about.html b/scipost_django/journals/templates/journals/about.html index 1169bcf04..d3852de25 100644 --- a/scipost_django/journals/templates/journals/about.html +++ b/scipost_django/journals/templates/journals/about.html @@ -95,18 +95,24 @@ </h2> {% automarkup journal.scope %} <br><br> - <h4>Specialties covered by this Journal</h4> - <ul> - {% if journal.specialties.length > 0 %} - {% for spec in journal.specialties.all %} - <li>{{ spec }}</li> - {% endfor %} - {% elif journal.college %} - {% for spec in journal.college.acad_field.specialties.all %} - <li>{{ spec }}</li> - {% endfor %} - {% endif %} - </ul> + {% if journal.specialties.exists or journal.college.acad_field.specialties.exists %} + <h4>Specialties covered by this Journal</h4> + <ul> + + {% for spec in journal.specialties.all %} + <li>{{ spec }}</li> + {% empty %} + {% if journal.college %} + + {% for spec in journal.college.acad_field.specialties.all %} + <li>{{ spec }}</li> + {% endfor %} + + {% endif %} + {% endfor %} + + </ul> + {% endif %} <h2 class="highlight" id="content"> Content -- GitLab