SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 03e3f8e0 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Finish moving comments to automarkup

parent ba94d1fe
No related branches found
No related tags found
No related merge requests found
Showing
with 81 additions and 82 deletions
...@@ -12,12 +12,10 @@ ...@@ -12,12 +12,10 @@
<div class="row"> <div class="row">
<div class="col-md-9"> <div class="col-md-9">
{{ form.comment_text|bootstrap:'12,12' }} {{ form.comment_text|bootstrap:'12,12' }}
<p><strong>
<p class="good_commenter">
You can use plain text, Markdown or reStructuredText; see our You can use plain text, Markdown or reStructuredText; see our
<a href="{% url 'markup:help' %}" target="_blank">markup help</a> pages. <a href="{% url 'markup:help' %}" target="_blank">markup help</a> pages.
<br> </strong></p>
Be professional. Only serious and meaningful comments will be vetted through.</p>
</div> </div>
<div class="col-md-3 radio-list"> <div class="col-md-3 radio-list">
<label>Specify categorization(s):</label> <label>Specify categorization(s):</label>
...@@ -52,7 +50,7 @@ ...@@ -52,7 +50,7 @@
</div> </div>
{% endif %} {% endif %}
<div id="submitButton"> <div id="submitButton">
<input type="submit" value="Submit your Comment for vetting" class="btn btn-primary"> <input type="submit" value="Preview looks good; submit this Comment for vetting" class="btn btn-primary">
{% if form.anonymous %} {% if form.anonymous %}
<p class="mt-2" id="goodCommenter"><i>By clicking on Submit, you agree with the <a target="_blank" href="{% url 'scipost:terms_and_conditions' %}">Terms and Conditions</a>.</i></p> <p class="mt-2" id="goodCommenter"><i>By clicking on Submit, you agree with the <a target="_blank" href="{% url 'scipost:terms_and_conditions' %}">Terms and Conditions</a>.</i></p>
{% else %} {% else %}
...@@ -63,7 +61,7 @@ ...@@ -63,7 +61,7 @@
</div> </div>
</form> </form>
<button class="btn btn-warning" id="runPreviewButton">Run/refresh preview and check your Comment before submitting it:</button> <button class="btn btn-warning" id="runPreviewButton">Run/refresh preview of your Comment</button>
<div class="card m-2"> <div class="card m-2">
<div class="card-header"> <div class="card-header">
Preview of your comment Preview of your comment
......
...@@ -7,18 +7,18 @@ ...@@ -7,18 +7,18 @@
<a href="{{ comment.author.get_absolute_url }}">{{ comment.get_author_str }}</a>: <a href="{{ comment.author.get_absolute_url }}">{{ comment.get_author_str }}</a>:
{% endif %} {% endif %}
<a href="{{comment.get_absolute_url}}"> <a href="{{ comment.get_absolute_url }}">
"{{comment.comment_text|slice:'30'}}{% if comment.comment_text|length > 30 %}...{% endif %}" "{{ comment.comment_text|slice:'30' }}{% if comment.comment_text|length > 30 %}...{% endif %}"
</a> </a>
</p><p class="card-text pl-md-3"> </p><p class="card-text pl-md-3">
in {{comment.content_type|capfirst}} on <a href="{{comment.content_object.get_absolute_url}}" class="pubtitleli">{{comment.title}}</a> in {{ comment.content_type|capfirst }} on <a href="{{ comment.content_object.get_absolute_url }}" class="pubtitleli">{{ comment.title }}</a>
{% if comment.content_object.author_list %} {% if comment.content_object.author_list %}
{% comment %} {% comment %}
Using 'by xxx' on non-submission comments here would be ambigious. Does the `by xxx` apply to the Using 'by xxx' on non-submission comments here would be ambigious. Does the `by xxx` apply to the
other object (eg. Report), or the Submission, the Comment, etc? other object (eg. Report), or the Submission, the Comment, etc?
{% endcomment %} {% endcomment %}
<span class="text-muted">by {{comment.content_object.author_list}}</span> <span class="text-muted">by {{ comment.content_object.author_list }}</span>
{% endif %} {% endif %}
</p> </p>
</div> </div>
{% load automarkup %}
<div class="card-body card-comment"> <div class="card-body card-comment">
<div class="mb-4 mt-2"> <div class="mb-4 mt-2">
<div class="d-inline-block mr-1">Nr {{comment.id}}</div> <div class="d-inline-block mr-1">Nr {{ comment.id }}</div>
{% include 'comments/_comment_voting_summary.html' with comment=comment class='small' %} {% include 'comments/_comment_voting_summary.html' with comment=comment class='small' %}
</div> </div>
<p>"{{comment.comment_text|linebreaksbr}}"</p> <p>{{ comment.comment_text|automarkup }}</p>
{% if comment.anonymous %} {% if comment.anonymous %}
<p class="card-text">by Anonymous in {{comment.content_type|capfirst}} on <a href="{{comment.content_object.get_absolute_url}}" class="pubtitleli">{{comment.title}}</a> {% if comment.content_object.author_list %} <span class="text-muted">by {{comment.content_object.author_list}}</span>{% endif %}</p> <p class="card-text">by Anonymous in {{ comment.content_type|capfirst }} on <a href="{{ comment.content_object.get_absolute_url }}" class="pubtitleli">{{ comment.title }}</a> {% if comment.content_object.author_list %} <span class="text-muted">by {{ comment.content_object.author_list }}</span>{% endif %}</p>
{% else %} {% else %}
<p class="card-text">by <a href="{{comment.author.get_absolute_url}}">{{comment.author.user.first_name}} {{comment.author.user.last_name}}</a> in {{comment.content_type|capfirst}} on <a href="{{comment.content_object.get_absolute_url}}" class="pubtitleli">{{comment.title}}</a> {% if comment.content_object.author_list %} <span class="text-muted">by {{comment.content_object.author_list}}</span>{% endif %}</p> <p class="card-text">by <a href="{{ comment.author.get_absolute_url }}">{{ comment.author.user.first_name }} {{ comment.author.user.last_name }}</a> in {{ comment.content_type|capfirst }} on <a href="{{ comment.content_object.get_absolute_url }}" class="pubtitleli">{{ comment.title }}</a> {% if comment.content_object.author_list %} <span class="text-muted">by {{ comment.content_object.author_list }}</span>{% endif %}</p>
{% endif %} {% endif %}
{% comment %} {% comment %}
Using 'by xxx' on non-submission comments here would be ambigious. Does the `by xxx` apply to the Using 'by xxx' on non-submission comments here would be ambigious. Does the `by xxx` apply to the
other object (eg. Report), or the Submission, the Comment, etc? other object (eg. Report), or the Submission, the Comment, etc?
{% endcomment %} {% endcomment %}
<p class="card-text text-muted">Comment submitted {{comment.date_submitted}}</p> <p class="card-text text-muted">Comment submitted {{ comment.date_submitted }}</p>
<p class="card-text">Status: <span class="{% if comment.status == 1 %} text-success{% elif comment.status == 0 %} text-danger{% endif %}">{{comment.get_status_display}}</span></p> <p class="card-text">Status: <span class="{% if comment.status == 1 %} text-success{% elif comment.status == 0 %} text-danger{% endif %}">{{ comment.get_status_display }}</span></p>
</div> </div>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
{% endif %} {% endif %}
<p class="my-3 pb-2"> <p class="my-3 pb-2">
{{ comment.comment_text|automarkup:'plain' }} {{ comment.comment_text|automarkup }}
</p> </p>
{% if comment.file_attachment %} {% if comment.file_attachment %}
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
{% if is_editorial_college or is_edcol_admin %} {% if is_editorial_college or is_edcol_admin %}
{% if comment.remarks_for_editors %} {% if comment.remarks_for_editors %}
<h3>Remarks for editors:</h3> <h3>Remarks for editors:</h3>
<p>{{ comment.remarks_for_editors|linebreaksbr }}</p> <p>{{ comment.remarks_for_editors|automarkup }}</p>
{% endif %} {% endif %}
{% endif %} {% endif %}
......
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
{% load filename %} {% load filename %}
{% load file_extentions %} {% load file_extentions %}
{% load comment_extras %} {% load comment_extras %}
{% load automarkup %}
<div> <div>
<h3>Details of the related {{comment.core_content_object|get_core_content_type|capfirst}}</h3> <h3>Details of the related {{ comment.core_content_object|get_core_content_type|capfirst }}</h3>
<a href="{{comment.get_absolute_url}}" target="_blank">See detail page</a> <a href="{{ comment.get_absolute_url }}" target="_blank">See detail page</a>
<div class="py-2"> <div class="py-2">
{% get_summary_template comment.core_content_object %} {% get_summary_template comment.core_content_object %}
</div> </div>
...@@ -16,12 +17,8 @@ ...@@ -16,12 +17,8 @@
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<!-- {% include 'comments/_comment_identifier.html' with comment=comment %} -->
{% include 'comments/_single_comment.html' with comment=comment hide_votes=1 %} {% include 'comments/_single_comment.html' with comment=comment hide_votes=1 %}
<h3>Comment text:</h3>
<p>{{ comment.comment_text|linebreaksbr }}</p>
{% if comment.file_attachment %} {% if comment.file_attachment %}
<h3>Attachment:</h3> <h3>Attachment:</h3>
<p> <p>
...@@ -37,7 +34,7 @@ ...@@ -37,7 +34,7 @@
{% if comment.remarks_for_editors %} {% if comment.remarks_for_editors %}
<h3>Remarks for Editors only:</h3> <h3>Remarks for Editors only:</h3>
<p>{{ comment.remarks_for_editors|linebreaksbr }}</p> <p>{{ comment.remarks_for_editors|automarkup }}</p>
{% endif %} {% endif %}
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
......
{% extends 'scipost/base.html' %} {% extends 'scipost/base.html' %}
{% load comment_extras %} {% load comment_extras %}
{% load automarkup %}
{% block pagetitle %}: reply to comment{% endblock pagetitle %} {% block pagetitle %}: reply to comment{% endblock pagetitle %}
...@@ -15,7 +16,7 @@ ...@@ -15,7 +16,7 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h2>The {{comment.core_content_object|get_core_content_type|capfirst}} concerned:</h2> <h2>The {{ comment.core_content_object|get_core_content_type|capfirst }} concerned:</h2>
{% get_summary_template comment.core_content_object %} {% get_summary_template comment.core_content_object %}
</div> </div>
</div> </div>
...@@ -34,7 +35,7 @@ ...@@ -34,7 +35,7 @@
{% include 'comments/_comment_voting_summary.html' with comment=comment %} {% include 'comments/_comment_voting_summary.html' with comment=comment %}
<p>{{ comment.comment_text|linebreaksbr }}</p> <p>{{ comment.comment_text|automarkup }}</p>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
<h1 class="highlight">SciPost Comments to vet:</h1> <h1 class="highlight">SciPost Comments to vet:</h1>
{% for comment_to_vet in comments_to_vet %} {% for comment_to_vet in comments_to_vet %}
<hr>
<h3 class="highlight">Comment {{ comment_to_vet.id }}</h3>
{% include 'comments/_vet_comment_form.html' with comment=comment_to_vet form=form %} {% include 'comments/_vet_comment_form.html' with comment=comment_to_vet form=form %}
{% endfor %} {% endfor %}
......
...@@ -33,12 +33,6 @@ li ol > li:before { ...@@ -33,12 +33,6 @@ li ol > li:before {
content: counters(item, ".") " "; content: counters(item, ".") " ";
} }
.good_commenter {
font-size: 90%;
font-style: italic;
}
.opinionsDisplay { .opinionsDisplay {
font-family: 'Merriweather Sans'; font-family: 'Merriweather Sans';
font-size: 10px; font-size: 10px;
......
<p>Dear {{comment.author.get_title_display}} {{comment.author.user.last_name}},</p> {% load automarkup %}
<p>
We hereby confirm reception of your Comment, concerning
<br/> <p>Dear {{ comment.author.get_title_display }} {{ comment.author.user.last_name }},</p>
{{comment.core_content_object.title}}
{% if comment.core_content_object.author_list %}
<br>
by {{comment.core_content_object.author_list}}.
{% elif comment.core_content_object.author %}
<br>
by {{comment.core_content_object.author}}.
{% endif %}
</p>
<p> <p>
We copy it below for your convenience. We hereby confirm reception of your Comment, concerning
<br/>
{{ comment.core_content_object.title }}
{% if comment.core_content_object.author_list %}
<br>
by {{ comment.core_content_object.author_list }}.
{% elif comment.core_content_object.author %}
<br> <br>
Your Comment will soon be vetted, at which point you will receive an email update from us. by {{ comment.core_content_object.author }}.
{% endif %}
</p> </p>
<p> <p>
Thank you for your contribution,<br><br> We copy it below for your convenience.
The SciPost Team. <br>
Your Comment will soon be vetted, at which point you will receive an email update from us.
</p>
<p>
Thank you for your contribution,<br><br>
The SciPost Team.
</p> </p>
<br> <br>
<p> <p>
Comment: Comment:
<br> <br>
{{ comment.comment_text|linebreaksbr }} {{ comment.comment_text|automarkup }}
</p> </p>
{% include 'email/_footer.html' %} {% include 'email/_footer.html' %}
<p>Dear {{comment.author.get_title_display}} {{comment.author.user.last_name}},</p> {% load automarkup %}
<p>Dear {{ comment.author.get_title_display }} {{ comment.author.user.last_name }},</p>
<p> <p>
The Comment you have submitted, concerning The Comment you have submitted, concerning
<br/> <br/>
{{comment.core_content_object.title}} by {% if comment.core_content_object.author_list %}{{comment.core_content_object.author_list}}{% elif comment.core_content_object.author %}{{comment.core_content_object.author}}{% endif %} (<a href="https://scipost.org{{comment.get_absolute_url}}">see on SciPost.org</a>) {{ comment.core_content_object.title }} by {% if comment.core_content_object.author_list %}{{ comment.core_content_object.author_list }}{% elif comment.core_content_object.author %}{{ comment.core_content_object.author }}{% endif %} (<a href="https://scipost.org{{ comment.get_absolute_url }}">see on SciPost.org</a>)
<br/> <br/>
has been rejected for the following reason: {{comment.get_status_display}}. has been rejected for the following reason: {{ comment.get_status_display }}.
</p> </p>
<p> <p>
We copy it below for your convenience. We copy it below for your convenience.
</p> </p>
<p> <p>
Thank you for your contribution,<br><br> Thank you for your contribution,<br><br>
The SciPost Team. The SciPost Team.
</p> </p>
{% if email_response %} {% if email_response %}
<p>Further explanations: {{email_response}}</p> <p>Further explanations: {{ email_response }}</p>
{% endif %} {% endif %}
<p> <p>
<br> <br>
Comment: Comment:
<br> <br>
{{comment.comment_text|linebreaksbr}} {{ comment.comment_text|automarkup }}
</p> </p>
{% include 'email/_footer.html' %} {% include 'email/_footer.html' %}
<p>Dear {{comment.author.get_title_display}} {{comment.author.user.last_name}},</p> {% load automarkup %}
<p>Dear {{ comment.author.get_title_display }} {{ comment.author.user.last_name }},</p>
<p> <p>
The Comment you have submitted, concerning The Comment you have submitted, concerning
<br/> <br/>
{{comment.core_content_object.title}} by {% if comment.core_content_object.author_list %}{{comment.core_content_object.author_list}}{% elif comment.core_content_object.author %}{{comment.core_content_object.author}}{% endif %} (<a href="https://scipost.org{{comment.get_absolute_url}}">see on SciPost.org</a>) {{ comment.core_content_object.title }} by {% if comment.core_content_object.author_list %}{{ comment.core_content_object.author_list }}{% elif comment.core_content_object.author %}{{ comment.core_content_object.author }}{% endif %} (<a href="https://scipost.org{{ comment.get_absolute_url }}">see on SciPost.org</a>)
<br/> <br/>
has been accepted and published online. has been accepted and published online.
</p> </p>
<p> <p>
We copy it below for your convenience. We copy it below for your convenience.
</p> </p>
<p> <p>
Thank you for your contribution,<br><br> Thank you for your contribution,<br><br>
The SciPost Team The SciPost Team
</p> </p>
<p> <p>
<br> <br>
Comment: Comment:
<br> <br>
{{comment.comment_text|linebreaksbr}} {{ comment.comment_text|automarkup }}
</p> </p>
{% include 'email/_footer.html' %} {% include 'email/_footer.html' %}
{{object.comment_text}} {{ object.comment_text }}
{{object.date_submitted}} {{ object.date_submitted }}
{% if not object.anonymous %}{{ object.author }}{% endif %} {% if not object.anonymous %}{{ object.author }}{% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment