SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit ebcba6d8 authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Move administrational items from pool to admin page

parent 968ea752
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,9 @@ register = template.Library() ...@@ -12,7 +12,9 @@ register = template.Library()
@register.filter(name='sort_by') @register.filter(name='sort_by')
def sort_by(queryset, order): def sort_by(queryset, order):
return queryset.order_by(order) if queryset:
return queryset.order_by(order)
return None
@register.filter(name='duration') @register.filter(name='duration')
......
{% extends 'scipost/_personal_page_base.html' %} {% extends 'scipost/_personal_page_base.html' %}
{% load scipost_extras %}
{% block pagetitle %}: Editorial Administration{% endblock pagetitle %} {% block pagetitle %}: Editorial Administration{% endblock pagetitle %}
{% block breadcrumb_items %} {% block breadcrumb_items %}
...@@ -20,6 +22,32 @@ ...@@ -20,6 +22,32 @@
<a href="{% url 'submissions:pool' %}">Go to the pool</a> <a href="{% url 'submissions:pool' %}">Go to the pool</a>
</p> </p>
{% if recommendations_to_prepare_for_voting %}
<h3>Recommendations to prepare for voting <i class="fa fa-exclamation-circle text-warning"></i></h3>
<ul>
{% for recommendation in recommendations_to_prepare_for_voting %}
<li>On Editorial Recommendation: {{ recommendation }}<br>
<a href="{% url 'submissions:prepare_for_voting' rec_id=recommendation.id %}">Prepare for voting</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% if recommendations_undergoing_voting %}
<h3>Recommendations undergoing voting <i class="fa fa-exclamation-circle text-warning"></i></h3>
<ul>
{% for recommendation in recommendations_undergoing_voting %}
<li>On Editorial Recommendation: {{ recommendation }}<br>
<a href="{% url 'submissions:admin_recommendation' recommendation.submission.arxiv_identifier_w_vn_nr %}">See Editorial Recommendation</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% if recommendations_to_prepare_for_voting or recommendations_undergoing_voting %}
<hr>
{% endif %}
<h3>Submissions currently in pre-screening</h3> <h3>Submissions currently in pre-screening</h3>
<ul class="list-unstyled"> <ul class="list-unstyled">
{% for sub in submission_list.prescreening %} {% for sub in submission_list.prescreening %}
......
{% extends 'submissions/pool/base.html' %}
{% load bootstrap %}
{% load scipost_extras %}
{% block breadcrumb_items %}
<a href="{% url 'submissions:admin' %}" class="breadcrumb-item">Editorial Administration</a>
<span class="breadcrumb-item">Editorial Recommendation</span>
{% endblock %}
{% block pagetitle %}: Editorial Recommendation{% endblock pagetitle %}
{% block content %}
<h1 class="highlight">Editorial Recommendation</h1>
<div class="card card-outline-secondary">
{% include 'submissions/_submission_card_fellow_content_sparse.html' with submission=object.submission %}
</div>
<div class="card card-outline-secondary">
{% include 'submissions/_recommendation_fellow_content.html' with recommendation=object %}
<div class="card-body">
{% if object.remarks.exists %}
<h3 class="card-title">Remarks by Fellows:</h3>
<ul>
{% for remark in object.remarks.all|sort_by:'date' %}
{% include 'partials/submissions/remark_as_li.html' with remark=remark %}
{% endfor %}
</ul>
{% endif %}
<h3 class="card-title">Fellows eligible to vote:</h3>
<ul>
<li>
{% for eligible in object.eligible_to_vote.all|sort_by:'user__last_name' %}
{{ eligible.user.last_name }},&nbsp;
{% endfor %}
</li>
</ul>
<h3 class="card-title">Voting results up to now:</h3>
<ul>
<li>
Agreed:&nbsp;({{ object.voted_for.all.count }})
{% for agreed in object.voted_for.all|sort_by:'user__last_name' %}
{{ agreed.user.last_name }},&nbsp;
{% endfor %}
</li>
<li>
Disagreed:&nbsp;({{ rec.voted_against.all.count }})
{% for disagreed in rec.voted_against.all|sort_by:'user__last_name' %}
{{ disagreed.user.last_name }},&nbsp;
{% endfor %}
</li>
<li>
Abstained:&nbsp;({{ object.voted_abstain.all.count }})
{% for abstained in object.voted_abstain.all|sort_by:'user__last_name' %}
{{ abstained.user.last_name }},&nbsp;
{% endfor %}
</li>
</ul>
{% if object.remarks.exists %}
<h3 class="card-title">Remarks:</h3>
<ul>
{% for rem in object.remarks.all %}
<li>{{ rem }}</li>
{% empty %}
<li><em>No remarks</em></li>
{% endfor %}
</ul>
{% endif %}
</div>
<div class="card-footer">
<h3 class="card-title">Administrative actions on recommendations undergoing voting:</h3>
<ul>
<li>To send an email reminder to each Fellow with at least one voting duty: <a href="{% url 'submissions:remind_Fellows_to_vote' %}">click here</a></li>
<li>To fix the College decision and follow the Editorial Recommendation as is: <a href="{% url 'submissions:fix_College_decision' rec_id=object.id %}">click here</a></li>
<li>To request a modification of the Recommendation to request for revision: click here</li>
</ul>
</div>
</div>
{% endblock %}
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
{% block content %} {% block content %}
<h1>Editorial Recommendation to vote on</h1> <h1>Editorial Recommendation to vote on</h1>
{# <div class="card card-outline-secondary">#} {% include 'submissions/_submission_card_fellow_content.html' with submission=recommendation.submission %}
{% include 'submissions/_submission_card_fellow_content.html' with submission=recommendation.submission %}
{# </div>#}
{# <div class="card card-outline-secondary">#} {# <div class="card card-outline-secondary">#}
{% include 'submissions/_recommendation_fellow_content.html' with recommendation=recommendation %} {% include 'submissions/_recommendation_fellow_content.html' with recommendation=recommendation %}
......
...@@ -40,6 +40,8 @@ urlpatterns = [ ...@@ -40,6 +40,8 @@ urlpatterns = [
views.report_pdf_compile, name='report_pdf_compile'), views.report_pdf_compile, name='report_pdf_compile'),
url(r'^admin/reports/(?P<report_id>[0-9]+)/compile$', url(r'^admin/reports/(?P<report_id>[0-9]+)/compile$',
views.report_pdf_compile, name='report_pdf_compile'), views.report_pdf_compile, name='report_pdf_compile'),
url(r'^admin/{regex}/recommendation$'.format(regex=SUBMISSIONS_COMPLETE_REGEX),
views.AdminRecommendationView.as_view(), name='admin_recommendation'),
url(r'^submit_manuscript$', views.RequestSubmission.as_view(), name='submit_manuscript'), url(r'^submit_manuscript$', views.RequestSubmission.as_view(), name='submit_manuscript'),
url(r'^submit_manuscript/prefill$', views.prefill_using_arxiv_identifier, url(r'^submit_manuscript/prefill$', views.prefill_using_arxiv_identifier,
......
...@@ -1521,6 +1521,13 @@ class EditorialSummaryView(SubmissionAdminViewMixin, ListView): ...@@ -1521,6 +1521,13 @@ class EditorialSummaryView(SubmissionAdminViewMixin, ListView):
except (AssertionError, Submission.DoesNotExist): except (AssertionError, Submission.DoesNotExist):
context['submission'] = None context['submission'] = None
context['latest_events'] = SubmissionEvent.objects.for_eic().last_hours() context['latest_events'] = SubmissionEvent.objects.for_eic().last_hours()
context['recommendations_undergoing_voting'] = (
EICRecommendation.objects.get_for_user_in_pool(self.request.user)
.filter(submission__status='put_to_EC_voting'))
context['recommendations_to_prepare_for_voting'] = (
EICRecommendation.objects.get_for_user_in_pool(self.request.user)
.filter(submission__status='voting_in_preparation'))
return context return context
...@@ -1548,3 +1555,14 @@ class PlagiarismReportPDFView(SubmissionAdminViewMixin, SingleObjectMixin, Redir ...@@ -1548,3 +1555,14 @@ class PlagiarismReportPDFView(SubmissionAdminViewMixin, SingleObjectMixin, Redir
if not url: if not url:
raise Http404 raise Http404
return url return url
class AdminRecommendationView(SubmissionAdminViewMixin, DetailView):
permission_required = 'scipost.can_fix_College_decision'
template_name = 'submissions/admin/recommendation.html'
editorial_page = True
def get_object(self):
""" Get the EICRecommendation as a submission-related instance. """
submission = super().get_object()
return submission.eicrecommendations.first()
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