├── web-client ├── assets │ ├── angular │ │ ├── version.txt │ │ ├── version.json │ │ ├── angular-csp.css │ │ ├── angular-cookies.min.js │ │ ├── angular-loader.min.js │ │ ├── angular-messages.min.js │ │ ├── angular-cookies.min.js.map │ │ └── i18n │ │ │ ├── angular-locale_ms.js │ │ │ ├── angular-locale_id.js │ │ │ ├── angular-locale_in.js │ │ │ ├── angular-locale_id-id.js │ │ │ └── angular-locale_ms-latn-my.js │ └── twitter-bootstrap │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ │ └── js │ │ └── npm.js ├── views │ ├── site │ │ ├── about.html │ │ ├── index.html │ │ └── contact.html │ └── book │ │ ├── index.html │ │ ├── create.html │ │ └── update.html ├── app.js ├── controllers │ ├── site.js │ └── book.js ├── models │ └── book.js └── index.html ├── web-client2 ├── assets │ ├── jquery │ │ ├── src │ │ │ ├── outro.js │ │ │ ├── selector.js │ │ │ ├── var │ │ │ │ ├── arr.js │ │ │ │ ├── rnotwhite.js │ │ │ │ ├── strundefined.js │ │ │ │ ├── push.js │ │ │ │ ├── class2type.js │ │ │ │ ├── concat.js │ │ │ │ ├── indexOf.js │ │ │ │ ├── slice.js │ │ │ │ ├── pnum.js │ │ │ │ ├── toString.js │ │ │ │ ├── hasOwn.js │ │ │ │ └── support.js │ │ │ ├── ajax │ │ │ │ ├── var │ │ │ │ │ ├── rquery.js │ │ │ │ │ └── nonce.js │ │ │ │ ├── parseJSON.js │ │ │ │ ├── parseXML.js │ │ │ │ ├── script.js │ │ │ │ └── load.js │ │ │ ├── css │ │ │ │ ├── var │ │ │ │ │ ├── rmargin.js │ │ │ │ │ ├── cssExpand.js │ │ │ │ │ ├── rnumnonpx.js │ │ │ │ │ ├── isHidden.js │ │ │ │ │ └── getStyles.js │ │ │ │ ├── hiddenVisibleSelectors.js │ │ │ │ ├── addGetHookIf.js │ │ │ │ ├── swap.js │ │ │ │ ├── curCSS.js │ │ │ │ └── defaultDisplay.js │ │ │ ├── data │ │ │ │ ├── var │ │ │ │ │ ├── data_priv.js │ │ │ │ │ └── data_user.js │ │ │ │ └── accepts.js │ │ │ ├── manipulation │ │ │ │ ├── var │ │ │ │ │ └── rcheckableType.js │ │ │ │ ├── _evalUrl.js │ │ │ │ └── support.js │ │ │ ├── core │ │ │ │ ├── var │ │ │ │ │ └── rsingleTag.js │ │ │ │ ├── parseHTML.js │ │ │ │ └── access.js │ │ │ ├── traversing │ │ │ │ └── var │ │ │ │ │ └── rneedsContext.js │ │ │ ├── event │ │ │ │ ├── support.js │ │ │ │ ├── ajax.js │ │ │ │ └── alias.js │ │ │ ├── attributes.js │ │ │ ├── deprecated.js │ │ │ ├── effects │ │ │ │ └── animatedSelector.js │ │ │ ├── selector-sizzle.js │ │ │ ├── queue │ │ │ │ └── delay.js │ │ │ ├── jquery.js │ │ │ ├── exports │ │ │ │ ├── global.js │ │ │ │ └── amd.js │ │ │ ├── attributes │ │ │ │ ├── support.js │ │ │ │ └── prop.js │ │ │ ├── intro.js │ │ │ ├── wrap.js │ │ │ └── dimensions.js │ │ ├── bower.json │ │ ├── .bower.json │ │ └── MIT-LICENSE.txt │ ├── bootstrap │ │ ├── test-infra │ │ │ ├── requirements.txt │ │ │ ├── uncached-npm-install.sh │ │ │ └── sauce_browsers.yml │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ └── glyphicons-halflings-regular.woff │ │ ├── dist │ │ │ └── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ ├── bower.json │ │ ├── less │ │ │ ├── component-animations.less │ │ │ ├── wells.less │ │ │ ├── breadcrumbs.less │ │ │ ├── close.less │ │ │ ├── thumbnails.less │ │ │ ├── utilities.less │ │ │ ├── jumbotron.less │ │ │ ├── media.less │ │ │ ├── pager.less │ │ │ ├── bootstrap.less │ │ │ ├── badges.less │ │ │ ├── labels.less │ │ │ ├── code.less │ │ │ ├── alerts.less │ │ │ ├── grid.less │ │ │ ├── progress-bars.less │ │ │ ├── print.less │ │ │ ├── pagination.less │ │ │ └── responsive-utilities.less │ │ ├── .bower.json │ │ ├── grunt │ │ │ ├── bs-raw-files-generator.js │ │ │ ├── shrinkwrap.js │ │ │ └── bs-glyphicons-data-generator.js │ │ ├── LICENSE │ │ ├── js │ │ │ ├── transition.js │ │ │ └── alert.js │ │ └── package.json │ ├── angular │ │ ├── index.js │ │ ├── angular.min.js.gzip │ │ ├── bower.json │ │ ├── angular-csp.css │ │ ├── .bower.json │ │ ├── package.json │ │ └── README.md │ ├── angular-route │ │ ├── index.js │ │ ├── bower.json │ │ ├── .bower.json │ │ ├── package.json │ │ └── README.md │ └── angular-animate │ │ ├── index.js │ │ ├── bower.json │ │ ├── .bower.json │ │ ├── package.json │ │ └── README.md ├── .bowerrc ├── views │ ├── site │ │ ├── about.html │ │ ├── index.html │ │ └── contact.html │ └── book │ │ ├── index.html │ │ ├── create.html │ │ └── update.html ├── bower.json ├── style.css ├── app.js ├── controllers │ ├── site.js │ └── book.js ├── models │ └── book.js └── index.html ├── web-service ├── runtime │ └── .gitignore ├── tests │ ├── codeception │ │ ├── unit │ │ │ ├── fixtures │ │ │ │ ├── .gitkeep │ │ │ │ └── data │ │ │ │ │ └── .gitkeep │ │ │ ├── templates │ │ │ │ └── fixtures │ │ │ │ │ └── .gitkeep │ │ │ ├── _bootstrap.php │ │ │ └── models │ │ │ │ ├── UserTest.php │ │ │ │ ├── ContactFormTest.php │ │ │ │ └── LoginFormTest.php │ │ ├── _output │ │ │ └── .gitignore │ │ ├── fixtures │ │ │ └── .gitignore │ │ ├── templates │ │ │ └── .gitignore │ │ ├── acceptance │ │ │ ├── _bootstrap.php │ │ │ ├── AboutCept.php │ │ │ ├── HomeCept.php │ │ │ ├── LoginCept.php │ │ │ └── ContactCept.php │ │ ├── functional │ │ │ ├── _bootstrap.php │ │ │ ├── AboutCept.php │ │ │ ├── HomeCept.php │ │ │ ├── LoginCept.php │ │ │ └── ContactCept.php │ │ ├── .gitignore │ │ ├── unit.suite.yml │ │ ├── config │ │ │ ├── unit.php │ │ │ ├── acceptance.php │ │ │ ├── config.php │ │ │ └── functional.php │ │ ├── _pages │ │ │ ├── AboutPage.php │ │ │ ├── LoginPage.php │ │ │ └── ContactPage.php │ │ ├── functional.suite.yml │ │ ├── bin │ │ │ ├── yii │ │ │ ├── yii.bat │ │ │ └── _bootstrap.php │ │ ├── _bootstrap.php │ │ └── acceptance.suite.yml │ └── codeception.yml ├── web │ ├── robots.txt │ ├── assets │ │ └── .gitignore │ ├── favicon.ico │ ├── .htaccess │ ├── index.php │ ├── index-test.php │ └── css │ │ └── site.css ├── .bowerrc ├── config │ ├── params.php │ ├── db.php │ ├── console.php │ └── web.php ├── views │ ├── site │ │ ├── about.php │ │ ├── error.php │ │ ├── login.php │ │ └── contact.php │ └── layouts │ │ └── main.php ├── .gitignore ├── controllers │ └── BookController.php ├── models │ ├── Book.php │ ├── ContactForm.php │ └── LoginForm.php ├── yii.bat ├── assets │ └── AppAsset.php ├── yii ├── mail │ └── layouts │ │ └── html.php ├── commands │ └── HelloController.php ├── LICENSE.md ├── composer.json └── angular_spa.sql ├── cover.jpg ├── documentation ├── images │ ├── yii.png │ ├── postman.png │ ├── angularjs.png │ ├── htmljscss.png │ ├── testing1.png │ ├── testing2.png │ ├── angularjsyii.png │ ├── dbstructure.png │ └── twitter_bootstrap.png ├── 06-conclusion.md ├── index.md └── 01-introduction.md ├── SUMMARY.md └── README.md /web-client/assets/angular/version.txt: -------------------------------------------------------------------------------- 1 | 1.3.15 -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/outro.js: -------------------------------------------------------------------------------- 1 | })); 2 | -------------------------------------------------------------------------------- /web-service/runtime/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /web-service/tests/codeception/unit/fixtures/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web-service/web/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: -------------------------------------------------------------------------------- /web-client2/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "assets" 3 | } -------------------------------------------------------------------------------- /web-service/tests/codeception/unit/fixtures/data/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web-service/web/assets/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /web-service/tests/codeception/unit/templates/fixtures/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web-service/tests/codeception/_output/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /web-service/tests/codeception/fixtures/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /web-service/tests/codeception/templates/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/test-infra/requirements.txt: -------------------------------------------------------------------------------- 1 | boto==2.20.0 2 | -------------------------------------------------------------------------------- /web-service/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory" : "vendor/bower" 3 | } 4 | -------------------------------------------------------------------------------- /cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/cover.jpg -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/selector.js: -------------------------------------------------------------------------------- 1 | define([ "./selector-sizzle" ]); 2 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/var/arr.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return []; 3 | }); 4 | -------------------------------------------------------------------------------- /web-client2/assets/angular/index.js: -------------------------------------------------------------------------------- 1 | require('./angular'); 2 | module.exports = angular; 3 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/ajax/var/rquery.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/\?/); 3 | }); 4 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/var/rnotwhite.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/\S+/g); 3 | }); 4 | -------------------------------------------------------------------------------- /web-client2/assets/angular-route/index.js: -------------------------------------------------------------------------------- 1 | require('./angular-route'); 2 | module.exports = 'ngRoute'; 3 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/css/var/rmargin.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/^margin/); 3 | }); 4 | -------------------------------------------------------------------------------- /web-client2/assets/angular-animate/index.js: -------------------------------------------------------------------------------- 1 | require('./angular-animate'); 2 | module.exports = 'ngAnimate'; 3 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/var/strundefined.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return typeof undefined; 3 | }); 4 | -------------------------------------------------------------------------------- /web-service/config/params.php: -------------------------------------------------------------------------------- 1 | 'admin@example.com', 5 | ]; 6 | -------------------------------------------------------------------------------- /web-service/web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/web-service/web/favicon.ico -------------------------------------------------------------------------------- /documentation/images/yii.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/documentation/images/yii.png -------------------------------------------------------------------------------- /web-service/tests/codeception/unit/_bootstrap.php: -------------------------------------------------------------------------------- 1 | type pairs 3 | return {}; 4 | }); 5 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/var/concat.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./arr" 3 | ], function( arr ) { 4 | return arr.concat; 5 | }); 6 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/var/indexOf.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./arr" 3 | ], function( arr ) { 4 | return arr.indexOf; 5 | }); 6 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/var/slice.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./arr" 3 | ], function( arr ) { 4 | return arr.slice; 5 | }); 6 | -------------------------------------------------------------------------------- /documentation/images/angularjsyii.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/documentation/images/angularjsyii.png -------------------------------------------------------------------------------- /documentation/images/dbstructure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/documentation/images/dbstructure.png -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/css/var/cssExpand.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return [ "Top", "Right", "Bottom", "Left" ]; 3 | }); 4 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/var/pnum.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; 3 | }); 4 | -------------------------------------------------------------------------------- /web-client/views/site/about.html: -------------------------------------------------------------------------------- 1 |
2 |

About Page

3 | 4 |

{{ message }}

5 |
-------------------------------------------------------------------------------- /web-client/views/site/index.html: -------------------------------------------------------------------------------- 1 |
2 |

Home Page

3 | 4 |

{{ message }}

5 |
-------------------------------------------------------------------------------- /web-client2/assets/jquery/src/data/var/data_priv.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../Data" 3 | ], function( Data ) { 4 | return new Data(); 5 | }); 6 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/data/var/data_user.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../Data" 3 | ], function( Data ) { 4 | return new Data(); 5 | }); 6 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/manipulation/var/rcheckableType.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/^(?:checkbox|radio)$/i); 3 | }); 4 | -------------------------------------------------------------------------------- /web-client2/views/site/about.html: -------------------------------------------------------------------------------- 1 |
2 |

About Page

3 | 4 |

{{ message }}

5 |
-------------------------------------------------------------------------------- /web-client2/views/site/index.html: -------------------------------------------------------------------------------- 1 |
2 |

Home Page

3 | 4 |

{{ message }}

5 |
-------------------------------------------------------------------------------- /documentation/images/twitter_bootstrap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/documentation/images/twitter_bootstrap.png -------------------------------------------------------------------------------- /web-client/views/site/contact.html: -------------------------------------------------------------------------------- 1 |
2 |

Contact Page

3 | 4 |

{{ message }}

5 |
-------------------------------------------------------------------------------- /web-client2/assets/jquery/src/ajax/var/nonce.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../../core" 3 | ], function( jQuery ) { 4 | return jQuery.now(); 5 | }); 6 | -------------------------------------------------------------------------------- /web-client2/views/site/contact.html: -------------------------------------------------------------------------------- 1 |
2 |

Contact Page

3 | 4 |

{{ message }}

