diff --git a/submissions/models.py b/submissions/models.py index a0e8cd4416352a1dee87b84d71df57974ecc2ace..f6b8faa61aa33bd4cfa089c2bfe5c27b74518d70 100644 --- a/submissions/models.py +++ b/submissions/models.py @@ -238,26 +238,26 @@ class Submission(ArxivCallable, models.Model): def header_as_table(self): # for Submission page - header = '<table>' - header += '<tr><td>Title: </td><td> </td><td>{{ title }}</td></tr>' - header += '<tr><td>Author(s): </td><td> </td><td>{{ author_list }}</td></tr>' - header += '<tr><td>As Contributors: </td><td> </td>' + header = '<table class="submission_header">' + header += '<tr><td>Title: </td><td>{{ title }}</td></tr>' + header += '<tr><td>Author(s): </td><td>{{ author_list }}</td></tr>' + header += '<tr><td>As Contributors: </td>' if self.authors.all(): header += '<td>' for auth in self.authors.all(): header += ('<a href="/contributor/' + str(auth.id) + '">' + auth.user.first_name - + ' ' + auth.user.last_name + '</a> ') + + ' ' + auth.user.last_name + '</a>') header += '</td>' else: header += '<td>(none claimed)</td>' header += ('</tr>' - '<tr><td>arxiv Link: </td><td> </td>' + '<tr><td>arxiv Link: </td>' '<td><a href="{{ arxiv_link }}" target="_blank">{{ arxiv_link }}</a></td></tr>' - '<tr><td>Date submitted: </td><td> </td><td>{{ submission_date }}</td></tr>' - '<tr><td>Submitted by: </td><td> </td><td>{{ submitted_by }}</td></tr>' - '<tr><td>Submitted to: </td><td> </td><td>{{ to_journal }}</td></tr>' - '<tr><td>Domain(s): </td><td> </td><td>{{ domain }}</td></tr>' - '<tr><td>Subject area: </td><td> </td><td>{{ subject_area }}</td></tr>' + '<tr><td>Date submitted: </td><td>{{ submission_date }}</td></tr>' + '<tr><td>Submitted by: </td><td>{{ submitted_by }}</td></tr>' + '<tr><td>Submitted to: </td><td>{{ to_journal }}</td></tr>' + '<tr><td>Domain(s): </td><td>{{ domain }}</td></tr>' + '<tr><td>Subject area: </td><td>{{ subject_area }}</td></tr>' '</table>') template = Template(header) context = Context({ @@ -675,7 +675,7 @@ class Report(models.Model): 'first_name': self.author.user.first_name, 'last_name': self.author.user.last_name, 'date_submitted': self.date_submitted.strftime("%Y-%m-%d")}) - output = '<div class="reportid">\n' + output = '<div class="reportid">' output += '<h3><a id="report_id{{ id }}"></a>' if self.anonymous: output += 'Anonymous Report {{ id }}' @@ -688,15 +688,15 @@ class Report(models.Model): def print_contents(self): context = Context({'strengths': self.strengths, 'weaknesses': self.weaknesses, 'report': self.report, 'requested_changes': self.requested_changes}) - output = ('<div class="row"><div class="col-2">' - '<p>Strengths:</p></div><div class="col-10"><p>{{ strengths }}</p></div></div>' - '<div class="row"><div class="col-2">' - '<p>Weaknesses:</p></div><div class="col-10"><p>{{ weaknesses }}</p></div></div>' - '<div class="row"><div class="col-2">' - '<p>Report:</p></div><div class="col-10"><p>{{ report }}</p></div></div>' - '<div class="row"><div class="col-2">' - '<p>Requested changes:</p></div>' - '<div class="col-10"><p>{{ requested_changes }}</p></div></div>' + output = ('<div class="row"><div class="col-6">' + 'Strengths:</div><div class="col-6">{{ strengths }}</div></div>' + '<div class="row"><div class="col-6">' + 'Weaknesses:</div><div class="col-6">{{ weaknesses }}</div></div>' + '<div class="row"><div class="col-6">' + 'Report:</div><div class="col-6">{{ report }}</div></div>' + '<div class="row"><div class="col-6">' + 'Requested changes:</div>' + '<div class="col-6">{{ requested_changes }}</div></div>' '<div class="reportRatings"><ul>' '<li>validity: ' + ranking_choices_dict[self.validity] + '</li>' '<li>significance: ' + ranking_choices_dict[self.significance] + '</li>' @@ -716,19 +716,19 @@ class Report(models.Model): 'date_submitted': self.date_submitted.strftime("%Y-%m-%d"), 'remarks_for_editors': self.remarks_for_editors, }) - output = '<div class="reportid">\n' - output += '<h3><a id="report_id{{ id }}"></a>' + output = '<div class="reportid">' + output += '<h3>' if self.anonymous: output += '(chose public anonymity) ' output += ('<a href="/contributor/{{ author_id }}">' '{{ author_first_name }} {{ author_last_name }}</a>' ' on {{ date_submitted }}</h3></div>' - '<div class="row"><div class="col-2">Qualification:</p></div>' - '<div class="col-10"><p>' - + ref_qualif_dict[self.qualification] + '</p></div></div>') + '<div class="row"><div class="col-6">Qualification:</div>' + '<div class="col-6">' + + ref_qualif_dict[self.qualification] + '</div></div>') output += self.print_contents() output += '<h3>Remarks for editors</h3><p>{{ remarks_for_editors }}</p>' - output += '<h3>Recommendation: ' + report_rec_dict[self.recommendation] + '</h3>' + output += '<h3>Recommendation</h3><p>%s</p>' % report_rec_dict[self.recommendation] template = Template(output) return template.render(context) diff --git a/submissions/templates/submissions/submission_detail.html b/submissions/templates/submissions/submission_detail.html index 53a0a20cc0a51c90a196d65f5312a509b63b2904..d0f095a1d0106195603831420e556bc08fbef14a 100644 --- a/submissions/templates/submissions/submission_detail.html +++ b/submissions/templates/submissions/submission_detail.html @@ -37,245 +37,257 @@ {% endblock headsup %} -{% block bodysup %} - - -<section> - <div class="flex-greybox"> - <h1>SciPost Submission Page</h1> - {% if not submission.is_current %} - <h3 style="color: red;">This is not the current version.</h3> - {% endif %} - {% if user.contributor == submission.editor_in_charge %} - <h3>(You are the Editor-in-charge, go to the <a href="{% url 'submissions:editorial_page' arxiv_identifier_w_vn_nr=submission.arxiv_identifier_w_vn_nr %}">Editorial Page</a> to take editorial actions)</h3> - {% endif %} - </div> - - {% if other_versions %} - <h3>Other versions of this Submission (with Reports) exist:</h3> - <ul> - {% for vn in other_versions %} - {{ vn.version_info_as_li }} - {% endfor %} - </ul> - {% endif %} +{% block content %} + - <hr class="hr12"> - <div class="row"> - <div class="col-4"> - <h2>Submission:</h2> +<div class="row"> + <div class="col-12"> + <div class="panel"> + <h1>SciPost Submission Page</h1> + {% if not submission.is_current %} + <h3 style="color: red;">This is not the current version.</h3> + {% endif %} + {% if user.contributor == submission.editor_in_charge %} + <h3>(You are the Editor-in-charge, go to the <a href="{% url 'submissions:editorial_page' arxiv_identifier_w_vn_nr=submission.arxiv_identifier_w_vn_nr %}">Editorial Page</a> to take editorial actions)</h3> + {% endif %} + </div> + </div> +</div> + +{% if other_versions %} +<div class="row"> + <div class="col-12"> + <h3>Other versions of this Submission (with Reports) exist:</h3> + <ul> + {% for vn in other_versions %} + {{ vn.version_info_as_li }} + {% endfor %} + </ul> </div> - </div> - {{ submission.header_as_table }} - <h3>Abstract:</h3> - <p>{{ submission.abstract }}</p> +</div> +{% endif %} - <h1>Status:</h1> - {{ submission.status_info_as_table }} +<div class="row"> + <div class="col-12"> + <hr> + {{ submission.header_as_table }} - {% if submission.author_comments %} - <h3>Author comments upon resubmission</h3> - <p>{{ submission.author_comments|linebreaks }}</p> - {% endif %} + <h3 class="mt-3">Abstract:</h3> + <p>{{ submission.abstract }}</p> - {% if submission.list_of_changes %} - <h3>List of changes</h3> - <p>{{ submission.list_of_changes|linebreaks }}</p> - {% endif %} + <h3>Status:</h3> + {{ submission.status_info_as_table }} -</section> + {% if submission.author_comments %} + <h3>Author comments upon resubmission</h3> + <p>{{ submission.author_comments|linebreaks }}</p> + {% endif %} + + {% if submission.list_of_changes %} + <h3>List of changes</h3> + <p>{{ submission.list_of_changes|linebreaks }}</p> + {% endif %} + </div> +</div> {% if is_author or user|is_in_group:'Editorial College' or user|is_in_group:'Editorial Administrators' %} {% if recommendation %} {% if user|is_in_group:'Editorial College' or user|is_in_group:'Editorial Administrators' or recommendation|is_viewable_by_authors %} -<section> - <div class="flex-greybox"> - <h1>Editorial Recommendation</h1> - </div> - {{ recommendation.print_for_authors }} -</section> +<div class="row"> + <div class="col-12"> + <h2>Editorial Recommendation</h2> + {{ recommendation.print_for_authors }} + </div> +</div> {% endif %} {% endif %} {% endif %} {% if user.is_authenticated and user|is_in_group:'Registered Contributors' %} -<section> - <div class="flex-greybox"> - <h1>Actions</h1> - </div> - <ul> - {% if submission.open_for_reporting %} - {% if perms.scipost.can_referee and not is_author and not is_author_unchecked %} - <li><h3><a href="{% url 'submissions:submit_report' arxiv_identifier_w_vn_nr=submission.arxiv_identifier_w_vn_nr %}">Contribute a Report</a></h3> - <div class="reportingDeadline">Deadline for reporting: {{ submission.reporting_deadline|date:"Y-m-d" }}</div></li> - {% elif is_author_unchecked %} - <li><h3>Contribute a Report [deactivated]: the system flagged you as a potential author of this Submission. - Please go to your <a href="{% url 'scipost:personal_page' %}">personal page</a> - under the Submissions tab to clarify this.</h3></li> - {% endif %} - {% else %} - <li>Reporting for this Submission is closed.</li> - {% endif %} - {% if submission.open_for_commenting %} - {% if perms.scipost.can_submit_comments %} - <li><h3><a href="#contribute_comment">Contribute a Comment</a></h3></li> - {% endif %} - {% else %} - <li>Commenting on this Submission is closed.</li> - {% endif %} - </ul> -</section> -{% endif %} - -{% if invited_reports %} -<section> - <hr class="hr12"> - <div class="flex-greybox"> - <h2>Invited Reports on this Submission</h2> - <button id="invitedreportsbutton">Toggle invited reports view</button> - </div> - - <div id="invitedreportslist"> - {% for report in invited_reports %} - <hr class="hr6"/> - {% if user.contributor == submission.editor_in_charge or user|is_in_group:'Editorial Administrators' and not is_author or user|is_in_group:'Editorial Administrators' and not is_author_unchecked %} - {% if report.flagged %} - <h4 style="color: red">CAUTION: check if this referee has been flagged by the authors</h4> - {% endif %} - {{ report.print_contents_for_editors|linebreaks }} - {% else %} - {{ report.print_identifier }} - {{ report.print_contents|linebreaks }} - {% endif %} - - <hr style="border-style: dotted;" /> - <h3><a href="{% url 'comments:reply_to_report' report_id=report.id %}">Reply to this Report</a> (authors only)</h3> - - {% for reply in author_replies %} - {% if reply.in_reply_to_report %} - {% if reply.in_reply_to_report.id == report.id %} - <div class="row"> - <div class="col-1"></div> - <hr style="border-style: dotted;" /> - - <div class="flex-container"> - <div class="flex-commentbox"> - {{ reply.print_identifier }} - {{ reply.categories_as_ul }} - <div class="opinionsDisplay"> - {% if user.is_authenticated and perms.scipost.can_express_opinion_on_comments %} - {% if user.contributor != reply.author %} - <form action="{% url 'comments:express_opinion' comment_id=reply.id opinion='A' %}" method="post"> - {% csrf_token %} - <input type="submit" class="agree" value="Agree {{ reply.nr_A }} "/> - </form> - <form action="{% url 'comments:express_opinion' comment_id=reply.id opinion='N' %}" method="post"> - {% csrf_token %} - <input type="submit" class="notsure" value="Not sure {{ reply.nr_N }}"/> - </form> - <form action="{% url 'comments:express_opinion' comment_id=reply.id opinion='D'%}" method="post"> - {% csrf_token %} - <input type="submit" class="disagree" value="Disagree {{ reply.nr_D }}"/> - </form> +<div class="row"> + <div class="col-12"> + <div class="panel"> + <h2>Actions</h2> + </div> + </div> +</div> +<div class="row"> + <div class="col-12"> + <ul> + {% if submission.open_for_reporting %} + {% if perms.scipost.can_referee and not is_author and not is_author_unchecked %} + <li><h3><a href="{% url 'submissions:submit_report' arxiv_identifier_w_vn_nr=submission.arxiv_identifier_w_vn_nr %}">Contribute a Report</a></h3> + <div class="reportingDeadline">Deadline for reporting: {{ submission.reporting_deadline|date:"Y-m-d" }}</div></li> + {% elif is_author_unchecked %} + <li><h3>Contribute a Report [deactivated]: the system flagged you as a potential author of this Submission. + Please go to your <a href="{% url 'scipost:personal_page' %}">personal page</a> + under the Submissions tab to clarify this.</h3></li> + {% endif %} {% else %} - {{ reply.opinions_as_ul }} + <li>Reporting for this Submission is closed.</li> {% endif %} + {% if submission.open_for_commenting %} + {% if perms.scipost.can_submit_comments %} + <li><h3><a href="#contribute_comment">Contribute a Comment</a></h3></li> + {% endif %} + {% else %} + <li>Commenting on this Submission is closed.</li> {% endif %} - </div> - </div> - </div> - </div> - <div class="row"> - <div class="col-1"></div> - <div class="col-10"> - <p>{{ reply.comment_text|linebreaks }}</p> - </div> + </ul> </div> +</div> +{% endif %} - {% endif %} - {% endif %} - {% endfor %} +{% if invited_reports %} +<hr> +<div class="row"> + <div class="col-12"> + <div class="panel"> + <h2>Invited Reports on this Submission</h2> + <button class="btn btn-secondary" id="invitedreportsbutton">Toggle invited reports view</button> + </div> + </div> +</div> +<div class="row" id="invitedreportslist"> + {% for report in invited_reports %} + <div class="col-12"> + <div class="report"> + {% if user.contributor == submission.editor_in_charge or user|is_in_group:'Editorial Administrators' and not is_author or user|is_in_group:'Editorial Administrators' and not is_author_unchecked %} + {% if report.flagged %} + <h4 style="color: red">CAUTION: check if this referee has been flagged by the authors</h4> + {% endif %} + {{ report.print_contents_for_editors }} + {% else %} + {{ report.print_identifier }} + {{ report.print_contents }} + {% endif %} + + <hr class="small"> + <h3 class="mb-3"><a href="{% url 'comments:reply_to_report' report_id=report.id %}">Reply to this Report</a> (authors only)</h3> + + {% for reply in author_replies %} + {% if reply.in_reply_to_report %} + {% if reply.in_reply_to_report.id == report.id %} + <div class="report nested_report"> + <div class="row"> + <div class="col-12"> + {{ reply.print_identifier }} + {{ reply.categories_as_ul }} + <div class="opinionsDisplay"> + {% if user.is_authenticated and perms.scipost.can_express_opinion_on_comments %} + {% if user.contributor != reply.author %} + <form action="{% url 'comments:express_opinion' comment_id=reply.id opinion='A' %}" method="post"> + {% csrf_token %} + <input type="submit" class="agree" value="Agree {{ reply.nr_A }} "/> + </form> + <form action="{% url 'comments:express_opinion' comment_id=reply.id opinion='N' %}" method="post"> + {% csrf_token %} + <input type="submit" class="notsure" value="Not sure {{ reply.nr_N }}"/> + </form> + <form action="{% url 'comments:express_opinion' comment_id=reply.id opinion='D'%}" method="post"> + {% csrf_token %} + <input type="submit" class="disagree" value="Disagree {{ reply.nr_D }}"/> + </form> + {% else %} + {{ reply.opinions_as_ul }} + {% endif %} + {% endif %} + </div> + </div> + <div class="col-12"> + <p>{{ reply.comment_text|linebreaks }}</p> + </div> + </div> + </div> + {% endif %} + {% endif %} + {% endfor %} + </div> + </div> {% endfor %} - </div> +</div> -</section> {% endif %} {% if contributed_reports %} -<section> - <hr class="hr12"> - <div class="flex-greybox"> - <h2>Contributed Reports on this Submission</h2> - <button id="contributedreportsbutton">Toggle contributed reports view</button> - </div> - - <div id="contributedreportslist"> - {% for report in contributed_reports %} - <hr class="hr6"/> - {% if user.contributor == submission.editor_in_charge or user|is_in_group:'Editorial Administrators' and not is_author or user|is_in_group:'Editorial Administrators' and not is_author_unchecked %} - {% if report.flagged %} - <h4 style="color: red">CAUTION: check if this referee has been flagged by the authors</h4> - {% endif %} - {{ report.print_contents_for_editors }} - {% else %} - {{ report.print_identifier }} - {{ report.print_contents }} - {% endif %} - - <hr style="border-style: dotted;" /> - <h3><a href="{% url 'comments:reply_to_report' report_id=report.id %}">Reply to this Report</a> (authors only)</h3> - - {% for reply in author_replies %} - {% if reply.in_reply_to_report %} - {% if reply.in_reply_to_report.id == report.id %} - <div class="row"> - <div class="col-1"></div> - <hr style="border-style: dotted;" /> - - <div class="flex-container"> - <div class="flex-commentbox"> - {{ reply.print_identifier }} - {{ reply.categories_as_ul }} - <div class="opinionsDisplay"> - {% if user.is_authenticated and perms.scipost.can_express_opinion_on_comments %} - {% if user.contributor != reply.author %} - <form action="{% url 'comments:express_opinion' comment_id=reply.id opinion='A' %}" method="post"> - {% csrf_token %} - <input type="submit" class="agree" value="Agree {{ reply.nr_A }} "/> - </form> - <form action="{% url 'comments:express_opinion' comment_id=reply.id opinion='N' %}" method="post"> - {% csrf_token %} - <input type="submit" class="notsure" value="Not sure {{ reply.nr_N }}"/> - </form> - <form action="{% url 'comments:express_opinion' comment_id=reply.id opinion='D'%}" method="post"> - {% csrf_token %} - <input type="submit" class="disagree" value="Disagree {{ reply.nr_D }}"/> - </form> - {% else %} - {{ reply.opinions_as_ul }} - {% endif %} - {% endif %} - </div> +<hr> +<div class="row"> + <div class="col-12"> + <div class="panel"> + <h2>Contributed Reports on this Submission</h2> + <button class="btn btn-secondary" id="contributedreportsbutton">Toggle contributed reports view</button> </div> - </div> - </div> - <div class="row"> - <div class="col-1"></div> - <div class="col-10"> - <p>{{ reply.comment_text|linebreaks }}</p> - </div> </div> +</div> - {% endif %} - {% endif %} - {% endfor %} - +<div class="row" id="contributedreportslist"> + {% for report in contributed_reports %} + <div class="col-12"> + <div class="report"> + {% if user.contributor == submission.editor_in_charge or user|is_in_group:'Editorial Administrators' and not is_author or user|is_in_group:'Editorial Administrators' and not is_author_unchecked %} + {% if report.flagged %} + <h4 style="color: red">CAUTION: check if this referee has been flagged by the authors</h4> + {% endif %} + {{ report.print_contents_for_editors }} + {% else %} + {{ report.print_identifier }} + {{ report.print_contents }} + {% endif %} + + <hr class="small"> + <h3><a href="{% url 'comments:reply_to_report' report_id=report.id %}">Reply to this Report</a> (authors only)</h3> + + {% for reply in author_replies %} + {% if reply.in_reply_to_report %} + {% if reply.in_reply_to_report.id == report.id %} + <div class="row"> + <div class="col-1"></div> + <hr style="border-style: dotted;" /> + + <div class="flex-container"> + <div class="flex-commentbox"> + {{ reply.print_identifier }} + {{ reply.categories_as_ul }} + <div class="opinionsDisplay"> + {% if user.is_authenticated and perms.scipost.can_express_opinion_on_comments %} + {% if user.contributor != reply.author %} + <form action="{% url 'comments:express_opinion' comment_id=reply.id opinion='A' %}" method="post"> + {% csrf_token %} + <input type="submit" class="agree" value="Agree {{ reply.nr_A }} "/> + </form> + <form action="{% url 'comments:express_opinion' comment_id=reply.id opinion='N' %}" method="post"> + {% csrf_token %} + <input type="submit" class="notsure" value="Not sure {{ reply.nr_N }}"/> + </form> + <form action="{% url 'comments:express_opinion' comment_id=reply.id opinion='D'%}" method="post"> + {% csrf_token %} + <input type="submit" class="disagree" value="Disagree {{ reply.nr_D }}"/> + </form> + {% else %} + {{ reply.opinions_as_ul }} + {% endif %} + {% endif %} + </div> + </div> + </div> + </div> + <div class="row"> + <div class="col-1"></div> + <div class="col-10"> + <p>{{ reply.comment_text|linebreaks }}</p> + </div> + </div> + + {% endif %} + {% endif %} + {% endfor %} + </div> + </div> {% endfor %} - </div> +</div> -</section> {% endif %} @@ -283,25 +295,32 @@ {% include 'scipost/comments_block.html' %} {% if user.is_authenticated and submission.open_for_commenting and perms.scipost.can_submit_comments %} -<section id="contribute_comment"> - <hr class="hr12"> - <div class="flex-greybox"> - <h1>Contribute a Comment:</h1> - </div> - <form action="{% url 'submissions:submission' arxiv_identifier_w_vn_nr=submission.arxiv_identifier_w_vn_nr %}" method="post"> - {% csrf_token %} - {% load crispy_forms_tags %} - {% crispy form %} - </form> - - <div class="row"> - <div class="col-10"> - <h3>Preview of your comment:</h3> - <p id="preview-comment_text"></p> +<hr> +<div id="contribute_comment"> + <div class="row"> + <div class="col-12"> + <div class="panel"> + <h2>Contribute a Comment:</h2> + </div> + </div> + </div> + <div class="row"> + <div class="col-12"> + <form action="{% url 'submissions:submission' arxiv_identifier_w_vn_nr=submission.arxiv_identifier_w_vn_nr %}" method="post"> + {% csrf_token %} + {% load crispy_forms_tags %} + {% crispy form %} + </form> + </div> </div> - </div> -</section> + <div class="row"> + <div class="col-12"> + <h3>Preview of your comment:</h3> + <p id="preview-comment_text"></p> + </div> + </div> +</div> {% endif %} -{% endblock bodysup %} +{% endblock content %} diff --git a/submissions/templates/submissions/submissions.html b/submissions/templates/submissions/submissions.html index 0a0b7f7a6d70ce919281dd15cc2bbe349c1fca75..564d99afdecc03bb524cb1a4f00c9afe6f9a3452 100644 --- a/submissions/templates/submissions/submissions.html +++ b/submissions/templates/submissions/submissions.html @@ -1,75 +1,82 @@ {% extends 'scipost/base.html' %} -{% block pagetitle %}: Submissions{% endblock pagetitle %} - -{% block bodysup %} +{% load bootstrap %} +{% block pagetitle %}: Submissions{% endblock pagetitle %} -<section> - <br/> - <div class="flex-container"> - <div class="flex-greybox320"> - <h1>SciPost Submissions</h1> - <h3><a href="{% url 'submissions:sub_and_ref_procedure' %}">Submission and refereeing procedure</a></h3> - <h3><a href="{% url 'submissions:submit_manuscript' %}">Submit a manuscript to SciPost</a></h3> +{% block content %} +<div class="row"> + <div class="col-md-4"> + <div class="panel"> + <h1>SciPost Submissions</h1> + <h3><a href="{% url 'submissions:sub_and_ref_procedure' %}">Submission and refereeing procedure</a></h3> + <h3><a href="{% url 'submissions:submit_manuscript' %}">Submit a manuscript to SciPost</a></h3> + </div> </div> - <div class="flex-greybox320"> - <h2>Search SciPost Submissions:</h2> - <form action="{% url 'submissions:submissions' %}" method="post"> - {% csrf_token %} - <table> - <ul> - {{ form.as_table }} - </ul> - </table> - <input type="submit" name="Submit" /> - </form> + <div class="col-md-4"> + <div class="panel"> + <h2>Search SciPost Submissions:</h2> + <form action="{% url 'submissions:submissions' %}" class="small" method="post"> + {% csrf_token %} + {{ form|bootstrap:'4,8,sm' }} + <input class="btn btn-sm btn-secondary" type="submit" name="Submit" /> + </form> + </div> </div> - <div class="flex-greybox320"> - <h2>View SciPost Submissions</h2> - <ul> - <li>Physics: last <a href="{% url 'submissions:browse' discipline='physics' nrweeksback=1 %}">week</a> <a href="{% url 'submissions:browse' discipline='physics' nrweeksback=4 %}">month</a> <a href="{% url 'submissions:browse' discipline='physics' nrweeksback=52 %}">year</a> </li> - </ul> + <div class="col-md-4"> + <div class="panel"> + <h2>View SciPost Submissions</h2> + <ul> + <li>Physics: last <a href="{% url 'submissions:browse' discipline='physics' nrweeksback=1 %}">week</a> <a href="{% url 'submissions:browse' discipline='physics' nrweeksback=4 %}">month</a> <a href="{% url 'submissions:browse' discipline='physics' nrweeksback=52 %}">year</a></li> + </ul> + </div> </div> - </div> +</div> - {% if submission_search_list %} - <br /> - <hr class="hr12"> - <h3>Search results:</h3> - <ul> - {% for submission in submission_search_list %} - {{ submission.header_as_li }} - {% endfor %} - </ul> - {% elif form.has_changed %} - <h3>No match found for your search query.</h3> - {% endif %} - -</section> +{% if submission_search_list or form.has_changed %} +<div class="row"> + <div class="col-12"> + <hr class="hr12"> + <h3>Search results:</h3> + {% if submission_search_list %} + <ul> + {% for submission in submission_search_list %} + {{ submission.header_as_li }} + {% endfor %} + </ul> + {% elif form.has_changed %} + <h3>No match found for your search query.</h3> + {% endif %} + </div> +</div> +{% endif %} {% if submission_recent_list %} -<section> - <hr class="hr12"> - <h2>Recent Submissions:</h2> - <ul> - {% for submission in submission_recent_list %} - {{ submission.header_as_li }} - {% endfor %} - </ul> -</section> +<div class="row"> + <div class="col-12"> + <hr class="hr12"> + <h2>Recent Submissions:</h2> + <ul> + {% for submission in submission_recent_list %} + {{ submission.header_as_li }} + {% endfor %} + </ul> + </div> +</div> {% endif %} {% if submission_browse_list %} -<section> - <hr class="hr12"> - <h2>Submissions in {{ discipline }} in the last {{ nrweeksback }} week{% if nrweeksback == '1' %}{% else %}s{% endif %}:</h2> - <ul> - {% for submission in submission_browse_list %} - {{ submission.header_as_li }} - {% endfor %} - </ul> - {% endif %} -</section> +<div class="row"> + <div class="col-12"> + <hr class="hr12"> + <h2>Submissions in {{ discipline }} in the last {{ nrweeksback }} week{% if nrweeksback == '1' %}{% else %}s{% endif %}:</h2> + <ul> + {% for submission in submission_browse_list %} + {{ submission.header_as_li }} + {% endfor %} + </ul> + </div> +</div> +{% endif %} -{% endblock bodysup %} +{% endblock content %} diff --git a/submissions/utils.py b/submissions/utils.py index 20690867f50cfa64766cbb573b2ad2b38b591c59..18fcb7e14d6c46f5df576fe95e17cbb281ea959c 100644 --- a/submissions/utils.py +++ b/submissions/utils.py @@ -15,9 +15,9 @@ from submissions.forms import report_refusal_choices_dict class SubmissionUtils(object): @classmethod - def load(cls, dict): - for var_name in dict: - setattr(cls, var_name, dict[var_name]) + def load(cls, _dict): + for var_name in _dict: + setattr(cls, var_name, _dict[var_name]) @classmethod def deprecate_other_assignments(cls): diff --git a/submissions/views.py b/submissions/views.py index 55a271901de3eae0abf48c39626819f1c5250c6f..1ded38ef59d4aef72858605c5973bd696f1193ce 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -999,6 +999,7 @@ def send_refereeing_invitation(request, arxiv_identifier_w_vn_nr, contributor_id date_invited=timezone.now(), invited_by=request.user.contributor) invitation.save() + # raise SubmissionUtils.load({'invitation': invitation}) SubmissionUtils.send_refereeing_invitation_email() return redirect(reverse('submissions:editorial_page',