Skip to content

Commit

Permalink
unifying status messages and style (bug 618950)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Balogh committed Dec 28, 2010
1 parent a2b4353 commit ece64f4
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 49 deletions.
12 changes: 6 additions & 6 deletions apps/amo/__init__.py
Expand Up @@ -88,16 +88,16 @@ def __set__(self, obj, value):

STATUS_CHOICES = {
STATUS_NULL: _(u'Incomplete'),
STATUS_UNREVIEWED: _(u'Not reviewed'),
STATUS_UNREVIEWED: _(u'Awaiting Preliminary Review'),
STATUS_PENDING: _(u'Pending approval'),
STATUS_NOMINATED: _(u'Nominated to be public'),
STATUS_PUBLIC: _(u'Public'),
STATUS_DISABLED: _(u'Disabled by Admins'),
STATUS_NOMINATED: _(u'Awaiting Full Review'),
STATUS_PUBLIC: _(u'Fully Reviewed'),
STATUS_DISABLED: _(u'Disabled by Mozilla'),
STATUS_LISTED: _(u'Listed'),
STATUS_BETA: _(u'Beta'),
STATUS_LITE: _(u'Preliminarily reviewed'),
STATUS_LITE: _(u'Preliminarily Reviewed'),
STATUS_LITE_AND_NOMINATED:
_(u'Preliminarily reviewed and awaiting full review'),
_(u'Preliminarily Reviewed and Awaiting Full Review'),
STATUS_PURGATORY:
_(u'Pending a review choice'),
}
Expand Down
18 changes: 18 additions & 0 deletions apps/devhub/helpers.py
Expand Up @@ -71,3 +71,21 @@ def dev_files_status(files):

return [(count, unicode(amo.STATUS_CHOICES[status])) for
(status, count) in status_count.items()]

