Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
For new add-ons awaiting review, all the files should be selected by …
Browse files Browse the repository at this point in the history
…default (bug 645194)
  • Loading branch information
gkoberger authored and Jeff Balogh committed Mar 29, 2011
1 parent 1d84372 commit f92802a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/editors/templates/editors/review.html
Expand Up @@ -128,7 +128,7 @@ <h3 id="file-history">{{ _('Item History') }}</h3>
</div>

<div class="review-actions-section review-actions-files data-toggle"
data-value="{{ actions_minimal|join("|") }}">
data-value="{{ actions_minimal|join("|") }}"{% if allow_unchecking_files %} data-uncheckable="1"{% endif %}>
<label for="id_addon_files"><strong>{{ form.addon_files.label }}</strong></label>
{{ form.addon_files }}

Expand Down
4 changes: 4 additions & 0 deletions apps/editors/views.py
Expand Up @@ -253,11 +253,15 @@ def review(request, version_id):
# The actions we should show a minimal form form.
actions_minimal = [k for (k, a) in actions if not a.get('minimal')]

# We only allow the user to check/uncheck files for "pending"
allow_unchecking_files = form.helper.review_type == "pending"

ctx = context(version=version, addon=addon,
flags=Review.objects.filter(addon=addon, flag=True),
form=form, paging=paging, canned=canned, is_admin=is_admin,
status_types=amo.STATUS_CHOICES,
has_public_files=has_public_files,
allow_unchecking_files=allow_unchecking_files,
actions=actions, actions_minimal=actions_minimal,
history=ActivityLog.objects.for_addons(addon)
.order_by('created')
Expand Down
2 changes: 1 addition & 1 deletion media/js/zamboni/editors.js
Expand Up @@ -79,7 +79,7 @@ function initReviewActions() {
var $files_input = $('#review-actions .review-actions-files').find('input');
$files_input.attr('disabled', false); // In case they refresh

if($files_input.length == 1) {
if($files_input.length == 1 || ! $('#review-actions .review-actions-files').attr('data-uncheckable')) {
// Add a dummy, disabled input
$files_input.attr({'checked': true}).hide();
$files_input.after($('<input>', {'type': 'checkbox', 'checked': true, 'disabled': true}));
Expand Down

0 comments on commit f92802a

Please sign in to comment.