SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 6f2a4803 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

add remarks count as submissions edadmin note

fixes #184
parent 10436ac4
No related branches found
No related tags found
No related merge requests found
...@@ -939,6 +939,20 @@ class Submission(models.Model): ...@@ -939,6 +939,20 @@ class Submission(models.Model):
return self.editorialdecision_set.nondeprecated().latest_version() return self.editorialdecision_set.nondeprecated().latest_version()
return None return None
def edadmin_notes(self):
"""Notes to be displayed to edadmin."""
notes: list[tuple[str, str]] = []
if nr_remarks := self.remarks.count():
notes.append(
(
"info",
f"There are {nr_remarks} remarks for this submission.",
)
)
return notes
# The next two models are for optimization of django guardian object-level permissions # The next two models are for optimization of django guardian object-level permissions
# using direct foreign keys instead of generic ones # using direct foreign keys instead of generic ones
......
<details id="submission-{{ submission.pk }}-details" <details id="submission-{{ submission.pk }}-details"
class="border border-2 mx-3 p-2 bg-primary bg-opacity-10" class="border border-2 mx-3 p-2 bg-primary bg-opacity-10 position-relative"
> >
<summary style="list-style: none;" <summary style="list-style: none;"
class="p-2" class="p-2"
......
{% load submissions_pool %} {% load submissions_pool %}
{% load ethics_extras %} {% load ethics_extras %}
{% load user_groups %}
{% is_ed_admin request.user as is_ed_admin %}
{% get_profile_clearance submission.clearances request.user.contributor.profile as clearance %} {% get_profile_clearance submission.clearances request.user.contributor.profile as clearance %}
{% if is_ed_admin %}
<div class="fs-5 float-start position-absolute top-0 start-0 translate-middle">
{% include "error_hover_explainer.html" with notes=submission.edadmin_notes %}
</div>
{% endif %}
<div class="row mb-0"> <div class="row mb-0">
<div class="col col-md-9"> <div class="col col-md-9">
<table> <table>
......
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