From 8f7bc33e8f3cee900daeda8093ab937c1dcb5489 Mon Sep 17 00:00:00 2001 From: Jorran de Wit <jorrandewit@outlook.com> Date: Sat, 3 Feb 2018 12:18:37 +0100 Subject: [PATCH] TOC Ready to go --- SciPost_v1/settings/base.py | 2 +- .../partials/comments/comments_list.html | 8 ++++++ .../scipost/personal_page/submissions.html | 2 +- .../submissions/table_of_contents.html | 28 ++++++------------- 4 files changed, 19 insertions(+), 21 deletions(-) create mode 100644 comments/templates/partials/comments/comments_list.html diff --git a/SciPost_v1/settings/base.py b/SciPost_v1/settings/base.py index 05df150ab..d4d350913 100644 --- a/SciPost_v1/settings/base.py +++ b/SciPost_v1/settings/base.py @@ -225,7 +225,7 @@ TIME_ZONE = 'CET' USE_I18N = True USE_L10N = False -DATE_FORMAT = 'Y-m-d' +SHORT_DATE_FORMAT = DATE_FORMAT = 'Y-m-d' DATETIME_FORMAT = 'Y-m-d H:i' USE_TZ = True diff --git a/comments/templates/partials/comments/comments_list.html b/comments/templates/partials/comments/comments_list.html new file mode 100644 index 000000000..169158b74 --- /dev/null +++ b/comments/templates/partials/comments/comments_list.html @@ -0,0 +1,8 @@ +{% if comments %} + <ul class="{{ css_class|default:'' }}"> + {% for comment in comments %} + <li><a href="{{ comment.get_absolute_url }}">{% if comment.is_author_reply %}Author Reply{% else %}Comment{% endif %} by {{ comment.author.get_title_display }} {{ comment.author.user.last_name }} on {{ comment.date_submitted|date:'DATE_FORMAT' }}</a></li> + {% include 'partials/comments/comments_list.html' with comments=comment.nested_comments.vetted css_class='m-0 pl-4' %} + {% endfor %} + </ul> +{% endif %} diff --git a/scipost/templates/partials/scipost/personal_page/submissions.html b/scipost/templates/partials/scipost/personal_page/submissions.html index 0e9c098fa..2af5125f6 100644 --- a/scipost/templates/partials/scipost/personal_page/submissions.html +++ b/scipost/templates/partials/scipost/personal_page/submissions.html @@ -21,7 +21,7 @@ </div> <div class="col-12"> <ul class="list-group list-group-flush"> - {% for sub in own_submissions %}, + {% for sub in own_submissions %} <li class="list-group-item"> <div class="card-body px-0"> {% include 'partials/submissions/submission_card_content.html' with submission=sub %} diff --git a/submissions/templates/partials/submissions/table_of_contents.html b/submissions/templates/partials/submissions/table_of_contents.html index 143d3d5f0..bb13dd40a 100644 --- a/submissions/templates/partials/submissions/table_of_contents.html +++ b/submissions/templates/partials/submissions/table_of_contents.html @@ -4,27 +4,17 @@ <div class="card-body"> <h3 class="card-title">Table of Contents</h3> {% for sibling in submission.thread %} - <div class="mt-1"> - <b><a href="{{ sibling.get_absolute_url }}" class="pubtitleli">Version {{ sibling.arxiv_vn_nr }}</a></b> - <span class="version-suffix"> - {% if sibling.is_current %} - (current version) - {% else %} - (deprecated version) - {% endif %} - </span> + <div class="my-2"> + {% if forloop.last %}Submission{% else %}Resubmission{% endif %} <a href="{{ sibling.get_absolute_url }}" class="pubtitleli">{{ sibling.arxiv_identifier_w_vn_nr }}</a> <em>submitted on {{ sibling.submission_date|date:'j F Y' }}</em> </div> - <div class="p-1"> - Submitted on {{ sibling.submission_date|date:'j F Y' }} - <br> + <ul class="m-0 pl-4"> + {% for report in sibling.reports.accepted %} + <li><a href="{{ report.get_absolute_url }}">Report {{ report.report_nr }} submitted on {{ report.date_submitted }} by {% if report.anonymous %}<em>Anonymous</em>{% else %}{{ report.author.get_title_display }} {{ report.author.user.last_name }}{% endif %}</a></li> + {% include 'partials/comments/comments_list.html' with comments=report.comments.vetted css_class='my-1 pl-4' %} + {% endfor %} + </ul> - <ul class="m-0"> - {% for report in sibling.reports.accepted %} - - <li><a href="{{ report.get_absolute_url }}">Report {{ report.report_nr }} submitted on {{ report.date_submitted }} by {% if report.anonymous %}<em>Anonymous</em>{% else %}{{ report.author.get_title_display }} {{ report.author.user.last_name }}{% endif %}</a></li> - {% endfor %} - </ul> - </div> + {% include 'partials/comments/comments_list.html' with comments=sibling.comments.vetted css_class='my-1 pl-4' %} {% endfor %} </div> </div> -- GitLab