Skip to content

Commit

Permalink
Merge pull request #531 from robhudson/1157349-visibility-status-box
Browse files Browse the repository at this point in the history
Added visibility to addon-status (bug 1157349)
  • Loading branch information
magopian committed Apr 30, 2015
2 parents 535a31d + 0ccd5ff commit feb1c56
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
12 changes: 12 additions & 0 deletions apps/addons/templates/addons/details_box.html
Expand Up @@ -52,6 +52,18 @@
<td>{{ addon.compatible_apps[APP] }}</td>
</tr>
{% endif %}
<tr>
<th>{{ _('Visibility') }}</th>
<td>
{% if not addon.is_disabled and addon.is_listed %}
{{ _('Listed') }}
{% elif addon.is_disabled and addon.is_listed %}
{{ _('Hidden') }}
{% elif not addon.is_listed %}
{{ _('Unlisted') }}
{% endif %}
</td>
</tr>
{% set deps = addon.all_dependencies %}
{% if deps %}
<tr class="addon-dependencies">
Expand Down
13 changes: 13 additions & 0 deletions apps/devhub/templates/devhub/includes/addon_details.html
Expand Up @@ -93,6 +93,19 @@
{% endif %}
</strong>
</li>

<li>
<strong>{{ _('Visibility:') }}</strong>
{% if not addon.is_disabled and addon.is_listed %}
{{ _('Listed') }}
{% elif addon.is_disabled and addon.is_listed %}
{{ _('Hidden') }}
{% elif not addon.is_listed %}
{{ _('Unlisted') }}
{% endif %}
</li>

</li>
{% if addon.current_version %}
<li>
<strong>{{ _('Current Version:') }}</strong>
Expand Down
10 changes: 10 additions & 0 deletions apps/devhub/templates/devhub/index.html
Expand Up @@ -86,6 +86,16 @@ <h2>{{ _('My Add-ons') }}</h2>
<strong>{{ _('Status:') }}</strong>
<span class="{{ status_class(item.addon) }}"><b>{{ item.addon.STATUS_CHOICES[item.addon.status] }}</b></span>
</p>
<p>
<strong>{{ _('Visibility:') }}</strong>
{% if not item.addon.is_disabled and item.addon.is_listed %}
{{ _('Listed') }}
{% elif item.addon.is_disabled and item.addon.is_listed %}
{{ _('Hidden') }}
{% elif not item.addon.is_listed %}
{{ _('Unlisted') }}
{% endif %}
</p>
{% if item.addon.current_version %}
<p>
<strong>{{ _('Latest Version:') }}</strong>
Expand Down
4 changes: 2 additions & 2 deletions apps/devhub/tests/test_views.py
Expand Up @@ -816,9 +816,9 @@ def test_my_addons(self):
if self.addon.is_listed:
# We don't display a link to the inexistent public page for
# unlisted addons.
eq_(addon_item.find('p').eq(2).find('a').attr('href'),
eq_(addon_item.find('p').eq(3).find('a').attr('href'),
self.addon.current_version.get_url_path())
eq_('Queue Position: 1 of 1', addon_item.find('p').eq(3).text())
eq_('Queue Position: 1 of 1', addon_item.find('p').eq(4).text())
eq_(addon_item.find('.upload-new-version a').attr('href'),
self.addon.get_dev_url('versions') + '#version-upload')

Expand Down

0 comments on commit feb1c56

Please sign in to comment.