├── .editorconfig ├── .eslintignore ├── .eslintrc.json ├── .gitattributes ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── generators └── app │ ├── index.js │ └── templates │ └── src │ └── main │ └── webapp │ └── app │ └── angular-ui │ ├── _angular-ui.controller.js │ ├── _angular-ui.html │ └── _angular-ui.js ├── gulpfile.js ├── package.json ├── static └── generator-jhipster-angular-ui.gif └── test ├── app.js └── templates └── .yo-rc.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 4 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.md] 11 | trim_trailing_whitespace = false 12 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | generators/**/templates 2 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true, 4 | "es6": true 5 | }, 6 | "extends": ["eslint:recommended"], 7 | "rules": { 8 | "indent": [2, 4], 9 | "linebreak-style": 0, 10 | "eol-last": 2, 11 | "quotes": [2, "single"], 12 | "semi": [2, "always"], 13 | "eqeqeq": [2, "smart"], 14 | "no-use-before-define": [2, "nofunc"], 15 | "no-unused-vars": [2, {"vars": "local", "args": "none"}], 16 | "no-multi-str": 2, 17 | "no-irregular-whitespace": 2 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | coverage 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - v5 4 | - v4 5 | - '0.12' 6 | - '0.10' 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015 Thibaut Mottet (http://blog.mottet.me/) 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **DEPRECATED this repository is no longer maintained** 2 | 3 | # generator-jhipster-angular-ui 4 | [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] 5 | > Install easily and get sample code of the most famous AngularUI library on your JHipster application. 6 | 7 | **Modules available:** 8 | - Font Awesome 9 | - Awesome Bootstrap Checkbox 10 | - NGSwitchery 11 | - Angular Bootstrap Slider 12 | 13 | ## Usage 14 | 15 | This is a [JHipster](http://jhipster.github.io/) module, that is meant to be use in a JHipster application. 16 | 17 | ![](/static/generator-jhipster-angular-ui.gif) 18 | 19 | ## Installation 20 | 21 | As this is a [JHipster](http://jhipster.github.io/) module, we expect you have JHipster and its related tools already installed. 22 | 23 | ```bash 24 | npm install -g generator-jhipster-angular-ui 25 | ``` 26 | 27 | Then run the module on a JHipster generated application: 28 | 29 | ```bash 30 | yo jhipster-angular-ui 31 | ``` 32 | 33 | ## Modules Details 34 | 35 | ### Font Awesome 36 | 37 | Font Awesome is a full suite of 605 pictographic icons for easy scalable vector graphics on websites, created and maintained by Dave Gandy. Stay up to date with the latest release and announcements on Twitter: @fontawesome. 38 | 39 | - Github: https://github.com/FortAwesome/Font-Awesome 40 | - Website: http://fontawesome.io/ 41 | 42 | ### Awesome Bootstrap Checkbox 43 | 44 | Font Awesome Bootstrap Checkboxes & Radios plugin. Pure CSS way to make inputs look prettier. No Javascript! 45 | 46 | - Github: https://github.com/flatlogic/awesome-bootstrap-checkbox 47 | - Demo: http://flatlogic.github.io/awesome-bootstrap-checkbox/demo/ 48 | 49 | ### NGSwitchery 50 | 51 | Switchery is a simple component that helps you turn your default HTML checkbox inputs into beautiful iOS 7 style switches in just few simple steps. You can easily customize switches, so that they match your design perfectly. 52 | 53 | - Github: https://github.com/servergrove/NgSwitchery 54 | - Website: http://abpetkov.github.io/switchery/ 55 | 56 | ### Angular Bootstrap Slider 57 | 58 | - Github: https://github.com/seiyria/angular-bootstrap-slider 59 | - Demo: http://seiyria.com/bootstrap-slider/ 60 | 61 | ## License 62 | 63 | Apache-2.0 © Thibaut Mottet 64 | 65 | 66 | [npm-image]: https://img.shields.io/npm/v/generator-jhipster-angular-ui.svg 67 | [npm-url]: https://npmjs.org/package/generator-jhipster-angular-ui 68 | [daviddm-image]: https://david-dm.org/moifort/generator-jhipster-angular-ui.svg?theme=shields.io 69 | [daviddm-url]: https://david-dm.org/moifort/generator-jhipster-angular-ui 70 | [travis-image]: https://travis-ci.org/moifort/generator-jhipster-angular-ui.svg?branch=master 71 | [travis-url]: https://travis-ci.org/moifort/generator-jhipster-angular-ui 72 | -------------------------------------------------------------------------------- /generators/app/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var path = require('path'); 3 | var util = require('util'); 4 | var yeoman = require('yeoman-generator'); 5 | var chalk = require('chalk'); 6 | var yosay = require('yosay'); 7 | var packagejs = require(__dirname + '/../../package.json'); 8 | 9 | // Stores JHipster variables 10 | var jhipsterVar = {moduleName: 'AngularUI'}; 11 | 12 | // Stores JHipster functions 13 | var jhipsterFunc = {}; 14 | 15 | module.exports = yeoman.Base.extend({ 16 | initializing: { 17 | templates: function (args) { 18 | this.composeWith('jhipster:modules', 19 | { 20 | options: { 21 | jhipsterVar: jhipsterVar, 22 | jhipsterFunc: jhipsterFunc 23 | } 24 | }, 25 | this.options.testmode ? {local: require.resolve('generator-jhipster/generators/modules')} : null 26 | ); 27 | } 28 | }, 29 | 30 | prompting: function () { 31 | var done = this.async(); 32 | 33 | // Have Yeoman greet the user. 34 | this.log(yosay( 35 | 'Welcome to the ' + chalk.red('JHipster AngularUI') + ' generator! ' + chalk.yellow('v' + packagejs.version) 36 | )); 37 | 38 | var prompts = [{ 39 | type: 'checkbox', 40 | name: 'modules', 41 | message: 'Which module do you like to install on your JHipster application?', 42 | choices: [ 43 | {name: 'Install all modules', value: 'all'}, 44 | {name: 'Font Awesome', value: 'fontAwesome'}, 45 | {name: 'Awesome Bootstrap Checkbox (+Font Awesome)', value: 'awesomeBootstrapCheckbox'}, 46 | {name: 'NGSwitchery', value: 'switchery'}, 47 | {name: 'Angular Bootstrap Slider', value: 'angularBootstrapSlider'} 48 | ], 49 | default: 'none' 50 | }]; 51 | 52 | this.prompt(prompts, function (props) { 53 | this.props = props; 54 | // To access props later use this.props.someOption; 55 | 56 | done(); 57 | }.bind(this)); 58 | }, 59 | 60 | writing: function () { 61 | var done = this.async(); 62 | 63 | this.baseName = jhipsterVar.baseName; 64 | this.packageName = jhipsterVar.packageName; 65 | this.angularAppName = jhipsterVar.angularAppName; 66 | var webappDir = jhipsterVar.webappDir; 67 | 68 | this.modules = this.props.modules; 69 | 70 | if (this.modules.length === 0) { 71 | this.log(chalk.yellow('No module to install')); 72 | done(); 73 | return; 74 | } 75 | 76 | // Before install 77 | var installAll = (this.modules.indexOf('all') !== -1); 78 | var installFontAwesome = (this.modules.indexOf('awesomeBootstrapCheckbox') !== -1); 79 | 80 | // Install 81 | this.buildFontAwesomeSample = false; 82 | if (installAll || installFontAwesome || this.modules.indexOf('fontAwesome') !== -1) { 83 | jhipsterFunc.addBowerDependency('font-awesome', '4.5.0'); 84 | jhipsterFunc.addBowerOverride('font-awesome', ['css/font-awesome.css']); 85 | this.buildFontAwesomeSample = true; 86 | } 87 | 88 | this.buildAwesomeBootstrapCheckboxSample = false; 89 | if (installAll || this.modules.indexOf('awesomeBootstrapCheckbox') !== -1) { 90 | jhipsterFunc.addBowerDependency('awesome-bootstrap-checkbox', '0.3.5'); 91 | this.buildAwesomeBootstrapCheckboxSample = true; 92 | } 93 | 94 | this.buildSwitcherySample = false; 95 | if (installAll || this.modules.indexOf('switchery') !== -1) { 96 | jhipsterFunc.addBowerDependency('ng-switchery', '1.0.0-alpha7'); 97 | jhipsterFunc.addAngularJsModule('NgSwitchery'); 98 | this.buildSwitcherySample = true; 99 | } 100 | 101 | this.buildAngularBootstrapSliderSample = false; 102 | if (installAll || this.modules.indexOf('angularBootstrapSlider') !== -1) { 103 | jhipsterFunc.addBowerDependency('angular-bootstrap-slider', '0.1.21'); 104 | jhipsterFunc.addAngularJsModule('ui.bootstrap-slider'); 105 | this.buildAngularBootstrapSliderSample = true; 106 | } 107 | 108 | // Sample page 109 | this.template('src/main/webapp/app/angular-ui/_angular-ui.controller.js', webappDir + 'app/angular-ui/angular-ui.controller.js'); 110 | this.template('src/main/webapp/app/angular-ui/_angular-ui.html', webappDir + 'app/angular-ui/angular-ui.html'); 111 | this.template('src/main/webapp/app/angular-ui/_angular-ui.js', webappDir + 'app/angular-ui/angular-ui.js'); 112 | jhipsterFunc.addElementToMenu('angular-ui', 'tint', false); 113 | 114 | done(); 115 | }, 116 | 117 | install: function () { 118 | var injectDependenciesAndConstants = function () { 119 | if (this.options['skip-install']) { 120 | this.log('You need run: gulp install'); 121 | } else { 122 | this.spawnCommand('gulp', ['install']); 123 | } 124 | }; 125 | 126 | if (!this.options['skip-install']) { 127 | this.installDependencies({ 128 | bower: true, 129 | npm: false, 130 | callback: injectDependenciesAndConstants.bind(this) 131 | }); 132 | } else { 133 | injectDependenciesAndConstants.bind(this); 134 | } 135 | }, 136 | 137 | end: function () { 138 | this.log('\n' + chalk.bold.green('Angular UI page has been created')); 139 | } 140 | }); 141 | -------------------------------------------------------------------------------- /generators/app/templates/src/main/webapp/app/angular-ui/_angular-ui.controller.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('<%=angularAppName%>') 6 | .controller('AngularUIController', AngularUIController); 7 | 8 | AngularUIController.$inject = ['$scope']; 9 | 10 | function AngularUIController ($scope) { 11 | $scope.switcheryValue = true; 12 | 13 | $scope.slider = {}; 14 | $scope.slider.value = 10; 15 | $scope.slider.min = 1; 16 | $scope.slider.max = 100; 17 | $scope.slider.step = 1; 18 | 19 | } 20 | })(); 21 | -------------------------------------------------------------------------------- /generators/app/templates/src/main/webapp/app/angular-ui/_angular-ui.html: -------------------------------------------------------------------------------- 1 |
2 | <%_ if (buildFontAwesomeSample) { _%> 3 |

Font Awesome

4 |
5 |
6 |
7 |

Overview

8 |

Font Awesome gives you scalable vector icons that can instantly be customized — size, color, drop shadow, and anything that can be done with the power of CSS.

9 |

Use

10 |
<i class="fa fa-camera-retro"></i>
11 |

Sample

12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
Source
42 | 46 |
47 |
48 |
49 |
50 |
51 | <%_ } _%> 52 | 53 | 54 | 55 | <%_ if (buildAwesomeBootstrapCheckboxSample) { _%> 56 |

Awesome Bootstrap Checkbox

57 |
58 |
59 |
60 |

Overview

61 |

Font Awesome Bootstrap Checkboxes & Radios plugin. Pure CSS way to make inputs look prettier. No Javascript!

62 |

Use

63 |
64 |
<form role="form">
 65 |   ...
 66 |   <div class="checkbox">
 67 |     <input type="checkbox" id="checkbox1">
 68 |     <label for="checkbox1">
 69 |         Check me out
 70 |     </label>
 71 |   </div>
 72 |   ...
 73 | </form>
 74 |                 
75 |
76 |

Sample

77 |
78 |
79 |
80 |
81 | 82 | 85 |
86 |
87 | 88 | 91 |
92 |
93 | 94 | 97 |
98 |
99 | 100 | 103 |
104 |
105 | 106 | 109 |
110 |
111 | 112 | 115 |
116 |
117 |
118 |
119 |
120 |
121 | 122 | 125 |
126 |
127 | 128 | 131 |
132 |
133 |
134 |
135 |
136 |
137 | 138 | 141 |
142 |
143 | 144 | 147 |
148 |
149 | 150 | 153 |
154 |
155 |
156 |
157 |
158 | 167 |
168 |
169 |
170 | <%_ } _%> 171 | 172 | 173 | 174 | <%_ if (buildSwitcherySample) { _%> 175 |

NGSwitchery

176 |
177 |
178 |
179 |

Overview

180 |

Switchery is a simple component that helps you turn your default HTML checkbox inputs into beautiful iOS 7 style switches in just few simple steps. You can easily customize switches, so that they match your design perfectly.

181 |

Use

182 |
<input type="checkbox" class="js-switch" ui-switch checked />
183 |

Sample

184 |
185 | value: {{ switcheryValue }} 186 |
187 |
188 |
189 |
190 |
Source
191 | 195 |
196 |
197 |
198 |
199 |
200 | <%_ } _%> 201 | 202 | <%_ if (buildAngularBootstrapSliderSample) { _%> 203 |

Angular Bootstrap Slider

204 |
205 |
206 |
207 |

Overview

208 |

209 |

Use

210 |
<span slider ng-model="sliders.secondSliderValue" min="minTest"></span>
211 |

Sample

212 |
213 | Value: {{ slider.value }} 214 | 215 |
216 |
217 |
218 |
219 |
Source
220 | 224 |
225 |
226 |
227 |
228 |
229 | <%_ } _%> 230 |
231 | -------------------------------------------------------------------------------- /generators/app/templates/src/main/webapp/app/angular-ui/_angular-ui.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular 5 | .module('<%=angularAppName%>') 6 | .config(stateConfig); 7 | 8 | stateConfig.$inject = ['$stateProvider']; 9 | 10 | function stateConfig($stateProvider) { 11 | $stateProvider.state('angular-ui', { 12 | parent: 'app', 13 | url: '/angular-ui', 14 | data: { 15 | authorities: [], 16 | pageTitle: 'AngularUI' 17 | }, 18 | views: { 19 | 'content@': { 20 | templateUrl: 'app/angular-ui/angular-ui.html', 21 | controller: 'AngularUIController' 22 | } 23 | } 24 | }); 25 | } 26 | })(); 27 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | var path = require('path'); 4 | var gulp = require('gulp'); 5 | var eslint = require('gulp-eslint'); 6 | var excludeGitignore = require('gulp-exclude-gitignore'); 7 | var mocha = require('gulp-mocha'); 8 | var istanbul = require('gulp-istanbul'); 9 | var nsp = require('gulp-nsp'); 10 | var plumber = require('gulp-plumber'); 11 | 12 | gulp.task('static', function () { 13 | return gulp.src('**/*.js') 14 | .pipe(excludeGitignore()) 15 | .pipe(eslint()) 16 | .pipe(eslint.format()) 17 | .pipe(eslint.failAfterError()); 18 | }); 19 | 20 | gulp.task('nsp', function (cb) { 21 | nsp({package: path.resolve('package.json')}, cb); 22 | }); 23 | 24 | gulp.task('pre-test', function () { 25 | return gulp.src('generators/**/*.js') 26 | .pipe(istanbul({ 27 | includeUntested: true 28 | })) 29 | .pipe(istanbul.hookRequire()); 30 | }); 31 | 32 | gulp.task('test', ['pre-test'], function (cb) { 33 | var mochaErr; 34 | 35 | gulp.src('test/**/*.js') 36 | .pipe(plumber()) 37 | .pipe(mocha({reporter: 'spec'})) 38 | .on('end', function () { 39 | cb(mochaErr); 40 | }); 41 | .pipe(istanbul.writeReports()) 42 | .on('end', function () { 43 | cb(mochaErr); 44 | }); 45 | }); 46 | 47 | gulp.task('prepublish', ['nsp']); 48 | gulp.task('default', ['static', 'test']); 49 | 50 | })(); 51 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "generator-jhipster-angular-ui", 3 | "version": "0.0.2", 4 | "description": "Install AngularUI module on your JHipster app", 5 | "homepage": "https://github.com/moifort/generator-jhipster-angular-ui", 6 | "author": { 7 | "name": "Thibaut Mottet", 8 | "email": "thibaut.mottet@gmail.com", 9 | "url": "http://blog.mottet.me/" 10 | }, 11 | "files": [ 12 | "generators" 13 | ], 14 | "main": "generators/index.js", 15 | "keywords": [ 16 | "yeoman-generator", 17 | "jhipster-module" 18 | ], 19 | "dependencies": { 20 | "yeoman-generator": "0.21.1", 21 | "chalk": "1.0.0", 22 | "yosay": "1.0.2", 23 | "generator-jhipster": "3.4.2" 24 | }, 25 | "devDependencies": { 26 | "fs-extra": "0.26.4", 27 | "gulp": "3.9.0", 28 | "gulp-bump": "1.0.0", 29 | "gulp-eslint": "1.0.0", 30 | "gulp-exclude-gitignore": "1.0.0", 31 | "gulp-istanbul": "0.10.3", 32 | "gulp-mocha": "2.2.0", 33 | "gulp-plumber": "1.0.1", 34 | "gulp-nsp": "2.3.0", 35 | "gulp-plumber": "1.0.1", 36 | "gulp-rename": "^1.2.0", 37 | "gulp-sequence": "0.4.4", 38 | "gulp-shell": "^0.5.1", 39 | "mocha": "2.3.4", 40 | "yeoman-assert": "2.1.1", 41 | "yeoman-test": "1.0.0" 42 | }, 43 | "repository": "moifort/generator-jhipster-angular-ui", 44 | "scripts": { 45 | "test": "mocha test/*" 46 | }, 47 | "license": "Apache-2.0" 48 | } 49 | -------------------------------------------------------------------------------- /static/generator-jhipster-angular-ui.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moifort/generator-jhipster-angular-ui/b48b02f2efd4daaef9eef8b270d590b329a4e497/static/generator-jhipster-angular-ui.gif -------------------------------------------------------------------------------- /test/app.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var util = require('util'); 3 | var path = require('path'); 4 | var fse = require('fs-extra'); 5 | var assert = require('yeoman-assert'); 6 | var helpers = require('yeoman-test'); 7 | 8 | var deps = [ 9 | [helpers.createDummyGenerator(), 'jhipster:modules'] 10 | ]; 11 | 12 | describe('generator-jhipster-angular-ui:app', function () { 13 | before(function (done) { 14 | helpers 15 | .run(path.join(__dirname, '../generators/app')) 16 | .inTmpDir(function (dir) { 17 | fse.copySync(path.join(__dirname, '../test/templates'), dir) 18 | }) 19 | .withOptions({ 20 | skipInstall: true, 21 | testmode: true 22 | }) 23 | .withPrompts({ 24 | modules: 'all' 25 | }) 26 | .withGenerators(deps) 27 | .on('end', done); 28 | }); 29 | 30 | it('creates files', function () { 31 | assert.file([ 32 | 'src/main/webapp/app/angular-ui/angular-ui.js', 33 | 'src/main/webapp/app/angular-ui/angular-ui.html', 34 | 'src/main/webapp/app/angular-ui/angular-ui.controller.js' 35 | ]); 36 | }); 37 | }); 38 | -------------------------------------------------------------------------------- /test/templates/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "sampleMysql", 5 | "packageName": "com.mycompany.myapp", 6 | "packageFolder": "com/mycompany/myapp", 7 | "authenticationType": "session", 8 | "hibernateCache": "ehcache", 9 | "clusteredHttpSession": "no", 10 | "websocket": "no", 11 | "databaseType": "sql", 12 | "devDatabaseType": "h2Disk", 13 | "prodDatabaseType": "mysql", 14 | "searchEngine": "no", 15 | "useSass": false, 16 | "buildTool": "maven", 17 | "enableTranslation": true, 18 | "enableSocialSignIn": false, 19 | "rememberMeKey": "2bb60a80889aa6e6767e9ccd8714982681152aa5", 20 | "testFrameworks": [ 21 | "gatling" 22 | ] 23 | } 24 | } 25 | --------------------------------------------------------------------------------