Allow a review request to include a comment to show to the review team secretary at assignment time and the reviewer at review time. Fixes #2096. Commit ready for merge.

- Legacy-Id: 12545
This commit is contained in:
Robert Sparks 2016-12-15 21:52:12 +00:00
parent 870fa59d0c
commit 6fcd8b8a16
8 changed files with 46 additions and 2 deletions

View file

@ -64,6 +64,7 @@ class ReviewTests(TestCase):
"deadline": deadline.isoformat(),
"requested_rev": "01",
"requested_by": Person.objects.get(user__username="reviewsecretary").pk,
"comment": "gZT2iiYqYLKiQHvsgWCcVLdH"
})
self.assertEqual(r.status_code, 302)
@ -74,6 +75,7 @@ class ReviewTests(TestCase):
self.assertEqual(req.deadline, deadline)
self.assertEqual(req.requested_rev, "01")
self.assertEqual(doc.latest_event().type, "requested_review")
self.assertEqual(req.comment, "gZT2iiYqYLKiQHvsgWCcVLdH")
def test_doc_page(self):

View file

@ -46,7 +46,7 @@ class RequestReviewForm(forms.ModelForm):
class Meta:
model = ReviewRequest
fields = ('requested_by', 'type', 'deadline', 'requested_rev')
fields = ('requested_by', 'type', 'deadline', 'requested_rev', 'comment')
def __init__(self, user, doc, *args, **kwargs):
super(RequestReviewForm, self).__init__(*args, **kwargs)
@ -62,6 +62,8 @@ class RequestReviewForm(forms.ModelForm):
self.fields["requested_rev"].label = "Document revision"
self.fields["comment"].widget = forms.Textarea()
if has_role(user, "Secretariat"):
self.fields["requested_by"] = SearchablePersonField()
else:

View file

@ -1,4 +1,5 @@
from django.contrib import admin
from django import forms
from ietf.review.models import (ReviewerSettings, UnavailablePeriod, ReviewWish, NextReviewerInTeam,
ReviewRequest, ReviewTeamSettings )
@ -43,7 +44,14 @@ class NextReviewerInTeamAdmin(admin.ModelAdmin):
admin.site.register(NextReviewerInTeam, NextReviewerInTeamAdmin)
class ReviewRequestAdminForm( forms.ModelForm ):
comment = forms.CharField(widget=forms.Textarea)
class Meta:
exclude = []
model = ReviewRequest
class ReviewRequestAdmin(admin.ModelAdmin):
form = ReviewRequestAdminForm
list_display = ["doc", "time", "type", "team", "deadline"]
list_display_links = ["doc"]
list_filter = ["team", "type", "state", "result"]

View file

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('review', '0009_auto_20161214_1537'),
]
operations = [
migrations.AddField(
model_name='reviewrequest',
name='comment',
field=models.CharField(default=b'', help_text=b'Provide any additional information to show to the review team secretary and reviewer', max_length=2048, verbose_name=b"Requester's comments and instructions", blank=True),
),
]

View file

@ -115,6 +115,7 @@ class ReviewRequest(models.Model):
deadline = models.DateField()
requested_by = models.ForeignKey(Person)
requested_rev = models.CharField(verbose_name="requested revision", max_length=16, blank=True, help_text="Fill in if a specific revision is to be reviewed, e.g. 02")
comment = models.CharField(verbose_name="Requester's comments and instructions", max_length=2048, blank=True, help_text="Provide any additional information to show to the review team secretary and reviewer", default='')
# Fields filled in as reviewer is assigned and as the review is
# uploaded. Once these are filled in and we progress beyond being

View file

@ -35,6 +35,7 @@
{% bootstrap_field form.team layout="horizontal" %}
{% bootstrap_field form.deadline layout="horizontal" %}
{% bootstrap_field form.requested_rev layout="horizontal" %}
{% bootstrap_field form.comment layout="horizontal" %}
{% buttons %}
<button type="submit" class="btn btn-primary">Request review</button>

View file

@ -66,6 +66,14 @@
<td>{{ review_req.requested_by }}</td>
</tr>
{% endif %}
{% if review_req.comment %}
<tr>
<th></th>
<th>Comments</th>
<td><pre class="pasted">{{review_req.comment}}</pre></td>
</tr>
{% endif %}
</tbody>
<tbody class="meta">

View file

@ -60,7 +60,7 @@
<div class="col-sm-6">
<div class="request-metadata">
<p>
{% if r.pk != None %}Requested: <a href="{% url "ietf.doc.views_review.review_request" name=r.doc.name request_id=r.pk %}">{{ r.time|date:"Y-m-d" }}</a>
{% if r.pk != None %}Requested: <a href="{% url "ietf.doc.views_review.review_request" name=r.doc.name request_id=r.pk %}">{{ r.time|date:"Y-m-d" }}{% if r.requested_by %} by {{r.requested_by.plain_name}}{% endif %}</a>
{% else %}
Auto-suggested
{% endif %}
@ -96,6 +96,9 @@
- <a href="{% url "ietf.group.views.group_home" acronym=r.doc.group.acronym group_type=r.doc.group.type_id %}">{{ r.doc.group.acronym }} {{ r.doc.group.type.name }}</a>
{% endif %}
</div>
{% if r.comment %}
<div><pre class="pasted">{{ r.comment }}</pre></div>
{% endif %}
</div>
<div class="col-sm-6 abstract">