Reviews with multiple OS files always show all files pending full review (bug 648549)

This commit is contained in:
Gregory Koberger 2011-04-13 14:38:15 -07:00
Родитель 76a53f3012
Коммит d9e9eb5ba0
6 изменённых файлов: 22 добавлений и 11 удалений

Просмотреть файл

@ -236,8 +236,10 @@ class ReviewAddonForm(happyforms.Form):
super(ReviewAddonForm, self).__init__(*args, **kw)
self.fields['addon_files'].queryset = self.helper.all_files
self.addon_files_disabled = (self.helper.all_files
.filter(status=amo.STATUS_DISABLED)
.values_list('pk', flat=True))
# We can't review disabled, and public are already reviewed.
.filter(status__in=[amo.STATUS_DISABLED, amo.STATUS_PUBLIC])
.values_list('pk', flat=True))
# We're starting with an empty one, which will be hidden via CSS.
canned_choices = [['', [('', _('Choose a canned response...'))]]]

Просмотреть файл

@ -22,11 +22,13 @@ from editors.sql_table import SQLTable
@register.function
def file_review_status(addon, file):
if file.status not in [amo.STATUS_DISABLED]:
if addon.status in [amo.STATUS_UNREVIEWED, amo.STATUS_LITE]:
if file.status in [amo.STATUS_UNREVIEWED, amo.STATUS_LITE]:
return _(u'Pending Preliminary Review')
elif addon.status in [amo.STATUS_NOMINATED,
amo.STATUS_LITE_AND_NOMINATED,
amo.STATUS_PUBLIC]:
elif file.status in [amo.STATUS_PUBLIC]:
return _(u'Fully Reviewed')
elif file.status in [amo.STATUS_NOMINATED,
amo.STATUS_LITE_AND_NOMINATED,
amo.STATUS_PUBLIC]:
return _(u'Pending Full Review')
return amo.STATUS_CHOICES[file.status]

Просмотреть файл

@ -133,11 +133,11 @@
<ul>
{% for pk, label in form.fields.get('addon_files').choices %}
<li>
<label for="file-{{ pk }}">
<label for="file-{{ pk }}"{% if pk in form.addon_files_disabled %} class="light"{% endif %}>
<input id="file-{{ pk }}" type="checkbox" value="{{ pk }}" name="addon_files"
{% if pk in form.addon_files_disabled %}disabled=""{% endif %} />
{{ label }}
</label>
</label>
</li>
{% endfor %}
</ul>

Просмотреть файл

@ -1299,7 +1299,7 @@ class TestStatusFile(ReviewBase):
self.addon.update(status=status)
res = self.client.get(self.url)
node = pq(res.content)('ul.files li:first-child')
assert 'Pending Preliminary Review' in node.text()
assert 'Listed' in node.text()
def test_status_full(self):
for status in [amo.STATUS_NOMINATED, amo.STATUS_LITE_AND_NOMINATED,
@ -1307,7 +1307,7 @@ class TestStatusFile(ReviewBase):
self.addon.update(status=status)
res = self.client.get(self.url)
node = pq(res.content)('ul.files li:first-child')
assert 'Pending Full Review' in node.text()
assert 'Listed' in node.text()
def test_other(self):
self.addon.update(status=amo.STATUS_BETA)

Просмотреть файл

@ -588,3 +588,10 @@ tr.comments {
text-align: right;
}
.light {
color: #888;
}
.light .light {
color: #ccc;
}

Просмотреть файл

@ -76,7 +76,7 @@ function initReviewActions() {
}
/* File checkboxes */
var $files_input = $('#review-actions .review-actions-files').find('input');
var $files_input = $('#review-actions .review-actions-files').find('input:enabled');
if($files_input.length == 1 || ! $('#review-actions .review-actions-files').attr('data-uncheckable')) {
// Add a dummy, disabled input