# HG changeset patch # User Ludovic Chabant # Date 1383804859 28800 # Node ID cc1f3b81364c304526e7c826241f2b36a1cb4fd0 # Parent ea23c9483bc4d3eecd73f4da3bf2f508ac17c09b Better development mode: - Javascript files copied instead of being concatenated. - They have cache busting enabled again. diff -r ea23c9483bc4 -r cc1f3b81364c Gruntfile.js --- a/Gruntfile.js Tue Nov 05 08:13:53 2013 -0800 +++ b/Gruntfile.js Wed Nov 06 22:14:19 2013 -0800 @@ -50,9 +50,12 @@ } }, copy: { - images: { + development: { files: [ - {expand: true, cwd: 'static/', dest: 'build/', src: ['img/**']} + {expand: true, cwd: 'static/', dest: 'build/', src: ['img/**']}, + {expand: true, cwd: 'static/', dest: 'build/', src: ['js/**']}, + {expand: true, cwd: 'static/', dest: 'build/', src: ['tpl/**']}, + {expand: true, cwd: 'static/', dest: 'build/', src: ['bootstrap/js/*.js']} ] }, production: { @@ -96,9 +99,9 @@ grunt.loadNpmTasks('grunt-contrib-watch'); // Default task(s). - grunt.registerTask('default', ['less:production', 'requirejs:production', 'imagemin:all', 'copy:production']); + grunt.registerTask('default', ['jshint', 'less:production', 'requirejs:production', 'imagemin:all', 'copy:production']); // Other tasks. - grunt.registerTask('dev', ['less:development', 'requirejs:development', 'copy:production', 'copy:images']); + grunt.registerTask('dev', ['less:development', 'copy:production', 'copy:development']); }; diff -r ea23c9483bc4 -r cc1f3b81364c wikked/settings.py --- a/wikked/settings.py Tue Nov 05 08:13:53 2013 -0800 +++ b/wikked/settings.py Wed Nov 06 22:14:19 2013 -0800 @@ -1,3 +1,4 @@ SECRET_KEY = '\xef)*\xbc\xd7\xa9t\x7f\xbc3pH1o\xc1\xe2\xb0\x19\\L\xeb\xe3\x00\xa3' DEBUG = True + diff -r ea23c9483bc4 -r cc1f3b81364c wikked/templates/index-dev.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wikked/templates/index-dev.html Wed Nov 06 22:14:19 2013 -0800 @@ -0,0 +1,19 @@ + + + + Wikked + + + + +
+
+ + + + diff -r ea23c9483bc4 -r cc1f3b81364c wikked/templates/index.html --- a/wikked/templates/index.html Tue Nov 05 08:13:53 2013 -0800 +++ b/wikked/templates/index.html Wed Nov 06 22:14:19 2013 -0800 @@ -10,12 +10,5 @@ - diff -r ea23c9483bc4 -r cc1f3b81364c wikked/views.py --- a/wikked/views.py Tue Nov 05 08:13:53 2013 -0800 +++ b/wikked/views.py Wed Nov 06 22:14:19 2013 -0800 @@ -144,17 +144,26 @@ @app.route('/') def home(): - return render_template('index.html', cache_bust=('?%d' % time.time())) + tpl_name = 'index.html' + if app.config['DEBUG']: + tpl_name = 'index-dev.html' + return render_template(tpl_name, cache_bust=('?%d' % time.time())); @app.route('/read/') def read(): - return render_template('index.html', cache_bust=('?%d' % time.time())) + tpl_name = 'index.html' + if app.config['DEBUG']: + tpl_name = 'index-dev.html' + return render_template(tpl_name, cache_bust=('?%d' % time.time())); @app.route('/search') def search(): - return render_template('index.html', cache_bust=('?%d' % time.time())) + tpl_name = 'index.html' + if app.config['DEBUG']: + tpl_name = 'index-dev.html' + return render_template(tpl_name, cache_bust=('?%d' % time.time())); @app.route('/api/list')