multiple platforms + eula button fix (bug 555065)
This commit is contained in:
Родитель
b7dfda4def
Коммит
bd96977dfe
|
@ -5,6 +5,7 @@ from l10n import ugettext as _, ugettext_lazy as _lazy
|
|||
import amo
|
||||
from amo.helpers import urlparams
|
||||
from addons.models import Addon
|
||||
from translations.models import Translation
|
||||
|
||||
|
||||
@jinja2.contextfunction
|
||||
|
@ -201,6 +202,16 @@ def smorgasbord(request):
|
|||
addons.append(Addon.objects.get(id=2313))
|
||||
addons[-1].tag = 'platformer'
|
||||
|
||||
# Multiple Platforms + EULA.
|
||||
addons.append(Addon.objects.get(id=2313))
|
||||
addons[-1].eula = Translation(localized_string='xxx')
|
||||
addons[-1].tag = 'platformer + eula'
|
||||
|
||||
# Incompatible Platform + EULa.
|
||||
addons.append(Addon.objects.get(id=5308))
|
||||
addons[-1].eula = Translation(localized_string='xxx')
|
||||
addons[-1].tag = 'windows/linux-only + eula'
|
||||
|
||||
# Incompatible Platform.
|
||||
all_versions(lambda: Addon.objects.get(id=5308), 'windows/linux-only')
|
||||
|
||||
|
|
|
@ -28,7 +28,9 @@
|
|||
{% if link.os %}
|
||||
{# L10n: {0} is a platform name like Windows or Mac OS X. #}
|
||||
<span class="os" data-os="{{ link.os.name }}">
|
||||
{{ _('for {0}')|f(link.os.name) }}
|
||||
{% if not b.show_eula %}
|
||||
{{ _('for {0}')|f(link.os.name) }}
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
{% block title %}It's an Add-on Buffet!{% endblock %}
|
||||
|
||||
{% macro item(addon, version=None) %}
|
||||
<div class="item">
|
||||
<div class="item" id="{{ addon.tag|slugify }}">
|
||||
{{ install_button(addon, version) }}
|
||||
<hgroup>
|
||||
<h3>{{ addon.name }}</h3>
|
||||
<h5>({{ addon.tag }})</h5>
|
||||
<h5><a href="#{{ addon.tag|slugify }}">({{ addon.tag }})</a></h5>
|
||||
</hgroup>
|
||||
<blockquote>{{ addon.summary }}</blockquote>
|
||||
</div>
|
||||
|
|
|
@ -351,3 +351,10 @@ class TestButtonHtml(ButtonTest):
|
|||
|
||||
doc = self.render(show_eula=False)
|
||||
assert not doc('.button').hasClass('eula')
|
||||
|
||||
def test_platformer_with_eula(self):
|
||||
"""Don't show platform text for eula buttons."""
|
||||
self.version.files.select_related.return_value = self.platform_files
|
||||
self.addon.has_eula = True
|
||||
doc = self.render()
|
||||
eq_(doc('.eula .os').text(), '')
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit b278902759c4ad02f4f647da7e2d1a0425678421
|
||||
Subproject commit 35982c1f1ed98ee86d3a9301a695a6b306e084dd
|
2
media/js
2
media/js
|
@ -1 +1 @@
|
|||
Subproject commit 832abb6b0b6d297b366376455beaa269f0decb3d
|
||||
Subproject commit 95fc766e72f1cd7d1e9fbd22f3a453ff5ed77354
|
Загрузка…
Ссылка в новой задаче