From 14d62d59b5b2f6f5e4294ddf72125b7764c8fe4f Mon Sep 17 00:00:00 2001 From: Jorran de Wit <jorrandewit@outlook.com> Date: Wed, 26 Jul 2017 21:08:49 +0200 Subject: [PATCH] Add SubmissionEvent summary-page for admin --- .../commands/add_groups_and_permissions.py | 5 ++++ scipost/templates/scipost/personal_page.html | 13 ++++------ .../templates/submissions/latest_events.html | 26 +++++++++++++++++++ .../submission_event_list_general.html | 17 ++++++++++++ submissions/urls.py | 15 +++++++---- submissions/views.py | 10 ++++++- 6 files changed, 72 insertions(+), 14 deletions(-) create mode 100644 submissions/templates/submissions/latest_events.html create mode 100644 submissions/templates/submissions/submission_event_list_general.html diff --git a/scipost/management/commands/add_groups_and_permissions.py b/scipost/management/commands/add_groups_and_permissions.py index f0c48b82f..694a47911 100644 --- a/scipost/management/commands/add_groups_and_permissions.py +++ b/scipost/management/commands/add_groups_and_permissions.py @@ -145,6 +145,10 @@ class Command(BaseCommand): codename='can_submit_manuscript', name='Can submit manuscript', content_type=content_type) + can_read_all_eic_events, created = Permission.objects.get_or_create( + codename='can_read_all_eic_events', + name='Can read all Editor-in-charge events', + content_type=content_type) # Submission handling can_view_pool, created = Permission.objects.get_or_create( @@ -259,6 +263,7 @@ class Command(BaseCommand): can_publish_accepted_submission, can_attend_VGMs, can_manage_reports, + can_read_all_eic_events, ]) EditorialCollege.permissions.set([ diff --git a/scipost/templates/scipost/personal_page.html b/scipost/templates/scipost/personal_page.html index 66207b001..76a405379 100644 --- a/scipost/templates/scipost/personal_page.html +++ b/scipost/templates/scipost/personal_page.html @@ -266,14 +266,11 @@ {% if 'Editorial Administrators' in user_groups %} <h3>Editorial Admin actions</h3> <ul> - {% if perms.scipost.can_publish_accepted_submission %} - <li><a href="{% url 'journals:manage_metadata' %}">Manage metadata</a></li> - <li><a href="{% url 'journals:harvest_citedby_list' %}">Harvest citedby data</a></li> - {% endif %} - {% if perms.scipost.can_manage_reports %} - <li><a href="{% url 'submissions:reports_accepted_list' %}">Accepted Reports</a>{% if nr_reports_without_pdf %} ({{nr_reports_without_pdf}} unfinished){% endif %}</li> - <li><a href="{% url 'submissions:treated_submissions_list' %}">Fully treated Submissions</a>{% if nr_treated_submissions_without_pdf %} ({{nr_treated_submissions_without_pdf}} unfinished){% endif %}</li> - {% endif %} + <li><a href="{% url 'submissions:reports_accepted_list' %}">Accepted Reports</a>{% if nr_reports_without_pdf %} ({{nr_reports_without_pdf}} unfinished){% endif %}</li> + <li><a href="{% url 'submissions:latest_events' %}">All events in the last 24 hours</a></li> + <li><a href="{% url 'submissions:treated_submissions_list' %}">Fully treated Submissions</a>{% if nr_treated_submissions_without_pdf %} ({{nr_treated_submissions_without_pdf}} unfinished){% endif %}</li> + <li><a href="{% url 'journals:harvest_citedby_list' %}">Harvest citedby data</a></li> + <li><a href="{% url 'journals:manage_metadata' %}">Manage metadata</a></li> </ul> {% endif %} diff --git a/submissions/templates/submissions/latest_events.html b/submissions/templates/submissions/latest_events.html new file mode 100644 index 000000000..3025ec20d --- /dev/null +++ b/submissions/templates/submissions/latest_events.html @@ -0,0 +1,26 @@ +{% extends 'scipost/_personal_page_base.html' %} + +{% block pagetitle %}: Latest events{% endblock pagetitle %} + +{% load scipost_extras %} +{% load bootstrap %} + +{% block breadcrumb_items %} + {{block.super}} + <a href="javascript:;" class="breadcrumb-item">Admin</a> + <span class="breadcrumb-item">All events in the last 24 hours</span> +{% endblock %} + +{% block content %} + +<div class="row"> + <div class="col-12"> + <h1>All events in the last 24 hours</h1> + <h2 class="text-warning">Submission Events are under construction. Please note this list may not be complete!</h2> + <div class="ml-md-5 mt-5">{% include 'submissions/submission_event_list_general.html' with events=events %}</div> + </div> +</div> + + + +{% endblock content %} diff --git a/submissions/templates/submissions/submission_event_list_general.html b/submissions/templates/submissions/submission_event_list_general.html new file mode 100644 index 000000000..a9d0b0d84 --- /dev/null +++ b/submissions/templates/submissions/submission_event_list_general.html @@ -0,0 +1,17 @@ +<div class="row"> + <div class="col-12"> + <ul class="list-group list-group-flush events-list"> + {% for event in events %} + <li class="list-group-item"> + <div> + <strong>{{event.text}}</strong><br> + Submission: <a href="{{event.submission.get_absolute_url}}">{{event.submission.title}} ({{event.submission.arxiv_identifier_w_vn_nr}})</a><br> + <span class="text-muted">{{event.created}}</span> + </div> + </li> + {% empty %} + <li class="list-group-item">No events found.</li> + {% endfor %} + </ul> + </div> +</div> diff --git a/submissions/urls.py b/submissions/urls.py index c4d8d4fc6..008260237 100644 --- a/submissions/urls.py +++ b/submissions/urls.py @@ -22,9 +22,16 @@ urlpatterns = [ views.report_detail_pdf, name='report_detail_pdf'), url(r'^(?P<arxiv_identifier_w_vn_nr>[0-9]{4,}.[0-9]{5,}v[0-9]{1,2})/reports/pdf$', views.submission_refereeing_package_pdf, name='refereeing_package_pdf'), - url(r'^treated_submissions$', views.treated_submissions_list, name='treated_submissions_list'), - url(r'^(?P<arxiv_identifier_w_vn_nr>[0-9]{4,}.[0-9]{5,}v[0-9]{1,2})/reports/compile$', + + # Editorial Administration + url(r'^admin/treated$', views.treated_submissions_list, name='treated_submissions_list'), + url(r'^admin/(?P<arxiv_identifier_w_vn_nr>[0-9]{4,}.[0-9]{5,}v[0-9]{1,2})/reports/compile$', views.treated_submission_pdf_compile, name='treated_submission_pdf_compile'), + url(r'^admin/events/latest$', views.latest_events, name='latest_events'), + url(r'^admin/reports$', views.reports_accepted_list, name='reports_accepted_list'), + url(r'^admin/reports/(?P<report_id>[0-9]+)/compile$', + views.report_pdf_compile, name='report_pdf_compile'), + url(r'^submit_manuscript$', views.RequestSubmission.as_view(), name='submit_manuscript'), url(r'^submit_manuscript/prefill$', views.prefill_using_arxiv_identifier, name='prefill_using_identifier'), @@ -80,13 +87,11 @@ urlpatterns = [ views.eic_recommendation, name='eic_recommendation'), url(r'^cycle/(?P<arxiv_identifier_w_vn_nr>[0-9]{4,}.[0-9]{5,}v[0-9]{1,2})/submit$', views.cycle_form_submit, name='cycle_confirmation'), + # Reports url(r'^(?P<arxiv_identifier_w_vn_nr>[0-9]{4,}.[0-9]{5,}v[0-9]{1,2})/reports/submit$', views.submit_report, name='submit_report'), url(r'^reports/vet_submitted$', views.vet_submitted_reports, name='vet_submitted_reports'), - url(r'^reports/list$', views.reports_accepted_list, name='reports_accepted_list'), - url(r'^reports/(?P<report_id>[0-9]+)/compile$', - views.report_pdf_compile, name='report_pdf_compile'), # Voting url(r'^prepare_for_voting/(?P<rec_id>[0-9]+)$', views.prepare_for_voting, name='prepare_for_voting'), diff --git a/submissions/views.py b/submissions/views.py index 7d54e68dd..48206c205 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -21,7 +21,7 @@ from .constants import SUBMISSION_STATUS_VOTING_DEPRECATED, STATUS_VETTED, STATU SUBMISSION_STATUS_PUBLICLY_INVISIBLE, SUBMISSION_STATUS, ED_COMM_CHOICES,\ STATUS_DRAFT from .models import Submission, EICRecommendation, EditorialAssignment,\ - RefereeInvitation, Report, EditorialCommunication + RefereeInvitation, Report, EditorialCommunication, SubmissionEvent from .forms import SubmissionIdentifierForm, RequestSubmissionForm, SubmissionSearchForm,\ RecommendationVoteForm, ConsiderAssignmentForm, AssignSubmissionForm,\ SetRefereeingDeadlineForm, RefereeSelectForm, RefereeRecruitmentForm,\ @@ -302,6 +302,14 @@ def treated_submission_pdf_compile(request, arxiv_identifier_w_vn_nr): return render(request, 'submissions/treated_submission_pdf_compile.html', context) +@permission_required('scipost.can_read_all_eic_events', raise_exception=True) +def latest_events(request): + context = { + 'events': SubmissionEvent.objects.for_eic() + } + return render(request, 'submissions/latest_events.html', context) + + ###################### # Editorial workflow # ###################### -- GitLab