Skip to content

Commit

Permalink
Merge branch 'stats-toggle'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Balogh committed Oct 26, 2011
2 parents 618c05f + eb63b33 commit e507e78
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/addons/forms.py
Expand Up @@ -399,7 +399,8 @@ class AddonFormTechnical(AddonFormBase):
class Meta:
model = Addon
fields = ('developer_comments', 'view_source', 'site_specific',
'external_software', 'binary', 'auto_repackage')
'external_software', 'binary', 'auto_repackage',
'public_stats')


class AddonForm(happyforms.ModelForm):
Expand Down
12 changes: 12 additions & 0 deletions apps/devhub/templates/devhub/addons/edit/technical.html
Expand Up @@ -104,6 +104,18 @@ <h3>
_("No, this add-on's source code is not publicly viewable.")) }}
</td>
</tr>
<tr>
<th>
{{ tip(_("Public Stats?"),
_("Whether the download and usage stats of your add-on can
be displayed in our online viewer.")) }}
</th>
<td>
{{ flags(_("This add-on's stats are publicly viewable."),
addon.public_stats if not editable else form.public_stats, editable,
_("No, this add-on's stats are not publicly viewable.")) }}
</td>
</tr>
{% if addon.current_version.is_jetpack %}
<tr>
<th>
Expand Down
13 changes: 13 additions & 0 deletions apps/stats/templates/stats/stats.html
Expand Up @@ -121,6 +121,19 @@ <h1 class="addon"{{ addon.name|locale_html }}>
</div>
</div>
{% endblock %}
<div id="stats-permissions">
{% if addon.public_stats %}
<p>{{ _('This dashboard is currently <b>public</b>.') }}</p>
{% if request.check_ownership(addon) %}
<p>{{ _('Contribution stats are currently <b>private</b>.') }}</p>
{% endif %}
{% else %}
<p>{{ _('This dashboard is currently <b>private</b>.') }}</p>
{% endif %}
{% if request.check_ownership(addon) %}
<p><a href="{{ url('devhub.addons.edit', addon.slug) }}#edit-addon-technical">{{ _('Change settings.') }}</a></p>
{% endif %}
</div>
<div class="hidden">
<div id="fieldMenuPopup" class="popup">
<form id="fieldMenu">
Expand Down
3 changes: 3 additions & 0 deletions media/css/impala/stats.less
Expand Up @@ -442,3 +442,6 @@ table.stats-aggregate tbody span.change.minus {
}
}

#stats-permissions p {
margin-top: .1em;
}

0 comments on commit e507e78

Please sign in to comment.