From 2840d4a7c70479cb71c9d59d698b6facace9d74c Mon Sep 17 00:00:00 2001 From: George Katsikas <giorgakis.katsikas@gmail.com> Date: Mon, 8 Apr 2024 15:23:32 +0200 Subject: [PATCH] render acceptance criteria from json field --- .../templates/journals/_acceptance_criteria.html | 16 ++++++++++++++++ .../journals/templates/journals/about.html | 2 +- .../submissions/submit_choose_journal.html | 4 +++- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 scipost_django/journals/templates/journals/_acceptance_criteria.html diff --git a/scipost_django/journals/templates/journals/_acceptance_criteria.html b/scipost_django/journals/templates/journals/_acceptance_criteria.html new file mode 100644 index 000000000..7b332a880 --- /dev/null +++ b/scipost_django/journals/templates/journals/_acceptance_criteria.html @@ -0,0 +1,16 @@ +{% load automarkup %} + +<p>{% automarkup journal.acceptance_criteria.preamble %}</p> + +{% for section in journal.acceptance_criteria.sections %} + <div class="my-3"> + <h6>{% automarkup section.title %}</h6> + <ol> + + {% for criterion in section.criteria.values %} + <li>{% automarkup criterion %}</li> + {% endfor %} + + </ol> + </div> +{% endfor %} diff --git a/scipost_django/journals/templates/journals/about.html b/scipost_django/journals/templates/journals/about.html index 2e1e2fa36..25eb061f7 100644 --- a/scipost_django/journals/templates/journals/about.html +++ b/scipost_django/journals/templates/journals/about.html @@ -126,7 +126,7 @@ <h2 class="highlight" id="criteria"> Acceptance criteria </h2> - {% automarkup journal.acceptance_criteria %} + {% include "journals/_acceptance_criteria.html" %} <h2 class="highlight" id="sub_and_ed"> Submission and Editorial Process diff --git a/scipost_django/submissions/templates/submissions/submit_choose_journal.html b/scipost_django/submissions/templates/submissions/submit_choose_journal.html index 5f8f05f15..e3034aec9 100644 --- a/scipost_django/submissions/templates/submissions/submit_choose_journal.html +++ b/scipost_django/submissions/templates/submissions/submit_choose_journal.html @@ -69,7 +69,9 @@ <p>{% automarkup journal.oneliner %}</p> <details class="text-start bg-primary bg-opacity-10 p-1"> <summary class="list-triangle mb-1">Acceptance Criteria</summary> - <div class="overflow-scroll" style="max-height: 33vh;">{% automarkup journal.acceptance_criteria %}</div> + <div class="overflow-scroll" style="max-height: 33vh;"> + {% include 'journals/_acceptance_criteria.html' %} + </div> </details> <nav class="d-flex flex-row justify-content-between align-items-end mt-2"> <a href="{{ journal.get_absolute_url }}/about" target="_blank"><em>View details</em></a> -- GitLab