5 |
-------------------------------------------------------------------------------- /web-service/tests/codeception/acceptance/_bootstrap.php: -------------------------------------------------------------------------------- 1 | (?:<\/\1>|)$/); 4 | }); 5 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/var/support.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | // All support tests are defined in their respective modules. 3 | return {}; 4 | }); 5 | -------------------------------------------------------------------------------- /web-service/web/.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine on 2 | 3 | RewriteCond %{REQUEST_FILENAME} !-f 4 | RewriteCond %{REQUEST_FILENAME} !-d 5 | RewriteRule (.*) index.php [L] -------------------------------------------------------------------------------- /web-client2/assets/angular/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.3.15", 4 | "main": "./angular.js", 5 | "ignore": [], 6 | "dependencies": { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/css/var/rnumnonpx.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../../var/pnum" 3 | ], function( pnum ) { 4 | return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 5 | }); 6 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/web-client2/assets/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/web-client2/assets/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/test-infra/uncached-npm-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cp test-infra/npm-shrinkwrap.canonical.json npm-shrinkwrap.json 3 | npm install 4 | rm npm-shrinkwrap.json 5 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/web-client2/assets/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/traversing/var/rneedsContext.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../../core", 3 | "../../selector" 4 | ], function( jQuery ) { 5 | return jQuery.expr.match.needsContext; 6 | }); 7 | -------------------------------------------------------------------------------- /web-service/tests/codeception/.gitignore: -------------------------------------------------------------------------------- 1 | # these files are auto generated by codeception build 2 | /unit/UnitTester.php 3 | /functional/FunctionalTester.php 4 | /acceptance/AcceptanceTester.php 5 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/web-client2/assets/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/web-client2/assets/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /web-client/assets/twitter-bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/web-client/assets/twitter-bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /web-client/assets/twitter-bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/web-client/assets/twitter-bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/web-client2/assets/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /web-client/assets/twitter-bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hscstudio/angular1-yii2/HEAD/web-client/assets/twitter-bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/event/support.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../var/support" 3 | ], function( support ) { 4 | 5 | support.focusinBubbles = "onfocusin" in window; 6 | 7 | return support; 8 | 9 | }); 10 | -------------------------------------------------------------------------------- /web-service/tests/codeception/unit.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | 3 | # suite for unit (internal) tests. 4 | # RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. 5 | 6 | class_name: UnitTester 7 | -------------------------------------------------------------------------------- /web-client2/assets/angular-route/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-route", 3 | "version": "1.3.15", 4 | "main": "./angular-route.js", 5 | "ignore": [], 6 | "dependencies": { 7 | "angular": "1.3.15" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /web-client2/assets/angular-animate/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-animate", 3 | "version": "1.3.15", 4 | "main": "./angular-animate.js", 5 | "ignore": [], 6 | "dependencies": { 7 | "angular": "1.3.15" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /web-service/config/db.php: -------------------------------------------------------------------------------- 1 | 'yii\db\Connection', 5 | 'dsn' => 'mysql:host=localhost;dbname=angular_spa', 6 | 'username' => 'root', 7 | 'password' => '', 8 | 'charset' => 'utf8', 9 | ]; 10 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/attributes.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./attributes/attr", 4 | "./attributes/prop", 5 | "./attributes/classes", 6 | "./attributes/val" 7 | ], function( jQuery ) { 8 | 9 | // Return jQuery for attributes-only inclusion 10 | return jQuery; 11 | }); 12 | -------------------------------------------------------------------------------- /web-service/tests/codeception/config/unit.php: -------------------------------------------------------------------------------- 1 | wantTo('ensure that about works'); 9 | AboutPage::openBy($I); 10 | $I->see('About', 'h1'); 11 | -------------------------------------------------------------------------------- /web-service/tests/codeception/functional/AboutCept.php: -------------------------------------------------------------------------------- 1 | wantTo('ensure that about works'); 9 | AboutPage::openBy($I); 10 | $I->see('About', 'h1'); 11 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/deprecated.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./traversing" 4 | ], function( jQuery ) { 5 | 6 | // The number of elements contained in the matched element set 7 | jQuery.fn.size = function() { 8 | return this.length; 9 | }; 10 | 11 | jQuery.fn.andSelf = jQuery.fn.addBack; 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/ajax/parseJSON.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // Support: Android 2.3 6 | // Workaround failure to string-cast null input 7 | jQuery.parseJSON = function( data ) { 8 | return JSON.parse( data + "" ); 9 | }; 10 | 11 | return jQuery.parseJSON; 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/effects/animatedSelector.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../selector", 4 | "../effects" 5 | ], function( jQuery ) { 6 | 7 | jQuery.expr.filters.animated = function( elem ) { 8 | return jQuery.grep(jQuery.timers, function( fn ) { 9 | return elem === fn.elem; 10 | }).length; 11 | }; 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /web-client/assets/angular/version.json: -------------------------------------------------------------------------------- 1 | {"raw":"v1.3.15","major":1,"minor":3,"patch":15,"prerelease":[],"build":[],"version":"1.3.15","codeName":"locality-filtration","full":"1.3.15","branch":"v1.3.x","cdn":{"raw":"v1.3.14","major":1,"minor":3,"patch":14,"prerelease":[],"build":[],"version":"1.3.14","docsUrl":"http://code.angularjs.org/1.3.14/docs"}} -------------------------------------------------------------------------------- /web-service/tests/codeception/_pages/AboutPage.php: -------------------------------------------------------------------------------- 1 | wantTo('ensure that home page works'); 7 | $I->amOnPage(Yii::$app->homeUrl); 8 | $I->see('My Company'); 9 | $I->seeLink('About'); 10 | $I->click('About'); 11 | $I->see('This is the About page.'); 12 | -------------------------------------------------------------------------------- /web-service/tests/codeception/functional/HomeCept.php: -------------------------------------------------------------------------------- 1 | wantTo('ensure that home page works'); 7 | $I->amOnPage(Yii::$app->homeUrl); 8 | $I->see('My Company'); 9 | $I->seeLink('About'); 10 | $I->click('About'); 11 | $I->see('This is the About page.'); 12 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/manipulation/_evalUrl.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../ajax" 3 | ], function( jQuery ) { 4 | 5 | jQuery._evalUrl = function( url ) { 6 | return jQuery.ajax({ 7 | url: url, 8 | type: "GET", 9 | dataType: "script", 10 | async: false, 11 | global: false, 12 | "throws": true 13 | }); 14 | }; 15 | 16 | return jQuery._evalUrl; 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /web-client2/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Angular1-Yii2", 3 | "version": "1.0.0", 4 | "homepage": "https://github.com/hscstudio/angular1-yii2", 5 | "description": "AngularJS 1.3 and Yii Framework 2.0", 6 | "dependencies": { 7 | "angular": "~1.3.0", 8 | "bootstrap": "~3.1.1", 9 | "angular-route": "~1.3.0", 10 | "angular-animate": "~1.3.0" 11 | } 12 | } -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/selector-sizzle.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "sizzle" 4 | ], function( jQuery, Sizzle ) { 5 | 6 | jQuery.find = Sizzle; 7 | jQuery.expr = Sizzle.selectors; 8 | jQuery.expr[":"] = jQuery.expr.pseudos; 9 | jQuery.unique = Sizzle.uniqueSort; 10 | jQuery.text = Sizzle.getText; 11 | jQuery.isXMLDoc = Sizzle.isXML; 12 | jQuery.contains = Sizzle.contains; 13 | 14 | }); 15 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/event/ajax.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../event" 4 | ], function( jQuery ) { 5 | 6 | // Attach a bunch of functions for handling common AJAX events 7 | jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { 8 | jQuery.fn[ type ] = function( fn ) { 9 | return this.on( type, fn ); 10 | }; 11 | }); 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /web-service/web/index.php: -------------------------------------------------------------------------------- 1 | run(); 13 | -------------------------------------------------------------------------------- /web-service/tests/codeception/unit/models/UserTest.php: -------------------------------------------------------------------------------- 1 | loadFixtures(['user']); 14 | } 15 | 16 | // TODO add test methods here 17 | } 18 | -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | * [Getting Started](README.md) 4 | * [Overview](documentation/index.md) 5 | * [Introduction](documentation/01-introduction.md) 6 | * [Preparation](documentation/02-preparation.md) 7 | * [Create Web Service](documentation/03-create-web-service.md) 8 | * [Create Web Client](documentation/04-create-web-client.md) 9 | * [Customization](documentation/05-customization.md) 10 | * [Conclusion](documentation/06-conclusion.md) 11 | 12 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/css/var/isHidden.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../../core", 3 | "../../selector" 4 | // css is assumed 5 | ], function( jQuery ) { 6 | 7 | return function( elem, el ) { 8 | // isHidden might be called from jQuery#filter function; 9 | // in that case, element will be second argument 10 | elem = el || elem; 11 | return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); 12 | }; 13 | }); 14 | -------------------------------------------------------------------------------- /web-service/views/site/about.php: -------------------------------------------------------------------------------- 1 | title = 'About'; 6 | $this->params['breadcrumbs'][] = $this->title; 7 | ?> 8 |
9 |

title) ?>

10 | 11 |

12 | This is the About page. You may modify the following file to customize its content: 13 |

14 | 15 | 16 |
17 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/css/hiddenVisibleSelectors.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../selector" 4 | ], function( jQuery ) { 5 | 6 | jQuery.expr.filters.hidden = function( elem ) { 7 | // Support: Opera <= 12.12 8 | // Opera reports offsetWidths and offsetHeights less than zero on some elements 9 | return elem.offsetWidth <= 0 && elem.offsetHeight <= 0; 10 | }; 11 | jQuery.expr.filters.visible = function( elem ) { 12 | return !jQuery.expr.filters.hidden( elem ); 13 | }; 14 | 15 | }); 16 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/css/var/getStyles.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return function( elem ) { 3 | // Support: IE<=11+, Firefox<=30+ (#15098, #14150) 4 | // IE throws on elements created in popups 5 | // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 6 | if ( elem.ownerDocument.defaultView.opener ) { 7 | return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); 8 | } 9 | 10 | return window.getComputedStyle( elem, null ); 11 | }; 12 | }); 13 | -------------------------------------------------------------------------------- /web-service/.gitignore: -------------------------------------------------------------------------------- 1 | # phpstorm project files 2 | .idea 3 | 4 | # netbeans project files 5 | nbproject 6 | 7 | # zend studio for eclipse project files 8 | .buildpath 9 | .project 10 | .settings 11 | 12 | # windows thumbnail cache 13 | Thumbs.db 14 | 15 | # composer vendor dir 16 | /vendor 17 | 18 | # composer itself is not needed 19 | composer.phar 20 | 21 | # Mac DS_Store Files 22 | .DS_Store 23 | 24 | # phpunit itself is not needed 25 | phpunit.phar 26 | # local phpunit config 27 | /phpunit.xml 28 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/data/accepts.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | /** 6 | * Determines whether an object can have data 7 | */ 8 | jQuery.acceptData = function( owner ) { 9 | // Accepts only: 10 | // - Node 11 | // - Node.ELEMENT_NODE 12 | // - Node.DOCUMENT_NODE 13 | // - Object 14 | // - Any 15 | /* jshint -W018 */ 16 | return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 17 | }; 18 | 19 | return jQuery.acceptData; 20 | }); 21 | -------------------------------------------------------------------------------- /web-service/controllers/BookController.php: -------------------------------------------------------------------------------- 1 | [ 15 | 'class' => \yii\filters\Cors::className(), 16 | ], 17 | ]); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /web-client2/assets/angular/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.3.15", 4 | "main": "./angular.js", 5 | "ignore": [], 6 | "dependencies": {}, 7 | "homepage": "https://github.com/angular/bower-angular", 8 | "_release": "1.3.15", 9 | "_resolution": { 10 | "type": "version", 11 | "tag": "v1.3.15", 12 | "commit": "ba7abcfa409ba852146e6ba206693cf7bac3e359" 13 | }, 14 | "_source": "git://github.com/angular/bower-angular.git", 15 | "_target": "~1.3.0", 16 | "_originalSource": "angular" 17 | } -------------------------------------------------------------------------------- /web-client/app.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var serviceBase = 'http://127.0.0.1/web-service/web/' 3 | // Declare app level module which depends on views, and components 4 | var spaApp = angular.module('spaApp', [ 5 | 'ngRoute', 6 | 'spaApp.site', 7 | 'spaApp.book', 8 | ]); 9 | var spaApp_site = angular.module('spaApp.site', ['ngRoute']) 10 | var spaApp_book = angular.module('spaApp.book', ['ngRoute']); 11 | 12 | spaApp.config(['$routeProvider', function($routeProvider) { 13 | $routeProvider.otherwise({redirectTo: '/site/index'}); 14 | }]); -------------------------------------------------------------------------------- /web-client2/style.css: -------------------------------------------------------------------------------- 1 | 2 | .animate.ng-leave { 3 | 4 | } 5 | .animate.ng-enter { 6 | -webkit-animation:scaleUp 0.5s both ease-in; 7 | -moz-animation:scaleUp 0.5s both ease-in; 8 | animation:scaleUp 0.5s both ease-in; 9 | } 10 | 11 | /* scale up */ 12 | @keyframes scaleUp { 13 | from { opacity: 0.3; transform: scale(0.8); } 14 | } 15 | @-moz-keyframes scaleUp { 16 | from { opacity: 0.3; -moz-transform: scale(0.8); } 17 | } 18 | @-webkit-keyframes scaleUp { 19 | from { opacity: 0.3; -webkit-transform: scale(0.8); } 20 | } -------------------------------------------------------------------------------- /web-service/tests/codeception/functional.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | 3 | # suite for functional (integration) tests. 4 | # emulate web requests and make application process them. 5 | # (tip: better to use with frameworks). 6 | 7 | # RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. 8 | #basic/web/index.php 9 | class_name: FunctionalTester 10 | modules: 11 | enabled: 12 | - Filesystem 13 | - Yii2 14 | config: 15 | Yii2: 16 | configFile: 'codeception/config/functional.php' 17 | -------------------------------------------------------------------------------- /web-client2/app.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var serviceBase = 'http://127.0.0.1/angular/app6/web-service/web/' 3 | // Declare app level module which depends on views, and components 4 | var spaApp = angular.module('spaApp', [ 5 | 'ngRoute', 6 | 'spaApp.site', 7 | 'spaApp.book', 8 | 'ngAnimate' 9 | ]); 10 | var spaApp_site = angular.module('spaApp.site', ['ngRoute']) 11 | var spaApp_book = angular.module('spaApp.book', ['ngRoute']); 12 | 13 | spaApp.config(['$routeProvider', function($routeProvider) { 14 | $routeProvider.otherwise({redirectTo: '/site/index'}); 15 | }]); -------------------------------------------------------------------------------- /web-client/assets/twitter-bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /web-client2/assets/angular-route/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-route", 3 | "version": "1.3.15", 4 | "main": "./angular-route.js", 5 | "ignore": [], 6 | "dependencies": { 7 | "angular": "1.3.15" 8 | }, 9 | "homepage": "https://github.com/angular/bower-angular-route", 10 | "_release": "1.3.15", 11 | "_resolution": { 12 | "type": "version", 13 | "tag": "v1.3.15", 14 | "commit": "1f6e6ac94e20b98bca10155363042411f7729ce2" 15 | }, 16 | "_source": "git://github.com/angular/bower-angular-route.git", 17 | "_target": "~1.3.0", 18 | "_originalSource": "angular-route" 19 | } -------------------------------------------------------------------------------- /web-client2/assets/jquery/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "version": "2.1.4", 4 | "main": "dist/jquery.js", 5 | "license": "MIT", 6 | "ignore": [ 7 | "**/.*", 8 | "build", 9 | "dist/cdn", 10 | "speed", 11 | "test", 12 | "*.md", 13 | "AUTHORS.txt", 14 | "Gruntfile.js", 15 | "package.json" 16 | ], 17 | "devDependencies": { 18 | "sizzle": "2.1.1-jquery.2.1.2", 19 | "requirejs": "2.1.10", 20 | "qunit": "1.14.0", 21 | "sinon": "1.8.1" 22 | }, 23 | "keywords": [ 24 | "jquery", 25 | "javascript", 26 | "library" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /web-client2/assets/angular-animate/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-animate", 3 | "version": "1.3.15", 4 | "main": "./angular-animate.js", 5 | "ignore": [], 6 | "dependencies": { 7 | "angular": "1.3.15" 8 | }, 9 | "homepage": "https://github.com/angular/bower-angular-animate", 10 | "_release": "1.3.15", 11 | "_resolution": { 12 | "type": "version", 13 | "tag": "v1.3.15", 14 | "commit": "30fb369974560dbeb8a5311861c124e094944dab" 15 | }, 16 | "_source": "git://github.com/angular/bower-angular-animate.git", 17 | "_target": "~1.3.0", 18 | "_originalSource": "angular-animate" 19 | } -------------------------------------------------------------------------------- /web-service/models/Book.php: -------------------------------------------------------------------------------- 1 | 255], 18 | [['description'], 'string'], 19 | [['author','publisher'], 'string', 'max' => 50] 20 | ]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /web-service/tests/codeception/bin/yii: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | run(); 20 | exit($exitCode); 21 | -------------------------------------------------------------------------------- /web-service/web/index-test.php: -------------------------------------------------------------------------------- 1 | run(); 17 | -------------------------------------------------------------------------------- /web-service/yii.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ------------------------------------------------------------- 4 | rem Yii command line bootstrap script for Windows. 5 | rem 6 | rem @author Qiang Xue 7 | rem @link http://www.yiiframework.com/ 8 | rem @copyright Copyright (c) 2008 Yii Software LLC 9 | rem @license http://www.yiiframework.com/license/ 10 | rem ------------------------------------------------------------- 11 | 12 | @setlocal 13 | 14 | set YII_PATH=%~dp0 15 | 16 | if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe 17 | 18 | "%PHP_COMMAND%" "%YII_PATH%yii" %* 19 | 20 | @endlocal 21 | -------------------------------------------------------------------------------- /web-service/tests/codeception/bin/yii.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ------------------------------------------------------------- 4 | rem Yii command line bootstrap script for Windows. 5 | rem 6 | rem @author Qiang Xue 7 | rem @link http://www.yiiframework.com/ 8 | rem @copyright Copyright (c) 2008 Yii Software LLC 9 | rem @license http://www.yiiframework.com/license/ 10 | rem ------------------------------------------------------------- 11 | 12 | @setlocal 13 | 14 | set YII_PATH=%~dp0 15 | 16 | if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe 17 | 18 | "%PHP_COMMAND%" "%YII_PATH%yii" %* 19 | 20 | @endlocal 21 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/ajax/parseXML.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // Cross-browser xml parsing 6 | jQuery.parseXML = function( data ) { 7 | var xml, tmp; 8 | if ( !data || typeof data !== "string" ) { 9 | return null; 10 | } 11 | 12 | // Support: IE9 13 | try { 14 | tmp = new DOMParser(); 15 | xml = tmp.parseFromString( data, "text/xml" ); 16 | } catch ( e ) { 17 | xml = undefined; 18 | } 19 | 20 | if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 21 | jQuery.error( "Invalid XML: " + data ); 22 | } 23 | return xml; 24 | }; 25 | 26 | return jQuery.parseXML; 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/css/addGetHookIf.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | 3 | function addGetHookIf( conditionFn, hookFn ) { 4 | // Define the hook, we'll check on the first run if it's really needed. 5 | return { 6 | get: function() { 7 | if ( conditionFn() ) { 8 | // Hook not needed (or it's not possible to use it due 9 | // to missing dependency), remove it. 10 | delete this.get; 11 | return; 12 | } 13 | 14 | // Hook needed; redefine it so that the support test is not executed again. 15 | return (this.get = hookFn).apply( this, arguments ); 16 | } 17 | }; 18 | } 19 | 20 | return addGetHookIf; 21 | 22 | }); 23 | -------------------------------------------------------------------------------- /web-service/tests/codeception/bin/_bootstrap.php: -------------------------------------------------------------------------------- 1 | = 1.9.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /web-service/views/site/error.php: -------------------------------------------------------------------------------- 1 | title = $name; 11 | ?> 12 |
13 | 14 |

