This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Track form element events | |
*/ | |
trackFormEvents: function(target) { | |
$(target).on('focus click change', 'input, select, button', function(e) { | |
var data = { | |
category: 'Form events', | |
action: e.type, | |
label: e.target | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% autoescape false %} | |
{# L10n: This is an email. Whitespace matters! #} | |
{{ _('Hi {username}')|f(username=username) }} | |
{# L10n: This is an email. Whitespace matters! #} | |
{% trans %} | |
Thanks for creating an account on Mozilla Developer Network (MDN) -- a community | |
making great resources for developers like you. | |
{% endtrans %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def form_valid(self, form): | |
""" | |
We send our welcome email via celery during complete_signup. | |
So, we need to manually commit the user to the db for it. | |
""" | |
with transaction.commit_on_success(): | |
form.save(self.request) | |
return helpers.complete_social_signup(self.request, | |
self.sociallogin) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elasticsearch::plugin{'mobz/elasticsearch-head': | |
module_dir => 'head', | |
instances => ['elasticsearch'] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Togglers within articles (i.e.) | |
*/ | |
$('.toggleable').mozTogglers(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var authors = [], authorElements = document.querySelectorAll('td.column-coauthors a'); | |
for (var i = 0; i < authorElements.length; ++i){ | |
var author = authorElements[i]; | |
if (authors.indexOf ( author.text ) === -1) { | |
authors.push( author.text ); | |
} | |
}; | |
alert(authors.length); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mzl.la/devrel-tools-bug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Meta(object): | |
unique_together = (('parent', 'locale'), ('slug', 'locale')) | |
permissions = ( | |
("view_document", "Can view document"), | |
("add_template_document", "Can add Template:* document"), | |
("change_template_document", "Can change Template:* document"), | |
("move_tree", "Can move a tree of documents"), | |
("purge_document", "Can permanently delete document"), | |
("restore_document", "Can restore deleted document"), | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Migration(SchemaMigration): | |
def forwards(self, orm): | |
# Adding model 'DocumentDeletionLog' | |
db.create_table('wiki_documentdeletionlog', ( | |
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), | |
('locale', self.gf('sumo.models.LocaleField')(default='en-US', max_length=7, db_index=True)), | |
('slug', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)), | |
('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), | |
('timestamp', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls import include, patterns, url | |
from django.views.generic import TemplateView | |
from sumo.views import redirect_to | |
from wiki.feeds import (DocumentsRecentFeed, DocumentsReviewFeed, RevisionsFeed, | |
AttachmentsFeed, | |
DocumentsUpdatedTranslationParentFeed,) |