@register.function
def status_class(addon):
classes = {
amo.STATUS_NULL: 'incomplete',
amo.STATUS_UNREVIEWED: 'unreviewed',
amo.STATUS_NOMINATED: 'nominated',
amo.STATUS_PUBLIC: 'fully-approved',
amo.STATUS_DISABLED: 'admin-disabled',
amo.STATUS_LITE: 'lite',
amo.STATUS_LITE_AND_NOMINATED: 'lite-nom',
amo.STATUS_PURGATORY: 'purgatory',
}
if addon.disabled_by_user:
cls = 'disabled'
else:
cls = classes.get(addon.status, 'none')
return 'status-' + cls
19 changes: 9 additions & 10 deletions apps/devhub/templates/devhub/addons/listing/items.html
Expand Up @@ -25,17 +25,16 @@
{# L10n: {0} is a date. #}
<li>{{ _('<strong>Last updated:</strong> {0}'|
f(addon.last_updated|datetime))|safe }}</li>
<li>
<li id="version-status-item">
<strong>{{ _('Status:') }}</strong>
{% if addon.disabled_by_user %}
<span class="inactive-1">{{ _('Disabled') }}</span>
{% else %}
<span class="inactive-0">{{ _('Active') }}</span>
{% endif %}
{% trans status_key=addon.status,
status_value=amo.STATUS_CHOICES[addon.status] %}
and <span class="status-{{ status_key }}">{{ status_value }}</span>
{% endtrans %}
<a href="{{ url('devhub.versions', addon.slug) }}">
{% if addon.disabled_by_user %}
<span class="{{ status_class(addon) }}"><b>{{ _('Disabled') }}</b></span>
{% else %}
<span class="{{ status_class(addon) }}">
<b>{{ amo.STATUS_CHOICES[addon.status] }}</b></span>
{% endif %}
</a>
</li>
</ul>
{% endif %}
Expand Down
22 changes: 11 additions & 11 deletions apps/devhub/templates/devhub/versions/list.html
Expand Up @@ -3,8 +3,8 @@
{% set title = _('Status & Versions') %}
{% block title %}{{ dev_page_title(title, addon) }}{% endblock %}

{% macro status(cls, msg) %}
<strong class="status-{{ cls }}">{{ msg }}</strong>
{% macro status(msg) %}
<strong class="{{ status_class(addon) }}">{{ msg }}</strong>
{% endmacro %}

{% block content %}
Expand All @@ -17,31 +17,31 @@ <h3>{{ _('Current Status') }}</h3>
<div class="item" id="version-status">
<div>
{% if addon.disabled_by_user %}
{{ status('disabled', _('You have <b>disabled</b> this add-on.')|safe) }}
{{ status(_('You have <b>disabled</b> this add-on.')|safe) }}
{{ _("Your add-on's listing is disabled and is not showing anywhere in our gallery or update service. You may re-enable it at any time below.") }}
{% elif addon.status == amo.STATUS_NULL %}
{{ status('incomplete', _('This add-on is <b>incomplete</b>.')|safe) }}
{{ status(_('This add-on is <b>incomplete</b>.')|safe) }}
{{ _('Please complete your add-on.') }}
{% elif addon.status == amo.STATUS_UNREVIEWED %}
{{ status('unreviewed', _('This add-on is <b>awaiting preliminary review</b>.')|safe) }}
{{ status( _('This add-on is <b>awaiting preliminary review</b>.')|safe) }}
{{ _("You will receive an email when the review is complete. Until then, your add-on is not listed in our gallery but can be accessed directly from its details page.") }}
{% elif addon.status == amo.STATUS_NOMINATED %}
{{ status('nominated', _('This add-on is <b>awaiting full review</b>.')|safe) }}
{{ status(_('This add-on is <b>awaiting full review</b>.')|safe) }}
{{ _("You will receive an email when the review is complete. Until then, your add-on is not listed in our gallery but can be accessed directly from its details page. ") }}
{% elif addon.status == amo.STATUS_PUBLIC %}
{{ status('fully-approved', _('This add-on has been <b>fully reviewed</b>.')|safe) }}
{{ status(_('This add-on has been <b>fully reviewed</b>.')|safe) }}
{{ _("Your add-on is displayed in our gallery and users are receiving automatic updates.") }}
{% elif addon.status == amo.STATUS_DISABLED %}
{{ status('admin-disabled', _('This add-on has been <b>disabled by Mozilla</b>.')|safe) }}
{{ status(_('This add-on has been <b>disabled by Mozilla</b>.')|safe) }}
{{ _("Your add-on was disabled by a site administrator and is no longer shown in our gallery. If you have any questions, please email amo-admins@mozilla.org.") }}
{% elif addon.status == amo.STATUS_LITE %}
{{ status('lite', _('This add-on has been <b>preliminarily reviewed</b>.')|safe) }}
{{ status(_('This add-on has been <b>preliminarily reviewed</b>.')|safe) }}
{{ _("Your add-on is displayed in our gallery as experimental and users are receiving automatic updates. Some features are unavailable to your add-on.") }}
{% elif addon.status == amo.STATUS_LITE_AND_NOMINATED %}
{{ status('lite-nom', _('This add-on has been <b>preliminarily reviewed</b> and is <b>awaiting full review</b>.')|safe) }}
{{ status(_('This add-on has been <b>preliminarily reviewed</b> and is <b>awaiting full review</b>.')|safe) }}
{{ _("You will receive an email when the full review is complete. Until then, your add-on is displayed in our gallery as experimental and users are receiving automatic updates. Some features are unavailable to your add-on.") }}
{% elif addon.status == amo.STATUS_PURGATORY %}
{{ status('purgatory', _('Please select a review option.')) }}
{{ status(_('Please select a review option.')) }}
{{ _("All add-ons hosted in our gallery must now be reviewed by an editor. If you wish to continue hosting your add-on, please select a review process from the choices below.") }}
{% endif %}
<a href="{{ remora_url('developers/docs/policies/reviews#selection') }}">
Expand Down
38 changes: 16 additions & 22 deletions media/css/zamboni/developers.css
Expand Up @@ -858,21 +858,28 @@ a.extra {
margin: 0;
}

#version-status strong b {
color: #38A532;
text-transform: lowercase;
}

#version-status .status-unreviewed b {
.status-nominated b,
.status-unreviewed b {
color: #4C8B97;
}

#version-status .status-disabled b,
#version-status .status-incomplete b,
#version-status .status-admin-disabled b {
.status-incomplete b,
.status-disabled b,
.status-admin-disabled b,
.status-purgatory b {
color: #991B0F;
}

.status-fully-approved b,
.status-lite b,
.status-lite-nom b {
color: #38A532;
}

#version-status-item b {
font-weight: normal;
}

.version-status-actions {
border-top: 1px dotted #ADD0DC;
margin-top: 10px;
Expand Down Expand Up @@ -1043,19 +1050,6 @@ a.extra {
}
/* @end */

/* @group My Add-ons */
.status-0 { color: gray; }
.status-1,
.status-2,
.status-3 { color: navy; }
.status-4 { color: green; }
.status-5 { color: red; }

.inactive-0 { color: green; }
.inactive-1 { color: red; }
/* @end */


/* @group Header and main navigation bar */
.section {
max-width: 75em;
Expand Down

0 comments on commit ece64f4

Please sign in to comment.