title) ?>

15 | 16 |
17 | 18 |
19 | 20 |

21 | The above error occurred while the Web server was processing your request. 22 |

23 |

24 | Please contact us if you think this is a server error. Thank you. 25 |

26 | 27 |
28 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twitter/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | &.in { 21 | display: block; 22 | } 23 | } 24 | .collapsing { 25 | position: relative; 26 | height: 0; 27 | overflow: hidden; 28 | .transition(height .35s ease); 29 | } 30 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/queue/delay.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../queue", 4 | "../effects" // Delay is optional because of this dependency 5 | ], function( jQuery ) { 6 | 7 | // Based off of the plugin by Clint Helfers, with permission. 8 | // http://blindsignals.com/index.php/2009/07/jquery-delay/ 9 | jQuery.fn.delay = function( time, type ) { 10 | time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 11 | type = type || "fx"; 12 | 13 | return this.queue( type, function( next, hooks ) { 14 | var timeout = setTimeout( next, time ); 15 | hooks.stop = function() { 16 | clearTimeout( timeout ); 17 | }; 18 | }); 19 | }; 20 | 21 | return jQuery.fn.delay; 22 | }); 23 | -------------------------------------------------------------------------------- /web-service/assets/AppAsset.php: -------------------------------------------------------------------------------- 1 | 14 | * @since 2.0 15 | */ 16 | class AppAsset extends AssetBundle 17 | { 18 | public $basePath = '@webroot'; 19 | public $baseUrl = '@web'; 20 | public $css = [ 21 | 'css/site.css', 22 | ]; 23 | public $js = [ 24 | ]; 25 | public $depends = [ 26 | 'yii\web\YiiAsset', 27 | 'yii\bootstrap\BootstrapAsset', 28 | ]; 29 | } 30 | -------------------------------------------------------------------------------- /web-client2/assets/angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.3.15", 4 | "description": "HTML enhanced for web apps", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/angular/angular.js.git" 12 | }, 13 | "keywords": [ 14 | "angular", 15 | "framework", 16 | "browser", 17 | "client-side" 18 | ], 19 | "author": "Angular Core Team ", 20 | "license": "MIT", 21 | "bugs": { 22 | "url": "https://github.com/angular/angular.js/issues" 23 | }, 24 | "homepage": "http://angularjs.org" 25 | } 26 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/css/swap.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // A method for quickly swapping in/out CSS properties to get correct calculations. 6 | jQuery.swap = function( elem, options, callback, args ) { 7 | var ret, name, 8 | old = {}; 9 | 10 | // Remember the old values, and insert the new ones 11 | for ( name in options ) { 12 | old[ name ] = elem.style[ name ]; 13 | elem.style[ name ] = options[ name ]; 14 | } 15 | 16 | ret = callback.apply( elem, args || [] ); 17 | 18 | // Revert the old values 19 | for ( name in options ) { 20 | elem.style[ name ] = old[ name ]; 21 | } 22 | 23 | return ret; 24 | }; 25 | 26 | return jQuery.swap; 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /web-service/tests/codeception/_pages/LoginPage.php: -------------------------------------------------------------------------------- 1 | actor->fillField('input[name="LoginForm[username]"]', $username); 22 | $this->actor->fillField('input[name="LoginForm[password]"]', $password); 23 | $this->actor->click('login-button'); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /web-client2/assets/angular-route/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-route", 3 | "version": "1.3.15", 4 | "description": "AngularJS router module", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/angular/angular.js.git" 12 | }, 13 | "keywords": [ 14 | "angular", 15 | "framework", 16 | "browser", 17 | "router", 18 | "client-side" 19 | ], 20 | "author": "Angular Core Team ", 21 | "license": "MIT", 22 | "bugs": { 23 | "url": "https://github.com/angular/angular.js/issues" 24 | }, 25 | "homepage": "http://angularjs.org" 26 | } 27 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /web-client2/assets/angular-animate/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-animate", 3 | "version": "1.3.15", 4 | "description": "AngularJS module for animations", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/angular/angular.js.git" 12 | }, 13 | "keywords": [ 14 | "angular", 15 | "framework", 16 | "browser", 17 | "animation", 18 | "client-side" 19 | ], 20 | "author": "Angular Core Team ", 21 | "license": "MIT", 22 | "bugs": { 23 | "url": "https://github.com/angular/angular.js/issues" 24 | }, 25 | "homepage": "http://angularjs.org" 26 | } 27 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/jquery.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./selector", 4 | "./traversing", 5 | "./callbacks", 6 | "./deferred", 7 | "./core/ready", 8 | "./data", 9 | "./queue", 10 | "./queue/delay", 11 | "./attributes", 12 | "./event", 13 | "./event/alias", 14 | "./manipulation", 15 | "./manipulation/_evalUrl", 16 | "./wrap", 17 | "./css", 18 | "./css/hiddenVisibleSelectors", 19 | "./serialize", 20 | "./ajax", 21 | "./ajax/xhr", 22 | "./ajax/script", 23 | "./ajax/jsonp", 24 | "./ajax/load", 25 | "./event/ajax", 26 | "./effects", 27 | "./effects/animatedSelector", 28 | "./offset", 29 | "./dimensions", 30 | "./deprecated", 31 | "./exports/amd", 32 | "./exports/global" 33 | ], function( jQuery ) { 34 | 35 | return jQuery; 36 | 37 | }); 38 | -------------------------------------------------------------------------------- /web-service/tests/codeception/_pages/ContactPage.php: -------------------------------------------------------------------------------- 1 | $value) { 21 | $inputType = $field === 'body' ? 'textarea' : 'input'; 22 | $this->actor->fillField($inputType . '[name="ContactForm[' . $field . ']"]', $value); 23 | } 24 | $this->actor->click('contact-button'); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /documentation/06-conclusion.md: -------------------------------------------------------------------------------- 1 | ## Conclusion 2 | 3 | Yii 2.0 makes it much easier and faster to implement a web service as well as teaching us how to do it properly. 4 | The API created could be used easily from AngularJs or any other client. Overall, AngularJS and Yii 2.0 are a good match. 5 | 6 | Happy coding! 7 | 8 | Jakarta, Indonesia 9 | May, 12 2015 10 | 11 | Hafid Mukhlasin 12 | http://www.hafidmukhlasin.com 13 | --- 14 | 15 | > [Back To Index](index.md)
16 | > [01. Introduction](01-introduction.md)
17 | > [02. Preparation](02-preparation.md)
18 | > [03. Create Web Service](03-create-web-service.md)
19 | > [04. Create Web Client](04-create-web-client.md)
20 | > [05. Customization](05-customization.md)
21 | > [06. Conclusion](06-conclusion.md)
22 | -------------------------------------------------------------------------------- /web-service/tests/codeception/config/config.php: -------------------------------------------------------------------------------- 1 | [ 7 | 'fixture' => [ 8 | 'class' => 'yii\faker\FixtureController', 9 | 'fixtureDataPath' => '@tests/codeception/fixtures', 10 | 'templatePath' => '@tests/codeception/templates', 11 | 'namespace' => 'tests\codeception\fixtures', 12 | ], 13 | ], 14 | 'components' => [ 15 | 'db' => [ 16 | 'dsn' => 'mysql:host=localhost;dbname=yii2_basic_tests', 17 | ], 18 | 'mailer' => [ 19 | 'useFileTransport' => true, 20 | ], 21 | 'urlManager' => [ 22 | 'showScriptName' => true, 23 | ], 24 | ], 25 | ]; 26 | -------------------------------------------------------------------------------- /web-service/yii: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | run(); 24 | exit($exitCode); 25 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/exports/global.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../var/strundefined" 4 | ], function( jQuery, strundefined ) { 5 | 6 | var 7 | // Map over jQuery in case of overwrite 8 | _jQuery = window.jQuery, 9 | 10 | // Map over the $ in case of overwrite 11 | _$ = window.$; 12 | 13 | jQuery.noConflict = function( deep ) { 14 | if ( window.$ === jQuery ) { 15 | window.$ = _$; 16 | } 17 | 18 | if ( deep && window.jQuery === jQuery ) { 19 | window.jQuery = _jQuery; 20 | } 21 | 22 | return jQuery; 23 | }; 24 | 25 | // Expose jQuery and $ identifiers, even in AMD 26 | // (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 27 | // and CommonJS for browser emulators (#13566) 28 | if ( typeof noGlobal === strundefined ) { 29 | window.jQuery = window.$ = jQuery; 30 | } 31 | 32 | }); 33 | -------------------------------------------------------------------------------- /web-service/mail/layouts/html.php: -------------------------------------------------------------------------------- 1 | 8 | beginPage() ?> 9 | 10 | 11 | 12 | 13 | <?= Html::encode($this->title) ?> 14 | head() ?> 15 | 16 | 17 | beginBody() ?> 18 | 19 | endBody() ?> 20 | 21 | 22 | endPage() ?> 23 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | button& { 27 | padding: 0; 28 | cursor: pointer; 29 | background: transparent; 30 | border: 0; 31 | -webkit-appearance: none; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /web-client/assets/angular/angular-cookies.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.3.15 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(p,f,n){'use strict';f.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(e,b){var c={},g={},h,k=!1,l=f.copy,m=f.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,l(a,g),l(a,c),k&&e.$apply())})();k=!0;e.$watch(function(){var a,d,e;for(a in g)m(c[a])&&b.cookies(a,n);for(a in c)d=c[a],f.isString(d)||(d=""+d,c[a]=d),d!==g[a]&&(b.cookies(a,d),e=!0);if(e)for(a in d=b.cookies(),c)c[a]!==d[a]&&(m(d[a])?delete c[a]:c[a]=d[a])});return c}]).factory("$cookieStore", 7 | ["$cookies",function(e){return{get:function(b){return(b=e[b])?f.fromJson(b):b},put:function(b,c){e[b]=f.toJson(c)},remove:function(b){delete e[b]}}}])})(window,window.angular); 8 | //# sourceMappingURL=angular-cookies.min.js.map 9 | -------------------------------------------------------------------------------- /web-service/commands/HelloController.php: -------------------------------------------------------------------------------- 1 | 18 | * @since 2.0 19 | */ 20 | class HelloController extends Controller 21 | { 22 | /** 23 | * This command echoes what you have entered as the message. 24 | * @param string $message the message to be echoed. 25 | */ 26 | public function actionIndex($message = 'hello world') 27 | { 28 | echo $message . "\n"; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /web-service/config/console.php: -------------------------------------------------------------------------------- 1 | 'basic-console', 10 | 'basePath' => dirname(__DIR__), 11 | 'bootstrap' => ['log', 'gii'], 12 | 'controllerNamespace' => 'app\commands', 13 | 'modules' => [ 14 | 'gii' => 'yii\gii\Module', 15 | ], 16 | 'components' => [ 17 | 'cache' => [ 18 | 'class' => 'yii\caching\FileCache', 19 | ], 20 | 'log' => [ 21 | 'targets' => [ 22 | [ 23 | 'class' => 'yii\log\FileTarget', 24 | 'levels' => ['error', 'warning'], 25 | ], 26 | ], 27 | ], 28 | 'db' => $db, 29 | ], 30 | 'params' => $params, 31 | ]; 32 | -------------------------------------------------------------------------------- /web-service/tests/codeception/config/functional.php: -------------------------------------------------------------------------------- 1 | [ 13 | 'request' => [ 14 | // it's not recommended to run functional tests with CSRF validation enabled 15 | 'enableCsrfValidation' => false, 16 | // but if you absolutely need it set cookie domain to localhost 17 | /* 18 | 'csrfCookie' => [ 19 | 'domain' => 'localhost', 20 | ], 21 | */ 22 | ], 23 | ], 24 | ] 25 | ); 26 | -------------------------------------------------------------------------------- /web-service/tests/codeception/functional/LoginCept.php: -------------------------------------------------------------------------------- 1 | wantTo('ensure that login works'); 9 | 10 | $loginPage = LoginPage::openBy($I); 11 | 12 | $I->see('Login', 'h1'); 13 | 14 | $I->amGoingTo('try to login with empty credentials'); 15 | $loginPage->login('', ''); 16 | $I->expectTo('see validations errors'); 17 | $I->see('Username cannot be blank.'); 18 | $I->see('Password cannot be blank.'); 19 | 20 | $I->amGoingTo('try to login with wrong credentials'); 21 | $loginPage->login('admin', 'wrong'); 22 | $I->expectTo('see validations errors'); 23 | $I->see('Incorrect username or password.'); 24 | 25 | $I->amGoingTo('try to login with correct credentials'); 26 | $loginPage->login('admin', 'admin'); 27 | $I->expectTo('see user info'); 28 | $I->see('Logout (admin)'); 29 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "version": "2.1.4", 4 | "main": "dist/jquery.js", 5 | "license": "MIT", 6 | "ignore": [ 7 | "**/.*", 8 | "build", 9 | "dist/cdn", 10 | "speed", 11 | "test", 12 | "*.md", 13 | "AUTHORS.txt", 14 | "Gruntfile.js", 15 | "package.json" 16 | ], 17 | "devDependencies": { 18 | "sizzle": "2.1.1-jquery.2.1.2", 19 | "requirejs": "2.1.10", 20 | "qunit": "1.14.0", 21 | "sinon": "1.8.1" 22 | }, 23 | "keywords": [ 24 | "jquery", 25 | "javascript", 26 | "library" 27 | ], 28 | "homepage": "https://github.com/jquery/jquery", 29 | "_release": "2.1.4", 30 | "_resolution": { 31 | "type": "version", 32 | "tag": "2.1.4", 33 | "commit": "7751e69b615c6eca6f783a81e292a55725af6b85" 34 | }, 35 | "_source": "git://github.com/jquery/jquery.git", 36 | "_target": ">= 1.9.0", 37 | "_originalSource": "jquery" 38 | } -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(all .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /web-service/tests/codeception/_bootstrap.php: -------------------------------------------------------------------------------- 1 | = 1.9.0" 23 | }, 24 | "homepage": "https://github.com/twbs/bootstrap", 25 | "_release": "3.1.1", 26 | "_resolution": { 27 | "type": "version", 28 | "tag": "v3.1.1", 29 | "commit": "a365d8689c3f3cee7f1acf86b61270ecca8e106d" 30 | }, 31 | "_source": "git://github.com/twbs/bootstrap.git", 32 | "_target": "~3.1.1", 33 | "_originalSource": "bootstrap" 34 | } -------------------------------------------------------------------------------- /web-client/views/book/index.html: -------------------------------------------------------------------------------- 1 |
2 |

