change labelling (bug 642941)
This commit is contained in:
Родитель
0dafbc500a
Коммит
09ec1cdf89
|
@ -19,6 +19,15 @@ from editors.models import (ViewPendingQueue, ViewFullReviewQueue,
|
|||
from editors.sql_table import SQLTable
|
||||
|
||||
|
||||
@register.function
|
||||
def file_review_status(addon, file):
|
||||
if addon.status in [amo.STATUS_UNREVIEWED]:
|
||||
return _('Pending Preliminary Review')
|
||||
elif addon.status in [amo.STATUS_NOMINATED, amo.STATUS_LITE_AND_NOMINATED]:
|
||||
return _('Pending Full Review')
|
||||
return amo.STATUS_CHOICES[file.status]
|
||||
|
||||
|
||||
@register.function
|
||||
@jinja2.contextfunction
|
||||
def editor_page_title(context, title=None, addon=None):
|
||||
|
|
|
@ -48,13 +48,13 @@
|
|||
{{ _('Files and Validation Results') }}
|
||||
<span>[<a href="{{ remora_url('pages/validation') }}">{{ _('help') }}</a>]</span>
|
||||
</h3>
|
||||
<ul>
|
||||
<ul class="files">
|
||||
{% for file in version.files.all() %}
|
||||
<li>
|
||||
<a href="{{ remora_url('/downloads/file/%d/%s' %( file.id, file.filename)) }}">
|
||||
<strong>{{ file.filename }}</strong></a>
|
||||
<br>
|
||||
{{ status_types[file.status] }}
|
||||
{{ file_review_status(addon, file) }}
|
||||
·
|
||||
<a href="{{ url('devhub.file_validation', addon.slug, file.id) }}">{{ _('Validation Results') }}</a>
|
||||
·
|
||||
|
|
|
@ -1079,3 +1079,29 @@ class TestEditorMOTD(EditorTest):
|
|||
r = self.client.post(reverse('editors.save_motd'), {})
|
||||
doc = pq(r.content)
|
||||
eq_(doc('#editor-motd .errorlist').text(), 'This field is required.')
|
||||
|
||||
|
||||
class TestStatusFile(ReviewBase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestStatusFile, self).setUp()
|
||||
self.file = self.addon.current_version.files.all()[0]
|
||||
|
||||
def test_status(self):
|
||||
self.addon.update(status=amo.STATUS_UNREVIEWED)
|
||||
res = self.client.get(self.url)
|
||||
node = pq(res.content)('ul.files li:first-child')
|
||||
assert 'Pending Preliminary Review' in node.text()
|
||||
|
||||
def test_status_full(self):
|
||||
for status in [amo.STATUS_NOMINATED, amo.STATUS_LITE_AND_NOMINATED]:
|
||||
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()
|
||||
|
||||
def test_other(self):
|
||||
self.addon.update(status=amo.STATUS_BETA)
|
||||
res = self.client.get(self.url)
|
||||
node = pq(res.content)('ul.files li:first-child')
|
||||
assert unicode(amo.STATUS_CHOICES[self.file.status]) in node.text()
|
||||
|
|
Загрузка…
Ссылка в новой задаче