generalize install button on disco add-on details
This commit is contained in:
Родитель
5a0e931bf6
Коммит
eb77c5d853
|
@ -15,14 +15,8 @@
|
|||
|
||||
<ul id="install">
|
||||
<li class="install-action">
|
||||
{% if addon.has_eula %}
|
||||
<a href="{{ services_url('discovery.addons.eula', addon.slug, src=src) }}"
|
||||
class="button eula go installer">
|
||||
{# L10n: please keep in the string so the → does not wrap #}
|
||||
{{ _('Continue to Download →')|safe }}</a>
|
||||
{% else %}
|
||||
{{ install_button(addon, show_contrib=False, show_warning=False) }}
|
||||
{% endif %}</li>
|
||||
{{ big_install_button(addon, show_contrib=False, show_warning=False) }}
|
||||
</li>
|
||||
<li><a href="{{ url('addons.detail', addon.slug, src='discovery-learnmore') }}"
|
||||
class="button">{{ _('Learn More') }}</a></li>
|
||||
{% with files = addon.current_version.all_files %}
|
||||
|
@ -38,10 +32,8 @@
|
|||
{% endif %}
|
||||
</ul>
|
||||
|
||||
{% if not addon.has_eula %}
|
||||
{% if settings.PERF_THRESHOLD and addon.ts_slowness >= settings.PERF_THRESHOLD %}
|
||||
{{ performance_note(amount=addon.ts_slowness) }}
|
||||
{% endif %}
|
||||
{% if settings.PERF_THRESHOLD and addon.ts_slowness >= settings.PERF_THRESHOLD %}
|
||||
{{ performance_note(amount=addon.ts_slowness) }}
|
||||
{% endif %}
|
||||
|
||||
{% if addon.type != amo.ADDON_PERSONA %}
|
||||
|
|
|
@ -253,6 +253,11 @@ class TestDetails(test_utils.TestCase):
|
|||
args=[self.addon.slug])
|
||||
self.eula_url = reverse('discovery.addons.eula',
|
||||
args=[self.addon.slug])
|
||||
self._perf_threshold = settings.PERF_THRESHOLD
|
||||
settings.PERF_THRESHOLD = 25
|
||||
|
||||
def tearDown(self):
|
||||
settings.PERF_THRESHOLD = self._perf_threshold
|
||||
|
||||
def get_addon(self):
|
||||
return Addon.objects.get(id=3615)
|
||||
|
@ -283,21 +288,11 @@ class TestDetails(test_utils.TestCase):
|
|||
r = self.client.get(self.eula_url)
|
||||
self.assertRedirects(r, self.detail_url, 302)
|
||||
|
||||
def set_slowness(self):
|
||||
settings.PERF_THRESHOLD = 1.0
|
||||
def test_perf_warning(self):
|
||||
self.addon.update(ts_slowness=100)
|
||||
|
||||
def test_perf_warning_eula(self):
|
||||
self.set_slowness()
|
||||
doc = pq(self.client.get(self.detail_url).content)
|
||||
assert not doc('.performance-note').length
|
||||
doc = pq(self.client.get(self.eula_url).content)
|
||||
assert doc('.performance-note').length
|
||||
|
||||
def test_perf_warning_no_eula(self):
|
||||
self.set_slowness()
|
||||
self.addon.update(eula=None)
|
||||
doc = pq(self.client.get(self.detail_url).content)
|
||||
doc = pq(self.client.get(self.eula_url).content)
|
||||
assert doc('.performance-note').length
|
||||
|
||||
|
||||
|
|
|
@ -1201,6 +1201,10 @@ p#back:hover:before {
|
|||
padding-top: 5px;
|
||||
}
|
||||
|
||||
#install .privacy-policy {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#install .button {
|
||||
display: block;
|
||||
}
|
||||
|
@ -1460,7 +1464,7 @@ a.button.add:active {
|
|||
margin: 0 -12px 0 0;
|
||||
}
|
||||
|
||||
.button span {
|
||||
.button.add span {
|
||||
border-left: 2px groove rgba(150,150,150,0.35);
|
||||
padding: 0 0 0 12px;
|
||||
margin: 0 2px 0 -2px;
|
||||
|
@ -1469,7 +1473,7 @@ a.button.add:active {
|
|||
white-space: normal;
|
||||
}
|
||||
|
||||
.html-rtl .button span {
|
||||
.html-rtl .button.add span {
|
||||
border-left: 0;
|
||||
border-right: 2px groove rgba(150,150,150,0.35);
|
||||
padding: 0 8px 0 6px;
|
||||
|
|
Загрузка…
Ссылка в новой задаче