John Doe
+Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum.
+diff --git a/src/main/webapp/static/.bowerrc b/src/main/webapp/static/.bowerrc new file mode 100644 index 000000000..69fad3580 --- /dev/null +++ b/src/main/webapp/static/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "bower_components" +} diff --git a/src/main/webapp/static/.editorconfig b/src/main/webapp/static/.editorconfig new file mode 100644 index 000000000..c2cdfb8ad --- /dev/null +++ b/src/main/webapp/static/.editorconfig @@ -0,0 +1,21 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + + +[*] + +# Change these settings to your own preference +indent_style = space +indent_size = 2 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/src/main/webapp/static/.gitattributes b/src/main/webapp/static/.gitattributes new file mode 100644 index 000000000..212566614 --- /dev/null +++ b/src/main/webapp/static/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/src/main/webapp/static/.gitignore b/src/main/webapp/static/.gitignore new file mode 100644 index 000000000..f9a9ad30e --- /dev/null +++ b/src/main/webapp/static/.gitignore @@ -0,0 +1,5 @@ +node_modules +.DS_Store +.tmp +.sass-cache +bower_components diff --git a/src/main/webapp/static/.jshintrc b/src/main/webapp/static/.jshintrc new file mode 100644 index 000000000..e0e07301b --- /dev/null +++ b/src/main/webapp/static/.jshintrc @@ -0,0 +1,21 @@ +{ + "node": true, + "browser": true, + "esnext": true, + "bitwise": true, + "camelcase": true, + "curly": true, + "eqeqeq": true, + "immed": true, + "indent": 2, + "latedef": true, + "newcap": true, + "noarg": true, + "quotmark": "single", + "undef": true, + "unused": true, + "strict": true, + "trailing": true, + "smarttabs": true, + "jquery": true +} diff --git a/src/main/webapp/static/.yo-rc.json b/src/main/webapp/static/.yo-rc.json new file mode 100644 index 000000000..7a2135249 --- /dev/null +++ b/src/main/webapp/static/.yo-rc.json @@ -0,0 +1,3 @@ +{ + "generator-mocha": {} +} \ No newline at end of file diff --git a/src/main/webapp/static/Gruntfile.js b/src/main/webapp/static/Gruntfile.js new file mode 100644 index 000000000..99758f3a6 --- /dev/null +++ b/src/main/webapp/static/Gruntfile.js @@ -0,0 +1,453 @@ +// Generated on 2015-01-19 using +// generator-webapp 0.5.1 +'use strict'; + +// # Globbing +// for performance reasons we're only matching one level down: +// 'test/spec/{,*/}*.js' +// If you want to recursively match all subfolders, use: +// 'test/spec/**/*.js' + +module.exports = function(grunt) { + + // Time how long tasks take. Can help when optimizing build times + require('time-grunt')(grunt); + + // Load grunt tasks automatically + require('load-grunt-tasks')(grunt); + + // Configurable paths + var config = { + app: 'app', + dist: 'dist' + }; + + // Define the configuration for all the tasks + grunt.initConfig({ + + // Project settings + config: config, + + // Watches files for changes and runs tasks based on the changed files + watch: { + bower: { + files: ['bower.json'], + tasks: ['wiredep'] + }, + js: { + files: ['<%= config.app %>/scripts/{,*/}*.js'], + tasks: ['jshint'], + options: { + livereload: true + } + }, + jstest: { + files: ['test/spec/{,*/}*.js'], + tasks: ['test:watch'] + }, + gruntfile: { + files: ['Gruntfile.js'] + }, + sass: { + files: ['<%= config.app %>/styles/{,*/}*.{scss,sass}'], + tasks: ['sass:server', 'autoprefixer'] + }, + styles: { + files: ['<%= config.app %>/styles/{,*/}*.css'], + tasks: ['newer:copy:styles', 'autoprefixer'] + }, + livereload: { + options: { + livereload: '<%= connect.options.livereload %>' + }, + files: [ + '<%= config.app %>/{,*/}*.html', + '.tmp/styles/{,*/}*.css', + '<%= config.app %>/images/{,*/}*' + ] + } + }, + + // The actual grunt server settings + connect: { + options: { + port: 9000, + open: true, + livereload: 35729, + // Change this to '0.0.0.0' to access the server from outside + hostname: '0.0.0.0' + }, + livereload: { + options: { + middleware: function(connect) { + return [ + connect.static('.tmp'), + connect().use('/bower_components', connect.static( + './bower_components')), + connect.static(config.app) + ]; + } + } + }, + test: { + options: { + open: false, + port: 9001, + middleware: function(connect) { + return [ + connect.static('.tmp'), + connect.static('test'), + connect().use('/bower_components', connect.static( + './bower_components')), + connect.static(config.app) + ]; + } + } + }, + dist: { + options: { + base: '<%= config.dist %>', + livereload: false + } + } + }, + + // Empties folders to start fresh + clean: { + dist: { + files: [{ + dot: true, + src: [ + '.tmp', + '<%= config.dist %>/*', + '!<%= config.dist %>/.git*' + ] + }] + }, + server: '.tmp' + }, + + // Make sure code styles are up to par and there are no obvious mistakes + jshint: { + options: { + jshintrc: '.jshintrc', + reporter: require('jshint-stylish') + }, + all: [ + 'Gruntfile.js', + '<%= config.app %>/scripts/{,*/}*.js', + '!<%= config.app %>/scripts/vendor/*', + 'test/spec/{,*/}*.js' + ] + }, + + // Mocha testing framework configuration options + mocha: { + all: { + options: { + run: true, + urls: [ + 'http://<%= connect.test.options.hostname %>:<%= connect.test.options.port %>/index.html' + ] + } + } + }, + + // Compiles Sass to CSS and generates necessary files if requested + sass: { + options: { + sourceMap: true, + includePaths: ['bower_components'] + }, + dist: { + files: [{ + expand: true, + cwd: '<%= config.app %>/styles', + src: ['*.{scss,sass}'], + dest: '.tmp/styles', + ext: '.css' + }] + }, + server: { + files: [{ + expand: true, + cwd: '<%= config.app %>/styles', + src: ['*.{scss,sass}'], + dest: '.tmp/styles', + ext: '.css' + }] + } + }, + + // Add vendor prefixed styles + autoprefixer: { + options: { + browsers: ['> 1%', 'last 2 versions', 'Firefox ESR', 'Opera 12.1'] + }, + dist: { + files: [{ + expand: true, + cwd: '.tmp/styles/', + src: '{,*/}*.css', + dest: '.tmp/styles/' + }] + } + }, + + // Automatically inject Bower components into the HTML file + wiredep: { + app: { + ignorePath: /^\/|\.\.\//, + src: ['<%= config.app %>/index.html'], + exclude: [ + 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js' + ] + }, + sass: { + src: ['<%= config.app %>/styles/{,*/}*.{scss,sass}'], + ignorePath: /(\.\.\/){1,2}bower_components\// + } + }, + + // Renames files for browser caching purposes + rev: { + dist: { + files: { + src: [ + '<%= config.dist %>/scripts/{,*/}*.js', + '<%= config.dist %>/styles/{,*/}*.css', + '<%= config.dist %>/images/{,*/}*.*', + '<%= config.dist %>/styles/fonts/{,*/}*.*', + '<%= config.dist %>/*.{ico,png}' + ] + } + } + }, + + // Reads HTML for usemin blocks to enable smart builds that automatically + // concat, minify and revision files. Creates configurations in memory so + // additional tasks can operate on them + // For Production + useminPrepare: { + options: { + dest: '<%= config.dist %>' + }, + html: '<%= config.app %>/index.html' + }, + // For Development + // useminPrepare: { + // options: { + // dest: '<%= config.dist %>', + // flow: { + // steps: { + // js: ['concat'], + // css: ['concat'] + // }, + // post: {} + // } + // }, + // html: '<%= config.app %>/index.html', + // }, + + // Performs rewrites based on rev and the useminPrepare configuration + usemin: { + options: { + assetsDirs: [ + '<%= config.dist %>', + '<%= config.dist %>/images', + '<%= config.dist %>/styles' + ] + }, + html: ['<%= config.dist %>/{,*/}*.html'], + css: ['<%= config.dist %>/styles/{,*/}*.css'] + }, + + // The following *-min tasks produce minified files in the dist folder + imagemin: { + dist: { + files: [{ + expand: true, + cwd: '<%= config.app %>/images', + src: '{,*/}*.{gif,jpeg,jpg,png}', + dest: '<%= config.dist %>/images' + }] + } + }, + + svgmin: { + dist: { + files: [{ + expand: true, + cwd: '<%= config.app %>/images', + src: '{,*/}*.svg', + dest: '<%= config.dist %>/images' + }] + } + }, + + htmlmin: { + dist: { + options: { + collapseBooleanAttributes: true, + collapseWhitespace: true, + conservativeCollapse: true, + removeAttributeQuotes: true, + removeCommentsFromCDATA: true, + removeEmptyAttributes: true, + removeOptionalTags: true, + removeRedundantAttributes: true, + useShortDoctype: true + }, + files: [{ + expand: true, + cwd: '<%= config.dist %>', + src: '{,*/}*.html', + dest: '<%= config.dist %>' + }] + } + }, + + // By default, your `index.html`'s will take care + // of minification. These next options are pre-configured if you do not + // wish to use the Usemin blocks. + // cssmin: { + // dist: { + // files: { + // '<%= config.dist %>/styles/main.css': [ + // '.tmp/styles/{,*/}*.css', + // '<%= config.app %>/styles/{,*/}*.css' + // ] + // } + // } + // }, + // uglify: { + // dist: { + // files: { + // '<%= config.dist %>/scripts/scripts.js': [ + // '<%= config.dist %>/scripts/scripts.js' + // ] + // } + // } + // }, + // concat: { + // dist: {} + // }, + + // Copies remaining files to places other tasks can use + copy: { + dist: { + files: [{ + expand: true, + dot: true, + cwd: '<%= config.app %>', + dest: '<%= config.dist %>', + src: [ + '*.{ico,png,txt}', + 'images/{,*/}*.webp', + '{,*/}*.html', + 'styles/fonts/{,*/}*.*' + ] + }, { + src: 'node_modules/apache-server-configs/dist/.htaccess', + dest: '<%= config.dist %>/.htaccess' + }, { + expand: true, + dot: true, + cwd: '.', + src: 'bower_components/bootstrap-sass-official/assets/fonts/bootstrap/*', + dest: '<%= config.dist %>' + }] + }, + styles: { + expand: true, + dot: true, + cwd: '<%= config.app %>/styles', + dest: '.tmp/styles/', + src: '{,*/}*.css' + } + }, + + // Run some tasks in parallel to speed up build process + concurrent: { + server: [ + 'sass:server', + 'copy:styles' + ], + test: [ + 'copy:styles' + ], + dist: [ + 'sass', + 'copy:styles', + 'imagemin', + 'svgmin' + ] + } + }); + + + grunt.registerTask('serve', + 'start the server and preview your app, --allow-remote for remote access', + function(target) { + if (grunt.option('allow-remote')) { + grunt.config.set('connect.options.hostname', '0.0.0.0'); + } + if (target === 'dist') { + return grunt.task.run(['build', 'connect:dist:keepalive']); + } + + grunt.task.run([ + 'clean:server', + 'wiredep', + 'concurrent:server', + 'autoprefixer', + 'connect:livereload', + 'watch' + ]); + }); + + grunt.registerTask('server', function(target) { + grunt.log.warn( + 'The `server` task has been deprecated. Use `grunt serve` to start a server.' + ); + grunt.task.run([target ? ('serve:' + target) : 'serve']); + }); + + grunt.registerTask('test', function(target) { + if (target !== 'watch') { + grunt.task.run([ + 'clean:server', + 'concurrent:test', + 'autoprefixer' + ]); + } + + grunt.task.run([ + 'connect:test', + 'mocha' + ]); + }); + + grunt.registerTask('build', [ + 'clean:dist', + 'wiredep', + 'useminPrepare', + 'concurrent:dist', + 'autoprefixer', + 'concat', + // For Development - Prevent minification + 'cssmin', + 'uglify', + 'copy:dist', + // 'rev', + 'usemin', + // For Development - Prevent minification + 'htmlmin' + ]); + + grunt.registerTask('default', [ + 'newer:jshint', + 'test', + 'build' + ]); +}; diff --git a/src/main/webapp/static/README.md b/src/main/webapp/static/README.md new file mode 100644 index 000000000..03e955b7c --- /dev/null +++ b/src/main/webapp/static/README.md @@ -0,0 +1,41 @@ +Pet Clinic Front-end +==================== + +Pet Clinic Front-end is the static file for [Spring Pet Clinic repo](https://github.com/singularity-sg/spring-petclinic) client-side code. It is generated by using [Yoeman](http://yeoman.io/), The web's scaffolding tool for modern webapps. + +### Start here: + +1. Download and install [NodeJS](http://nodejs.org/) if you haven't installed it yet. +2. Be sure you are at the root directory of the **spring-petclinic** repo. +3. Change directory by issuing this command, `cd assets/petclinic/` +4. Run `npm install -g yo bower grunt-cli`. This will install [Yoeman](http://yeoman.io/), [Bower](http://bower.io/), and [Grunt](http://gruntjs.com/). +5. On the same folder, run `bower install && npm install` + +Assuming all went well, after which, all we have to run are `grunt` commands to start the server and review the app you have generated, run the unit tests, and build an optimized, production-ready version of your app. + + +## Preview an app you have generated (with Livereload) + +Run `grunt serve`. This will open up the app on your browser in http://localhost:9000/ url + +## Run the unit tests + +Run `grunt test`. This is how you'll run unit test. Though we haven't done any test for this app, so you skip this. + +## Build an optimized, production-ready version of your app + +Run `grunt build` + +Running `grunt build` takes your `app/` source code files and turns them into a distributable application, which ends up in `dist/` directory + +### Install Grunt + + +> **Note** +> +> If an error occurred when running any grunt commands relating to PhantomJS timing out, do the following to fix the issue. + +1. Make sure you're in `assets/petclinic/` directory. Run `cd test` +2. Run `bower install` +3. Go back to the petclinic folder, run `cd ..` +4. Try to run `grunt`. See if no errors appeared. \ No newline at end of file diff --git a/src/main/webapp/static/app/dashboard.html b/src/main/webapp/static/app/dashboard.html new file mode 100644 index 000000000..92b48d1f0 --- /dev/null +++ b/src/main/webapp/static/app/dashboard.html @@ -0,0 +1,327 @@ + + +
+ +When you’re ready, you may start adding a new pet owner or continue browsing.
+Helping you discover pet owners near you and connect.
+Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum.
+Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane.
+Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum.
+Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane.
+Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum.
+Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane.
+Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum.
+Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane.
+Use it as a starting point to create something more unique.
+ +Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.
+Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.
+PetClinic is here to enhance people's relationships with their pets
+ +A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.
+Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.
+Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum.
+Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane.
+Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum.
+Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane.
+The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli.
+A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.
++ Learn more » +
+A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.
++ Learn more » +
+A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.
++ Learn more » +
+Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar.
+Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.
+Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.
+Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
+Use it as a starting point to create something more unique.
+ +Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum.
+Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.
+Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.
+