This file contains 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
# -*- coding: utf-8 -*- | |
from django.contrib import admin | |
from django.contrib.auth.admin import UserAdmin | |
from django.utils.translation import ugettext_lazy as _ | |
from earnest.accounts.models import Account, AccessHistory | |
from earnest.accounts.forms import AdminPasswordChangeForm, AdminRegisterUserFullForm | |
class ReadonlyTabularInline(admin.TabularInline): |
This file contains 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
{% block main_section_content %} | |
{% endblock %} | |
<a class="close-reveal-modal">×</a> | |
This file contains 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
AnimatedTransitionRegion = Backbone.Marionette.Region.extend({ | |
show: function(view){ | |
this.ensureEl(); | |
view.render(); | |
this.close(function() { | |
if (this.currentView && this.currentView !== view) { return; } | |
this.currentView = view; | |
this.open(view, function(){ |
This file contains 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
// using jQuery | |
function getCookie(name) { | |
var cookieValue = null; | |
if (document.cookie && document.cookie != '') { | |
var cookies = document.cookie.split(';'); | |
for (var i = 0; i < cookies.length; i++) { | |
var cookie = jQuery.trim(cookies[i]); | |
// Does this cookie string begin with the name we want? | |
if (cookie.substring(0, name.length + 1) == (name + '=')) { | |
cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); |
This file contains 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
# -*- coding: utf-8 -*- | |
from django.conf import settings | |
from django.core.mail import EmailMessage | |
def zendesk_ticket(subject, form, request, form_type='email'): | |
email = form.cleaned_data['email'] | |
if form_type == 'email': | |
message = """ | |
Email: %s |
This file contains 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 gulp = require('gulp'); | |
var compass = require('gulp-compass'); | |
var path = require('path'); | |
var paths = { | |
styles: { | |
src: 'nutrimom/static/scss/*', | |
dest: 'nutrimom/static/.sass-cache' | |
} | |
}; |
This file contains 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
/* jslint browser: true, undef: true, newcap: true, forin: true, sub: true, white: true, indent: 4, unused: false */ | |
/* globals define: true */ | |
define( | |
[ | |
'angularAMD', | |
'angular-mm-foundation', | |
'selectize-ng' | |
], function (angularAMD) { | |
$.noConflict(); |
This file contains 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
#!/bin/bash | |
git pull | |
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install -r requirements.txt | |
./manage.py migrate | |
sh ./scripts/bind_solr.sh | |
./manage.py rebuild_index --noinput |
This file contains 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
{% block preloader %} | |
{% if user.is_authenticated %} | |
<div data-ng-if="showPreloader"> | |
{% assign name="loadingText" %}{% trans "Loading..." %}{% endassign %} | |
{% include 'inc/preloader.html' %} | |
</div> | |
{% endif %} | |
{% endblock %} |
This file contains 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
elm.bind('paste', function(e) { | |
//console.log(e); | |
e.preventDefault(); | |
var text = (e.originalEvent || e).clipboardData.getData("text/html"); | |
if (!text){ | |
console.log('no html'); | |
text = (e.originalEvent || e).clipboardData.getData("text/plain"); | |
} | |
var temp = $('<div />'); | |
$(temp).html(text); |
OlderNewer