Migrated from grunt to django-compressor
This commit is contained in:
parent
cffecfc223
commit
b86d599f19
|
@ -16,6 +16,8 @@ db.sqlite3
|
||||||
# Bootflat
|
# Bootflat
|
||||||
shelfzilla/themes/bootflat/static/css/*.css
|
shelfzilla/themes/bootflat/static/css/*.css
|
||||||
shelfzilla/themes/bootflat/static/js/*.js
|
shelfzilla/themes/bootflat/static/js/*.js
|
||||||
|
shelfzilla/themes/bootflat/static/bower/*
|
||||||
|
**/CACHE/*
|
||||||
|
|
||||||
# Bower
|
# Bower
|
||||||
bower_components
|
bower_components
|
||||||
|
|
|
@ -11,6 +11,9 @@ django-import-export==0.2.2
|
||||||
# Fixes
|
# Fixes
|
||||||
longerusername==0.4
|
longerusername==0.4
|
||||||
|
|
||||||
|
# Statics
|
||||||
|
django-compressor==1.4
|
||||||
|
|
||||||
# DDBB
|
# DDBB
|
||||||
dj-database-url==0.3.0
|
dj-database-url==0.3.0
|
||||||
psycopg2==2.5.2
|
psycopg2==2.5.2
|
||||||
|
|
113
gruntfile.coffee
113
gruntfile.coffee
|
@ -3,93 +3,6 @@ module.exports = (grunt) ->
|
||||||
grunt.initConfig
|
grunt.initConfig
|
||||||
pkg: grunt.file.readJSON 'package.json'
|
pkg: grunt.file.readJSON 'package.json'
|
||||||
|
|
||||||
bower:
|
|
||||||
dev:
|
|
||||||
dest: "static_components/"
|
|
||||||
js_dest: 'static_components/js',
|
|
||||||
css_dest: 'static_components/css'
|
|
||||||
options:
|
|
||||||
packageSpecific:
|
|
||||||
Bootflat:
|
|
||||||
dest: 'static_components/fonts',
|
|
||||||
files: [
|
|
||||||
'css/bootstrap.min.css',
|
|
||||||
'bootflat/css/bootflat.min.css',
|
|
||||||
'bootflat/img/check_flat/default.png',
|
|
||||||
'bootflat/js/icheck.min.js',
|
|
||||||
'js/bootstrap.min.js',
|
|
||||||
'fonts/glyphicons-halflings-regular.eot',
|
|
||||||
'fonts/glyphicons-halflings-regular.svg',
|
|
||||||
'fonts/glyphicons-halflings-regular.ttf',
|
|
||||||
'fonts/glyphicons-halflings-regular.woff',
|
|
||||||
]
|
|
||||||
nprogress:
|
|
||||||
files: [
|
|
||||||
'nprogress.css',
|
|
||||||
]
|
|
||||||
|
|
||||||
less:
|
|
||||||
options:
|
|
||||||
ieCompat: true
|
|
||||||
compress: true
|
|
||||||
development:
|
|
||||||
files:
|
|
||||||
"shelfzilla/themes/bootflat/static/css/app.css": "shelfzilla/themes/bootflat/static/less/app.less"
|
|
||||||
|
|
||||||
coffee:
|
|
||||||
development:
|
|
||||||
files:
|
|
||||||
'shelfzilla/themes/bootflat/static/js/main.full.js': 'shelfzilla/themes/bootflat/static/coffee/main.coffee'
|
|
||||||
|
|
||||||
|
|
||||||
concat:
|
|
||||||
options:
|
|
||||||
separator: ';'
|
|
||||||
js:
|
|
||||||
src: [
|
|
||||||
"static_components/js/jquery.js",
|
|
||||||
"static_components/js/vegas.js",
|
|
||||||
"static_components/js/bootstrap.min.js",
|
|
||||||
"static_components/js/icheck.min.js",
|
|
||||||
"static_components/js/jquery-pjax.js",
|
|
||||||
"static_components/js/nprogress.js",
|
|
||||||
"static_components/js/toastr.js",
|
|
||||||
"static_components/js/eventEmitter.js",
|
|
||||||
"static_components/js/eventie.js",
|
|
||||||
"static_components/js/imagesloaded.js",
|
|
||||||
"shelfzilla/themes/bootflat/static/js/main.full.js",
|
|
||||||
]
|
|
||||||
dest: "shelfzilla/themes/bootflat/static/js/site.js"
|
|
||||||
css:
|
|
||||||
src: [
|
|
||||||
"shelfzilla/themes/bootflat/static/css/app.css",
|
|
||||||
"static_components/css/bootstrap.min.css",
|
|
||||||
"static_components/css/bootflat.min.css",
|
|
||||||
"static_components/css/nprogress.css",
|
|
||||||
"static_components/css/toastr.css",
|
|
||||||
]
|
|
||||||
dest: "shelfzilla/themes/bootflat/static/css/style.css"
|
|
||||||
|
|
||||||
uglify:
|
|
||||||
development:
|
|
||||||
files:
|
|
||||||
'shelfzilla/themes/bootflat/static/js/site.js': 'shelfzilla/themes/bootflat/static/js/site.js'
|
|
||||||
|
|
||||||
clean:
|
|
||||||
development:
|
|
||||||
src: [
|
|
||||||
"shelfzilla/themes/bootflat/static/js/*.full.js",
|
|
||||||
]
|
|
||||||
production:
|
|
||||||
src: [
|
|
||||||
"shelfzilla/themes/bootflat/static/js/*.full.js",
|
|
||||||
]
|
|
||||||
release:
|
|
||||||
src: [
|
|
||||||
"shelfzilla/themes/bootflat/static/less",
|
|
||||||
"shelfzilla/themes/bootflat/static/coffee",
|
|
||||||
]
|
|
||||||
|
|
||||||
watch:
|
watch:
|
||||||
options:
|
options:
|
||||||
livereload: true
|
livereload: true
|
||||||
|
@ -98,35 +11,15 @@ module.exports = (grunt) ->
|
||||||
tasks: []
|
tasks: []
|
||||||
less:
|
less:
|
||||||
files: ['shelfzilla/themes/bootflat/static/less/*.less']
|
files: ['shelfzilla/themes/bootflat/static/less/*.less']
|
||||||
tasks: ['less', 'concat:css']
|
tasks: []
|
||||||
coffee:
|
coffee:
|
||||||
files: ['shelfzilla/themes/bootflat/static/coffee/*.coffee']
|
files: ['shelfzilla/themes/bootflat/static/coffee/*.coffee']
|
||||||
tasks: ['coffee', 'concat:js', 'clean:development']
|
tasks: []
|
||||||
|
|
||||||
|
|
||||||
# Modules
|
# Modules
|
||||||
grunt.loadNpmTasks 'grunt-contrib-less'
|
|
||||||
grunt.loadNpmTasks 'grunt-contrib-coffee'
|
|
||||||
grunt.loadNpmTasks 'grunt-contrib-uglify'
|
|
||||||
grunt.loadNpmTasks 'grunt-contrib-watch'
|
grunt.loadNpmTasks 'grunt-contrib-watch'
|
||||||
grunt.loadNpmTasks 'grunt-contrib-concat'
|
|
||||||
grunt.loadNpmTasks 'grunt-contrib-clean'
|
|
||||||
grunt.loadNpmTasks 'grunt-contrib-clean'
|
|
||||||
grunt.loadNpmTasks 'grunt-bower'
|
grunt.loadNpmTasks 'grunt-bower'
|
||||||
|
|
||||||
# Tasks
|
# Tasks
|
||||||
grunt.registerTask 'default', [
|
grunt.registerTask 'default', ["watch"]
|
||||||
"bower",
|
|
||||||
"less", "coffee", "concat", "clean:development",
|
|
||||||
"watch"
|
|
||||||
]
|
|
||||||
|
|
||||||
grunt.registerTask 'compile', [
|
|
||||||
"bower",
|
|
||||||
"less", "coffee", "concat", 'uglify', "clean:development"
|
|
||||||
]
|
|
||||||
|
|
||||||
grunt.registerTask 'build', [
|
|
||||||
"bower",
|
|
||||||
"less", "coffee", "concat", "uglify", 'clean:production'
|
|
||||||
]
|
|
||||||
|
|
|
@ -56,6 +56,9 @@ INSTALLED_APPS = (
|
||||||
'south',
|
'south',
|
||||||
'import_export',
|
'import_export',
|
||||||
|
|
||||||
|
# Staticfiles
|
||||||
|
"compressor",
|
||||||
|
|
||||||
# Apps
|
# Apps
|
||||||
'shelfzilla.apps._admin',
|
'shelfzilla.apps._admin',
|
||||||
'shelfzilla.apps.config',
|
'shelfzilla.apps.config',
|
||||||
|
@ -153,6 +156,17 @@ STATICFILES_DIRS = (
|
||||||
os.path.join(BASE_DIR, "themes", "bootflat", "static"),
|
os.path.join(BASE_DIR, "themes", "bootflat", "static"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
STATICFILES_FINDERS = (
|
||||||
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
||||||
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
||||||
|
'compressor.finders.CompressorFinder',
|
||||||
|
)
|
||||||
|
|
||||||
|
COMPRESS_PRECOMPILERS = (
|
||||||
|
('text/less', 'lessc {infile} {outfile}'),
|
||||||
|
('text/coffeescript', 'coffee --compile --stdio --no-header'),
|
||||||
|
)
|
||||||
|
|
||||||
# Max username length (longerusername)
|
# Max username length (longerusername)
|
||||||
MAX_USERNAME_LENGTH = 75
|
MAX_USERNAME_LENGTH = 75
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
body {
|
body {
|
||||||
background-color: rgb(241, 242, 246) !important;
|
background-color: rgb(241, 242, 246) !important;
|
||||||
background-image: url('../backgrounds/triangify.png');
|
background-image: url('../../backgrounds/triangify.png');
|
||||||
background-position: center top;
|
background-position: center top;
|
||||||
background-attachment: fixed;
|
background-attachment: fixed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,19 @@
|
||||||
{% load i18n solo_tags staticfiles %}
|
{% load i18n solo_tags staticfiles compress %}
|
||||||
{% get_solo 'config.SiteConfiguration' as site_config %}
|
{% get_solo 'config.SiteConfiguration' as site_config %}
|
||||||
{% get_solo 'config.SocialConfiguration' as social_config %}
|
{% get_solo 'config.SocialConfiguration' as social_config %}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" href="{% static "css/style.css" %}" />
|
{% compress css %}
|
||||||
{% block extra_css %}{% endblock %}
|
{% block stylesheets %}
|
||||||
|
<link rel="stylesheet" href="{% static "bower/Bootflat/css/bootstrap.min.css" %}" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="{% static "bower/Bootflat/bootflat/css/bootflat.css" %}" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="{% static "bower/nprogress/nprogress.css" %}" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="{% static "bower/toastr/toastr.css" %}" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="{% static "less/app.less" %}" type="text/less" />
|
||||||
|
{% endblock %}
|
||||||
|
{% endcompress %}
|
||||||
<title>{% block page_title %}ShelfZilla{% endblock %}</title>
|
<title>{% block page_title %}ShelfZilla{% endblock %}</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -86,11 +93,22 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% block footer %}{% endblock %}
|
{% block footer %}{% endblock %}
|
||||||
|
{% compress js %}
|
||||||
|
{% block javascript %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var USE_PJAX = {{ site_config.use_pjax|lower }};
|
var USE_PJAX = {{ site_config.use_pjax|lower }};
|
||||||
</script>
|
</script>
|
||||||
<script src="{% static "js/site.js" %}"></script>
|
<script type="text/javascript" src="{% static "bower/jquery/dist/jquery.js" %}"></script>
|
||||||
{% block extra_js %}{% endblock %}
|
<script type="text/javascript" src="{% static "bower/Bootflat/js/bootstrap.min.js" %}"></script>
|
||||||
|
<script type="text/javascript" src="{% static "bower/jquery-pjax/jquery.pjax.js" %}"></script>
|
||||||
|
<script type="text/javascript" src="{% static "bower/nprogress/nprogress.js" %}"></script>
|
||||||
|
<script type="text/javascript" src="{% static "bower/toastr/toastr.js" %}"></script>
|
||||||
|
<script type="text/javascript" src="{% static "bower/EventEmitter/EventEmitter.js" %}"></script>
|
||||||
|
<script type="text/javascript" src="{% static "bower/eventie/eventie.js" %}"></script>
|
||||||
|
<script type="text/javascript" src="{% static "bower/imagesloaded/imagesloaded.js" %}"></script>
|
||||||
|
<script type="text/coffeescript" src="{% static "coffee/main.coffee" %}"></script>
|
||||||
|
{% endblock %}
|
||||||
|
{% endcompress %}
|
||||||
|
|
||||||
{% if social_config.google_analytics %}
|
{% if social_config.google_analytics %}
|
||||||
{% include "_includes/google_analytics.html" %}
|
{% include "_includes/google_analytics.html" %}
|
||||||
|
|
Reference in New Issue