Skip to content

Commit

Permalink
have iarc required on app submission and review flows (bug 931935)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngokevin committed Nov 2, 2013
1 parent cae4224 commit 5333c6d
Show file tree
Hide file tree
Showing 23 changed files with 440 additions and 138 deletions.
6 changes: 5 additions & 1 deletion apps/amo/tests/__init__.py
Expand Up @@ -30,6 +30,7 @@
from redisutils import mock_redis, reset_redis
from tastypie.exceptions import ImmediateHttpResponse
from test_utils import RequestFactory
import waffle
from waffle import cache_sample, cache_switch
from waffle.models import Flag, Sample, Switch

Expand Down Expand Up @@ -601,7 +602,10 @@ def assert_no_validation_errors(validation):

def app_factory(**kw):
kw.update(type=amo.ADDON_WEBAPP)
return amo.tests.addon_factory(**kw)
app = amo.tests.addon_factory(**kw)
if waffle.switch_is_active('iarc') and not kw.get('unrated'):
ContentRating.objects.create(addon=app, ratings_body=0, rating=0)
return app


def _get_created(created):
Expand Down
15 changes: 15 additions & 0 deletions media/css/devreg/listing.styl
Expand Up @@ -420,3 +420,18 @@
.html-rtl .item-actions a.more-actions:after {
margin: 5px 4px 0 0;
}

li.payments, li.ratings {
a {
font-size: 11px;
margin-left: 4px;
}
}

