Commit b72060d0 authored by Bram's avatar Bram

init

parents
*~
build
develop-eggs
dist
*.egg
*.egg-info
eggs
.installed.cfg
nosetests.xml
pip-log.txt
*.py[co]
pylint.out
.tox
env
settings_local.py
*.swp
*.swo
*.index
ve/
db.sqlite
COFFEESCRIPT_CACHE
This diff is collapsed.
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "political_memory.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
# Django settings for political_memory project.
import os
PROJECT_PATH = os.path.abspath(os.path.split(__file__)[0])
SUBPROJECT_PATH = os.path.split(PROJECT_PATH)[0]
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db.sqlite',
}
}
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
TIME_ZONE = 'Europe/Brussels'
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
USE_L10N = True
USE_TZ = True
MEDIA_ROOT = ''
MEDIA_URL = '/medias/'
STATIC_ROOT = ''
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(SUBPROJECT_PATH, "static"),
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
COFFEESCRIPT_LOCATION = SUBPROJECT_PATH + '/static/coffeescript/'
SECRET_KEY = 'z74l8#z&ij&$n_nj*y&3m&=(7f0^kf73fz9ldxy4e&d69gz!(u'
TEMPLATE_LOADERS = (
'hamlpy.template.loaders.HamlPyFilesystemLoader',
'hamlpy.template.loaders.HamlPyAppDirectoriesLoader',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
if DEBUG:
MIDDLEWARE_CLASSES += (
'debug_toolbar.middleware.DebugToolbarMiddleware',
)
INTERNAL_IPS = ('127.0.0.1',)
ROOT_URLCONF = 'political_memory.urls'
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'political_memory.wsgi.application'
TEMPLATE_DIRS = (
os.path.join(SUBPROJECT_PATH, "templates"),
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'south',
)
if DEBUG:
INSTALLED_APPS += (
'debug_toolbar',
'django_pdb',
'django_extensions',
)
DEBUG_TOOLBAR_PANELS = (
'debug_toolbar.panels.version.VersionDebugPanel',
'debug_toolbar.panels.timer.TimerDebugPanel',
'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
'debug_toolbar.panels.headers.HeaderDebugPanel',
'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
'debug_toolbar.panels.template.TemplateDebugPanel',
'debug_toolbar.panels.sql.SQLDebugPanel',
'debug_toolbar.panels.signals.SignalDebugPanel',
'debug_toolbar.panels.logger.LoggingPanel',
)
FIXTURE_DIRS = (
'fixtures',
)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
try:
from settings_local import *
except ImportError:
pass
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic import TemplateView
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', TemplateView.as_view(template_name="home.html"), name='home'),
# url(r'^political_memory/', include('foo.urls')),
url(r'^admin/', include(admin.site.urls)),
)
"""
WSGI config for political_memory project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "political_memory.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
(function($){
$(function(){
$(document).foundationMediaQueryViewer();
$(document).foundationAlerts();
$(document).foundationAccordion();
$(document).tooltips();
$('input, textarea').placeholder();
$(document).foundationButtons();
$(document).foundationNavigation();
$(document).foundationCustomForms();
$(document).foundationTabs({callback:$.foundation.customForms.appendCustomMarkup});
$("#featured").orbit();
// UNCOMMENT THE LINE YOU WANT BELOW IF YOU WANT IE8 SUPPORT AND ARE USING .block-grids
// $('.block-grid.two-up>li:nth-child(2n+1)').css({clear: 'left'});
// $('.block-grid.three-up>li:nth-child(3n+1)').css({clear: 'left'});
// $('.block-grid.four-up>li:nth-child(4n+1)').css({clear: 'left'});
// $('.block-grid.five-up>li:nth-child(5n+1)').css({clear: 'left'});
});
})(jQuery);
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
(function ($){
$.fn.foundationAccordion = function (options) {
$(document).on('click.fndtn', '.accordion li', function () {
var flyout = $(this).children('.content').first();
$('.accordion .content').not(flyout).hide().parent('li').removeClass('active');
flyout.show(0, function () {
flyout.parent('li').addClass('active');
});
});
};
})( jQuery );
(function ($) {
$.fn.foundationAlerts = function (options) {
var settings = $.extend({
callback: $.noop
}, options);
$(document).on("click", ".alert-box a.close", function (event) {
event.preventDefault();
$(this).closest(".alert-box").fadeOut(function (event) {
$(this).remove();
// Do something else after the alert closes
settings.callback();
});
});
};
})(jQuery);
(function ($) {
$.fn.foundationButtons = function(options) {
// Prevent event propagation on disabled buttons
$(document).on('click.fndtn', '.button.disabled', function (e) {
e.preventDefault();
});
$('.button.dropdown > ul', this).addClass('no-hover');
$(document).on('click.fndtn', '.button.dropdown, .button.dropdown.split span', function (e) {
// Stops further propagation of the event up the DOM tree when clicked on the button.
// Events fired by its descendants are not being blocked.
if (e.target === this) {
e.stopPropagation();
}
});
$(document).on('click.fndtn', '.button.dropdown.split span', function (e) {
e.preventDefault();
$('.button.dropdown', this).not($(this).parent()).children('ul').removeClass('show-dropdown');
$(this).siblings('ul').toggleClass('show-dropdown');
});
$(document).on('click.fndtn', '.button.dropdown:not(.split)', function (e) {
$('.button.dropdown', this).not(this).children('ul').removeClass('show-dropdown');
$(this).children('ul').toggleClass('show-dropdown');
});
$(document).on('click.fndtn', 'body, html', function () {
$('.button.dropdown ul').removeClass('show-dropdown');
});
// Positioning the Flyout List
var normalButtonHeight = $('.button.dropdown:not(.large):not(.small):not(.tiny)', this).outerHeight() - 1,
largeButtonHeight = $('.button.large.dropdown', this).outerHeight() - 1,
smallButtonHeight = $('.button.small.dropdown', this).outerHeight() - 1,
tinyButtonHeight = $('.button.tiny.dropdown', this).outerHeight() - 1;
$('.button.dropdown:not(.large):not(.small):not(.tiny) > ul', this).css('top', normalButtonHeight);
$('.button.dropdown.large > ul', this).css('top', largeButtonHeight);
$('.button.dropdown.small > ul', this).css('top', smallButtonHeight);
$('.button.dropdown.tiny > ul', this).css('top', tinyButtonHeight);
$('.button.dropdown.up:not(.large):not(.small):not(.tiny) > ul', this).css('top', 'auto').css('bottom', normalButtonHeight - 2);
$('.button.dropdown.up.large > ul', this).css('top', 'auto').css('bottom', largeButtonHeight - 2);
$('.button.dropdown.up.small > ul', this).css('top', 'auto').css('bottom', smallButtonHeight - 2);
$('.button.dropdown.up.tiny > ul', this).css('top', 'auto').css('bottom', tinyButtonHeight - 2);
};
})( jQuery );
This diff is collapsed.
(function ($) {
$.fn.foundationMediaQueryViewer = function (options) {
var settings = $.extend(options,{toggleKey:77}); // // Press 'M'
$(document).on("keyup.mediaQueryViewer", ":input", function(e){
if (e.which === settings.toggleKey) {
e.stopPropagation();
}
});
$(document).on("keyup.mediaQueryViewer", function(e) {
var $mqViewer = $('#fqv');
if (e.which === settings.toggleKey) {
if ($mqViewer.length > 0) {
$mqViewer.remove();
} else {
$('body').prepend('<div id="fqv" style="position:fixed;top:4px;left:4px;z-index:999;color:#fff;"><p style="font-size:12px;background:rgba(0,0,0,0.75);padding:5px;margin-bottom:1px;line-height:1.2;"><span class="left">Media:</span> <span style="font-weight:bold;" class="show-for-xlarge">Extra Large</span><span style="font-weight:bold;" class="show-for-large">Large</span><span style="font-weight:bold;" class="show-for-medium">Medium</span><span style="font-weight:bold;" class="show-for-small">Small</span><span style="font-weight:bold;" class="show-for-landscape">Landscape</span><span style="font-weight:bold;" class="show-for-portrait">Portrait</span><span style="font-weight:bold;" class="show-for-touch">Touch</span></p></div>');
}
}
});
};
})(jQuery);
\ No newline at end of file
(function ($){
$.fn.foundationNavigation = function (options) {
var lockNavBar = false;
// Windows Phone, sadly, does not register touch events :(
if (Modernizr.touch || navigator.userAgent.match(/Windows Phone/i)) {
$(document).on('click.fndtn touchstart.fndtn', '.nav-bar a.flyout-toggle', function (e) {
e.preventDefault();
var flyout = $(this).siblings('.flyout').first();
if (lockNavBar === false) {
$('.nav-bar .flyout').not(flyout).slideUp(500);
flyout.slideToggle(500, function () {
lockNavBar = false;
});
}
lockNavBar = true;
});
$('.nav-bar>li.has-flyout', this).addClass('is-touch');
} else {
$('.nav-bar>li.has-flyout', this).hover(function () {
$(this).children('.flyout').show();
}, function () {
$(this).children('.flyout').hide();
});
}
};
})( jQuery );
This diff is collapsed.
This diff is collapsed.
(function ($) {
$.fn.foundationTabs = function (options) {
var settings = $.extend({
callback: $.noop
}, options);
var activateTab = function ($tab) {
var $activeTab = $tab.closest('dl').find('dd.active'),
contentLocation = $tab.children('a').attr("href") + 'Tab';
// Strip off the current url that IE adds
contentLocation = contentLocation.replace(/^.+#/, '#');
//Make Tab Active
$activeTab.removeClass('active');
$tab.addClass('active');
//Show Tab Content
$(contentLocation).closest('.tabs-content').children('li').removeClass('active').hide();
$(contentLocation).css('display', 'block').addClass('active');
};
$(document).on('click.fndtn', 'dl.tabs dd a', function (event){
activateTab($(this).parent('dd'));
});
if (window.location.hash) {
activateTab($('a[href="' + window.location.hash + '"]').parent('dd'));
settings.callback();
}
};
})(jQuery);
\ No newline at end of file
/*
* jQuery Foundation Tooltip Plugin 2.0.1
* http://foundation.zurb.com
* Copyright 2012, ZURB
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
/*jslint unparam: true, browser: true, indent: 2 */
;(function ($) {
'use strict';
var settings = {
bodyHeight : 0,
targetClass : '.has-tip',
tooltipClass : '.tooltip',
tipTemplate : function (selector, content) {
return '<span data-selector="' + selector + '" class="' + settings.tooltipClass.substring(1) + '">' + content + '<span class="nub"></span></span>';
}
},
methods = {
init : function (options) {
return this.each(function () {
var $body = $('body');
if (Modernizr.touch) {
$body.on('click.tooltip touchstart.tooltip touchend.tooltip', settings.targetClass, function (e) {
e.preventDefault();
$(settings.tooltipClass).hide();
methods.showOrCreateTip($(this));
});
$body.on('click.tooltip touchstart.tooltip touchend.tooltip', settings.tooltipClass, function (e) {
e.preventDefault();
$(this).fadeOut(150);
});
} else {
$body.on('mouseenter.tooltip mouseleave.tooltip', settings.targetClass, function (e) {
var $this = $(this);
if (e.type === 'mouseenter') {
methods.showOrCreateTip($this);
} else if (e.type === 'mouseleave') {
methods.hide($this);
}
});
}
});
},
showOrCreateTip : function ($target) {
var $tip = methods.getTip($target);
if ($tip && $tip.length > 0) {
methods.show($target);
} else {
methods.create($target);
}
},
getTip : function ($target) {
var selector = methods.selector($target),
tip = null;
if (selector) {
tip = $('span[data-selector=' + selector + ']' + settings.tooltipClass);
}
return (tip.length > 0) ? tip : false;
},
selector : function ($target) {
var id = $target.attr('id'),
dataSelector = $target.data('selector');
if (id === undefined && dataSelector === undefined) {
dataSelector = 'tooltip' + Math.random().toString(36).substring(7);
$target.attr('data-selector', dataSelector);
}
return (id) ? id : dataSelector;
},
create : function ($target) {
var $tip = $(settings.tipTemplate(methods.selector($target), $('<div>').text($target.attr('title')).html())),
classes = methods.inheritable_classes($target);
$tip.addClass(classes).appendTo('body');
if (Modernizr.touch) {
$tip.append('<span class="tap-to-close">tap to close </span>');
}
$target.removeAttr('title');
methods.show($target);
},
reposition : function (target, tip, classes) {
var width, nub, nubHeight, nubWidth, column, objPos;
tip.css('visibility', 'hidden').show();
width = target.data('width');
nub = tip.children('.nub');
nubHeight = nub.outerHeight();
nubWidth = nub.outerWidth();
objPos = function (obj, top, right, bottom, left, width) {
return obj.css({
'top' : top,
'bottom' : bottom,
'left' : left,
'right' : right,
'width' : (width) ? width : 'auto'
}).end();
};
objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', target.offset().left, width);
objPos(nub, -nubHeight, 'auto', 'auto', 10);
if ($(window).width() < 767) {
column = target.closest('.columns');
if (column.length < 0) {
// if not using Foundation
column = $('body');
}
tip.width(column.outerWidth() - 25).css('left', 15).addClass('tip-override');
objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left);
} else {
if (classes.indexOf('tip-top') > -1) {
objPos(tip, (target.offset().top - tip.outerHeight() - nubHeight), 'auto', 'auto', target.offset().left, width)
.removeClass('tip-override');
objPos(nub, 'auto', 'auto', -nubHeight, 'auto');
} else if (classes.indexOf('tip-left') > -1) {
objPos(tip, (target.offset().top + (target.outerHeight() / 2) - nubHeight), 'auto', 'auto', (target.offset().left - tip.outerWidth() - 10), width)
.removeClass('tip-override');
objPos(nub, (tip.outerHeight() / 2) - (nubHeight / 2), -nubHeight, 'auto', 'auto');
} else if (classes.indexOf('tip-right') > -1) {
objPos(tip, (target.offset().top + (target.outerHeight() / 2) - nubHeight), 'auto', 'auto', (target.offset().left + target.outerWidth() + 10), width)
.removeClass('tip-override');
objPos(nub, (tip.outerHeight() / 2) - (nubHeight / 2), 'auto', 'auto', -nubHeight);
}
}
tip.css('visibility', 'visible').hide();
},
inheritable_classes : function (target) {
var inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'noradius'],
filtered = target.attr('class').split(' ').map(function (el, i) {
if ($.inArray(el, inheritables) !== -1) {
return el;
}
}).join(' ');
return $.trim(filtered);
},
show : function ($target) {
var $tip = methods.getTip($target);
methods.reposition($target, $tip, $target.attr('class'));
$tip.fadeIn(150);
},
hide : function ($target) {
var $tip = methods.getTip($target);
$tip.fadeOut(150);
},
reload : function () {
var $self = $(this);
return ($self.data('tooltips')) ? $self.tooltips('destroy').tooltips('init') : $self.tooltips('init');
},
destroy : function () {
return this.each(function () {
$(window).off('.tooltip');
$(settings.targetClass).off('.tooltip');
$(settings.tooltipClass).each(function (i) {
$($(settings.targetClass).get(i)).attr('title', $(this).text());
}).remove();
});
}
};
$.fn.tooltips = function (method) {
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
return methods.init.apply(this, arguments);
} else {
$.error('Method ' + method + ' does not exist on jQuery.tooltips');
}
};
}(jQuery));
\ No newline at end of file
This diff is collapsed.
/*! http://mths.be/placeholder v2.0.7 by @mathias */
;(function(window, document, $) {
var isInputSupported = 'placeholder' in document.createElement('input'),
isTextareaSupported = 'placeholder' in document.createElement('textarea'),
prototype = $.fn,
valHooks = $.valHooks,
hooks,
placeholder;
if (isInputSupported && isTextareaSupported) {