BOOK CRUD

3 |

{{ message }}

4 |
5 | 6 | Create 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 30 | 31 | 32 |
TitleAuthorPublisherYearAction 
{{data.title}}{{data.author}}{{data.publisher}}{{data.year}} 23 | 24 | 25 | 26 | 27 | 28 | 29 |
33 |
34 |
35 | Empty 36 |
37 |
-------------------------------------------------------------------------------- /web-client2/views/book/index.html: -------------------------------------------------------------------------------- 1 |
2 |

BOOK CRUD

3 |

{{ message }}

4 |
5 | 6 | Create 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 30 | 31 | 32 |
TitleAuthorPublisherYearAction 
{{data.title}}{{data.author}}{{data.publisher}}{{data.year}} 23 | 24 | 25 | 26 | 27 | 28 | 29 |
33 |
34 |
35 | Empty 36 |
37 |
-------------------------------------------------------------------------------- /web-client/controllers/site.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | spaApp_site.config(['$routeProvider', function($routeProvider) { 3 | $routeProvider 4 | .when('/site/index', { 5 | templateUrl: 'views/site/index.html', 6 | controller: 'index' 7 | }) 8 | .when('/site/about', { 9 | templateUrl: 'views/site/about.html', 10 | controller: 'about' 11 | }) 12 | .when('/site/contact', { 13 | templateUrl: 'views/site/contact.html', 14 | controller: 'contact' 15 | }) 16 | .otherwise({ 17 | redirectTo: '/site/index' 18 | }); 19 | }]) 20 | .controller('index', ['$scope', '$http', function($scope,$http) { 21 | // create a message to display in our view 22 | $scope.message = 'Everyone come and see how good I look!'; 23 | }]) 24 | .controller('about', ['$scope', '$http', function($scope,$http) { 25 | // create a message to display in our view 26 | $scope.message = 'Look! I am an about page.'; 27 | }]) 28 | .controller('contact', ['$scope', '$http', function($scope,$http) { 29 | // create a message to display in our view 30 | $scope.message = 'Contact us! JK. This is just a demo.'; 31 | }]); -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | visibility: hidden !important; 48 | } 49 | 50 | 51 | // For Affix plugin 52 | // ------------------------- 53 | 54 | .affix { 55 | position: fixed; 56 | } 57 | -------------------------------------------------------------------------------- /web-client2/controllers/site.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | spaApp_site.config(['$routeProvider', function($routeProvider) { 3 | $routeProvider 4 | .when('/site/index', { 5 | templateUrl: 'views/site/index.html', 6 | controller: 'index' 7 | }) 8 | .when('/site/about', { 9 | templateUrl: 'views/site/about.html', 10 | controller: 'about' 11 | }) 12 | .when('/site/contact', { 13 | templateUrl: 'views/site/contact.html', 14 | controller: 'contact' 15 | }) 16 | .otherwise({ 17 | redirectTo: '/site/index' 18 | }); 19 | }]) 20 | .controller('index', ['$scope', '$http', function($scope,$http) { 21 | // create a message to display in our view 22 | $scope.message = 'Everyone come and see how good I look!'; 23 | }]) 24 | .controller('about', ['$scope', '$http', function($scope,$http) { 25 | // create a message to display in our view 26 | $scope.message = 'Look! I am an about page.'; 27 | }]) 28 | .controller('contact', ['$scope', '$http', function($scope,$http) { 29 | // create a message to display in our view 30 | $scope.message = 'Contact us! JK. This is just a demo.'; 31 | }]); -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/attributes/support.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../var/support" 3 | ], function( support ) { 4 | 5 | (function() { 6 | var input = document.createElement( "input" ), 7 | select = document.createElement( "select" ), 8 | opt = select.appendChild( document.createElement( "option" ) ); 9 | 10 | input.type = "checkbox"; 11 | 12 | // Support: iOS<=5.1, Android<=4.2+ 13 | // Default value for a checkbox should be "on" 14 | support.checkOn = input.value !== ""; 15 | 16 | // Support: IE<=11+ 17 | // Must access selectedIndex to make default options select 18 | support.optSelected = opt.selected; 19 | 20 | // Support: Android<=2.3 21 | // Options inside disabled selects are incorrectly marked as disabled 22 | select.disabled = true; 23 | support.optDisabled = !opt.disabled; 24 | 25 | // Support: IE<=11+ 26 | // An input loses its value after becoming a radio 27 | input = document.createElement( "input" ); 28 | input.value = "t"; 29 | input.type = "radio"; 30 | support.radioValue = input.value === "t"; 31 | })(); 32 | 33 | return support; 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding; 8 | margin-bottom: @jumbotron-padding; 9 | color: @jumbotron-color; 10 | background-color: @jumbotron-bg; 11 | 12 | h1, 13 | .h1 { 14 | color: @jumbotron-heading-color; 15 | } 16 | p { 17 | margin-bottom: (@jumbotron-padding / 2); 18 | font-size: @jumbotron-font-size; 19 | font-weight: 200; 20 | } 21 | 22 | .container & { 23 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 24 | } 25 | 26 | .container { 27 | max-width: 100%; 28 | } 29 | 30 | @media screen and (min-width: @screen-sm-min) { 31 | padding-top: (@jumbotron-padding * 1.6); 32 | padding-bottom: (@jumbotron-padding * 1.6); 33 | 34 | .container & { 35 | padding-left: (@jumbotron-padding * 2); 36 | padding-right: (@jumbotron-padding * 2); 37 | } 38 | 39 | h1, 40 | .h1 { 41 | font-size: (@font-size-base * 4.5); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/media.less: -------------------------------------------------------------------------------- 1 | // Media objects 2 | // Source: http://stubbornella.org/content/?p=497 3 | // -------------------------------------------------- 4 | 5 | 6 | // Common styles 7 | // ------------------------- 8 | 9 | // Clear the floats 10 | .media, 11 | .media-body { 12 | overflow: hidden; 13 | zoom: 1; 14 | } 15 | 16 | // Proper spacing between instances of .media 17 | .media, 18 | .media .media { 19 | margin-top: 15px; 20 | } 21 | .media:first-child { 22 | margin-top: 0; 23 | } 24 | 25 | // For images and videos, set to block 26 | .media-object { 27 | display: block; 28 | } 29 | 30 | // Reset margins on headings for tighter default spacing 31 | .media-heading { 32 | margin: 0 0 5px; 33 | } 34 | 35 | 36 | // Media image alignment 37 | // ------------------------- 38 | 39 | .media { 40 | > .pull-left { 41 | margin-right: 10px; 42 | } 43 | > .pull-right { 44 | margin-left: 10px; 45 | } 46 | } 47 | 48 | 49 | // Media list variation 50 | // ------------------------- 51 | 52 | // Undo default ul/ol styles 53 | .media-list { 54 | padding-left: 0; 55 | list-style: none; 56 | } 57 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/exports/amd.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // Register as a named AMD module, since jQuery can be concatenated with other 6 | // files that may use define, but not via a proper concatenation script that 7 | // understands anonymous AMD modules. A named AMD is safest and most robust 8 | // way to register. Lowercase jquery is used because AMD module names are 9 | // derived from file names, and jQuery is normally delivered in a lowercase 10 | // file name. Do this after creating the global so that if an AMD module wants 11 | // to call noConflict to hide this version of jQuery, it will work. 12 | 13 | // Note that for maximum portability, libraries that are not jQuery should 14 | // declare themselves as anonymous modules, and avoid setting a global if an 15 | // AMD loader is present. jQuery is a special case. For more information, see 16 | // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 17 | 18 | if ( typeof define === "function" && define.amd ) { 19 | define( "jquery", [], function() { 20 | return jQuery; 21 | }); 22 | } 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: not-allowed; 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/core/parseHTML.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "./var/rsingleTag", 4 | "../manipulation" // buildFragment 5 | ], function( jQuery, rsingleTag ) { 6 | 7 | // data: string of html 8 | // context (optional): If specified, the fragment will be created in this context, defaults to document 9 | // keepScripts (optional): If true, will include scripts passed in the html string 10 | jQuery.parseHTML = function( data, context, keepScripts ) { 11 | if ( !data || typeof data !== "string" ) { 12 | return null; 13 | } 14 | if ( typeof context === "boolean" ) { 15 | keepScripts = context; 16 | context = false; 17 | } 18 | context = context || document; 19 | 20 | var parsed = rsingleTag.exec( data ), 21 | scripts = !keepScripts && []; 22 | 23 | // Single tag 24 | if ( parsed ) { 25 | return [ context.createElement( parsed[1] ) ]; 26 | } 27 | 28 | parsed = jQuery.buildFragment( [ data ], context, scripts ); 29 | 30 | if ( scripts && scripts.length ) { 31 | jQuery( scripts ).remove(); 32 | } 33 | 34 | return jQuery.merge( [], parsed.childNodes ); 35 | }; 36 | 37 | return jQuery.parseHTML; 38 | 39 | }); 40 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/manipulation/support.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../var/support" 3 | ], function( support ) { 4 | 5 | (function() { 6 | var fragment = document.createDocumentFragment(), 7 | div = fragment.appendChild( document.createElement( "div" ) ), 8 | input = document.createElement( "input" ); 9 | 10 | // Support: Safari<=5.1 11 | // Check state lost if the name is set (#11217) 12 | // Support: Windows Web Apps (WWA) 13 | // `name` and `type` must use .setAttribute for WWA (#14901) 14 | input.setAttribute( "type", "radio" ); 15 | input.setAttribute( "checked", "checked" ); 16 | input.setAttribute( "name", "t" ); 17 | 18 | div.appendChild( input ); 19 | 20 | // Support: Safari<=5.1, Android<4.2 21 | // Older WebKit doesn't clone checked state correctly in fragments 22 | support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 23 | 24 | // Support: IE<=11+ 25 | // Make sure textarea (and checkbox) defaultValue is properly cloned 26 | div.innerHTML = ""; 27 | support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 28 | })(); 29 | 30 | return support; 31 | 32 | }); 33 | -------------------------------------------------------------------------------- /web-service/tests/codeception.yml: -------------------------------------------------------------------------------- 1 | actor: Tester 2 | #coverage: 3 | # #c3_url: http://localhost:8080/index-test.php/ 4 | # enabled: true 5 | # #remote: true 6 | # #remote_config: '../tests/codeception.yml' 7 | # white_list: 8 | # include: 9 | # - ../models/* 10 | # - ../controllers/* 11 | # - ../commands/* 12 | # - ../mail/* 13 | # blacklist: 14 | # include: 15 | # - ../assets/* 16 | # - ../config/* 17 | # - ../runtime/* 18 | # - ../vendor/* 19 | # - ../views/* 20 | # - ../web/* 21 | # - ../tests/* 22 | paths: 23 | tests: codeception 24 | log: codeception/_output 25 | data: codeception/_data 26 | helpers: codeception/_support 27 | settings: 28 | bootstrap: _bootstrap.php 29 | suite_class: \PHPUnit_Framework_TestSuite 30 | memory_limit: 1024M 31 | log: true 32 | colors: true 33 | config: 34 | # the entry script URL (with host info) for functional and acceptance tests 35 | # PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL 36 | test_entry_url: http://localhost:8080/index-test.php -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/grunt/bs-raw-files-generator.js: -------------------------------------------------------------------------------- 1 | /* global btoa: true */ 2 | /*! 3 | * Bootstrap Grunt task for generating raw-files.min.js for the Customizer 4 | * http://getbootstrap.com 5 | * Copyright 2014 Twitter, Inc. 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 | */ 8 | 'use strict'; 9 | var btoa = require('btoa'); 10 | var fs = require('fs'); 11 | 12 | function getFiles(type) { 13 | var files = {}; 14 | fs.readdirSync(type) 15 | .filter(function (path) { 16 | return type === 'fonts' ? true : new RegExp('\\.' + type + '$').test(path); 17 | }) 18 | .forEach(function (path) { 19 | var fullPath = type + '/' + path; 20 | files[path] = (type === 'fonts' ? btoa(fs.readFileSync(fullPath)) : fs.readFileSync(fullPath, 'utf8')); 21 | }); 22 | return 'var __' + type + ' = ' + JSON.stringify(files) + '\n'; 23 | } 24 | 25 | module.exports = function generateRawFilesJs(banner) { 26 | if (!banner) { 27 | banner = ''; 28 | } 29 | var files = banner + getFiles('js') + getFiles('less') + getFiles('fonts'); 30 | fs.writeFileSync('docs/assets/js/raw-files.min.js', files); 31 | }; 32 | -------------------------------------------------------------------------------- /web-service/tests/codeception/acceptance.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | 3 | # suite for acceptance tests. 4 | # perform tests in browser using the Selenium-like tools. 5 | # powered by Mink (http://mink.behat.org). 6 | # (tip: that's what your customer will see). 7 | # (tip: test your ajax and javascript by one of Mink drivers). 8 | 9 | # RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. 10 | 11 | class_name: AcceptanceTester 12 | modules: 13 | enabled: 14 | - PhpBrowser 15 | # you can use WebDriver instead of PhpBrowser to test javascript and ajax. 16 | # This will require you to install selenium. See http://codeception.com/docs/04-AcceptanceTests#Selenium 17 | # "restart" option is used by the WebDriver to start each time per test-file new session and cookies, 18 | # it is useful if you want to login in your app in each test. 19 | # - WebDriver 20 | config: 21 | PhpBrowser: 22 | # PLEASE ADJUST IT TO THE ACTUAL ENTRY POINT WITHOUT PATH INFO 23 | url: http://localhost:8080 24 | # WebDriver: 25 | # url: http://localhost:8080 26 | # browser: firefox 27 | # restart: true 28 | -------------------------------------------------------------------------------- /web-service/tests/codeception/acceptance/LoginCept.php: -------------------------------------------------------------------------------- 1 | wantTo('ensure that login works'); 9 | 10 | $loginPage = LoginPage::openBy($I); 11 | 12 | $I->see('Login', 'h1'); 13 | 14 | $I->amGoingTo('try to login with empty credentials'); 15 | $loginPage->login('', ''); 16 | if (method_exists($I, 'wait')) { 17 | $I->wait(3); // only for selenium 18 | } 19 | $I->expectTo('see validations errors'); 20 | $I->see('Username cannot be blank.'); 21 | $I->see('Password cannot be blank.'); 22 | 23 | $I->amGoingTo('try to login with wrong credentials'); 24 | $loginPage->login('admin', 'wrong'); 25 | if (method_exists($I, 'wait')) { 26 | $I->wait(3); // only for selenium 27 | } 28 | $I->expectTo('see validations errors'); 29 | $I->see('Incorrect username or password.'); 30 | 31 | $I->amGoingTo('try to login with correct credentials'); 32 | $loginPage->login('admin', 'admin'); 33 | if (method_exists($I, 'wait')) { 34 | $I->wait(3); // only for selenium 35 | } 36 | $I->expectTo('see user info'); 37 | $I->see('Logout (admin)'); 38 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2014 Twitter, Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2014 jQuery Foundation and other contributors 2 | http://jquery.com/ 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/grunt/shrinkwrap.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Grunt task for generating npm-shrinkwrap.canonical.json 3 | * http://getbootstrap.com 4 | * Copyright 2014 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | */ 7 | /* 8 | This Grunt task updates the npm-shrinkwrap.canonical.json file that's used as the key for Bootstrap's npm packages cache. 9 | This task should be run and the updated file should be committed whenever Bootstrap's dependencies change. 10 | */ 11 | 'use strict'; 12 | var canonicallyJsonStringify = require('canonical-json'); 13 | var NON_CANONICAL_FILE = 'npm-shrinkwrap.json'; 14 | var DEST_FILE = 'test-infra/npm-shrinkwrap.canonical.json'; 15 | 16 | 17 | function updateShrinkwrap(grunt) { 18 | // Assumption: Non-canonical shrinkwrap already generated by prerequisite Grunt task 19 | var shrinkwrapData = grunt.file.readJSON(NON_CANONICAL_FILE); 20 | grunt.log.writeln('Deleting ' + NON_CANONICAL_FILE.cyan + '...'); 21 | grunt.file.delete(NON_CANONICAL_FILE); 22 | // Output as Canonical JSON in correct location 23 | grunt.file.write(DEST_FILE, canonicallyJsonStringify(shrinkwrapData)); 24 | grunt.log.writeln('File ' + DEST_FILE.cyan + ' updated.'); 25 | } 26 | 27 | 28 | module.exports = updateShrinkwrap; 29 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/event/alias.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../event" 4 | ], function( jQuery ) { 5 | 6 | jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + 7 | "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 8 | "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { 9 | 10 | // Handle event binding 11 | jQuery.fn[ name ] = function( data, fn ) { 12 | return arguments.length > 0 ? 13 | this.on( name, null, data, fn ) : 14 | this.trigger( name ); 15 | }; 16 | }); 17 | 18 | jQuery.fn.extend({ 19 | hover: function( fnOver, fnOut ) { 20 | return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 21 | }, 22 | 23 | bind: function( types, data, fn ) { 24 | return this.on( types, null, data, fn ); 25 | }, 26 | unbind: function( types, fn ) { 27 | return this.off( types, null, fn ); 28 | }, 29 | 30 | delegate: function( selector, types, data, fn ) { 31 | return this.on( types, selector, data, fn ); 32 | }, 33 | undelegate: function( selector, types, fn ) { 34 | // ( namespace ) or ( selector, types [, fn] ) 35 | return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); 36 | } 37 | }); 38 | 39 | }); 40 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables.less"; 3 | @import "mixins.less"; 4 | 5 | // Reset 6 | @import "normalize.less"; 7 | @import "print.less"; 8 | 9 | // Core CSS 10 | @import "scaffolding.less"; 11 | @import "type.less"; 12 | @import "code.less"; 13 | @import "grid.less"; 14 | @import "tables.less"; 15 | @import "forms.less"; 16 | @import "buttons.less"; 17 | 18 | // Components 19 | @import "component-animations.less"; 20 | @import "glyphicons.less"; 21 | @import "dropdowns.less"; 22 | @import "button-groups.less"; 23 | @import "input-groups.less"; 24 | @import "navs.less"; 25 | @import "navbar.less"; 26 | @import "breadcrumbs.less"; 27 | @import "pagination.less"; 28 | @import "pager.less"; 29 | @import "labels.less"; 30 | @import "badges.less"; 31 | @import "jumbotron.less"; 32 | @import "thumbnails.less"; 33 | @import "alerts.less"; 34 | @import "progress-bars.less"; 35 | @import "media.less"; 36 | @import "list-group.less"; 37 | @import "panels.less"; 38 | @import "wells.less"; 39 | @import "close.less"; 40 | 41 | // Components w/ JavaScript 42 | @import "modals.less"; 43 | @import "tooltip.less"; 44 | @import "popovers.less"; 45 | @import "carousel.less"; 46 | 47 | // Utility classes 48 | @import "utilities.less"; 49 | @import "responsive-utilities.less"; 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # How To Create Single Page Application in minutes!
with AngularJs 1.3 and Yii 2.0 2 | ![](documentation/images/angularjsyii.png) 3 | 4 | ## Introduction 5 | 6 | This is a demo and a tutorial showing how to develop an application using Yii 2.0 for creating REST API and then using it 7 | from UI built with AngularJS. 8 | 9 | Tutorial is [available here](documentation/index.md).
10 | Book is [available here](https://www.gitbook.com/book/hscstudio/angular1-yii2/details) 11 | 12 | ## Installing demo 13 | 14 | In order to install demo clone this repository: 15 | 16 | ``` 17 | git clone https://github.com/hscstudio/angular1-yii2 angular1-yii2 18 | cd angular1-yii2 19 | ``` 20 | 21 | Then import database [angular_spa.sql](web-service/angular_spa.sql). 22 | 23 | After it's done run the following: 24 | 25 | ``` 26 | cd web-service 27 | composer update --prefer-dist 28 | ``` 29 | 30 | Set database config in [web-service\config\db.php](web-service/config/db.php). 31 | 32 | Set up two hosts in your webserver. One should point to `web-client`, aother to `web-service/web`. Then set `serviceBase` 33 | variable in [web-client\app.js](web-client/app.js) to point to web-service URL. 34 | 35 | ## License 36 | 37 | Free open source 38 | 39 | ## Changelog 40 | 41 | - 0.1 (Alpha - 11/05/2015) 42 | - 0.2 (Beta - 12/05/2015) 43 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base classes 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | .btn-xs & { 32 | top: 0; 33 | padding: 1px 5px; 34 | } 35 | } 36 | 37 | // Hover state, but only for links 38 | a.badge { 39 | &:hover, 40 | &:focus { 41 | color: @badge-link-hover-color; 42 | text-decoration: none; 43 | cursor: pointer; 44 | } 45 | } 46 | 47 | // Account for counters in navs 48 | a.list-group-item.active > .badge, 49 | .nav-pills > .active > a > .badge { 50 | color: @badge-active-color; 51 | background-color: @badge-active-bg; 52 | } 53 | .nav-pills > li > a > .badge { 54 | margin-left: 3px; 55 | } 56 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | &[href] { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/grunt/bs-glyphicons-data-generator.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Grunt task for Glyphicons data generation 3 | * http://getbootstrap.com 4 | * Copyright 2014 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | */ 7 | 'use strict'; 8 | var fs = require('fs'); 9 | 10 | module.exports = function generateGlyphiconsData() { 11 | // Pass encoding, utf8, so `readFileSync` will return a string instead of a 12 | // buffer 13 | var glyphiconsFile = fs.readFileSync('less/glyphicons.less', 'utf8'); 14 | var glpyhiconsLines = glyphiconsFile.split('\n'); 15 | 16 | // Use any line that starts with ".glyphicon-" and capture the class name 17 | var iconClassName = /^\.(glyphicon-[^\s]+)/; 18 | var glyphiconsData = '# This file is generated via Grunt task. **Do not edit directly.**\n' + 19 | '# See the \'build-glyphicons-data\' task in Gruntfile.js.\n\n'; 20 | for (var i = 0, len = glpyhiconsLines.length; i < len; i++) { 21 | var match = glpyhiconsLines[i].match(iconClassName); 22 | 23 | if (match !== null) { 24 | glyphiconsData += '- ' + match[1] + '\n'; 25 | } 26 | } 27 | 28 | // Create the `_data` directory if it doesn't already exist 29 | if (!fs.existsSync('docs/_data')) { 30 | fs.mkdirSync('docs/_data'); 31 | } 32 | 33 | fs.writeFileSync('docs/_data/glyphicons.yml', glyphiconsData); 34 | }; 35 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/core/access.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // Multifunctional method to get and set values of a collection 6 | // The value/s can optionally be executed if it's a function 7 | var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 8 | var i = 0, 9 | len = elems.length, 10 | bulk = key == null; 11 | 12 | // Sets many values 13 | if ( jQuery.type( key ) === "object" ) { 14 | chainable = true; 15 | for ( i in key ) { 16 | jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); 17 | } 18 | 19 | // Sets one value 20 | } else if ( value !== undefined ) { 21 | chainable = true; 22 | 23 | if ( !jQuery.isFunction( value ) ) { 24 | raw = true; 25 | } 26 | 27 | if ( bulk ) { 28 | // Bulk operations run against the entire set 29 | if ( raw ) { 30 | fn.call( elems, value ); 31 | fn = null; 32 | 33 | // ...except when executing function values 34 | } else { 35 | bulk = fn; 36 | fn = function( elem, key, value ) { 37 | return bulk.call( jQuery( elem ), value ); 38 | }; 39 | } 40 | } 41 | 42 | if ( fn ) { 43 | for ( ; i < len; i++ ) { 44 | fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); 45 | } 46 | } 47 | } 48 | 49 | return chainable ? 50 | elems : 51 | 52 | // Gets 53 | bulk ? 54 | fn.call( elems ) : 55 | len ? fn( elems[0], key ) : emptyGet; 56 | }; 57 | 58 | return access; 59 | 60 | }); 61 | -------------------------------------------------------------------------------- /documentation/index.md: -------------------------------------------------------------------------------- 1 | # How To Create Single Page Application in minutes!
with AngularJs 1.3 and Yii 2.0 2 | 3 | ![](images/angularjsyii.png) 4 | 5 | ## Table Of Contents 6 | 7 | - [Introduction](01-introduction.md) 8 | - [Preparation](02-preparation.md) 9 | - [Creating Web Service](03-create-web-service.md) 10 | - [Creating Web Client](04-create-web-client.md) 11 | - [Customization](05-customization.md) 12 | - [Conclusion](06-conclusion.md) 13 | 14 | ## Development 15 | 16 | This guide is an OpenSource project so your contribution is very welcome. 17 | 18 | In order to get started: 19 | 20 | - Clone this repository. 21 | - Check [README.md](../README.md). 22 | - Read everything in `documentation`. 23 | - Send [pull requests](https://github.com/hscstudio/angular1-yii2/pulls). 24 | 25 | Aside from contributing via pull requests you may [submit issues](https://github.com/hscstudio/angular1-yii2/issues). 26 | 27 | ## Reference 28 | 29 | - [Official Yii 2.0 guide](http://www.yiiframework.com/doc-2.0). 30 | - [Yii 2.0 source code](https://github.com/yiisoft/yii2). 31 | - [Example of AngularJS + Yii 2.0 by githubjeka](https://github.com/githubjeka/angular-yii2). 32 | 33 | ## Our Team 34 | 35 | - [Hafid Mukhlasin](http://www.hafidmukhlasin.com) - Project Leader / Indonesian Yii developer. 36 | - [Alexander Makarov](http://rmcreative.ru/) - Editorial / Yii core team. 37 | 38 | We'd like to thank our [contributors](https://github.com/hscstudio/angular1-yii2/graphs/contributors) for improving 39 | the guide. Thank you! 40 | -------------------------------------------------------------------------------- /web-client/models/book.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | spaApp_book.factory("services", ['$http','$location','$route', 3 | function($http,$location,$route) { 4 | var obj = {}; 5 | obj.getBooks = function(){ 6 | return $http.get(serviceBase + 'books'); 7 | } 8 | obj.createBook = function (book) { 9 | return $http.post( serviceBase + 'books', book ) 10 | .then( successHandler ) 11 | .catch( errorHandler ); 12 | function successHandler( result ) { 13 | $location.path('/book/index'); 14 | } 15 | function errorHandler( result ){ 16 | alert("Error data") 17 | $location.path('/book/create') 18 | } 19 | }; 20 | obj.getBook = function(bookID){ 21 | return $http.get(serviceBase + 'books/' + bookID); 22 | } 23 | 24 | obj.updateBook = function (book) { 25 | return $http.put(serviceBase + 'books/' + book.id, book ) 26 | .then( successHandler ) 27 | .catch( errorHandler ); 28 | function successHandler( result ) { 29 | $location.path('/book/index'); 30 | } 31 | function errorHandler( result ){ 32 | alert("Error data") 33 | $location.path('/book/update/' + book.id) 34 | } 35 | }; 36 | obj.deleteBook = function (bookID) { 37 | return $http.delete(serviceBase + 'books/' + bookID) 38 | .then( successHandler ) 39 | .catch( errorHandler ); 40 | function successHandler( result ) { 41 | $route.reload(); 42 | } 43 | function errorHandler( result ){ 44 | alert("Error data") 45 | $route.reload(); 46 | } 47 | }; 48 | return obj; 49 | }]); -------------------------------------------------------------------------------- /web-client2/models/book.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | spaApp_book.factory("services", ['$http','$location','$route', 3 | function($http,$location,$route) { 4 | var obj = {}; 5 | obj.getBooks = function(){ 6 | return $http.get(serviceBase + 'books'); 7 | } 8 | obj.createBook = function (book) { 9 | return $http.post( serviceBase + 'books', book ) 10 | .then( successHandler ) 11 | .catch( errorHandler ); 12 | function successHandler( result ) { 13 | $location.path('/book/index'); 14 | } 15 | function errorHandler( result ){ 16 | alert("Error data") 17 | $location.path('/book/create') 18 | } 19 | }; 20 | obj.getBook = function(bookID){ 21 | return $http.get(serviceBase + 'books/' + bookID); 22 | } 23 | 24 | obj.updateBook = function (book) { 25 | return $http.put(serviceBase + 'books/' + book.id, book ) 26 | .then( successHandler ) 27 | .catch( errorHandler ); 28 | function successHandler( result ) { 29 | $location.path('/book/index'); 30 | } 31 | function errorHandler( result ){ 32 | alert("Error data") 33 | $location.path('/book/update/' + book.id) 34 | } 35 | }; 36 | obj.deleteBook = function (bookID) { 37 | return $http.delete(serviceBase + 'books/' + bookID) 38 | .then( successHandler ) 39 | .catch( errorHandler ); 40 | function successHandler( result ) { 41 | $route.reload(); 42 | } 43 | function errorHandler( result ){ 44 | alert("Error data") 45 | $route.reload(); 46 | } 47 | }; 48 | return obj; 49 | }]); -------------------------------------------------------------------------------- /web-client/assets/angular/angular-loader.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.3.15 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(){'use strict';function d(b){return function(){var c=arguments[0],e;e="["+(b?b+":":"")+c+"] http://errors.angularjs.org/1.3.15/"+(b?b+"/":"")+c;for(c=1;c").prop({ 40 | async: true, 41 | charset: s.scriptCharset, 42 | src: s.url 43 | }).on( 44 | "load error", 45 | callback = function( evt ) { 46 | script.remove(); 47 | callback = null; 48 | if ( evt ) { 49 | complete( evt.type === "error" ? 404 : 200, evt.type ); 50 | } 51 | } 52 | ); 53 | document.head.appendChild( script[ 0 ] ); 54 | }, 55 | abort: function() { 56 | if ( callback ) { 57 | callback(); 58 | } 59 | } 60 | }; 61 | } 62 | }); 63 | 64 | }); 65 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/intro.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery JavaScript Library v@VERSION 3 | * http://jquery.com/ 4 | * 5 | * Includes Sizzle.js 6 | * http://sizzlejs.com/ 7 | * 8 | * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors 9 | * Released under the MIT license 10 | * http://jquery.org/license 11 | * 12 | * Date: @DATE 13 | */ 14 | 15 | (function( global, factory ) { 16 | 17 | if ( typeof module === "object" && typeof module.exports === "object" ) { 18 | // For CommonJS and CommonJS-like environments where a proper `window` 19 | // is present, execute the factory and get jQuery. 20 | // For environments that do not have a `window` with a `document` 21 | // (such as Node.js), expose a factory as module.exports. 22 | // This accentuates the need for the creation of a real `window`. 23 | // e.g. var jQuery = require("jquery")(window); 24 | // See ticket #14549 for more info. 25 | module.exports = global.document ? 26 | factory( global, true ) : 27 | function( w ) { 28 | if ( !w.document ) { 29 | throw new Error( "jQuery requires a window with a document" ); 30 | } 31 | return factory( w ); 32 | }; 33 | } else { 34 | factory( global ); 35 | } 36 | 37 | // Pass this if window is not defined yet 38 | }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 39 | 40 | // Support: Firefox 18+ 41 | // Can't be in strict mode, several libs including ASP.NET trace 42 | // the stack via arguments.caller.callee and Firefox dies if 43 | // you try to trace through "use strict" call chains. (#13335) 44 | //"use strict"; 45 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | white-space: nowrap; 21 | border-radius: @border-radius-base; 22 | } 23 | 24 | // User input typically entered via keyboard 25 | kbd { 26 | padding: 2px 4px; 27 | font-size: 90%; 28 | color: @kbd-color; 29 | background-color: @kbd-bg; 30 | border-radius: @border-radius-small; 31 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 32 | } 33 | 34 | // Blocks of code 35 | pre { 36 | display: block; 37 | padding: ((@line-height-computed - 1) / 2); 38 | margin: 0 0 (@line-height-computed / 2); 39 | font-size: (@font-size-base - 1); // 14px to 13px 40 | line-height: @line-height-base; 41 | word-break: break-all; 42 | word-wrap: break-word; 43 | color: @pre-color; 44 | background-color: @pre-bg; 45 | border: 1px solid @pre-border-color; 46 | border-radius: @border-radius-base; 47 | 48 | // Account for some code outputs that place code tags in pre tags 49 | code { 50 | padding: 0; 51 | font-size: inherit; 52 | color: inherit; 53 | white-space: pre-wrap; 54 | background-color: transparent; 55 | border-radius: 0; 56 | } 57 | } 58 | 59 | // Enable scrollable blocks of code 60 | .pre-scrollable { 61 | max-height: @pre-scrollable-max-height; 62 | overflow-y: scroll; 63 | } 64 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/css/curCSS.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "./var/rnumnonpx", 4 | "./var/rmargin", 5 | "./var/getStyles", 6 | "../selector" // contains 7 | ], function( jQuery, rnumnonpx, rmargin, getStyles ) { 8 | 9 | function curCSS( elem, name, computed ) { 10 | var width, minWidth, maxWidth, ret, 11 | style = elem.style; 12 | 13 | computed = computed || getStyles( elem ); 14 | 15 | // Support: IE9 16 | // getPropertyValue is only needed for .css('filter') (#12537) 17 | if ( computed ) { 18 | ret = computed.getPropertyValue( name ) || computed[ name ]; 19 | } 20 | 21 | if ( computed ) { 22 | 23 | if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { 24 | ret = jQuery.style( elem, name ); 25 | } 26 | 27 | // Support: iOS < 6 28 | // A tribute to the "awesome hack by Dean Edwards" 29 | // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels 30 | // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values 31 | if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { 32 | 33 | // Remember the original values 34 | width = style.width; 35 | minWidth = style.minWidth; 36 | maxWidth = style.maxWidth; 37 | 38 | // Put in the new values to get a computed value out 39 | style.minWidth = style.maxWidth = style.width = ret; 40 | ret = computed.width; 41 | 42 | // Revert the changed values 43 | style.width = width; 44 | style.minWidth = minWidth; 45 | style.maxWidth = maxWidth; 46 | } 47 | } 48 | 49 | return ret !== undefined ? 50 | // Support: IE 51 | // IE returns zIndex value as an integer. 52 | ret + "" : 53 | ret; 54 | } 55 | 56 | return curCSS; 57 | }); 58 | -------------------------------------------------------------------------------- /web-service/views/site/login.php: -------------------------------------------------------------------------------- 1 | title = 'Login'; 10 | $this->params['breadcrumbs'][] = $this->title; 11 | ?> 12 | 47 | -------------------------------------------------------------------------------- /web-service/tests/codeception/functional/ContactCept.php: -------------------------------------------------------------------------------- 1 | wantTo('ensure that contact works'); 9 | 10 | $contactPage = ContactPage::openBy($I); 11 | 12 | $I->see('Contact', 'h1'); 13 | 14 | $I->amGoingTo('submit contact form with no data'); 15 | $contactPage->submit([]); 16 | $I->expectTo('see validations errors'); 17 | $I->see('Contact', 'h1'); 18 | $I->see('Name cannot be blank'); 19 | $I->see('Email cannot be blank'); 20 | $I->see('Subject cannot be blank'); 21 | $I->see('Body cannot be blank'); 22 | $I->see('The verification code is incorrect'); 23 | 24 | $I->amGoingTo('submit contact form with not correct email'); 25 | $contactPage->submit([ 26 | 'name' => 'tester', 27 | 'email' => 'tester.email', 28 | 'subject' => 'test subject', 29 | 'body' => 'test content', 30 | 'verifyCode' => 'testme', 31 | ]); 32 | $I->expectTo('see that email adress is wrong'); 33 | $I->dontSee('Name cannot be blank', '.help-inline'); 34 | $I->see('Email is not a valid email address.'); 35 | $I->dontSee('Subject cannot be blank', '.help-inline'); 36 | $I->dontSee('Body cannot be blank', '.help-inline'); 37 | $I->dontSee('The verification code is incorrect', '.help-inline'); 38 | 39 | $I->amGoingTo('submit contact form with correct data'); 40 | $contactPage->submit([ 41 | 'name' => 'tester', 42 | 'email' => 'tester@example.com', 43 | 'subject' => 'test subject', 44 | 'body' => 'test content', 45 | 'verifyCode' => 'testme', 46 | ]); 47 | $I->dontSeeElement('#contact-form'); 48 | $I->see('Thank you for contacting us. We will respond to you as soon as possible.'); 49 | -------------------------------------------------------------------------------- /web-service/LICENSE.md: -------------------------------------------------------------------------------- 1 | The Yii framework is free software. It is released under the terms of 2 | the following BSD License. 3 | 4 | Copyright © 2008 by Yii Software LLC (http://www.yiisoft.com) 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions 9 | are met: 10 | 11 | * Redistributions of source code must retain the above copyright 12 | notice, this list of conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in 15 | the documentation and/or other materials provided with the 16 | distribution. 17 | * Neither the name of Yii Software LLC nor the names of its 18 | contributors may be used to endorse or promote products derived 19 | from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | // Provide class for links that match alerts 22 | .alert-link { 23 | font-weight: @alert-link-font-weight; 24 | } 25 | 26 | // Improve alignment and spacing of inner content 27 | > p, 28 | > ul { 29 | margin-bottom: 0; 30 | } 31 | > p + p { 32 | margin-top: 5px; 33 | } 34 | } 35 | 36 | // Dismissable alerts 37 | // 38 | // Expand the right padding and account for the close button's positioning. 39 | 40 | .alert-dismissable { 41 | padding-right: (@alert-padding + 20); 42 | 43 | // Adjust close link position 44 | .close { 45 | position: relative; 46 | top: -2px; 47 | right: -21px; 48 | color: inherit; 49 | } 50 | } 51 | 52 | // Alternate styles 53 | // 54 | // Generate contextual modifier classes for colorizing the alert. 55 | 56 | .alert-success { 57 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 58 | } 59 | .alert-info { 60 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 61 | } 62 | .alert-warning { 63 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 64 | } 65 | .alert-danger { 66 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 67 | } 68 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/js/transition.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: transition.js v3.1.1 3 | * http://getbootstrap.com/javascript/#transitions 4 | * ======================================================================== 5 | * Copyright 2011-2014 Twitter, Inc. 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 | * ======================================================================== */ 8 | 9 | 10 | +function ($) { 11 | 'use strict'; 12 | 13 | // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) 14 | // ============================================================ 15 | 16 | function transitionEnd() { 17 | var el = document.createElement('bootstrap') 18 | 19 | var transEndEventNames = { 20 | 'WebkitTransition' : 'webkitTransitionEnd', 21 | 'MozTransition' : 'transitionend', 22 | 'OTransition' : 'oTransitionEnd otransitionend', 23 | 'transition' : 'transitionend' 24 | } 25 | 26 | for (var name in transEndEventNames) { 27 | if (el.style[name] !== undefined) { 28 | return { end: transEndEventNames[name] } 29 | } 30 | } 31 | 32 | return false // explicit for ie8 ( ._.) 33 | } 34 | 35 | // http://blog.alexmaccaw.com/css-transitions 36 | $.fn.emulateTransitionEnd = function (duration) { 37 | var called = false, $el = this 38 | $(this).one($.support.transition.end, function () { called = true }) 39 | var callback = function () { if (!called) $($el).trigger($.support.transition.end) } 40 | setTimeout(callback, duration) 41 | return this 42 | } 43 | 44 | $(function () { 45 | $.support.transition = transitionEnd() 46 | }) 47 | 48 | }(jQuery); 49 | -------------------------------------------------------------------------------- /web-client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 |
25 | 26 | 27 |
28 |
29 | 30 |
31 |

Yii 2.0.3 + AngularJs 1.3.15

32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /web-client/assets/angular/angular-messages.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.3.15 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(r,f,s){'use strict';f.module("ngMessages",[]).directive("ngMessages",["$compile","$animate","$templateRequest",function(q,k,l){return{restrict:"AE",controller:function(){this.$renderNgMessageClasses=f.noop;var b=[];this.registerMessage=function(d,a){for(var c=0;c").html(a);f.forEach(a.children(), 8 | function(a){a=f.element(a);h?h.after(a):d.prepend(a);h=a;q(a)(b)});c.renderMessages(e,g)})}}}]).directive("ngMessage",["$animate",function(f){return{require:"^ngMessages",transclude:"element",terminal:!0,restrict:"AE",link:function(k,l,b,d,a){for(var c,g,e=l[0],n=e.parentNode,h=0,p=0;h .container { 14 | padding: 70px 15px 20px; 15 | } 16 | 17 | .footer { 18 | height: 60px; 19 | background-color: #f5f5f5; 20 | border-top: 1px solid #ddd; 21 | padding-top: 20px; 22 | } 23 | 24 | .jumbotron { 25 | text-align: center; 26 | background-color: transparent; 27 | } 28 | 29 | .jumbotron .btn { 30 | font-size: 21px; 31 | padding: 14px 24px; 32 | } 33 | 34 | .not-set { 35 | color: #c55; 36 | font-style: italic; 37 | } 38 | 39 | /* add sorting icons to gridview sort links */ 40 | a.asc:after, a.desc:after { 41 | position: relative; 42 | top: 1px; 43 | display: inline-block; 44 | font-family: 'Glyphicons Halflings'; 45 | font-style: normal; 46 | font-weight: normal; 47 | line-height: 1; 48 | padding-left: 5px; 49 | } 50 | 51 | a.asc:after { 52 | content: /*"\e113"*/ "\e151"; 53 | } 54 | 55 | a.desc:after { 56 | content: /*"\e114"*/ "\e152"; 57 | } 58 | 59 | .sort-numerical a.asc:after { 60 | content: "\e153"; 61 | } 62 | 63 | .sort-numerical a.desc:after { 64 | content: "\e154"; 65 | } 66 | 67 | .sort-ordinal a.asc:after { 68 | content: "\e155"; 69 | } 70 | 71 | .sort-ordinal a.desc:after { 72 | content: "\e156"; 73 | } 74 | 75 | .grid-view th { 76 | white-space: nowrap; 77 | } 78 | 79 | .hint-block { 80 | display: block; 81 | margin-top: 5px; 82 | color: #999; 83 | } 84 | 85 | .error-summary { 86 | color: #a94442; 87 | background: #fdf7f7; 88 | border-left: 3px solid #eed3d7; 89 | padding: 10px 20px; 90 | margin: 0 0 15px 0; 91 | } 92 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /web-service/models/ContactForm.php: -------------------------------------------------------------------------------- 1 | 'Verification Code', 41 | ]; 42 | } 43 | 44 | /** 45 | * Sends an email to the specified email address using the information collected by this model. 46 | * @param string $email the target email address 47 | * @return boolean whether the model passes validation 48 | */ 49 | public function contact($email) 50 | { 51 | if ($this->validate()) { 52 | Yii::$app->mailer->compose() 53 | ->setTo($email) 54 | ->setFrom([$this->email => $this->name]) 55 | ->setSubject($this->subject) 56 | ->setTextBody($this->body) 57 | ->send(); 58 | 59 | return true; 60 | } else { 61 | return false; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /web-client2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 |
26 | 27 | 28 |
29 |
30 | 31 |
32 |

Yii 2.0.3 + AngularJs 1.3.15

33 |
34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/wrap.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./core/init", 4 | "./manipulation", // clone 5 | "./traversing" // parent, contents 6 | ], function( jQuery ) { 7 | 8 | jQuery.fn.extend({ 9 | wrapAll: function( html ) { 10 | var wrap; 11 | 12 | if ( jQuery.isFunction( html ) ) { 13 | return this.each(function( i ) { 14 | jQuery( this ).wrapAll( html.call(this, i) ); 15 | }); 16 | } 17 | 18 | if ( this[ 0 ] ) { 19 | 20 | // The elements to wrap the target around 21 | wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 22 | 23 | if ( this[ 0 ].parentNode ) { 24 | wrap.insertBefore( this[ 0 ] ); 25 | } 26 | 27 | wrap.map(function() { 28 | var elem = this; 29 | 30 | while ( elem.firstElementChild ) { 31 | elem = elem.firstElementChild; 32 | } 33 | 34 | return elem; 35 | }).append( this ); 36 | } 37 | 38 | return this; 39 | }, 40 | 41 | wrapInner: function( html ) { 42 | if ( jQuery.isFunction( html ) ) { 43 | return this.each(function( i ) { 44 | jQuery( this ).wrapInner( html.call(this, i) ); 45 | }); 46 | } 47 | 48 | return this.each(function() { 49 | var self = jQuery( this ), 50 | contents = self.contents(); 51 | 52 | if ( contents.length ) { 53 | contents.wrapAll( html ); 54 | 55 | } else { 56 | self.append( html ); 57 | } 58 | }); 59 | }, 60 | 61 | wrap: function( html ) { 62 | var isFunction = jQuery.isFunction( html ); 63 | 64 | return this.each(function( i ) { 65 | jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); 66 | }); 67 | }, 68 | 69 | unwrap: function() { 70 | return this.parent().each(function() { 71 | if ( !jQuery.nodeName( this, "body" ) ) { 72 | jQuery( this ).replaceWith( this.childNodes ); 73 | } 74 | }).end(); 75 | } 76 | }); 77 | 78 | return jQuery; 79 | }); 80 | -------------------------------------------------------------------------------- /web-service/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yiisoft/yii2-app-basic", 3 | "description": "Yii 2 Basic Application Template", 4 | "keywords": ["yii2", "framework", "basic", "application template"], 5 | "homepage": "http://www.yiiframework.com/", 6 | "type": "project", 7 | "license": "BSD-3-Clause", 8 | "support": { 9 | "issues": "https://github.com/yiisoft/yii2/issues?state=open", 10 | "forum": "http://www.yiiframework.com/forum/", 11 | "wiki": "http://www.yiiframework.com/wiki/", 12 | "irc": "irc://irc.freenode.net/yii", 13 | "source": "https://github.com/yiisoft/yii2" 14 | }, 15 | "minimum-stability": "stable", 16 | "require": { 17 | "php": ">=5.4.0", 18 | "yiisoft/yii2": "*", 19 | "yiisoft/yii2-bootstrap": "*", 20 | "yiisoft/yii2-swiftmailer": "*" 21 | }, 22 | "require-dev": { 23 | "yiisoft/yii2-codeception": "*", 24 | "yiisoft/yii2-debug": "*", 25 | "yiisoft/yii2-gii": "*", 26 | "yiisoft/yii2-faker": "*" 27 | }, 28 | "config": { 29 | "process-timeout": 1800 30 | }, 31 | "scripts": { 32 | "post-create-project-cmd": [ 33 | "yii\\composer\\Installer::postCreateProject" 34 | ] 35 | }, 36 | "extra": { 37 | "yii\\composer\\Installer::postCreateProject": { 38 | "setPermission": [ 39 | { 40 | "runtime": "0777", 41 | "web/assets": "0777", 42 | "yii": "0755" 43 | } 44 | ], 45 | "generateCookieValidationKey": [ 46 | "config/web.php" 47 | ] 48 | }, 49 | "asset-installer-paths": { 50 | "npm-asset-library": "vendor/npm", 51 | "bower-asset-library": "vendor/bower" 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/test-infra/sauce_browsers.yml: -------------------------------------------------------------------------------- 1 | [ 2 | # Docs: https://saucelabs.com/docs/platforms/webdriver 3 | 4 | { 5 | browserName: "safari", 6 | platform: "OS X 10.9" 7 | }, 8 | # { 9 | # browserName: "googlechrome", 10 | # platform: "OS X 10.9", 11 | # version: "31" 12 | # }, 13 | { 14 | browserName: "firefox", 15 | platform: "OS X 10.9" 16 | }, 17 | 18 | # Mac Opera not currently supported by Sauce Labs 19 | 20 | { 21 | browserName: "internet explorer", 22 | version: "11", 23 | platform: "Windows 8.1" 24 | }, 25 | { 26 | browserName: "internet explorer", 27 | version: "10", 28 | platform: "Windows 8" 29 | }, 30 | # { 31 | # browserName: "internet explorer", 32 | # version: "9", 33 | # platform: "Windows 7" 34 | # }, 35 | # { 36 | # browserName: "internet explorer", 37 | # version: "8", 38 | # platform: "Windows 7" 39 | # }, 40 | 41 | # { # Unofficial 42 | # browserName: "internet explorer", 43 | # version: "7", 44 | # platform: "Windows XP" 45 | # }, 46 | 47 | { 48 | browserName: "googlechrome", 49 | platform: "Windows 8.1" 50 | }, 51 | { 52 | browserName: "firefox", 53 | platform: "Windows 8.1" 54 | }, 55 | 56 | # Win Opera 15+ not currently supported by Sauce Labs 57 | 58 | { 59 | browserName: "iphone", 60 | platform: "OS X 10.9", 61 | version: "7" 62 | }, 63 | 64 | # iOS Chrome not currently supported by Sauce Labs 65 | 66 | # Linux (unofficial) 67 | { 68 | browserName: "googlechrome", 69 | platform: "Linux" 70 | }, 71 | { 72 | browserName: "firefox", 73 | platform: "Linux" 74 | } 75 | 76 | # Android Chrome not currently supported by Sauce Labs 77 | 78 | # { # Android Browser (super-unofficial) 79 | # browserName: "android", 80 | # version: "4.0", 81 | # platform: "Linux" 82 | # } 83 | ] 84 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/progress-bars.less: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | 23 | // Bar itself 24 | // ------------------------- 25 | 26 | // Outer container 27 | .progress { 28 | overflow: hidden; 29 | height: @line-height-computed; 30 | margin-bottom: @line-height-computed; 31 | background-color: @progress-bg; 32 | border-radius: @border-radius-base; 33 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 34 | } 35 | 36 | // Bar of progress 37 | .progress-bar { 38 | float: left; 39 | width: 0%; 40 | height: 100%; 41 | font-size: @font-size-small; 42 | line-height: @line-height-computed; 43 | color: @progress-bar-color; 44 | text-align: center; 45 | background-color: @progress-bar-bg; 46 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 47 | .transition(width .6s ease); 48 | } 49 | 50 | // Striped bars 51 | .progress-striped .progress-bar { 52 | #gradient > .striped(); 53 | background-size: 40px 40px; 54 | } 55 | 56 | // Call animation for the active one 57 | .progress.active .progress-bar { 58 | .animation(progress-bar-stripes 2s linear infinite); 59 | } 60 | 61 | 62 | 63 | // Variations 64 | // ------------------------- 65 | 66 | .progress-bar-success { 67 | .progress-bar-variant(@progress-bar-success-bg); 68 | } 69 | 70 | .progress-bar-info { 71 | .progress-bar-variant(@progress-bar-info-bg); 72 | } 73 | 74 | .progress-bar-warning { 75 | .progress-bar-variant(@progress-bar-warning-bg); 76 | } 77 | 78 | .progress-bar-danger { 79 | .progress-bar-variant(@progress-bar-danger-bg); 80 | } 81 | -------------------------------------------------------------------------------- /web-service/tests/codeception/acceptance/ContactCept.php: -------------------------------------------------------------------------------- 1 | wantTo('ensure that contact works'); 9 | 10 | $contactPage = ContactPage::openBy($I); 11 | 12 | $I->see('Contact', 'h1'); 13 | 14 | $I->amGoingTo('submit contact form with no data'); 15 | $contactPage->submit([]); 16 | if (method_exists($I, 'wait')) { 17 | $I->wait(3); // only for selenium 18 | } 19 | $I->expectTo('see validations errors'); 20 | $I->see('Contact', 'h1'); 21 | $I->see('Name cannot be blank'); 22 | $I->see('Email cannot be blank'); 23 | $I->see('Subject cannot be blank'); 24 | $I->see('Body cannot be blank'); 25 | $I->see('The verification code is incorrect'); 26 | 27 | $I->amGoingTo('submit contact form with not correct email'); 28 | $contactPage->submit([ 29 | 'name' => 'tester', 30 | 'email' => 'tester.email', 31 | 'subject' => 'test subject', 32 | 'body' => 'test content', 33 | 'verifyCode' => 'testme', 34 | ]); 35 | if (method_exists($I, 'wait')) { 36 | $I->wait(3); // only for selenium 37 | } 38 | $I->expectTo('see that email adress is wrong'); 39 | $I->dontSee('Name cannot be blank', '.help-inline'); 40 | $I->see('Email is not a valid email address.'); 41 | $I->dontSee('Subject cannot be blank', '.help-inline'); 42 | $I->dontSee('Body cannot be blank', '.help-inline'); 43 | $I->dontSee('The verification code is incorrect', '.help-inline'); 44 | 45 | $I->amGoingTo('submit contact form with correct data'); 46 | $contactPage->submit([ 47 | 'name' => 'tester', 48 | 'email' => 'tester@example.com', 49 | 'subject' => 'test subject', 50 | 'body' => 'test content', 51 | 'verifyCode' => 'testme', 52 | ]); 53 | if (method_exists($I, 'wait')) { 54 | $I->wait(3); // only for selenium 55 | } 56 | $I->dontSeeElement('#contact-form'); 57 | $I->see('Thank you for contacting us. We will respond to you as soon as possible.'); 58 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/dimensions.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./core/access", 4 | "./css" 5 | ], function( jQuery, access ) { 6 | 7 | // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 8 | jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 9 | jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { 10 | // Margin is only for outerHeight, outerWidth 11 | jQuery.fn[ funcName ] = function( margin, value ) { 12 | var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 13 | extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 14 | 15 | return access( this, function( elem, type, value ) { 16 | var doc; 17 | 18 | if ( jQuery.isWindow( elem ) ) { 19 | // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there 20 | // isn't a whole lot we can do. See pull request at this URL for discussion: 21 | // https://github.com/jquery/jquery/pull/764 22 | return elem.document.documentElement[ "client" + name ]; 23 | } 24 | 25 | // Get document width or height 26 | if ( elem.nodeType === 9 ) { 27 | doc = elem.documentElement; 28 | 29 | // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 30 | // whichever is greatest 31 | return Math.max( 32 | elem.body[ "scroll" + name ], doc[ "scroll" + name ], 33 | elem.body[ "offset" + name ], doc[ "offset" + name ], 34 | doc[ "client" + name ] 35 | ); 36 | } 37 | 38 | return value === undefined ? 39 | // Get width or height on the element, requesting but not forcing parseFloat 40 | jQuery.css( elem, type, extra ) : 41 | 42 | // Set width or height on the element 43 | jQuery.style( elem, type, value, extra ); 44 | }, type, chainable ? margin : undefined, chainable, null ); 45 | }; 46 | }); 47 | }); 48 | 49 | return jQuery; 50 | }); 51 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/ajax/load.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../core/parseHTML", 4 | "../ajax", 5 | "../traversing", 6 | "../manipulation", 7 | "../selector", 8 | // Optional event/alias dependency 9 | "../event/alias" 10 | ], function( jQuery ) { 11 | 12 | // Keep a copy of the old load method 13 | var _load = jQuery.fn.load; 14 | 15 | /** 16 | * Load a url into a page 17 | */ 18 | jQuery.fn.load = function( url, params, callback ) { 19 | if ( typeof url !== "string" && _load ) { 20 | return _load.apply( this, arguments ); 21 | } 22 | 23 | var selector, type, response, 24 | self = this, 25 | off = url.indexOf(" "); 26 | 27 | if ( off >= 0 ) { 28 | selector = jQuery.trim( url.slice( off ) ); 29 | url = url.slice( 0, off ); 30 | } 31 | 32 | // If it's a function 33 | if ( jQuery.isFunction( params ) ) { 34 | 35 | // We assume that it's the callback 36 | callback = params; 37 | params = undefined; 38 | 39 | // Otherwise, build a param string 40 | } else if ( params && typeof params === "object" ) { 41 | type = "POST"; 42 | } 43 | 44 | // If we have elements to modify, make the request 45 | if ( self.length > 0 ) { 46 | jQuery.ajax({ 47 | url: url, 48 | 49 | // if "type" variable is undefined, then "GET" method will be used 50 | type: type, 51 | dataType: "html", 52 | data: params 53 | }).done(function( responseText ) { 54 | 55 | // Save response for use in complete callback 56 | response = arguments; 57 | 58 | self.html( selector ? 59 | 60 | // If a selector was specified, locate the right elements in a dummy div 61 | // Exclude scripts to avoid IE 'Permission Denied' errors 62 | jQuery("
").append( jQuery.parseHTML( responseText ) ).find( selector ) : 63 | 64 | // Otherwise use the full result 65 | responseText ); 66 | 67 | }).complete( callback && function( jqXHR, status ) { 68 | self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); 69 | }); 70 | } 71 | 72 | return this; 73 | }; 74 | 75 | }); 76 | -------------------------------------------------------------------------------- /web-client/views/book/create.html: -------------------------------------------------------------------------------- 1 |
2 |

BOOK CRUD

3 | 4 |

{{ message }}

5 |
6 |
7 | 8 |
9 | 10 | Title Required 11 |
12 |
13 |
14 | 15 |
16 | 17 |
18 |
19 |
20 | 21 |
22 | 23 | Author Required 24 |
25 |
26 |
27 | 28 |
29 | 30 | Publisher Required 31 |
32 |
33 |
34 | 35 |
36 | 37 | Year Required 38 |
39 |
40 | 41 | Cancel 42 | 45 |
46 |
-------------------------------------------------------------------------------- /web-client2/views/book/create.html: -------------------------------------------------------------------------------- 1 |
2 |

BOOK CRUD

3 | 4 |

{{ message }}

5 |
6 |
7 | 8 |
9 | 10 | Title Required 11 |
12 |
13 |
14 | 15 |
16 | 17 |
18 |
19 |
20 | 21 |
22 | 23 | Author Required 24 |
25 |
26 |
27 | 28 |
29 | 30 | Publisher Required 31 |
32 |
33 |
34 | 35 |
36 | 37 | Year Required 38 |
39 |
40 | 41 | Cancel 42 | 45 |
46 |
-------------------------------------------------------------------------------- /web-client/views/book/update.html: -------------------------------------------------------------------------------- 1 |
2 |

BOOK CRUD

3 | 4 |

{{ message }}

5 |
6 |
7 | 8 |
9 | 10 | Title Required 11 |
12 |
13 |
14 | 15 |
16 | 17 |
18 |
19 |
20 | 21 |
22 | 23 | Author Required 24 |
25 |
26 |
27 | 28 |
29 | 30 | Publisher Required 31 |
32 |
33 |
34 | 35 |
36 | 37 | Year Required 38 |
39 |
40 | 41 | Cancel 42 | 45 |
46 |
-------------------------------------------------------------------------------- /web-client2/views/book/update.html: -------------------------------------------------------------------------------- 1 |
2 |

BOOK CRUD

3 | 4 |

{{ message }}

5 |
6 |
7 | 8 |
9 | 10 | Title Required 11 |
12 |
13 |
14 | 15 |
16 | 17 |
18 |
19 |
20 | 21 |
22 | 23 | Author Required 24 |
25 |
26 |
27 | 28 |
29 | 30 | Publisher Required 31 |
32 |
33 |
34 | 35 |
36 | 37 | Year Required 38 |
39 |
40 | 41 | Cancel 42 | 45 |
46 |
-------------------------------------------------------------------------------- /web-client2/assets/bootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "Sleek, intuitive, and powerful front-end framework for faster and easier web development.", 4 | "version": "3.1.1", 5 | "keywords": [ 6 | "bootstrap", 7 | "css" 8 | ], 9 | "homepage": "http://getbootstrap.com", 10 | "author": "Twitter, Inc.", 11 | "scripts": { 12 | "test": "grunt test" 13 | }, 14 | "style": "./dist/css/bootstrap.css", 15 | "less": "./less/bootstrap.less", 16 | "repository": { 17 | "type": "git", 18 | "url": "https://github.com/twbs/bootstrap.git" 19 | }, 20 | "bugs": { 21 | "url": "https://github.com/twbs/bootstrap/issues" 22 | }, 23 | "license": { 24 | "type": "MIT", 25 | "url": "https://github.com/twbs/bootstrap/blob/master/LICENSE" 26 | }, 27 | "devDependencies": { 28 | "btoa": "~1.1.1", 29 | "canonical-json": "~0.0.3", 30 | "grunt": "~0.4.2", 31 | "grunt-banner": "~0.2.0", 32 | "grunt-contrib-clean": "~0.5.0", 33 | "grunt-contrib-concat": "~0.3.0", 34 | "grunt-contrib-connect": "~0.6.0", 35 | "grunt-contrib-copy": "~0.5.0", 36 | "grunt-contrib-csslint": "~0.2.0", 37 | "grunt-contrib-cssmin": "~0.7.0", 38 | "grunt-contrib-jade": "~0.9.1", 39 | "grunt-contrib-jshint": "~0.8.0", 40 | "grunt-contrib-less": "~0.9.0", 41 | "grunt-contrib-qunit": "~0.4.0", 42 | "grunt-contrib-uglify": "~0.3.0", 43 | "grunt-contrib-watch": "~0.5.3", 44 | "grunt-csscomb": "~2.0.1", 45 | "grunt-exec": "0.4.3", 46 | "grunt-html-validation": "~0.1.13", 47 | "grunt-jekyll": "~0.4.1", 48 | "grunt-jscs-checker": "~0.3.0", 49 | "grunt-saucelabs": "~5.0.0", 50 | "grunt-sed": "~0.1.1", 51 | "load-grunt-tasks": "~0.3.0", 52 | "markdown": "~0.5.0" 53 | }, 54 | "jspm": { 55 | "main": "js/bootstrap", 56 | "directories": { 57 | "example": "examples", 58 | "lib": "dist" 59 | }, 60 | "shim": { 61 | "js/bootstrap": { 62 | "imports": "jquery", 63 | "exports": "$" 64 | } 65 | }, 66 | "buildConfig": { 67 | "uglify": true 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /web-service/tests/codeception/unit/models/ContactFormTest.php: -------------------------------------------------------------------------------- 1 | mailer->fileTransportCallback = function ($mailer, $message) { 17 | return 'testing_message.eml'; 18 | }; 19 | } 20 | 21 | protected function tearDown() 22 | { 23 | unlink($this->getMessageFile()); 24 | parent::tearDown(); 25 | } 26 | 27 | public function testContact() 28 | { 29 | $model = $this->getMock('app\models\ContactForm', ['validate']); 30 | $model->expects($this->once())->method('validate')->will($this->returnValue(true)); 31 | 32 | $model->attributes = [ 33 | 'name' => 'Tester', 34 | 'email' => 'tester@example.com', 35 | 'subject' => 'very important letter subject', 36 | 'body' => 'body of current message', 37 | ]; 38 | 39 | $model->contact('admin@example.com'); 40 | 41 | $this->specify('email should be send', function () { 42 | expect('email file should exist', file_exists($this->getMessageFile()))->true(); 43 | }); 44 | 45 | $this->specify('message should contain correct data', function () use ($model) { 46 | $emailMessage = file_get_contents($this->getMessageFile()); 47 | 48 | expect('email should contain user name', $emailMessage)->contains($model->name); 49 | expect('email should contain sender email', $emailMessage)->contains($model->email); 50 | expect('email should contain subject', $emailMessage)->contains($model->subject); 51 | expect('email should contain body', $emailMessage)->contains($model->body); 52 | }); 53 | } 54 | 55 | private function getMessageFile() 56 | { 57 | return Yii::getAlias(Yii::$app->mailer->fileTransportPath) . '/testing_message.eml'; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /web-client2/assets/angular/README.md: -------------------------------------------------------------------------------- 1 | # packaged angular 2 | 3 | This repo is for distribution on `npm` and `bower`. The source for this module is in the 4 | [main AngularJS repo](https://github.com/angular/angular.js). 5 | Please file issues and pull requests against that repo. 6 | 7 | ## Install 8 | 9 | You can install this package either with `npm` or with `bower`. 10 | 11 | ### npm 12 | 13 | ```shell 14 | npm install angular 15 | ``` 16 | 17 | Then add a ` 21 | ``` 22 | 23 | Or `require('angular')` from your code. 24 | 25 | ### bower 26 | 27 | ```shell 28 | bower install angular 29 | ``` 30 | 31 | Then add a ` 35 | ``` 36 | 37 | ## Documentation 38 | 39 | Documentation is available on the 40 | [AngularJS docs site](http://docs.angularjs.org/). 41 | 42 | ## License 43 | 44 | The MIT License 45 | 46 | Copyright (c) 2010-2015 Google, Inc. http://angularjs.org 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining a copy 49 | of this software and associated documentation files (the "Software"), to deal 50 | in the Software without restriction, including without limitation the rights 51 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 52 | copies of the Software, and to permit persons to whom the Software is 53 | furnished to do so, subject to the following conditions: 54 | 55 | The above copyright notice and this permission notice shall be included in 56 | all copies or substantial portions of the Software. 57 | 58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 59 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 60 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 61 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 62 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 63 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 64 | THE SOFTWARE. 65 | -------------------------------------------------------------------------------- /web-service/tests/codeception/unit/models/LoginFormTest.php: -------------------------------------------------------------------------------- 1 | user->logout(); 17 | parent::tearDown(); 18 | } 19 | 20 | public function testLoginNoUser() 21 | { 22 | $model = new LoginForm([ 23 | 'username' => 'not_existing_username', 24 | 'password' => 'not_existing_password', 25 | ]); 26 | 27 | $this->specify('user should not be able to login, when there is no identity', function () use ($model) { 28 | expect('model should not login user', $model->login())->false(); 29 | expect('user should not be logged in', Yii::$app->user->isGuest)->true(); 30 | }); 31 | } 32 | 33 | public function testLoginWrongPassword() 34 | { 35 | $model = new LoginForm([ 36 | 'username' => 'demo', 37 | 'password' => 'wrong_password', 38 | ]); 39 | 40 | $this->specify('user should not be able to login with wrong password', function () use ($model) { 41 | expect('model should not login user', $model->login())->false(); 42 | expect('error message should be set', $model->errors)->hasKey('password'); 43 | expect('user should not be logged in', Yii::$app->user->isGuest)->true(); 44 | }); 45 | } 46 | 47 | public function testLoginCorrect() 48 | { 49 | $model = new LoginForm([ 50 | 'username' => 'demo', 51 | 'password' => 'demo', 52 | ]); 53 | 54 | $this->specify('user should be able to login with correct credentials', function () use ($model) { 55 | expect('model should login user', $model->login())->true(); 56 | expect('error message should not be set', $model->errors)->hasntKey('password'); 57 | expect('user should be logged in', Yii::$app->user->isGuest)->false(); 58 | }); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /web-client2/assets/bootstrap/less/print.less: -------------------------------------------------------------------------------- 1 | // 2 | // Basic print styles 3 | // -------------------------------------------------- 4 | // Source: https://github.com/h5bp/html5-boilerplate/blob/master/css/main.css 5 | 6 | @media print { 7 | 8 | * { 9 | text-shadow: none !important; 10 | color: #000 !important; // Black prints faster: h5bp.com/s 11 | background: transparent !important; 12 | box-shadow: none !important; 13 | } 14 | 15 | a, 16 | a:visited { 17 | text-decoration: underline; 18 | } 19 | 20 | a[href]:after { 21 | content: " (" attr(href) ")"; 22 | } 23 | 24 | abbr[title]:after { 25 | content: " (" attr(title) ")"; 26 | } 27 | 28 | // Don't show links for images, or javascript/internal links 29 | a[href^="javascript:"]:after, 30 | a[href^="#"]:after { 31 | content: ""; 32 | } 33 | 34 | pre, 35 | blockquote { 36 | border: 1px solid #999; 37 | page-break-inside: avoid; 38 | } 39 | 40 | thead { 41 | display: table-header-group; // h5bp.com/t 42 | } 43 | 44 | tr, 45 | img { 46 | page-break-inside: avoid; 47 | } 48 | 49 | img { 50 | max-width: 100% !important; 51 | } 52 | 53 | p, 54 | h2, 55 | h3 { 56 | orphans: 3; 57 | widows: 3; 58 | } 59 | 60 | h2, 61 | h3 { 62 | page-break-after: avoid; 63 | } 64 | 65 | // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245 66 | // Once fixed, we can just straight up remove this. 67 | select { 68 | background: #fff !important; 69 | } 70 | 71 | // Bootstrap components 72 | .navbar { 73 | display: none; 74 | } 75 | .table { 76 | td, 77 | th { 78 | background-color: #fff !important; 79 | } 80 | } 81 | .btn, 82 | .dropup > .btn { 83 | > .caret { 84 | border-top-color: #000 !important; 85 | } 86 | } 87 | .label { 88 | border: 1px solid #000; 89 | } 90 | 91 | .table { 92 | border-collapse: collapse !important; 93 | } 94 | .table-bordered { 95 | th, 96 | td { 97 | border: 1px solid #ddd !important; 98 | } 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /web-client2/assets/jquery/src/css/defaultDisplay.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../manipulation" // appendTo 4 | ], function( jQuery ) { 5 | 6 | var iframe, 7 | elemdisplay = {}; 8 | 9 | /** 10 | * Retrieve the actual display of a element 11 | * @param {String} name nodeName of the element 12 | * @param {Object} doc Document object 13 | */ 14 | // Called only from within defaultDisplay 15 | function actualDisplay( name, doc ) { 16 | var style, 17 | elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), 18 | 19 | // getDefaultComputedStyle might be reliably used only on attached element 20 | display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? 21 | 22 | // Use of this method is a temporary fix (more like optimization) until something better comes along, 23 | // since it was removed from specification and supported only in FF 24 | style.display : jQuery.css( elem[ 0 ], "display" ); 25 | 26 | // We don't have any data stored on the element, 27 | // so use "detach" method as fast way to get rid of the element 28 | elem.detach(); 29 | 30 | return display; 31 | } 32 | 33 | /** 34 | * Try to determine the default display value of an element 35 | * @param {String} nodeName 36 | */ 37 | function defaultDisplay( nodeName ) { 38 | var doc = document, 39 | display = elemdisplay[ nodeName ]; 40 | 41 | if ( !display ) { 42 | display = actualDisplay( nodeName, doc ); 43 | 44 | // If the simple way fails, read from inside an iframe 45 | if ( display === "none" || !display ) { 46 | 47 | // Use the already-created iframe if possible 48 | iframe = (iframe || jQuery( "