From 569467d33991d10b6da27d24daeca3eee47f0b0e Mon Sep 17 00:00:00 2001 From: Gregory Koberger Date: Tue, 31 Aug 2010 21:11:19 +0000 Subject: hide 'more about this add-on' on details page (bug 527849) --- diff --git a/apps/addons/templates/addons/details.html b/apps/addons/templates/addons/details.html index fdfd5f4..45fc3ef 100644 --- a/apps/addons/templates/addons/details.html +++ b/apps/addons/templates/addons/details.html @@ -121,62 +121,64 @@ {# /featured-inner #} {# /featured #} -

{{ _('More about this add-on') }}

-
- {{ addon.description|nl2br }}

- - {% if previews|length > 1 %} -

{{ _('Image Gallery') }}

- {% for preview in previews[1:] %} - - - - {% endfor %} - {% endif %} + {% if addon.description or previews|length > 1 or addon.developer_comments or + (addon.show_beta and addon.current_beta_version) %} +

{{ _('More about this add-on') }}

+
+ {{ addon.description|nl2br }}

+ + {% if previews|length > 1 %} +

{{ _('Image Gallery') }}

+ {% for preview in previews[1:] %} + + + + {% endfor %} + {% endif %} - {% if addon.developer_comments %} -

{{ _('Developer Comments', 'addons_display_developer_comments') }}

-
- {{ - addon.developer_comments|nl2br }}

-
- {% endif %} + {% if addon.developer_comments %} +

{{ _('Developer Comments', 'addons_display_developer_comments') }}

+
+ {{ + addon.developer_comments|nl2br }}

+
+ {% endif %} - {# beta channel #} - {% if addon.show_beta and addon.current_beta_version %} -

{{ _('Beta Channel') }}

-
-

- {% trans %} - The Beta Channel lets you test an experimental new version of this - add-on before it's released to the general public. Once you install - the beta version, you will continue to get updates from this channel. - {% endtrans %} - {{ _('Install beta version') }} -

-
+ {# beta channel #} + {% if addon.show_beta and addon.current_beta_version %} +

{{ _('Beta Channel') }}

+

{% trans %} - Caution: Beta versions of this add-on have not - been reviewed by Mozilla. Once you install a beta version you will - continue to receive beta updates from this developer. To stop - receiving beta updates, reinstall the default version from the - link above. + The Beta Channel lets you test an experimental new version of this + add-on before it's released to the general public. Once you install + the beta version, you will continue to get updates from this channel. {% endtrans %} + {{ _('Install beta version') }}

-
-
{{ _('Version {0}:')|f( - addon.current_beta_version.version) }}
-
{{ install_button(addon, version=addon.current_beta_version, - show_warning=False) }}
-
-
{# /install-beta #} -
+
+

+ {% trans %} + Caution: Beta versions of this add-on have not + been reviewed by Mozilla. Once you install a beta version you will + continue to receive beta updates from this developer. To stop + receiving beta updates, reinstall the default version from the + link above. + {% endtrans %} +

+
+
{{ _('Version {0}:')|f( + addon.current_beta_version.version) }}
+
{{ install_button(addon, version=addon.current_beta_version, + show_warning=False) }}
+
+
{# /install-beta #} +
+ {% endif %} + {# /beta #} +
{# /article #} {% endif %} - {# /beta #} -
{# /article #} - {{ review_list_box(addon=addon, reviews=reviews) }} {% if request.user.is_authenticated() %} diff --git a/apps/addons/tests/test_views.py b/apps/addons/tests/test_views.py index 540ab47..0fff743 100644 --- a/apps/addons/tests/test_views.py +++ b/apps/addons/tests/test_views.py @@ -324,6 +324,21 @@ class TestDetailPage(amo.test_utils.ExtraSetup, test_utils.TestCase): eq_(hosted('#releasenotes').length, 1) eq_(listed('#releasenotes').length, 0) + def test_more_about(self): + # Don't show more about box if there's nothing to populate it. + addon = Addon.objects.get(id=3615) + addon.developer_comments_id = None + addon.description_id = None + addon.show_beta = False + addon.previews.all().delete() + addon.save() + + r = self.client.get(reverse('addons.detail', args=[3615])) + doc = pq(r.content) + + eq_(doc('#more-about').length, 0) + eq_(doc('.article.userinput').length, 0) + def test_beta(self): """Test add-on with a beta channel.""" my_addonid = 3615 -- cgit v0.9.1