diff --git a/fabfile.py b/fabfile.py index 2d3644e8..d1ae5e17 100644 --- a/fabfile.py +++ b/fabfile.py @@ -163,7 +163,7 @@ def collectstatic(): """ collect_remote_statics() dj('collectstatic --link --noinput') - # dj('compress') + dj('compress') # with cd('{virtualenv_dir}/var/static'.format(**env)): # fix_permissions() diff --git a/requirements.pip b/requirements.pip index 93acadbe..3c22d407 100644 --- a/requirements.pip +++ b/requirements.pip @@ -9,4 +9,5 @@ django==1.4.2 git+git://github.com/petry/django-foundation.git git+git://github.com/yohanboniface/django-chickpea.git git+git://github.com/frankban/django-endless-pagination.git -hg+https://bitbucket.org/liberation/sesql \ No newline at end of file +hg+https://bitbucket.org/liberation/sesql +django_compressor \ No newline at end of file diff --git a/youmap/settings/base.py b/youmap/settings/base.py index 9f375ac1..67903ed8 100644 --- a/youmap/settings/base.py +++ b/youmap/settings/base.py @@ -30,6 +30,7 @@ INSTALLED_APPS = ( 'endless_pagination', 'youmap', 'sesql', + 'compressor', #'south', @@ -95,6 +96,10 @@ STATICFILES_DIRS = ( os.path.join(PROJECT_DIR, 'static'), ) +STATICFILES_FINDERS += ( + 'compressor.finders.CompressorFinder', +) + #============================================================================== # Templates #============================================================================== @@ -129,3 +134,5 @@ AUTHENTICATION_BACKENDS += ( #============================================================================== # Third party app settings #============================================================================== +COMPRESS_ENABLED = True +COMPRESS_OFFLINE = True diff --git a/youmap/templates/base.html b/youmap/templates/base.html index 6a06c3db..32549a48 100644 --- a/youmap/templates/base.html +++ b/youmap/templates/base.html @@ -1,20 +1,21 @@ +{% load compress %} {% block head_title %}u{Map}{% endblock %} + {% compress css %} - + {% endcompress css %} {% block extra_head %} - {% endblock extra_head %} @@ -24,7 +25,7 @@ {% block content %} {% endblock %} - + {% compress js %} @@ -39,6 +40,7 @@ + {% endcompress js %} {% block bottom_js %} {% endblock %} diff --git a/youmap/templates/chickpea/map_detail.html b/youmap/templates/chickpea/map_detail.html new file mode 100644 index 00000000..04b7897b --- /dev/null +++ b/youmap/templates/chickpea/map_detail.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} +{% load chickpea_tags compress %} +{% block title %}{{ map.name }}{% endblock %} + +{% block extra_head %} + {% compress css %} + {% chickpea_css %} + {% endcompress %} + {% compress js %} + {% chickpea_js %} + {% endcompress %} + +{% endblock %} + +{% block content %} + {% block map_init %} + {% include "chickpea/map_init.html" %} + {% endblock %} +{% endblock %} \ No newline at end of file