.rating-notice {
display: inline-block;
margin-top: 5px;
}
.item:hover .rating-notice {
color: $text;
}
44 changes: 27 additions & 17 deletions media/css/devreg/reviewers.styl
Expand Up @@ -846,29 +846,33 @@ button.search, .log-filter-outside button {

.review-actions {
border-radius: 5px;
box-shadow: 0 -2px 0 $faded-blue inset, 0 0 1px rgba(0,0,0,0.1);
box-shadow: 0 -2px 0 rgba($taupe, .2) inset, 0 0 1px rgba(0, 0, 0, .1);
border: 1px solid $border-blue;
margin: 15px 0 30px;

#review-actions-form {
display: none;
}
.action_nav {
background: #fff;
border-radius: 2px;

ul {
margin: 0;
display: table;
width: 100%;
}
li {
gradient-two-color($white, #e0effd);
border-top: 1px solid #2E5186;
border-bottom: 1px solid #2E5186;
border-right: 1px solid #A5BFCE;
background: $faded-blue;
border-top: 0;
border-bottom: 0;
border-right: 1px solid $border-blue;
display: table-cell;
text-align: center;
text-shadow: 1px 1px 0 $white;
text-shadow: 1px 1px 0 #fff;

&:active {
gradient-two-color(#e0effd, $white);
background: $white;
}
input {
display: none;
Expand All @@ -878,23 +882,29 @@ button.search, .log-filter-outside button {
padding: 10px 5px;
}
&:first-child {
border-left: 1px solid #2E5186;
border-radius: 5px 0 0 5px;
border-left: 0;
border-radius: 2px 0 0 2px;
}

&:last-child {
border-right: 1px solid #2E5186;
border-radius: 0 5px 5px 0;
border-right: 0;
border-radius: 0 2px 2px 0;
}
&.disabled {
background: $faint-gray;
color: $note-gray;

label:hover {
cursor: default;
}
}
}
}
}

.review-actions.on {
#review-actions-form {
border: 1px solid #2E5186;
border-top-width: 0;
border-radius: 0 0 5px 5px;
border: 0;
border-radius: 0 0 2px 2px;
}
.action_nav {
ul li.on-tab {
Expand All @@ -905,10 +915,10 @@ button.search, .log-filter-outside button {
border-bottom: 1px solid #A5BFCE;

&:first-child {
border-radius: 5px 0 0;
border-radius: 2px 0 0;
}
&:last-child {
border-radius: 0 5px 0 0;
border-radius: 0 2px 0 0;
}
}
}
Expand Down
33 changes: 33 additions & 0 deletions media/css/devreg/submit.styl
Expand Up @@ -179,3 +179,36 @@ h2 .soon {
#upload-file.spacer {
margin-top: 60px;
}

#submit-next-steps {
ol.next-steps {
list-style: decimal inside;
}
li {
line-height: 20px;

&.done {
color: $note-gray;

span {
text-decoration: line-through;
}
&:after {
color: $green;
content: "\2714";
margin-left: 5px;
text-decoration: none;
}
}
}
ul.other-options {
list-style: disc inside;
}
.listing-footer {
margin-top: 20px;

span {
margin-right: 10px;
}
}
}
4 changes: 3 additions & 1 deletion media/js/zamboni/editors.js
Expand Up @@ -87,7 +87,9 @@ function initReviewActions() {
groups.filter("[label='"+label+"']").css('color', '#444');
}

$('#review-actions .action_nav ul li').click(function(){ showForm(this); });
$('#review-actions .action_nav ul li:not(.disabled)').click(function() {
showForm(this);
});

/* Canned Response stuff */
$('.review-actions-canned select').change(function() {
Expand Down
1 change: 1 addition & 0 deletions mkt/constants/submit.py
Expand Up @@ -6,6 +6,7 @@
('manifest', _('Submit')),
('details', _('Details')),
('done', _('Done!')),
# ('next_steps', _('Next Steps')),
]
APP_STEPS_TITLE = dict(APP_STEPS)

Expand Down
Expand Up @@ -19,6 +19,7 @@ <h5>{{ _('Actions') }}</h5>
</li>
{% endif %}
{% endif %}

{% if check_addon_ownership(request, addon) and addon.can_be_deleted() %}
<li>
<a href="#" class="delete-addon tooltip"
Expand All @@ -36,58 +37,67 @@ <h5>{{ _('Actions') }}</h5>
{{ _('Edit Listing') }}</a>
</li>
{% endif %}

{% if addon.is_packaged %}
<li>
<a href="{{ addon.get_dev_url('versions') }}" class="action-link tooltip"
title="{{ _('Add a new version of the packaged app.') }}">
{{ _('Add New Version') }}</a>
</li>
{% endif %}

<li>
<a class="action-link" href="{{ addon.get_dev_url('owner') }}">{{ _('Team Members') }}</a>
<a class="action-link status-link" href="{{ addon.get_dev_url('versions') }}">
{{ _('Status &amp; Versions') if addon.is_packaged else _('Status') }}</a>
</li>

{% if waffle.switch('iarc') %}
<li>
<a class="action-link" href="{{ addon.get_dev_url('ratings') }}">
{{ _('Content Ratings') }}</a>
{# TODO: red cross-mark if the app hasn't been rated yet. #}
</li>
{% endif %}

{% if not waffle.switch('disabled-payments') or addon.is_premium() %}
<li>
<a class="action-link{{ ' alert' if waffle.switch('disabled-payments') and addon.is_premium() }}" href="{{ addon.get_dev_url('payments') }}">
{{ _('Compatibility & Payments') }}</a>
</li>
{% endif %}

{% if addon.premium_type in amo.ADDON_INAPPS and waffle.switch('in-app-payments') %}
<li>
<a class="action-link" href="{{ addon.get_dev_url('in_app_config') }}">
{{ _('In-App Payments') }}
</a>
</li>
{% endif %}

<li>
<a class="action-link status-link" href="{{ addon.get_dev_url('versions') }}">
{{ _('Manage Status &amp; Versions') if addon.is_packaged else _('Manage Status') }}</a>
<a class="action-link" href="{{ addon.get_dev_url('owner') }}">{{ _('Team Members') }}</a>
</li>

<li>
<a class="action-link" href="{{ addon.get_url_path() }}">{{ _('View Listing') }}</a>
</li>

{% if waffle.switch('comm-dashboard') %}
<li>
<a class="action-link" href="{{ addon.get_comm_thread_url() }}">
{{ _('Messages') }}</a>
</li>
{% endif %}

<li>
<a class="action-link" href="{{ addon.get_stats_url() }}">{{ _('Statistics') }}</a>
</li>

{% if waffle.switch('view-transactions') %}
<li>
<a class="action-link" href="{{ url('mkt.developers.transactions')|urlparams(app=addon.id) }}">
{{ _('Transactions') }}</a>
</li>
{% endif %}
{% if addon.premium_type in amo.ADDON_INAPPS and waffle.switch('in-app-payments') %}
<li>
<a class="action-link" href="{{ addon.get_dev_url('in_app_config') }}">
{{ _('Manage In-App Payments') }}
</a>
</li>
{% endif %}
{% if waffle.switch('comm-dashboard') %}
<li>
<a class="action-link" href="{{ addon.get_comm_thread_url() }}">
{{ _('Messages') }}</a>
</li>
{% endif %}
</ul>
{% endif %}
1 change: 0 additions & 1 deletion mkt/developers/templates/developers/apps/ratings.html
Expand Up @@ -6,7 +6,6 @@
{% block content %}
<header>
{{ hub_breadcrumbs(addon, items=[
(addon.get_dev_url('versions'), title),
(None, _('Content Ratings') )])
}}
<h1>{{ title }}</h1>
Expand Down
Expand Up @@ -41,7 +41,7 @@ <h3>{{ _('Already Have Your App Rated?') }}</h3>
{% endtrans %}
</p>
<div class="iarc-sec-code">
<!-- style element temporary! once we get a form, we can use pretty_field. -->
<!-- Once we get a form, we can use pretty_field. -->
{# TODO: IARC security code form. #}
<label>Enter Security Code</label>
<input type="text">
Expand Down
49 changes: 27 additions & 22 deletions mkt/developers/templates/developers/includes/addons_edit_nav.html
@@ -1,7 +1,19 @@
{% set urls = [
(addon.get_dev_url(), _('Edit Listing')),
(addon.get_dev_url('owner'), _('Team Members')),
(addon.get_dev_url(), _('Edit Listing'))
] %}

{% if addon.is_packaged %}
{% do urls.append((addon.get_dev_url('versions'), _('Status &amp; Versions'))) %}
{% else %}
{% do urls.append((addon.get_dev_url('versions'), _('Status'))) %}
{% endif %}

{% if waffle.switch('iarc') %}
{% do urls.append(
(addon.get_dev_url('ratings'), _('Content Ratings'))
) %}
{% endif %}

{% if not waffle.switch('disabled-payments') or addon.is_premium() %}
{% do urls.append((addon.get_dev_url('payments'),
_('Compatibility & Payments'))) %}
Expand All @@ -15,32 +27,25 @@
{% do urls.append((addon.get_dev_url('payments'),
_('Manage Compatibility'))) %}
{% endif %}
{% if addon.is_packaged %}
{% do urls.append((addon.get_dev_url('versions'), _('Status &amp; Versions'))) %}
{% else %}
{% do urls.append((addon.get_dev_url('versions'), _('Status'))) %}
{% endif %}
{% if waffle.switch('iarc') %}
{% do urls.append(
(addon.get_dev_url('ratings'), _('Content Ratings'))
) %}
{% endif %}
{% do urls.append(
(addon.get_url_path(), _('View Listing'))
) %}
{% if waffle.switch('view-transactions') %}
{% do urls.append(
(url('mkt.developers.transactions')|urlparams(app=addon.id), _('Transactions')),

{% do urls.append((addon.get_dev_url('owner'), _('Team Members'))) %}
{% do urls.append((addon.get_url_path(), _('View Listing'))) %}


{% set other_urls = [] %}
{% if waffle.switch('comm-dashboard') %}
{% do other_urls.append(
(addon.get_comm_thread_url(), _('Messages'))
) %}
{% endif %}

{% set other_urls = [] %}
{% do other_urls.append(
(addon.get_stats_url(), _('Statistics')),
(addon.get_stats_url(), _('Statistics'))
) %}
{% if waffle.switch('comm-dashboard') %}

{% if waffle.switch('view-transactions') %}
{% do other_urls.append(
(addon.get_comm_thread_url(), _('Messages'))
(url('mkt.developers.transactions')|urlparams(app=addon.id), _('Transactions')),
) %}
{% endif %}

Expand Down

0 comments on commit 5333c6d

Please sign in to comment.