Clean mockup assets
|
@ -29,7 +29,7 @@ module.exports = function(grunt) {
|
||||||
sourcemap: 'none'
|
sourcemap: 'none'
|
||||||
},
|
},
|
||||||
files: { // Dictionary of files
|
files: { // Dictionary of files
|
||||||
"publichealth/static/mockup/assets/css/main.css": "publichealth/static/css/main.scss"
|
"./assets/css/main.css": "publichealth/static/css/main.scss"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dist: {
|
dist: {
|
||||||
|
@ -38,7 +38,7 @@ module.exports = function(grunt) {
|
||||||
sourcemap: 'none'
|
sourcemap: 'none'
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
"publichealth/static/mockup/assets/css/main.min.css": "publichealth/static/css/main.scss"
|
"./assets/css/main.min.css": "publichealth/static/css/main.scss"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -58,8 +58,8 @@ module.exports = function(grunt) {
|
||||||
dev: {
|
dev: {
|
||||||
bsFiles: {
|
bsFiles: {
|
||||||
src: [
|
src: [
|
||||||
"publichealth/static/mockup/assets/css/*.css",
|
"./assets/css/*.css",
|
||||||
"publichealth/static/mockup/*.html"
|
"./*.html"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
|
|
|
@ -29,7 +29,7 @@ bower install
|
||||||
|
|
||||||
The first command (`..install -g..`) may require `sudo` if you installed node.js as a system package.
|
The first command (`..install -g..`) may require `sudo` if you installed node.js as a system package.
|
||||||
|
|
||||||
If you are only working on the frontend, you can start a local webserver and work on frontend assets without the backend setup described below. Mock content is at `publichealth/static/mockup`
|
If you are only working on the frontend, you can start a local webserver and work on frontend assets without the backend setup described below. Mock content is at `mockup`, and there is a `grunt browser-sync` setup for working with frontend assets.
|
||||||
|
|
||||||
**Backend setup**
|
**Backend setup**
|
||||||
|
|
||||||
|
@ -57,13 +57,12 @@ If you have one installed, also start your local redis server (`service redis st
|
||||||
Run this after completing setup:
|
Run this after completing setup:
|
||||||
|
|
||||||
```
|
```
|
||||||
./manage.py runserver &
|
./manage.py runserver
|
||||||
grunt browser-sync
|
|
||||||
```
|
```
|
||||||
|
|
||||||
A default browser should open pointing to the default home page.
|
A default browser should open pointing to the default home page.
|
||||||
|
|
||||||
Now access the admin panel with the user account you created earlier: http://localhost:3000/admin/
|
Now access the admin panel with the user account you created earlier: http://localhost:8000/admin/
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
|
|
5423
config.codekit3
84
mockup/Gruntfile.js
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
module.exports = function(grunt) {
|
||||||
|
|
||||||
|
grunt.initConfig({
|
||||||
|
pkg: grunt.file.readJSON('package.json'),
|
||||||
|
|
||||||
|
imagemin: {
|
||||||
|
media: {
|
||||||
|
files: [{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'media/images/',
|
||||||
|
src: '{,*/}*.{png,jpg,jpeg,gif}',
|
||||||
|
dest: 'media/images'
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
sass: {
|
||||||
|
files: "publichealth/static/**/*.scss",
|
||||||
|
tasks: ['sass:dev']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// TODO: switch to https://github.com/sindresorhus/grunt-sass
|
||||||
|
sass: { // Task
|
||||||
|
dev: { // Target
|
||||||
|
options: { // Target options
|
||||||
|
style: 'expanded',
|
||||||
|
sourcemap: 'none'
|
||||||
|
},
|
||||||
|
files: { // Dictionary of files
|
||||||
|
"mockup/assets/css/main.css": "publichealth/static/css/main.scss"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dist: {
|
||||||
|
options: {
|
||||||
|
style: 'compressed',
|
||||||
|
sourcemap: 'none'
|
||||||
|
},
|
||||||
|
files: {
|
||||||
|
"mockup/assets/css/main.min.css": "publichealth/static/css/main.scss"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
bgShell: {
|
||||||
|
_defaults: {
|
||||||
|
bg: true,
|
||||||
|
stdout: false,
|
||||||
|
stderr: false,
|
||||||
|
},
|
||||||
|
runDjango: {
|
||||||
|
cmd: 'python manage.py runserver'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
browserSync: {
|
||||||
|
dev: {
|
||||||
|
bsFiles: {
|
||||||
|
src: [
|
||||||
|
"mockup/assets/css/*.css",
|
||||||
|
"mockup/*.html"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
watchTask: true,
|
||||||
|
proxy: "localhost:8000"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-imagemin');
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-sass');
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||||
|
grunt.loadNpmTasks('grunt-bg-shell');
|
||||||
|
grunt.loadNpmTasks('grunt-browser-sync');
|
||||||
|
grunt.registerTask('default', ['imagemin', 'sass']);
|
||||||
|
grunt.registerTask('browser-sync', [
|
||||||
|
'bgShell',
|
||||||
|
'browserSync',
|
||||||
|
'watch'
|
||||||
|
]);
|
||||||
|
};
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
Before Width: | Height: | Size: 382 KiB After Width: | Height: | Size: 382 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
@ -54,6 +54,6 @@ cd $PROJECT_DIR
|
||||||
npm install -g bower grunt-cli
|
npm install -g bower grunt-cli
|
||||||
npm install
|
npm install
|
||||||
bower install
|
bower install
|
||||||
alias liverun="grunt browser-sync"
|
alias bower="bower install"
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|