Permalink
Browse files

Merge pull request #3458 from mozilla/waffle-cleanup-1177264

bug 1177264 - waffle cleanups
  • Loading branch information...
darkwing committed Sep 2, 2015
2 parents 395f880 + 3224ee5 commit 074d735eaa0cb99d3a4f5ee5757c35c04e5bcba5
View
@@ -33,7 +33,6 @@ Flags
other advanced criteria.
* ``events_map`` - show the map on the events page
* ``search_explanation`` - show search results scoring details
* ``search_doc_navigator`` - show the search doc navigator feature
* ``search_drilldown_faceting`` - treat search filters as "drill-down" filters
- i.e., combine them with "AND" logic
@@ -45,7 +44,6 @@ other advanced criteria.
* ``kumaediting`` - enable/disable wiki editing
* ``kumabanned`` - (deprecated) added to users to mark them as banned
* ``enable_customcss`` - enable/disable Template:CustomCSS styles in wiki pages
* ``top_contributors`` - enable/disable the "Top Contributors" feature on wiki
pages
* ``page_move`` - enable/disable page move feature
@@ -46,15 +46,9 @@ <h1>2015 MDN Fellowship Program</h1>
<div class="column-9">
<div class="media media-small-mobile-stack media-reverse">
<div class="media-side">
{% if waffle.flag('fellowship_applications_open') %}
<a class="cta" href="http://www.surveygizmo.com/s3/1998528/PILOT-Developer-Fellowship-Application">
<span class="cta-head">Apply now!</span>
</a>
{% else %}
<div class="cta negative">
<span class="cta-head">Applications<br> are closed.</span>
</div>
{% endif %}
<div class="cta negative">
<span class="cta-head">Applications<br> are closed.</span>
</div>
</div>
<div class="media-body">
<p>Launching in Q1 2015, the Mozilla Developer Fellowship intends to accelerate the involvement of highly-skilled and experienced web developers with the open web.</p>
@@ -173,41 +167,8 @@ <h3>The Fine Print</h3>
<p>If you’ve read all of this and still have a question, contact Diane Tate at <a href="mailto:diane@mozilla.com">diane@mozilla.com</a>. If you don’t have specific questions and just want to introduce yourself, please use the application form.</p>
{% if waffle.flag('fellowship_applications_open') %}
<section class="section-apply">
<h2 class="offscreen">Apply now.</h2>
<div class="media media-small-mobile-stack">
<div class="media-side">
<a class="cta" href="http://www.surveygizmo.com/s3/1998528/PILOT-Developer-Fellowship-Application"><span class="cta-head"> Apply now!</span></a>
</div>
<div class="media-body">
<p><a href="http://www.surveygizmo.com/s3/1998528/PILOT-Developer-Fellowship-Application">Applications are open now</a> and we will accept them through April 1, 2015.</p>
</div>
</div>
<div class="media media-small-mobile-stack">
<div class="media-side">
<div class="cta">
<h3 class="cta-head">Share This</h3>
<ul>
<li><a class="twitter" href="https://www.twitter.com/intent/tweet?url=https://developer.mozilla.org{{ url('fellowship') }}" title="Twitter" target="_blank">Twitter</a></li>
<li><a class="facebook" href="https://www.facebook.com/sharer/sharer.php?u=https://developer.mozilla.org{{ url('fellowship') }}" title="Facebook" target="_blank">Facebook</a></li>
<li><a class="g-plus" href="https://plus.google.com/share?url=https://developer.mozilla.org{{ url('fellowship') }}" title="Google+" target="_blank">Google+</a></li>
</ul>
</div><!-- .share-widget -->
</div>
<div class="media-body">
<p>Excited about this opportunity? Share it with your friends.</p>
</div>
</div>
</section>
{% else %}
<h2>Applications are closed.</h2>
<p>The application period has ended. Watch this space for information about our 2015 Fellows!</p>
{% endif %}
<h2>Applications are closed.</h2>
<p>The application period has ended. Watch this space for information about our 2015 Fellows!</p>
</div><!-- .column-9 -->
View
@@ -4,7 +4,6 @@
from elasticsearch_dsl import F, Q, query
from rest_framework.filters import BaseFilterBackend
from waffle import flag_is_active
from kuma.wiki.search import WikiDocumentType
@@ -100,7 +99,7 @@ def filter_queryset(self, request, queryset, view):
functions=[query.SF('field_value_factor', field='boost')],
)
if flag_is_active(request, 'search_explanation'):
if request.user.is_superuser:
queryset = queryset.extra(explain=True)
return queryset
@@ -34,7 +34,7 @@
<h4><a href="{{ doc.url }}"{% if index == 1 %} tabindex="1"{% endif %}>{{ doc.title }}</a></h4>
<p>{{ doc.excerpt|safe }}</p>
<p class="search-meta"><a href="{{ doc.url }}">{{ doc.url|replace('https://', '') }}</a>
{% if waffle.flag('search_explanation') %}Score: <span title="explanation: {{ doc.explanation }}">{{ doc.score }}</span>{% endif%}
{% if request.user.is_superuser %}Score: <span title="explanation: {{ doc.explanation }}">{{ doc.score }}</span>{% endif%}
{% if doc.parent %}
{% trans parent_url=doc.parent.url, parent_title=doc.parent.title, parent_language=settings.LOCALES[doc.parent.locale].native %}
translated from <a href="{{ parent_url }}" title="{{ parent_title }}">{{ parent_title }} ({{ parent_language }})</a>
@@ -157,7 +157,6 @@ def test_redirect(self):
Also check the backlink to the redirect page.
"""
Flag.objects.create(name='redirect_messages', everyone=True)
target = document(save=True)
target_url = target.get_absolute_url()
@@ -167,7 +166,8 @@ def test_redirect(self):
redirect = document(html=redirect_html)
redirect.save()
redirect_url = redirect.get_absolute_url()
response = self.client.get(redirect_url)
self.client.login(username='admin', password='testpass')
response = self.client.get(redirect_url, follow=True)
self.assertRedirects(response, urlparams(target_url), status_code=301)
self.assertContains(response, redirect_url)
@@ -26,7 +26,6 @@
from constance import config
from jingo.helpers import urlparams
import waffle
from kuma.authkeys.decorators import accepts_auth_key
from kuma.attachments.utils import attachments_json
@@ -625,10 +624,7 @@ def document(request, document_slug, document_locale):
share_text = _('I learned about %(title)s on MDN.') % {"title": doc.title}
if waffle.flag_is_active(request, 'top_contributors'):
contributors = doc.contributors
else:
contributors = []
contributors = doc.contributors
contributors_count = len(contributors)
has_contributors = contributors_count > 0
View
@@ -216,7 +216,7 @@
if ($body.is('.edit, .new, .translate')) {
initMetadataEditButton();
initSaveAndEditButtons();
if(!$body.is('.is-template') && window.waffle && window.waffle.flag_is_active('dirtiness_tracking')) {
if(!$body.is('.is-template')) {
initDirtinessTracking();
}
initArticlePreview();
@@ -518,9 +518,7 @@
// Re-enable the form; it gets disabled to prevent double-POSTs
$form.data('disabled', false).removeClass('disabled');
// Trigger a `mdn:save-success` event so dirtiness can be reset throughout the page
if(window.waffle && window.waffle.flag_is_active('dirtiness_tracking')) {
$form.trigger('mdn:save-success');
}
$form.trigger('mdn:save-success');
return true;
});
View
@@ -26,12 +26,10 @@
hiddenTags.val(itemTexts.join(','));
// Check whether there are net changes in tags
if(window.waffle && window.waffle.flag_is_active('dirtiness_tracking')) {
if (undefined !== originalTags && hiddenTags.val() !== originalTags) {
$('#page-tags').addClass('dirty').trigger('mdn:dirty');
} else {
$('#page-tags').removeClass('dirty').trigger('mdn:clean');
}
if (undefined !== originalTags && hiddenTags.val() !== originalTags) {
$('#page-tags').addClass('dirty').trigger('mdn:dirty');
} else {
$('#page-tags').removeClass('dirty').trigger('mdn:clean');
}
};
}
@@ -53,11 +51,9 @@
$idTagsField.remove();
// Keep track of tag dirtiness
if(window.waffle && window.waffle.flag_is_active('dirtiness_tracking')) {
var originalTags = hiddenTags.val();
$form.on('mdn:save-success', function() {
originalTags = hiddenTags.val();
});
}
var originalTags = hiddenTags.val();
$form.on('mdn:save-success', function() {
originalTags = hiddenTags.val();
});
})(jQuery);
@@ -21,7 +21,7 @@
optimizely: win['optimizely'] || [],
// Site notifications
{% if messages %}notifications: [
{% for message in messages %}{% if 'wiki_redirect' not in message.tags or waffle.flag('redirect_messages') %}{message: "{{ message }}", tags: "{{ message.tags }}", level: "{{ message|level_tag }}"}{% if not loop.last %},{% endif %}{% endif %}
{% for message in messages %}{% if 'wiki_redirect' not in message.tags or request.user.is_superuser %}{message: "{{ message }}", tags: "{{ message.tags }}", level: "{{ message|level_tag }}"}{% if not loop.last %},{% endif %}{% endif %}
{% endfor %}
],
{% else %}
@@ -20,16 +20,6 @@
{% endif %}
{% endif %}
{% if waffle.flag('top_contributors') %}
// dimension4 == "top contributors"
ga('set', 'dimension4', 'Yes');
{% endif %}
{% if waffle.flag('wiki_spellcheck') %}
// dimension3 == "Wiki Spellchecker"
ga('set', 'dimension3', 'Yes');
{% endif %}
(function() {
// http://cfsimplicity.com/61/removing-analytics-clutter-from-campaign-urls
var win = window;

0 comments on commit 074d735

Please sign in to comment.