say Accept and Install for eula buttons (bug 556094)

This commit is contained in:
Jeff Balogh 2010-04-09 12:02:55 -07:00
Родитель f28f77f0da
Коммит 8ee988d5dd
3 изменённых файлов: 16 добавлений и 1 удалений

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

@ -67,6 +67,7 @@ class InstallButton(object):
or addon.is_category_featured(app, lang))
self.show_eula = show_eula and addon.has_eula
self.accept_eula = addon.has_eula and not show_eula
self.show_contrib = (show_contrib and addon.takes_contributions
and addon.annoying == amo.CONTRIB_ROADBLOCK)
self.show_warning = show_warning and (self.unreviewed or
@ -88,6 +89,9 @@ class InstallButton(object):
self.button_class.append('go')
self.install_class.append(cls)
if self.accept_eula:
self.install_class.append('accept')
def attrs(self):
rv = {}
addon = self.addon
@ -116,6 +120,8 @@ class InstallButton(object):
if self.show_eula:
text, url = _('Continue to Download →'), file.eula_url()
elif self.accept_eula:
text = _('Accept and Download')
elif self.show_contrib:
# The eula doesn't exist or has been hit already.
text = _('Continue to Download →')

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

@ -179,6 +179,15 @@ class TestButton(ButtonTest):
eq_(b.button_class, ['eula', 'go'])
eq_(b.install_class, ['eula'])
def test_accept_eula(self):
self.addon.has_eula = True
b = self.get_button(show_eula=False)
assert 'accept' in b.install_class
file = self.get_file(amo.PLATFORM_ALL)
text, _, _ = b.file_details(file)
eq_(text, 'Accept and Download')
def test_featured(self):
self.addon.is_featured.return_value = True
b = self.get_button()

@ -1 +1 @@
Subproject commit 490d42e496f603d66b401430915059508103dadd
Subproject commit 2deb00195ca6c90cd42908e6263ab4c2b435d714