Permalink
Browse files

Merge branch 'master' into stats

Conflicts:
	plan/settings/base.py
  • Loading branch information...
adamcik committed Jul 30, 2011
2 parents 06c8157 + 3652f18 commit 2deb803190ae5bc4a0f5f460e210a05c3bff52a6
View
@@ -73,18 +73,31 @@
TIME_FORMAT = "H:i"
DATE_FORMAT = "Y-m-d"
-STATIC_ROOT = BASE_PATH + '/static'
+MEDIA_ROOT = join(BASE_PATH, 'media')
+STATIC_ROOT = join(BASE_PATH, 'static')
STATIC_URL = '/static/'
-COMPRESS_URL = STATIC_URL
-COMPRESS_ROOT = STATIC_ROOT
-
ADMIN_MEDIA_PREFIX = STATIC_URL + "admin/"
STATICFILES_FINDERS = (
'staticfiles.finders.AppDirectoriesFinder',
'staticfiles.finders.FileSystemFinder',
'staticfiles.finders.LegacyAppDirectoriesFinder',
+ 'compressor.finders.CompressorFinder',
+)
+
+STATICFILES_DIRS = (MEDIA_ROOT,)
+
+COMPRESS = True
+
+COMPRESS_OFFLINE = True
+
+if DEBUG:
+ COMPRESS_DEBUG_TOGGLE = 'no-cache'
+
+COMPRESS_CSS_FILTERS = (
+ 'compressor.filters.css_default.CssAbsoluteFilter',
+ 'compressor.filters.cssmin.CSSMinFilter',
)
# List of callables that know how to import templates from various sources.
@@ -129,51 +142,20 @@
'django.contrib.sites',
'django.contrib.contenttypes',
'django.contrib.contenttypes',
- 'south',
- 'compress',
- 'staticfiles',
'plan.common',
'plan.scrape',
'plan.ical',
'plan.pdf',
'plan.cache',
'plan.translation',
'plan.google',
+ 'south',
+ 'compressor',
+ 'staticfiles',
)
SKIP_SOUTH_TESTS = True
-COMPRESS = True
-COMPRESS_VERSION = True
-COMPRESS_VERSION_REMOVE_OLD = False
-COMPRESS_AUTO = False
-COMPRESS_CSS_FILTERS = None
-
-COMPRESS_CSS = {
- 'screen': {
- 'source_filenames': ('css/reset-fonts-grids.css',
- 'css/base-min.css',
- 'css/style.css',),
- 'output_filename': 'compressed/screen.r?.css',
- },
-}
-COMPRESS_JS = {
- 'all': {
- 'source_filenames': ('js/jquery-1.3.1.min.js',
- 'js/jquery.autocomplete.min.js',
- 'js/autocomplete.js',
- 'js/navigation.js',
- 'js/advanced.js'),
- 'output_filename': 'compressed/all.r?.js',
- },
-
- 'graph': {
- 'source_filenames': ('js/jquery-1.3.1.min.js',
- 'js/jquery.flot.min.js',),
- 'output_filename': 'compressed/graph.r?.js',
- },
-}
-
TIMETABLE_COLORS = [
'#B3E2CD',
'#FDCDAC',
@@ -1,15 +1,19 @@
{% extends "base.html" %}
{% load translation %}
-{% load compressed %}
+{% load compress %}
{% load google %}
{% block title %}
{% trans "Timetable generator for NTNU students" %}
{% endblock %}
{% block style %}
- {% compressed_css 'screen' %}
+ {% compress css %}
+ <link rel="stylesheet" href="{{ STATIC_URL }}css/reset-fonts-grids.css" />
+ <link rel="stylesheet" href="{{ STATIC_URL }}css/base-min.css" />
+ <link rel="stylesheet" href="{{ STATIC_URL }}css/style.css" />
+ {% endcompress %}
{% endblock %}
{% block extrahead %}
@@ -1,15 +1,20 @@
{% extends "base_site.html" %}
-{% load translation %}
-{% load title %}
{% load color %}
-{% load compressed %}
+{% load compress %}
+{% load title %}
+{% load translation %}
{% block extrastyle %}
{% if courses %}
- <style type="text/css">
- {% for course in courses %}.course-{{ course.id }} { background-color: {% color course.id %} }
- {% endfor %}
- </style>
+ {% compress css inline %}
+ <style type="text/css">
+ {% for course in courses %}
+ .course-{{ course.id }} {
+ background-color: {% color course.id %};
+ }
+ {% endfor %}
+ </style>
+ {% endcompress %}
{% endif %}
{% endblock %}
@@ -24,7 +29,13 @@
var language = '{{ LANGUAGE_CODE }}';
var autocomplete_url = "{% url course-query semester.year,semester.type %}";
</script>
- {% compressed_js 'all' %}
+ {% compress js %}
+ <script type="text/javascript" src="{{ STATIC_URL}}js/jquery-1.3.1.min.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL}}js/jquery.autocomplete.min.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL}}js/autocomplete.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL}}js/navigation.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL}}js/advanced.js"></script>
+ {% endcompress %}
{{ block.super }}
{% endblock %}
@@ -1,21 +1,31 @@
{% extends "base_site.html" %}
-{% load translation %}
{% load color %}
-{% load compressed %}
+{% load compress %}
+{% load translation %}
{% block extrastyle %}
{% if courses %}
- <style type="text/css">
- {% for course in courses %}
- .course-{{ course.id }} { background-color: {% color course.id %} }
- {% endfor %}
- </style>
+ {% compress css inline %}
+ <style type="text/css">
+ {% for course in courses %}
+ .course-{{ course.id }} {
+ background-color: {% color course.id %};
+ }
+ {% endfor %}
+ </style>
+ {% endcompress %}
{% endif %}
{% endblock %}
{% block extrascript %}
- {% compressed_js 'all' %}
+ {% compress js %}
+ <script type="text/javascript" src="{{ STATIC_URL}}js/jquery-1.3.1.min.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL}}js/jquery.autocomplete.min.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL}}js/autocomplete.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL}}js/navigation.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL}}js/advanced.js"></script>
+ {% endcompress %}
{{ block.super }}
{% endblock %}
View
@@ -1,5 +1,6 @@
{% extends "base_site.html" %}
{% load color %}
+{% load compress %}
{% load strip %}
{% load translation %}
@@ -27,10 +28,15 @@ <h1>{% trans "Timetable generator for NTNU students" %}</h1>
{% block extrastyle %}
{% if stats %}
- <style type="text/css">
- {% for count,course_id,code,name in stats %}.course-{{ course_id }} { background-color: {% color course_id %} }
- {% endfor %}
- </style>
+ {% compress css inline %}
+ <style type="text/css">
+ {% for count,course_id,code,name in stats %}
+ .course-{{ course_id }} {
+ background-color: {% color course_id %};
+ }
+ {% endfor %}
+ </style>
+ {% endcompress %}
{% endif %}
{% endblock %}
View
@@ -12,7 +12,4 @@ lxml # Web scraping of data
sphinx # To build docs
django-staticfiles # Better handling of static media for django apps
-
-#django-compress # CSS and JS compression
-# Use github version to get COMPRESS_VERSION_REMOVE_OLD support
--e git://github.com/cyberdelia/django-compress.git#egg=compress
+django_compressor # Sane handling of compressing js/css

0 comments on commit 2deb803

Please sign in to comment.