-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #748 from Karthik99999/peer-reviewers
feat: Add PeerReviewer model for improved peer review support
- Loading branch information
Showing
45 changed files
with
1,192 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 27,7 @@ class Meta: | |
"review", | ||
"editor", | ||
"candidate_reviewer", | ||
"reviewer", | ||
] | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
django/library/jinja2/library/review/email/review_invitation_declined.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
django/library/jinja2/library/review/email/reviewer_submitted.jinja
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 1,3 @@ | ||
Dear {{invitation.editor.name}}, | ||
|
||
The reviewer {{ invitation.candidate_reviewer }} has submitted their feedback. Action is needed on your part to continue the peer review process and send the recommendation back to the original submitter. You can do this at the [review management page]({{ build_absolute_uri(review.get_absolute_url()) }}). | ||
The reviewer {{ invitation.reviewer.member_profile }} has submitted their feedback. Action is needed on your part to continue the peer review process and send the recommendation back to the original submitter. You can do this at the [review management page]({{ build_absolute_uri(review.get_absolute_url()) }}). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,26 @@ | ||
{% extends 'base.jinja' %} | ||
{% from "common.jinja" import breadcrumb %} | ||
|
||
{% block introduction %} | ||
<h1>Manage Peer Reviewers</h1> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{{ breadcrumb([ | ||
{'url': '/reviews/', 'text': 'Reviews'}, | ||
{'text': 'Manage Reviewers' }]) | ||
}} | ||
<ul class="nav nav-tabs justify-content-center mb-4"> | ||
<li class="nav-item"> | ||
<a href="/reviews/dashboard" class="nav-link">Reviews</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a href="/reviews/reviewers" class="nav-link active">Reviewers</a> | ||
</li> | ||
</ul> | ||
<div id="reviewer-list"></div> | ||
{% endblock %} | ||
|
||
{% block js %} | ||
{{ vite_asset("apps/reviewer_list.ts") }} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,66 @@ | ||
# Generated by Django 4.2.14 on 2024-07-11 17:58 | ||
|
||
import django.contrib.postgres.fields | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("core", "0021_add_spam_moderation"), | ||
("library", "0028_contributor_json_affiliations"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="PeerReviewer", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("date_created", models.DateTimeField(auto_now_add=True)), | ||
("is_active", models.BooleanField(default=True)), | ||
( | ||
"programming_languages", | ||
django.contrib.postgres.fields.ArrayField( | ||
base_field=models.CharField(max_length=100), | ||
blank=True, | ||
default=list, | ||
help_text="Programming Languages this reviewer knows, e.g. Python, Java", | ||
size=None, | ||
), | ||
), | ||
( | ||
"subject_areas", | ||
django.contrib.postgres.fields.ArrayField( | ||
base_field=models.CharField(max_length=100), | ||
blank=True, | ||
default=list, | ||
help_text="Areas of expertise, e.g. social science, biology", | ||
size=None, | ||
), | ||
), | ||
( | ||
"notes", | ||
models.TextField( | ||
blank=True, help_text="Any additional notes about this reviewer" | ||
), | ||
), | ||
( | ||
"member_profile", | ||
models.OneToOneField( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="peer_reviewer", | ||
to="core.memberprofile", | ||
), | ||
), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,52 @@ | ||
# Generated by Django 4.2.14 on 2024-09-20 23:12 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
from django.utils import timezone | ||
from datetime import timedelta | ||
|
||
|
||
def create_reviewers(apps, schema): | ||
PeerReviewInvitation = apps.get_model("library", "PeerReviewInvitation") | ||
PeerReviewer = apps.get_model("library", "PeerReviewer") | ||
PeerReviewerFeedback = apps.get_model("library", "PeerReviewerFeedback") | ||
|
||
one_year_ago = timezone.now() - timedelta(days=365) | ||
for invitation in PeerReviewInvitation.objects.all(): | ||
member_profile = invitation.candidate_reviewer | ||
reviewer, created = PeerReviewer.objects.get_or_create( | ||
member_profile=member_profile, | ||
defaults={ | ||
"is_active": PeerReviewerFeedback.objects.filter( | ||
invitation__candidate_reviewer=member_profile, | ||
last_modified__gte=one_year_ago, | ||
).exists() | ||
}, | ||
) | ||
invitation.reviewer = reviewer | ||
invitation.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("library", "0029_peerreviewer"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="peerreviewinvitation", | ||
name="reviewer", | ||
field=models.ForeignKey( | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="invitation_set", | ||
to="library.peerreviewer", | ||
), | ||
), | ||
migrations.RunPython(create_reviewers), | ||
migrations.AlterUniqueTogether( | ||
name="peerreviewinvitation", | ||
unique_together={("review", "reviewer")}, | ||
), | ||
] |
Oops, something went wrong.