Clean mockup assets

This commit is contained in:
Oleg Lavrovsky 2017-05-03 08:51:43 +02:00
parent 4eb01b47d2
commit e2527f79cf
49 changed files with 92 additions and 5432 deletions

View File

@ -29,7 +29,7 @@ module.exports = function(grunt) {
sourcemap: 'none'
},
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: {
@ -38,7 +38,7 @@ module.exports = function(grunt) {
sourcemap: 'none'
},
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: {
bsFiles: {
src: [
"publichealth/static/mockup/assets/css/*.css",
"publichealth/static/mockup/*.html"
"./assets/css/*.css",
"./*.html"
]
},
options: {

View File

@ -29,7 +29,7 @@ bower install
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**
@ -57,13 +57,12 @@ If you have one installed, also start your local redis server (`service redis st
Run this after completing setup:
```
./manage.py runserver &
grunt browser-sync
./manage.py runserver
```
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

File diff suppressed because it is too large Load Diff

84
mockup/Gruntfile.js Normal file
View 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'
]);
};

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 382 KiB

After

Width:  |  Height:  |  Size: 382 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -54,6 +54,6 @@ cd $PROJECT_DIR
npm install -g bower grunt-cli
npm install
bower install
alias liverun="grunt browser-sync"
alias bower="bower install"
EOF