diff --git a/public/app/bower_components/angular-loading-bar/.bower.json b/public/app/bower_components/angular-loading-bar/.bower.json index 3da3d192..431d9079 100644 --- a/public/app/bower_components/angular-loading-bar/.bower.json +++ b/public/app/bower_components/angular-loading-bar/.bower.json @@ -24,7 +24,6 @@ "commit": "4cc49a7df36e367457d0fdfbd44148848eeb8466" }, "_source": "git://github.com/chieffancypants/angular-loading-bar.git", - "_target": "~0.5.0", - "_originalSource": "angular-loading-bar", - "_direct": true + "_target": "*", + "_originalSource": "angular-loading-bar" } \ No newline at end of file diff --git a/public/app/bower_components/angular-moment/.bower.json b/public/app/bower_components/angular-moment/.bower.json index febe8150..d8e03f8c 100644 --- a/public/app/bower_components/angular-moment/.bower.json +++ b/public/app/bower_components/angular-moment/.bower.json @@ -26,7 +26,6 @@ "commit": "99475e0365ea0955071026b9b210f116fe15fdae" }, "_source": "git://github.com/urish/angular-moment.git", - "_target": "~0.8.0", - "_originalSource": "angular-moment", - "_direct": true + "_target": "*", + "_originalSource": "angular-moment" } \ No newline at end of file diff --git a/public/app/bower_components/bootstrap/.bower.json b/public/app/bower_components/bootstrap/.bower.json index 4325ed99..c47d4a44 100644 --- a/public/app/bower_components/bootstrap/.bower.json +++ b/public/app/bower_components/bootstrap/.bower.json @@ -42,7 +42,6 @@ "commit": "c068162161154a4b85110ea1e7dd3d7897ce2b72" }, "_source": "git://github.com/twbs/bootstrap.git", - "_target": "~3.2.0", - "_originalSource": "bootstrap", - "_direct": true + "_target": "*", + "_originalSource": "bootstrap" } \ No newline at end of file diff --git a/public/app/bower_components/ng-table/.bower.json b/public/app/bower_components/ng-table/.bower.json new file mode 100644 index 00000000..2a54301e --- /dev/null +++ b/public/app/bower_components/ng-table/.bower.json @@ -0,0 +1,29 @@ +{ + "name": "ng-table", + "version": "0.3.3", + "main": [ + "ng-table.js", + "ng-table.css" + ], + "ignore": [ + "examples", + "src" + ], + "dependencies": { + "angular": "~1" + }, + "devDependencies": { + "angular-mocks": "~1" + }, + "homepage": "https://github.com/esvit/ng-table", + "_release": "0.3.3", + "_resolution": { + "type": "version", + "tag": "v0.3.3", + "commit": "bd9ec42172389257fcd312330013302b2696ac2a" + }, + "_source": "git://github.com/esvit/ng-table.git", + "_target": "~0.3.3", + "_originalSource": "ng-table", + "_direct": true +} \ No newline at end of file diff --git a/public/app/bower_components/ng-table/.bowerrc b/public/app/bower_components/ng-table/.bowerrc new file mode 100644 index 00000000..dd7c6b18 --- /dev/null +++ b/public/app/bower_components/ng-table/.bowerrc @@ -0,0 +1,4 @@ +{ + "directory": "bower_components", + "json": "bower.json" +} diff --git a/public/app/bower_components/ng-table/.editorconfig b/public/app/bower_components/ng-table/.editorconfig new file mode 100644 index 00000000..c308ed0c --- /dev/null +++ b/public/app/bower_components/ng-table/.editorconfig @@ -0,0 +1,13 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/public/app/bower_components/ng-table/.gitignore b/public/app/bower_components/ng-table/.gitignore new file mode 100644 index 00000000..e2ca63bd --- /dev/null +++ b/public/app/bower_components/ng-table/.gitignore @@ -0,0 +1,5 @@ +.temp +.idea +node_modules +bower_components +out \ No newline at end of file diff --git a/public/app/bower_components/ng-table/.jshintrc b/public/app/bower_components/ng-table/.jshintrc new file mode 100644 index 00000000..53d4e869 --- /dev/null +++ b/public/app/bower_components/ng-table/.jshintrc @@ -0,0 +1,21 @@ +{ + "camelcase" : true, + "indent": 4, + "strict": true, + "undef": true, + "unused": true, + "quotmark": "single", + "maxlen": 120, + "trailing": true, + "curly": true, + + "devel": true, + + "browser":true, + "jquery":true, + "predef": [ + "angular", + "define", + "require" + ] +} \ No newline at end of file diff --git a/public/app/bower_components/ng-table/.travis.yml b/public/app/bower_components/ng-table/.travis.yml new file mode 100644 index 00000000..b08b929b --- /dev/null +++ b/public/app/bower_components/ng-table/.travis.yml @@ -0,0 +1,19 @@ +language: node_js +node_js: + - 0.10 + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + - npm install -g karma + - npm install -g grunt-cli + - npm install -g bower + - npm install + - bower install + - grunt + +script: + - karma start --no-auto-watch --single-run --browsers Firefox + +after_success: + cat out/coverage/*/lcov.info | ./node_modules/coveralls/bin/coveralls.js \ No newline at end of file diff --git a/public/app/bower_components/ng-table/CONTRIBUTING.md b/public/app/bower_components/ng-table/CONTRIBUTING.md new file mode 100644 index 00000000..04b907cd --- /dev/null +++ b/public/app/bower_components/ng-table/CONTRIBUTING.md @@ -0,0 +1,20 @@ +CONTRIBUTING +============ + +Here's a quick guide: + +1. Fork the repo. + +2. `npm install` + +3. `bower install` + +4. Run the tests: `karma start` + +5. Make changes in source folder `src`. + +6. Minify source files: `grunt` + +7. Make the test pass. + +8. Push to your fork and submit a pull request. \ No newline at end of file diff --git a/public/app/bower_components/ng-table/Gruntfile.js b/public/app/bower_components/ng-table/Gruntfile.js new file mode 100644 index 00000000..e88636ee --- /dev/null +++ b/public/app/bower_components/ng-table/Gruntfile.js @@ -0,0 +1,138 @@ +var mountFolder = function (connect, dir) { + return connect.static(require('path').resolve(dir)); +}; +module.exports = function (grunt) { + + require('load-grunt-tasks')(grunt); + + grunt.registerTask('serve', ['connect:serve', 'watch']); + + grunt.registerTask('dev', [ + 'clean', + 'ngTemplateCache', + 'concat', + 'less', + 'copy' + ]); + + grunt.registerTask('default', [ + 'dev', + 'uglify', + 'cssmin' + ]); + + grunt.initConfig({ + cmpnt: grunt.file.readJSON('bower.json'), + banner: '/*! ngTable v<%= cmpnt.version %> by Vitalii Savchuk(esvit666@gmail.com) - ' + + 'https://github.com/esvit/ng-table - New BSD License */\n', + clean: { + + working: { + src: ['ng-table.*', './.temp/views', './.temp/'] + } + }, + copy: { + styles: { + files: [ + { + src: './src/styles/ng-table.less', + dest: './ng-table.less' + } + ] + } + }, + uglify: { + js: { + src: ['ng-table.js'], + dest: 'ng-table.min.js', + options: { + banner: '<%= banner %>', + sourceMap: function (fileName) { + return fileName.replace(/\.min\.js$/, '.map'); + } + } + } + }, + concat: { + js: { + src: [ + 'src/scripts/01-*.js', + 'src/scripts/02-*.js', + 'src/scripts/03-*.js', + 'src/scripts/04-*.js', + 'src/scripts/05-*.js', + 'src/scripts/06-*.js', + './.temp/scripts/views.js', + 'src/scripts/07-*.js' + ], + dest: 'ng-table.js' + } + }, + less: { + css: { + files: { + 'ng-table.css': 'src/styles/ng-table.less' + } + } + }, + cssmin: { + css: { + files: { + 'ng-table.min.css': 'ng-table.css' + }, + options: { + banner: '<%= banner %>' + } + } + }, + watch: { + css: { + files: 'src/styles/*.less', + tasks: ['less'], + options: { + livereload: true + } + }, + js: { + files: 'src/scripts/*.js', + tasks: ['concat'], + options: { + livereload: true + } + }, + html: { + files: 'src/ng-table/*.html', + tasks: ['ngTemplateCache', 'concat'], + options: { + livereload: true + } + } + }, + connect: { + options: { + port: 8000, + hostname: 'localhost' + }, + serve: { + options: { + middleware: function (connect) { + return [ + mountFolder(connect, '.') + ]; + } + } + } + }, + ngTemplateCache: { + views: { + files: { + './.temp/scripts/views.js': 'src/ng-table/**/*.html' + }, + options: { + trim: 'src/', + module: 'ngTable' + } + } + } + }); +}; diff --git a/public/app/bower_components/ng-table/LICENSE b/public/app/bower_components/ng-table/LICENSE new file mode 100644 index 00000000..1885e866 --- /dev/null +++ b/public/app/bower_components/ng-table/LICENSE @@ -0,0 +1,9 @@ +Copyright (c) 2013, esvit. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +Neither the name of the esvit nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/public/app/bower_components/ng-table/README.md b/public/app/bower_components/ng-table/README.md new file mode 100644 index 00000000..616600ac --- /dev/null +++ b/public/app/bower_components/ng-table/README.md @@ -0,0 +1,101 @@ +Table + AngularJS +================= +[![Build Status](https://travis-ci.org/esvit/ng-table.png)](https://travis-ci.org/esvit/ng-table) [![Coverage Status](https://coveralls.io/repos/esvit/ng-table/badge.png)](https://coveralls.io/r/esvit/ng-table) + +Code licensed under New BSD License. + +This directive allow to liven your tables. It support sorting, filtering and pagination. +Header row with titles and filters automatic generated on compilation step. + +## Compatibility + +For work in IE < 9 need jQuery, just add: +```html + +``` + +## Plugins + +* [Export to CSV](https://github.com/esvit/ng-table-export) + +## Updates + +### v0.3.2 (master) +- add pagination directive ngTablePagination [(see usage)](https://github.com/esvit/ng-table/blob/master/examples/demo28.html) +- rename filter.name to filter.$$name according to issue #196 +- add debugMode setting +- add defaultSort setting +- add filterDelay setting +- add multisorting (click on header with Ctrl-key) +- add css classes (ng-table-pager, ng-table-pagination, ng-table-counts) + +### v0.3.1 +- add support of `header-class` attribute +- add fixes for compatibility with early versions of AngularJS +- add `data` field to ngTableParams +- Allow expressions in the sortable & filter attribute (Issue #93) + +### v0.3.0 +- I abandoned from CoffeeScript in favor of a javascript, fully agree with http://blog.ponyfoo.com/2013/09/28/we-dont-want-your-coffee & (rus) http://habrahabr.ru/post/195944/ +- added examples of table with grouping +- fully rewrited interface of ngTableParams + +### v0.2.2 +In functions that return data for the filters were removed `.promise` +```javascript +$scope.names = function(column) { + ... + def.resolve(names); + // return def.promise; - old code + return def; +}; +``` + + +## Installing via Bower +``` +bower install ng-table +``` + +## Development +We use Karma to ensure the quality of the code. The easiest way to run these checks is to use grunt: + +```sh +npm install -g grunt-cli +npm install && bower install +grunt +``` + +The karma task will try to open Firefox and Chrome as browser in which to run the tests. Make sure this is available or change the configuration in `karma.conf.js` + +## Examples (from simple to complex) + +* [Pagination](http://bazalt-cms.com/ng-table/example/1) +* [Sorting](http://bazalt-cms.com/ng-table/example/3) +* [Filtering](http://bazalt-cms.com/ng-table/example/4) +* [Cell template](http://bazalt-cms.com/ng-table/example/8) +* [Row template](http://bazalt-cms.com/ng-table/example/9) +* [Params in url](http://bazalt-cms.com/ng-table/example/5) +* [Ajax](http://bazalt-cms.com/ng-table/example/6) +* [Table with hidden pagination](http://bazalt-cms.com/ng-table/example/7) +* [Custom template(pagination)](http://bazalt-cms.com/ng-table/example/2) +* [Custom filters](http://bazalt-cms.com/ng-table/example/11) +* [Table with checkboxes](http://bazalt-cms.com/ng-table/example/10) +* [Table with grouping](http://bazalt-cms.com/ng-table/example/12) +* [Table with grouping with callback](http://bazalt-cms.com/ng-table/example/13) +* [Table with external control of data](http://bazalt-cms.com/ng-table/example/14) +* [Export to CSV](http://bazalt-cms.com/ng-table/example/15) + +## Configuring ng-table +For a list of configuration options available, see [Configuring your table with ngTableParams](https://github.com/esvit/ng-table/wiki/Configuring-your-table-with-ngTableParams) + +#### PS +Let me know if you are using **ng-table**. It will motivate me to work harder. +And if you like **ng-table**, just email me and add your website [here](http://bazalt-cms.com/ng-table/who-is-using) +Hope you like it, Thanks! :) + +--- + +This project is part of [Bazalt CMS](http://bazalt-cms.com/). diff --git a/public/app/bower_components/ng-table/bower.json b/public/app/bower_components/ng-table/bower.json new file mode 100644 index 00000000..b8e09240 --- /dev/null +++ b/public/app/bower_components/ng-table/bower.json @@ -0,0 +1,18 @@ +{ + "name": "ng-table", + "version": "0.3.2", + "main": [ + "ng-table.js", + "ng-table.css" + ], + "ignore": [ + "examples", + "src" + ], + "dependencies": { + "angular": "~1" + }, + "devDependencies": { + "angular-mocks": "~1" + } +} diff --git a/public/app/bower_components/ng-table/karma.conf.js b/public/app/bower_components/ng-table/karma.conf.js new file mode 100644 index 00000000..964565a0 --- /dev/null +++ b/public/app/bower_components/ng-table/karma.conf.js @@ -0,0 +1,38 @@ +// Karma configuration file +// See http://karma-runner.github.io/0.10/config/configuration-file.html +module.exports = function (config) { + config.set({ + basePath: '', + + frameworks: ['jasmine'], + + // list of files / patterns to load in the browser + files: [ + // libraries + 'bower_components/angular/angular.js', + 'bower_components/angular-mocks/angular-mocks.js', + + // directive + 'ng-table.js', + + // tests + 'test/*.js' + //'test/tableParamsSpec.js' + //'test/tableControllerSpec.js' + ], + + // generate js files from html templates + preprocessors: { + '*.js': 'coverage' + }, + + reporters: ['progress', 'coverage'], + + autoWatch: true, + browsers: ['Chrome'], + coverageReporter: { + type: 'lcov', + dir: 'out/coverage' + } + }); +}; diff --git a/public/app/bower_components/ng-table/ng-table.css b/public/app/bower_components/ng-table/ng-table.css new file mode 100644 index 00000000..2c0a4446 --- /dev/null +++ b/public/app/bower_components/ng-table/ng-table.css @@ -0,0 +1,136 @@ +.ng-table th { + text-align: center; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.ng-table th.sortable { + cursor: pointer; +} +.ng-table th.sortable div { + padding-right: 18px; + position: relative; +} +.ng-table th.sortable div:after, +.ng-table th.sortable div:before { + content: ""; + border-width: 0 4px 4px; + border-style: solid; + border-color: #000 transparent; + visibility: visible; + right: 8px; + top: 50%; + position: absolute; + opacity: .3; + margin-top: -4px; +} +.ng-table th.sortable div:before { + margin-top: 2px; + border-bottom: none; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid #000; +} +.ng-table th.sortable div:hover:after, +.ng-table th.sortable div:hover:before { + opacity: 1; + visibility: visible; +} +.ng-table th.sortable.sort-desc, +.ng-table th.sortable.sort-asc { + background-color: rgba(141, 192, 219, 0.25); + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); +} +.ng-table th.sortable.sort-desc div:after, +.ng-table th.sortable.sort-asc div:after { + margin-top: -2px; +} +.ng-table th.sortable.sort-desc div:before, +.ng-table th.sortable.sort-asc div:before { + visibility: hidden; +} +.ng-table th.sortable.sort-asc div:after, +.ng-table th.sortable.sort-asc div:hover:after { + visibility: visible; + filter: alpha(opacity=60); + -khtml-opacity: 0.6; + -moz-opacity: 0.6; + opacity: 0.6; +} +.ng-table th.sortable.sort-desc div:after { + border-bottom: none; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid #000; + visibility: visible; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + filter: alpha(opacity=60); + -khtml-opacity: 0.6; + -moz-opacity: 0.6; + opacity: 0.6; +} +.ng-table th.filter .input-filter { + margin: 0; + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.ng-table + .pagination { + margin-top: 0; +} +@media only screen and (max-width: 800px) { + .ng-table-responsive { + border-bottom: 1px solid #999999; + } + .ng-table-responsive tr { + border-top: 1px solid #999999; + border-left: 1px solid #999999; + border-right: 1px solid #999999; + } + .ng-table-responsive td:before { + position: absolute; + padding: 8px; + left: 0; + top: 0; + width: 50%; + white-space: nowrap; + text-align: left; + font-weight: bold; + } + .ng-table-responsive thead tr th { + text-align: left; + } + .ng-table-responsive thead tr.ng-table-filters th { + padding: 0; + } + .ng-table-responsive thead tr.ng-table-filters th form > div { + padding: 8px; + } + .ng-table-responsive td { + border: none; + border-bottom: 1px solid #eeeeee; + position: relative; + padding-left: 50%; + white-space: normal; + text-align: left; + } + .ng-table-responsive td:before { + content: attr(data-title-text); + } + .ng-table-responsive, + .ng-table-responsive thead, + .ng-table-responsive tbody, + .ng-table-responsive th, + .ng-table-responsive td, + .ng-table-responsive tr { + display: block; + } +} diff --git a/public/app/bower_components/ng-table/ng-table.js b/public/app/bower_components/ng-table/ng-table.js new file mode 100644 index 00000000..a949fe03 --- /dev/null +++ b/public/app/bower_components/ng-table/ng-table.js @@ -0,0 +1,718 @@ +(function(angular, factory) { + 'use strict'; + + if (typeof define === 'function' && define.amd) { + define(['angular'], function(angular) { + return factory(angular); + }); + } else { + return factory(angular); + } +}(angular || null, function(angular) { + 'use strict'; +/** + * ngTable: Table + Angular JS + * + * @author Vitalii Savchuk + * @url https://github.com/esvit/ng-table/ + * @license New BSD License + */ + +/** + * @ngdoc module + * @name ngTable + * @description ngTable: Table + Angular JS + * @example + + + + + + + + +
{{user.name}}{{user.age}}
+
+
+ */ +var app = angular.module('ngTable', []); +/** + * ngTable: Table + Angular JS + * + * @author Vitalii Savchuk + * @url https://github.com/esvit/ng-table/ + * @license New BSD License + */ + +/** + * @ngdoc service + * @name ngTable.factory:ngTableParams + * @description Parameters manager for ngTable + */ +app.factory('ngTableParams', ['$q', '$log', function ($q, $log) { + var isNumber = function (n) { + return !isNaN(parseFloat(n)) && isFinite(n); + }; + var ngTableParams = function (baseParameters, baseSettings) { + var self = this, + log = function () { + if (settings.debugMode && $log.debug) { + $log.debug.apply(this, arguments); + } + }; + + this.data = []; + + /** + * @ngdoc method + * @name ngTable.factory:ngTableParams#parameters + * @methodOf ngTable.factory:ngTableParams + * @description Set new parameters or get current parameters + * + * @param {string} newParameters New parameters + * @param {string} parseParamsFromUrl Flag if parse parameters like in url + * @returns {Object} Current parameters or `this` + */ + this.parameters = function (newParameters, parseParamsFromUrl) { + parseParamsFromUrl = parseParamsFromUrl || false; + if (angular.isDefined(newParameters)) { + for (var key in newParameters) { + var value = newParameters[key]; + if (parseParamsFromUrl && key.indexOf('[') >= 0) { + var keys = key.split(/\[(.*)\]/).reverse() + var lastKey = ''; + for (var i = 0, len = keys.length; i < len; i++) { + var name = keys[i]; + if (name !== '') { + var v = value; + value = {}; + value[lastKey = name] = (isNumber(v) ? parseFloat(v) : v); + } + } + if (lastKey === 'sorting') { + params[lastKey] = {}; + } + params[lastKey] = angular.extend(params[lastKey] || {}, value[lastKey]); + } else { + params[key] = (isNumber(newParameters[key]) ? parseFloat(newParameters[key]) : newParameters[key]); + } + } + log('ngTable: set parameters', params); + return this; + } + return params; + }; + + /** + * @ngdoc method + * @name ngTable.factory:ngTableParams#settings + * @methodOf ngTable.factory:ngTableParams + * @description Set new settings for table + * + * @param {string} newSettings New settings or undefined + * @returns {Object} Current settings or `this` + */ + this.settings = function (newSettings) { + if (angular.isDefined(newSettings)) { + if (angular.isArray(newSettings.data)) { + //auto-set the total from passed in data + newSettings.total = newSettings.data.length; + } + settings = angular.extend(settings, newSettings); + log('ngTable: set settings', settings); + return this; + } + return settings; + }; + + /** + * @ngdoc method + * @name ngTable.factory:ngTableParams#page + * @methodOf ngTable.factory:ngTableParams + * @description If parameter page not set return current page else set current page + * + * @param {string} page Page number + * @returns {Object|Number} Current page or `this` + */ + this.page = function (page) { + return angular.isDefined(page) ? this.parameters({'page': page}) : params.page; + }; + + /** + * @ngdoc method + * @name ngTable.factory:ngTableParams#total + * @methodOf ngTable.factory:ngTableParams + * @description If parameter total not set return current quantity else set quantity + * + * @param {string} total Total quantity of items + * @returns {Object|Number} Current page or `this` + */ + this.total = function (total) { + return angular.isDefined(total) ? this.settings({'total': total}) : settings.total; + }; + + /** + * @ngdoc method + * @name ngTable.factory:ngTableParams#count + * @methodOf ngTable.factory:ngTableParams + * @description If parameter count not set return current count per page else set count per page + * + * @param {string} count Count per number + * @returns {Object|Number} Count per page or `this` + */ + this.count = function (count) { + // reset to first page because can be blank page + return angular.isDefined(count) ? this.parameters({'count': count, 'page': 1}) : params.count; + }; + + /** + * @ngdoc method + * @name ngTable.factory:ngTableParams#filter + * @methodOf ngTable.factory:ngTableParams + * @description If parameter page not set return current filter else set current filter + * + * @param {string} filter New filter + * @returns {Object} Current filter or `this` + */ + this.filter = function (filter) { + return angular.isDefined(filter) ? this.parameters({'filter': filter}) : params.filter; + }; + + /** + * @ngdoc method + * @name ngTable.factory:ngTableParams#sorting + * @methodOf ngTable.factory:ngTableParams + * @description If 'sorting' parameter is not set, return current sorting. Otherwise set current sorting. + * + * @param {string} sorting New sorting + * @returns {Object} Current sorting or `this` + */ + this.sorting = function (sorting) { + if (arguments.length == 2) { + var sortArray = {}; + sortArray[sorting] = arguments[1]; + this.parameters({'sorting': sortArray}); + return this; + } + return angular.isDefined(sorting) ? this.parameters({'sorting': sorting}) : params.sorting; + }; + + /** + * @ngdoc method + * @name ngTable.factory:ngTableParams#isSortBy + * @methodOf ngTable.factory:ngTableParams + * @description Checks sort field + * + * @param {string} field Field name + * @param {string} direction Direction of sorting 'asc' or 'desc' + * @returns {Array} Return true if field sorted by direction + */ + this.isSortBy = function (field, direction) { + return angular.isDefined(params.sorting[field]) && params.sorting[field] == direction; + }; + + /** + * @ngdoc method + * @name ngTable.factory:ngTableParams#orderBy + * @methodOf ngTable.factory:ngTableParams + * @description Return object of sorting parameters for angular filter + * + * @returns {Array} Array like: [ '-name', '+age' ] + */ + this.orderBy = function () { + var sorting = []; + for (var column in params.sorting) { + sorting.push((params.sorting[column] === "asc" ? "+" : "-") + column); + } + return sorting; + }; + + /** + * @ngdoc method + * @name ngTable.factory:ngTableParams#getData + * @methodOf ngTable.factory:ngTableParams + * @description Called when updated some of parameters for get new data + * + * @param {Object} $defer promise object + * @param {Object} params New parameters + */ + this.getData = function ($defer, params) { + if (angular.isArray(this.data) && angular.isObject(params)) { + $defer.resolve(this.data.slice((params.page() - 1) * params.count(), params.page() * params.count())); + } else { + $defer.resolve([]); + } + }; + + /** + * @ngdoc method + * @name ngTable.factory:ngTableParams#getGroups + * @methodOf ngTable.factory:ngTableParams + * @description Return groups for table grouping + */ + this.getGroups = function ($defer, column) { + var defer = $q.defer(); + + defer.promise.then(function (data) { + var groups = {}; + angular.forEach(data, function (item) { + var groupName = angular.isFunction(column) ? column(item) : item[column]; + + groups[groupName] = groups[groupName] || { + data: [] + }; + groups[groupName]['value'] = groupName; + groups[groupName].data.push(item); + }); + var result = []; + for (var i in groups) { + result.push(groups[i]); + } + log('ngTable: refresh groups', result); + $defer.resolve(result); + }); + this.getData(defer, self); + }; + + /** + * @ngdoc method + * @name ngTable.factory:ngTableParams#generatePagesArray + * @methodOf ngTable.factory:ngTableParams + * @description Generate array of pages + * + * @param {boolean} currentPage which page must be active + * @param {boolean} totalItems Total quantity of items + * @param {boolean} pageSize Quantity of items on page + * @returns {Array} Array of pages + */ + this.generatePagesArray = function (currentPage, totalItems, pageSize) { + var maxBlocks, maxPage, maxPivotPages, minPage, numPages, pages; + maxBlocks = 11; + pages = []; + numPages = Math.ceil(totalItems / pageSize); + if (numPages > 1) { + pages.push({ + type: 'prev', + number: Math.max(1, currentPage - 1), + active: currentPage > 1 + }); + pages.push({ + type: 'first', + number: 1, + active: currentPage > 1 + }); + maxPivotPages = Math.round((maxBlocks - 5) / 2); + minPage = Math.max(2, currentPage - maxPivotPages); + maxPage = Math.min(numPages - 1, currentPage + maxPivotPages * 2 - (currentPage - minPage)); + minPage = Math.max(2, minPage - (maxPivotPages * 2 - (maxPage - minPage))); + var i = minPage; + while (i <= maxPage) { + if ((i === minPage && i !== 2) || (i === maxPage && i !== numPages - 1)) { + pages.push({ + type: 'more', + active: false + }); + } else { + pages.push({ + type: 'page', + number: i, + active: currentPage !== i + }); + } + i++; + } + pages.push({ + type: 'last', + number: numPages, + active: currentPage !== numPages + }); + pages.push({ + type: 'next', + number: Math.min(numPages, currentPage + 1), + active: currentPage < numPages + }); + } + return pages; + }; + + /** + * @ngdoc method + * @name ngTable.factory:ngTableParams#url + * @methodOf ngTable.factory:ngTableParams + * @description Return groups for table grouping + * + * @param {boolean} asString flag indicates return array of string or object + * @returns {Array} If asString = true will be return array of url string parameters else key-value object + */ + this.url = function (asString) { + asString = asString || false; + var pairs = (asString ? [] : {}); + for (var key in params) { + if (params.hasOwnProperty(key)) { + var item = params[key], + name = encodeURIComponent(key); + if (typeof item === "object") { + for (var subkey in item) { + if (!angular.isUndefined(item[subkey]) && item[subkey] !== "") { + var pname = name + "[" + encodeURIComponent(subkey) + "]"; + if (asString) { + pairs.push(pname + "=" + item[subkey]); + } else { + pairs[pname] = item[subkey]; + } + } + } + } else if (!angular.isFunction(item) && !angular.isUndefined(item) && item !== "") { + if (asString) { + pairs.push(name + "=" + encodeURIComponent(item)); + } else { + pairs[name] = encodeURIComponent(item); + } + } + } + } + return pairs; + }; + + /** + * @ngdoc method + * @name ngTable.factory:ngTableParams#reload + * @methodOf ngTable.factory:ngTableParams + * @description Reload table data + */ + this.reload = function () { + var $defer = $q.defer(), + self = this; + + settings.$loading = true; + if (settings.groupBy) { + settings.getGroups($defer, settings.groupBy, this); + } else { + settings.getData($defer, this); + } + log('ngTable: reload data'); + $defer.promise.then(function (data) { + settings.$loading = false; + log('ngTable: current scope', settings.$scope); + if (settings.groupBy) { + self.data = settings.$scope.$groups = data; + } else { + self.data = settings.$scope.$data = data; + } + settings.$scope.pages = self.generatePagesArray(self.page(), self.total(), self.count()); + settings.$scope.$emit('ngTableAfterReloadData'); + }); + }; + + this.reloadPages = function () { + var self = this; + settings.$scope.pages = self.generatePagesArray(self.page(), self.total(), self.count()); + }; + + var params = this.$params = { + page: 1, + count: 1, + filter: {}, + sorting: {}, + group: {}, + groupBy: null + }; + var settings = { + $scope: null, // set by ngTable controller + $loading: false, + data: null, //allows data to be set when table is initialized + total: 0, + defaultSort: 'desc', + filterDelay: 750, + counts: [10, 25, 50, 100], + getGroups: this.getGroups, + getData: this.getData + }; + + this.settings(baseSettings); + this.parameters(baseParameters, true); + return this; + }; + return ngTableParams; +}]); + +/** + * ngTable: Table + Angular JS + * + * @author Vitalii Savchuk + * @url https://github.com/esvit/ng-table/ + * @license New BSD License + */ + +/** + * @ngdoc object + * @name ngTable.directive:ngTable.ngTableController + * + * @description + * Each {@link ngTable.directive:ngTable ngTable} directive creates an instance of `ngTableController` + */ +var ngTableController = ['$scope', 'ngTableParams', '$timeout', function ($scope, ngTableParams, $timeout) { + $scope.$loading = false; + + if (!$scope.params) { + $scope.params = new ngTableParams(); + } + $scope.params.settings().$scope = $scope; + + var delayFilter = (function () { + var timer = 0; + return function (callback, ms) { + $timeout.cancel(timer); + timer = $timeout(callback, ms); + }; + })(); + + $scope.$watch('params.$params', function (newParams, oldParams) { + $scope.params.settings().$scope = $scope; + + if (!angular.equals(newParams.filter, oldParams.filter)) { + delayFilter(function () { + $scope.params.$params.page = 1; + $scope.params.reload(); + }, $scope.params.settings().filterDelay); + } else { + $scope.params.reload(); + } + }, true); + + $scope.sortBy = function (column, event) { + var parsedSortable = $scope.parse(column.sortable); + if (!parsedSortable) { + return; + } + var defaultSort = $scope.params.settings().defaultSort; + var inverseSort = (defaultSort === 'asc' ? 'desc' : 'asc'); + var sorting = $scope.params.sorting() && $scope.params.sorting()[parsedSortable] && ($scope.params.sorting()[parsedSortable] === defaultSort); + var sortingParams = (event.ctrlKey || event.metaKey) ? $scope.params.sorting() : {}; + sortingParams[parsedSortable] = (sorting ? inverseSort : defaultSort); + $scope.params.parameters({ + sorting: sortingParams + }); + }; +}]; +/** + * ngTable: Table + Angular JS + * + * @author Vitalii Savchuk + * @url https://github.com/esvit/ng-table/ + * @license New BSD License + */ + +/** + * @ngdoc directive + * @name ngTable.directive:ngTable + * @restrict A + * + * @description + * Directive that instantiates {@link ngTable.directive:ngTable.ngTableController ngTableController}. + */ +app.directive('ngTable', ['$compile', '$q', '$parse', + function ($compile, $q, $parse) { + 'use strict'; + + return { + restrict: 'A', + priority: 1001, + scope: true, + controller: ngTableController, + compile: function (element) { + var columns = [], i = 0, row = null; + + // custom header + var thead = element.find('thead'); + + // IE 8 fix :not(.ng-table-group) selector + angular.forEach(angular.element(element.find('tr')), function (tr) { + tr = angular.element(tr); + if (!tr.hasClass('ng-table-group') && !row) { + row = tr; + } + }); + if (!row) { + return; + } + angular.forEach(row.find('td'), function (item) { + var el = angular.element(item); + if (el.attr('ignore-cell') && 'true' === el.attr('ignore-cell')) { + return; + } + var parsedAttribute = function (attr, defaultValue) { + return function (scope) { + return $parse(el.attr('x-data-' + attr) || el.attr('data-' + attr) || el.attr(attr))(scope, { + $columns: columns + }) || defaultValue; + }; + }; + + var parsedTitle = parsedAttribute('title', ' '), + headerTemplateURL = parsedAttribute('header', false), + filter = parsedAttribute('filter', false)(), + filterTemplateURL = false, + filterName = false; + + if (filter && filter.$$name) { + filterName = filter.$$name; + delete filter.$$name; + } + if (filter && filter.templateURL) { + filterTemplateURL = filter.templateURL; + delete filter.templateURL; + } + + el.attr('data-title-text', parsedTitle()); // this used in responsive table + columns.push({ + id: i++, + title: parsedTitle, + sortable: parsedAttribute('sortable', false), + 'class': el.attr('x-data-header-class') || el.attr('data-header-class') || el.attr('header-class'), + filter: filter, + filterTemplateURL: filterTemplateURL, + filterName: filterName, + headerTemplateURL: headerTemplateURL, + filterData: (el.attr("filter-data") ? el.attr("filter-data") : null), + show: (el.attr("ng-show") ? function (scope) { + return $parse(el.attr("ng-show"))(scope); + } : function () { + return true; + }) + }); + }); + return function (scope, element, attrs) { + scope.$loading = false; + scope.$columns = columns; + + scope.$watch(attrs.ngTable, (function (params) { + if (angular.isUndefined(params)) { + return; + } + scope.paramsModel = $parse(attrs.ngTable); + scope.params = params; + }), true); + scope.parse = function (text) { + return angular.isDefined(text) ? text(scope) : ''; + }; + if (attrs.showFilter) { + scope.$parent.$watch(attrs.showFilter, function (value) { + scope.show_filter = value; + }); + } + angular.forEach(columns, function (column) { + var def; + if (!column.filterData) { + return; + } + def = $parse(column.filterData)(scope, { + $column: column + }); + if (!(angular.isObject(def) && angular.isObject(def.promise))) { + throw new Error('Function ' + column.filterData + ' must be instance of $q.defer()'); + } + delete column.filterData; + return def.promise.then(function (data) { + if (!angular.isArray(data)) { + data = []; + } + data.unshift({ + title: '-', + id: '' + }); + column.data = data; + }); + }); + if (!element.hasClass('ng-table')) { + scope.templates = { + header: (attrs.templateHeader ? attrs.templateHeader : 'ng-table/header.html'), + pagination: (attrs.templatePagination ? attrs.templatePagination : 'ng-table/pager.html') + }; + var headerTemplate = thead.length > 0 ? thead : angular.element(document.createElement('thead')).attr('ng-include', 'templates.header'); + var paginationTemplate = angular.element(document.createElement('div')).attr({ + 'ng-table-pagination': 'params', + 'template-url': 'templates.pagination' + }); + + element.find('thead').remove(); + + element.addClass('ng-table') + .prepend(headerTemplate) + .after(paginationTemplate); + + $compile(headerTemplate)(scope); + $compile(paginationTemplate)(scope); + } + }; + } + } + } +]); + +/** + * ngTable: Table + Angular JS + * + * @author Vitalii Savchuk + * @url https://github.com/esvit/ng-table/ + * @license New BSD License + */ + +/** + * @ngdoc directive + * @name ngTable.directive:ngTablePagination + * @restrict A + */ +app.directive('ngTablePagination', ['$compile', + function ($compile) { + 'use strict'; + + return { + restrict: 'A', + scope: { + 'params': '=ngTablePagination', + 'templateUrl': '=' + }, + replace: false, + link: function (scope, element, attrs) { + + scope.params.settings().$scope.$on('ngTableAfterReloadData', function () { + scope.pages = scope.params.generatePagesArray(scope.params.page(), scope.params.total(), scope.params.count()); + }, true); + + scope.$watch('templateUrl', function(templateUrl) { + if (angular.isUndefined(templateUrl)) { + return; + } + var template = angular.element(document.createElement('div')) + template.attr({ + 'ng-include': 'templateUrl' + }); + element.append(template); + $compile(template)(scope); + }); + } + }; + } +]); + +angular.module('ngTable').run(['$templateCache', function ($templateCache) { + $templateCache.put('ng-table/filters/select-multiple.html', ''); + $templateCache.put('ng-table/filters/select.html', ''); + $templateCache.put('ng-table/filters/text.html', ''); + $templateCache.put('ng-table/header.html', '
'); + $templateCache.put('ng-table/pager.html', ' '); +}]); + return app; +})); \ No newline at end of file diff --git a/public/app/bower_components/ng-table/ng-table.less b/public/app/bower_components/ng-table/ng-table.less new file mode 100644 index 00000000..79d007ad --- /dev/null +++ b/public/app/bower_components/ng-table/ng-table.less @@ -0,0 +1,151 @@ +@table-border-color: #999; +@cell-border-color: #eee; + +.ng-table { + th { + text-align: center; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + + &.sortable { + cursor: pointer; + + div { + padding-right: 18px; + position: relative; + + &:after, &:before { + content: ""; + border-width: 0 4px 4px; + border-style: solid; + border-color: #000 transparent; + visibility: visible; + right: 8px; + top: 50%; + position: absolute; + opacity: .3; + margin-top: -4px; + } + &:before { + margin-top: 2px; + border-bottom: none; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid #000; + } + } + + div:hover:after, div:hover:before { + opacity: 1; + visibility: visible; + } + &.sort-desc, &.sort-asc { + background-color: rgba(141, 192, 219, 0.25); + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + + div:after { + margin-top: -2px; + } + div:before { + visibility: hidden; + } + } + &.sort-asc div:after, &.sort-asc div:hover:after { + visibility: visible; + filter: alpha(opacity=60); + -khtml-opacity: 0.6; + -moz-opacity: 0.6; + opacity: 0.6; + } + &.sort-desc div:after { + border-bottom: none; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid #000; + visibility: visible; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + filter: alpha(opacity=60); + -khtml-opacity: 0.6; + -moz-opacity: 0.6; + opacity: 0.6; + } + } + &.filter { + .input-filter { + margin: 0; + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + } + } + + & + .pagination { + margin-top: 0; + } +} + +@media only screen and (max-width: 800px) { + .ng-table-responsive { + border-bottom: 1px solid @table-border-color; + tr { + border-top: 1px solid @table-border-color; + border-left: 1px solid @table-border-color; + border-right: 1px solid @table-border-color; + } + td:before { + position: absolute; + padding: 8px; + left: 0; + top: 0; + width: 50%; + white-space: nowrap; + text-align: left; + font-weight: bold; + } + thead { + tr { + th { + text-align: left; + } + &.ng-table-filters { + th { + padding: 0; + + form > div { + padding: 8px; + } + } + } + } + } + td { + border: none; + border-bottom: 1px solid @cell-border-color; + position: relative; + padding-left: 50%; + white-space: normal; + text-align: left; + + &:before { + content: attr(data-title-text); + } + } + &, thead, tbody, th, td, tr { + display: block; + } + } + + .ng-table-pager {} + .ng-table-pagination {} + .ng-table-counts {} +} \ No newline at end of file diff --git a/public/app/bower_components/ng-table/ng-table.map b/public/app/bower_components/ng-table/ng-table.map new file mode 100644 index 00000000..89edf270 --- /dev/null +++ b/public/app/bower_components/ng-table/ng-table.map @@ -0,0 +1 @@ +{"version":3,"file":"ng-table.min.js","sources":["ng-table.js"],"names":["angular","factory","define","amd","app","module","$q","$log","isNumber","n","isNaN","parseFloat","isFinite","ngTableParams","baseParameters","baseSettings","self","this","log","settings","debugMode","debug","apply","arguments","data","parameters","newParameters","parseParamsFromUrl","isDefined","key","value","indexOf","keys","split","reverse","lastKey","i","len","length","name","v","params","extend","newSettings","isArray","total","page","count","filter","sorting","sortArray","isSortBy","field","direction","orderBy","column","push","getData","$defer","isObject","resolve","slice","getGroups","defer","promise","then","groups","forEach","item","groupName","isFunction","result","generatePagesArray","currentPage","totalItems","pageSize","maxBlocks","maxPage","maxPivotPages","minPage","numPages","pages","Math","ceil","type","number","max","active","round","min","url","asString","pairs","hasOwnProperty","encodeURIComponent","subkey","isUndefined","pname","reload","$loading","groupBy","$scope","$groups","$data","$emit","reloadPages","$params","group","defaultSort","filterDelay","counts","ngTableController","$timeout","delayFilter","timer","callback","ms","cancel","$watch","newParams","oldParams","equals","sortBy","event","parsedSortable","parse","sortable","inverseSort","sortingParams","ctrlKey","metaKey","directive","$compile","$parse","restrict","priority","scope","controller","compile","element","columns","row","thead","find","tr","hasClass","el","attr","parsedAttribute","defaultValue","$columns","parsedTitle","headerTemplateURL","filterTemplateURL","filterName","$$name","templateURL","id","title","class","filterData","show","attrs","ngTable","paramsModel","text","showFilter","$parent","show_filter","def","$column","Error","unshift","templates","header","templateHeader","pagination","templatePagination","headerTemplate","document","createElement","paginationTemplate","ng-table-pagination","template-url","remove","addClass","prepend","after","templateUrl","replace","link","$on","template","ng-include","append","run","$templateCache","put"],"mappings":"CAAC,SAASA,EAASC,GACf,YAEA,OAAsB,kBAAXC,SAAyBA,OAAOC,KACvCD,QAAQ,WAAY,SAASF,GACzB,MAAOC,GAAQD,KADnBE,QAIOD,EAAQD,IAErBA,SAAW,KAAM,SAASA,GACxB,YAqCJ,IAAII,GAAMJ,EAAQK,OAAO,aAczBD,GAAIH,QAAQ,iBAAkB,KAAM,OAAQ,SAAUK,EAAIC,GACtD,GAAIC,GAAW,SAAUC,GACrB,OAAQC,MAAMC,WAAWF,KAAOG,SAASH,IAEzCI,EAAgB,SAAUC,EAAgBC,GAC1C,GAAIC,GAAOC,KACPC,EAAM,WACEC,EAASC,WAAab,EAAKc,OAC3Bd,EAAKc,MAAMC,MAAML,KAAMM,WAInCN,MAAKO,QAYLP,KAAKQ,WAAa,SAAUC,EAAeC,GAEvC,GADAA,EAAqBA,IAAsB,EACvC3B,EAAQ4B,UAAUF,GAAgB,CAClC,IAAK,GAAIG,KAAOH,GAAe,CAC3B,GAAII,GAAQJ,EAAcG,EAC1B,IAAIF,GAAsBE,EAAIE,QAAQ,MAAQ,EAAG,CAG7C,IAAK,GAFDC,GAAOH,EAAII,MAAM,YAAYC,UAC7BC,EAAU,GACLC,EAAI,EAAGC,EAAML,EAAKM,OAAYD,EAAJD,EAASA,IAAK,CAC7C,GAAIG,GAAOP,EAAKI,EAChB,IAAa,KAATG,EAAa,CACb,GAAIC,GAAIV,CACRA,MACAA,EAAMK,EAAUI,GAAS/B,EAASgC,GAAK7B,WAAW6B,GAAKA,GAG/C,YAAZL,IACAM,EAAON,OAEXM,EAA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OAAOM,WACvG,GAEHyF,EAAMlB,OAAO,cAAe,SAASsE,GACjC,IAAI5L,EAAQgG,YAAY4F,GAAxB,CAGA,GAAII,GAAWhM,EAAQ2I,QAAQwC,SAASC,cAAc,OACtDY,GAAS7C,MACL8C,aAAc,gBAElBtD,EAAQuD,OAAOF,GACf5D,EAAS4D,GAAUxD,WAOvCxI,EAAQK,OAAO,WAAW8L,KAAK,iBAAkB,SAAUC,GAC1DA,EAAeC,IAAI,wCAAyC,oQAC5DD,EAAeC,IAAI,+BAAgC,sNACnDD,EAAeC,IAAI,6BAA8B,iJACjDD,EAAeC,IAAI,uBAAwB,mgCAC3CD,EAAeC,IAAI,sBAAuB,wjCAEhCjM"} \ No newline at end of file diff --git a/public/app/bower_components/ng-table/ng-table.min.css b/public/app/bower_components/ng-table/ng-table.min.css new file mode 100644 index 00000000..8975838c --- /dev/null +++ b/public/app/bower_components/ng-table/ng-table.min.css @@ -0,0 +1,3 @@ +/*! ngTable v0.3.2 by Vitalii Savchuk(esvit666@gmail.com) - https://github.com/esvit/ng-table - New BSD License */ + +.ng-table th{text-align:center;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ng-table th.sortable{cursor:pointer}.ng-table th.sortable div{padding-right:18px;position:relative}.ng-table th.sortable div:after,.ng-table th.sortable div:before{content:"";border-width:0 4px 4px;border-style:solid;border-color:#000 transparent;visibility:visible;right:8px;top:50%;position:absolute;opacity:.3;margin-top:-4px}.ng-table th.sortable div:before{margin-top:2px;border-bottom:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000}.ng-table th.sortable div:hover:after,.ng-table th.sortable div:hover:before{opacity:1;visibility:visible}.ng-table th.sortable.sort-desc,.ng-table th.sortable.sort-asc{background-color:rgba(141,192,219,.25);text-shadow:0 1px 1px rgba(255,255,255,.75)}.ng-table th.sortable.sort-desc div:after,.ng-table th.sortable.sort-asc div:after{margin-top:-2px}.ng-table th.sortable.sort-desc div:before,.ng-table th.sortable.sort-asc div:before{visibility:hidden}.ng-table th.sortable.sort-asc div:after,.ng-table th.sortable.sort-asc div:hover:after{visibility:visible;filter:alpha(opacity=60);-khtml-opacity:.6;-moz-opacity:.6;opacity:.6}.ng-table th.sortable.sort-desc div:after{border-bottom:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000;visibility:visible;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:alpha(opacity=60);-khtml-opacity:.6;-moz-opacity:.6;opacity:.6}.ng-table th.filter .input-filter{margin:0;display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ng-table+.pagination{margin-top:0}@media only screen and (max-width:800px){.ng-table-responsive{border-bottom:1px solid #999}.ng-table-responsive tr{border-top:1px solid #999;border-left:1px solid #999;border-right:1px solid #999}.ng-table-responsive td:before{position:absolute;padding:8px;left:0;top:0;width:50%;white-space:nowrap;text-align:left;font-weight:700}.ng-table-responsive thead tr th{text-align:left}.ng-table-responsive thead tr.ng-table-filters th{padding:0}.ng-table-responsive thead tr.ng-table-filters th form>div{padding:8px}.ng-table-responsive td{border:0;border-bottom:1px solid #eee;position:relative;padding-left:50%;white-space:normal;text-align:left}.ng-table-responsive td:before{content:attr(data-title-text)}.ng-table-responsive,.ng-table-responsive thead,.ng-table-responsive tbody,.ng-table-responsive th,.ng-table-responsive td,.ng-table-responsive tr{display:block}} \ No newline at end of file diff --git a/public/app/bower_components/ng-table/ng-table.min.js b/public/app/bower_components/ng-table/ng-table.min.js new file mode 100644 index 00000000..dca0cf90 --- /dev/null +++ b/public/app/bower_components/ng-table/ng-table.min.js @@ -0,0 +1,3 @@ +/*! ngTable v0.3.2 by Vitalii Savchuk(esvit666@gmail.com) - https://github.com/esvit/ng-table - New BSD License */ +!function(a,b){"use strict";return"function"==typeof define&&define.amd?(define(["angular"],function(a){return b(a)}),void 0):b(a)}(angular||null,function(a){"use strict";var b=a.module("ngTable",[]);b.factory("ngTableParams",["$q","$log",function(b,c){var d=function(a){return!isNaN(parseFloat(a))&&isFinite(a)},e=function(e,f){var g=this,h=function(){j.debugMode&&c.debug&&c.debug.apply(this,arguments)};this.data=[],this.parameters=function(b,c){if(c=c||!1,a.isDefined(b)){for(var e in b){var f=b[e];if(c&&e.indexOf("[")>=0){for(var g=e.split(/\[(.*)\]/).reverse(),j="",k=0,l=g.length;l>k;k++){var m=g[k];if(""!==m){var n=f;f={},f[j=m]=d(n)?parseFloat(n):n}}"sorting"===j&&(i[j]={}),i[j]=a.extend(i[j]||{},f[j])}else i[e]=d(b[e])?parseFloat(b[e]):b[e]}return h("ngTable: set parameters",i),this}return i},this.settings=function(b){return a.isDefined(b)?(a.isArray(b.data)&&(b.total=b.data.length),j=a.extend(j,b),h("ngTable: set settings",j),this):j},this.page=function(b){return a.isDefined(b)?this.parameters({page:b}):i.page},this.total=function(b){return a.isDefined(b)?this.settings({total:b}):j.total},this.count=function(b){return a.isDefined(b)?this.parameters({count:b,page:1}):i.count},this.filter=function(b){return a.isDefined(b)?this.parameters({filter:b}):i.filter},this.sorting=function(b){if(2==arguments.length){var c={};return c[b]=arguments[1],this.parameters({sorting:c}),this}return a.isDefined(b)?this.parameters({sorting:b}):i.sorting},this.isSortBy=function(b,c){return a.isDefined(i.sorting[b])&&i.sorting[b]==c},this.orderBy=function(){var a=[];for(var b in i.sorting)a.push(("asc"===i.sorting[b]?"+":"-")+b);return a},this.getData=function(b,c){a.isArray(this.data)&&a.isObject(c)?b.resolve(this.data.slice((c.page()-1)*c.count(),c.page()*c.count())):b.resolve([])},this.getGroups=function(c,d){var e=b.defer();e.promise.then(function(b){var e={};a.forEach(b,function(b){var c=a.isFunction(d)?d(b):b[d];e[c]=e[c]||{data:[]},e[c].value=c,e[c].data.push(b)});var f=[];for(var g in e)f.push(e[g]);h("ngTable: refresh groups",f),c.resolve(f)}),this.getData(e,g)},this.generatePagesArray=function(a,b,c){var d,e,f,g,h,i;if(d=11,i=[],h=Math.ceil(b/c),h>1){i.push({type:"prev",number:Math.max(1,a-1),active:a>1}),i.push({type:"first",number:1,active:a>1}),f=Math.round((d-5)/2),g=Math.max(2,a-f),e=Math.min(h-1,a+2*f-(a-g)),g=Math.max(2,g-(2*f-(e-g)));for(var j=g;e>=j;)j===g&&2!==j||j===e&&j!==h-1?i.push({type:"more",active:!1}):i.push({type:"page",number:j,active:a!==j}),j++;i.push({type:"last",number:h,active:a!==h}),i.push({type:"next",number:Math.min(h,a+1),active:h>a})}return i},this.url=function(b){b=b||!1;var c=b?[]:{};for(var d in i)if(i.hasOwnProperty(d)){var e=i[d],f=encodeURIComponent(d);if("object"==typeof e){for(var g in e)if(!a.isUndefined(e[g])&&""!==e[g]){var h=f+"["+encodeURIComponent(g)+"]";b?c.push(h+"="+e[g]):c[h]=e[g]}}else a.isFunction(e)||a.isUndefined(e)||""===e||(b?c.push(f+"="+encodeURIComponent(e)):c[f]=encodeURIComponent(e))}return c},this.reload=function(){var a=b.defer(),c=this;j.$loading=!0,j.groupBy?j.getGroups(a,j.groupBy,this):j.getData(a,this),h("ngTable: reload data"),a.promise.then(function(a){j.$loading=!1,h("ngTable: current scope",j.$scope),c.data=j.groupBy?j.$scope.$groups=a:j.$scope.$data=a,j.$scope.pages=c.generatePagesArray(c.page(),c.total(),c.count()),j.$scope.$emit("ngTableAfterReloadData")})},this.reloadPages=function(){var a=this;j.$scope.pages=a.generatePagesArray(a.page(),a.total(),a.count())};var i=this.$params={page:1,count:1,filter:{},sorting:{},group:{},groupBy:null},j={$scope:null,$loading:!1,data:null,total:0,defaultSort:"desc",filterDelay:750,counts:[10,25,50,100],getGroups:this.getGroups,getData:this.getData};return this.settings(f),this.parameters(e,!0),this};return e}]);var c=["$scope","ngTableParams","$timeout",function(b,c,d){b.$loading=!1,b.params||(b.params=new c),b.params.settings().$scope=b;var e=function(){var a=0;return function(b,c){d.cancel(a),a=d(b,c)}}();b.$watch("params.$params",function(c,d){b.params.settings().$scope=b,a.equals(c.filter,d.filter)?b.params.reload():e(function(){b.params.$params.page=1,b.params.reload()},b.params.settings().filterDelay)},!0),b.sortBy=function(a,c){var d=b.parse(a.sortable);if(d){var e=b.params.settings().defaultSort,f="asc"===e?"desc":"asc",g=b.params.sorting()&&b.params.sorting()[d]&&b.params.sorting()[d]===e,h=c.ctrlKey||c.metaKey?b.params.sorting():{};h[d]=g?f:e,b.params.parameters({sorting:h})}}}];return b.directive("ngTable",["$compile","$q","$parse",function(b,d,e){return{restrict:"A",priority:1001,scope:!0,controller:c,compile:function(c){var d=[],f=0,g=null,h=c.find("thead");return a.forEach(a.element(c.find("tr")),function(b){b=a.element(b),b.hasClass("ng-table-group")||g||(g=b)}),g?(a.forEach(g.find("td"),function(b){var c=a.element(b);if(!c.attr("ignore-cell")||"true"!==c.attr("ignore-cell")){var g=function(a,b){return function(f){return e(c.attr("x-data-"+a)||c.attr("data-"+a)||c.attr(a))(f,{$columns:d})||b}},h=g("title"," "),i=g("header",!1),j=g("filter",!1)(),k=!1,l=!1;j&&j.$$name&&(l=j.$$name,delete j.$$name),j&&j.templateURL&&(k=j.templateURL,delete j.templateURL),c.attr("data-title-text",h()),d.push({id:f++,title:h,sortable:g("sortable",!1),"class":c.attr("x-data-header-class")||c.attr("data-header-class")||c.attr("header-class"),filter:j,filterTemplateURL:k,filterName:l,headerTemplateURL:i,filterData:c.attr("filter-data")?c.attr("filter-data"):null,show:c.attr("ng-show")?function(a){return e(c.attr("ng-show"))(a)}:function(){return!0}})}}),function(c,f,g){if(c.$loading=!1,c.$columns=d,c.$watch(g.ngTable,function(b){a.isUndefined(b)||(c.paramsModel=e(g.ngTable),c.params=b)},!0),c.parse=function(b){return a.isDefined(b)?b(c):""},g.showFilter&&c.$parent.$watch(g.showFilter,function(a){c.show_filter=a}),a.forEach(d,function(b){var d;if(b.filterData){if(d=e(b.filterData)(c,{$column:b}),!a.isObject(d)||!a.isObject(d.promise))throw new Error("Function "+b.filterData+" must be instance of $q.defer()");return delete b.filterData,d.promise.then(function(c){a.isArray(c)||(c=[]),c.unshift({title:"-",id:""}),b.data=c})}}),!f.hasClass("ng-table")){c.templates={header:g.templateHeader?g.templateHeader:"ng-table/header.html",pagination:g.templatePagination?g.templatePagination:"ng-table/pager.html"};var i=h.length>0?h:a.element(document.createElement("thead")).attr("ng-include","templates.header"),j=a.element(document.createElement("div")).attr({"ng-table-pagination":"params","template-url":"templates.pagination"});f.find("thead").remove(),f.addClass("ng-table").prepend(i).after(j),b(i)(c),b(j)(c)}}):void 0}}}]),b.directive("ngTablePagination",["$compile",function(b){return{restrict:"A",scope:{params:"=ngTablePagination",templateUrl:"="},replace:!1,link:function(c,d){c.params.settings().$scope.$on("ngTableAfterReloadData",function(){c.pages=c.params.generatePagesArray(c.params.page(),c.params.total(),c.params.count())},!0),c.$watch("templateUrl",function(e){if(!a.isUndefined(e)){var f=a.element(document.createElement("div"));f.attr({"ng-include":"templateUrl"}),d.append(f),b(f)(c)}})}}}]),a.module("ngTable").run(["$templateCache",function(a){a.put("ng-table/filters/select-multiple.html",''),a.put("ng-table/filters/select.html",''),a.put("ng-table/filters/text.html",''),a.put("ng-table/header.html",'
'),a.put("ng-table/pager.html",' ')}]),b}); +//# sourceMappingURL=ng-table.map \ No newline at end of file diff --git a/public/app/bower_components/ng-table/package.json b/public/app/bower_components/ng-table/package.json new file mode 100644 index 00000000..62a340c5 --- /dev/null +++ b/public/app/bower_components/ng-table/package.json @@ -0,0 +1,39 @@ +{ + "name": "ng-table", + "version": "0.3.1", + "author": "Vitalii Savchuk ", + "license": "BSD", + "repository": { + "type": "git", + "url": "git://github.com/esvit/ng-table.git" + }, + "devDependencies": { + "coffee-script": "~1.6.2", + "grunt-regarde": "~0.1.1", + "grunt-contrib-jade": "~0.5.0", + "grunt-hustler": "0.11.2", + "grunt-contrib-copy": "~0.4.1", + "grunt-contrib-coffee": "~0.7.0", + "grunt-contrib-clean": "~0.4.0", + "grunt-contrib-concat": "~0.3.0", + "grunt-contrib-requirejs": "~0.4.0", + "grunt-contrib-uglify": "~0.2.1", + "grunt-contrib-connect": "~0.5.0", + "grunt": "~0.4.2", + "grunt-contrib-less": "~0.5.2", + "grunt-contrib-cssmin": "~0.6.1", + "load-grunt-tasks": "~0.2.0", + "grunt-contrib-watch": "~0.5.3", + "karma": "~0.10", + "karma-jasmine": "*", + "karma-chrome-launcher": "*", + "karma-firefox-launcher": "*", + "karma-ng-html2js-preprocessor": "*", + "coveralls": "", + "karma-coverage": "~0.1.0", + "grunt-coffee-build": "~1.4.12" + }, + "scripts": { + "test": "karma start --single-run --no-auto-watch" + } +} diff --git a/public/app/bower_components/ng-table/test/tableControllerSpec.js b/public/app/bower_components/ng-table/test/tableControllerSpec.js new file mode 100644 index 00000000..3cd03b7d --- /dev/null +++ b/public/app/bower_components/ng-table/test/tableControllerSpec.js @@ -0,0 +1,35 @@ +describe('ngTableParams', function () { + var scope, ctrl, params, data = [ + {name: "Moroni", age: 50, role: 'Administrator'}, + {name: "Tiancum", age: 43, role: 'Administrator'}, + {name: "Jacob", age: 27, role: 'Administrator'}, + {name: "Nephi", age: 29, role: 'Moderator'}, + {name: "Enos", age: 34, role: 'User'}, + {name: "Tiancum", age: 43, role: 'User'}, + {name: "Jacob", age: 27, role: 'User'}, + {name: "Nephi", age: 29, role: 'Moderator'}, + {name: "Enos", age: 34, role: 'User'}, + {name: "Tiancum", age: 43, role: 'Moderator'}, + {name: "Jacob", age: 27, role: 'User'}, + {name: "Nephi", age: 29, role: 'User'}, + {name: "Enos", age: 34, role: 'Moderator'}, + {name: "Tiancum", age: 43, role: 'User'}, + {name: "Jacob", age: 27, role: 'User'}, + {name: "Nephi", age: 29, role: 'User'}, + {name: "Enos", age: 34, role: 'User'} + ]; + beforeEach(module('ngTable')); + + /*beforeEach(inject(function ($controller, $rootScope, ngTableParams) { + scope = $rootScope.$new(); + params = scope.params = new ngTableParams(); + ctrl = $controller(ngTableController, { + $scope: scope + }); + })); + + it('ngTableController should have parameters', inject(function (ngTableParams) { + var params = new ngTableParams(); + expect(ngTableParams).toBeDefined(); + }));*/ +}); \ No newline at end of file diff --git a/public/app/bower_components/ng-table/test/tableParamsSpec.js b/public/app/bower_components/ng-table/test/tableParamsSpec.js new file mode 100644 index 00000000..ea1113c5 --- /dev/null +++ b/public/app/bower_components/ng-table/test/tableParamsSpec.js @@ -0,0 +1,273 @@ +describe('ngTableParams', function () { + var scope, ctrl, data = [ + {name: "Moroni", age: 50, role: 'Administrator'}, + {name: "Tiancum", age: 43, role: 'Administrator'}, + {name: "Jacob", age: 27, role: 'Administrator'}, + {name: "Nephi", age: 29, role: 'Moderator'}, + {name: "Enos", age: 34, role: 'User'}, + {name: "Tiancum", age: 43, role: 'User'}, + {name: "Jacob", age: 27, role: 'User'}, + {name: "Nephi", age: 29, role: 'Moderator'}, + {name: "Enos", age: 34, role: 'User'}, + {name: "Tiancum", age: 43, role: 'Moderator'}, + {name: "Jacob", age: 27, role: 'User'}, + {name: "Nephi", age: 29, role: 'User'}, + {name: "Enos", age: 34, role: 'Moderator'}, + {name: "Tiancum", age: 43, role: 'User'}, + {name: "Jacob", age: 27, role: 'User'}, + {name: "Nephi", age: 29, role: 'User'}, + {name: "Enos", age: 34, role: 'User'} + ]; + beforeEach(module('ngTable')); + + beforeEach(inject(function ($controller, $rootScope) { + scope = $rootScope.$new(); + })); + + it('ngTableParams should be defined', inject(function (ngTableParams) { + var params = new ngTableParams(); + expect(ngTableParams).toBeDefined(); + })); + + it('ngTableParams test generatePagesArray', inject(function (ngTableParams) { + var params = new ngTableParams(); + expect(params.generatePagesArray(1, 30, 10)).toEqual([ + { type: 'prev', number: 1, active: false }, + { type: 'first', number: 1, active: false }, + { type: 'page', number: 2, active: true }, + { type: 'last', number: 3, active: true }, + { type: 'next', number: 2, active: true } + ]); + expect(params.generatePagesArray(2, 30, 10)).toEqual([ + { type: 'prev', number: 1, active: true }, + { type: 'first', number: 1, active: true }, + { type: 'page', number: 2, active: false }, + { type: 'last', number: 3, active: true }, + { type: 'next', number: 3, active: true } + ]); + expect(params.generatePagesArray(2, 100, 10)).toEqual([ + { type: 'prev', number: 1, active: true }, + { type: 'first', number: 1, active: true }, + { type: 'page', number: 2, active: false }, + { type: 'page', number: 3, active: true }, + { type: 'page', number: 4, active: true }, + { type: 'page', number: 5, active: true }, + { type: 'page', number: 6, active: true }, + { type: 'page', number: 7, active: true }, + { type: 'more', active: false }, + { type: 'last', number: 10, active: true }, + { type: 'next', number: 3, active: true } + ]); + })); + + it('ngTableParams `page` parameter', inject(function (ngTableParams) { + var params = new ngTableParams(); + + expect(params.page()).toBe(1); + expect(params.page(2)).toEqual(params); + expect(params.page()).toBe(2); + + params = new ngTableParams({ + page: 3 + }); + expect(params.page()).toBe(3); + + var callCount = 0; + scope.tableParams = params; + scope.$watch('tableParams', function (innerParams) { + callCount++; + expect(innerParams.page()).toBe(4); + }); + params.page(4); + scope.$apply(); + expect(callCount).toBe(1); + // repeat call + scope.$apply(); + expect(callCount).toBe(1); + })); + + it('ngTableParams parse url parameters', inject(function (ngTableParams) { + var params = new ngTableParams({ + 'sorting[name]': 'asc', + 'sorting[age]': 'desc', + 'filter[name]': 'test', + 'filter[age]': 20 + }); + + expect(params.filter()).toEqual({ 'name': 'test', 'age': 20 }); + expect(params.filter({})).toEqual(params); + + expect(params.sorting()).toEqual({ 'age': 'desc' }); // sorting only by one column + expect(params.sorting({})).toEqual(params); + })); + + it('ngTableParams return url parameters', inject(function (ngTableParams) { + var params = new ngTableParams({ + 'sorting[name]': 'asc', + 'sorting[age]': 'desc', + 'filter[name]': 'test', + 'filter[age]': 20 + }); + expect(params.url()).toEqual({ + 'page': '1', + 'count': '1', + 'filter[name]': 'test', + 'filter[age]': 20, + 'sorting[age]': 'desc' + }); + expect(params.url(true)).toEqual([ + 'page=1', + 'count=1', + 'filter[name]=test', + 'filter[age]=20', + 'sorting[age]=desc' + ]); + })); + + it('ngTableParams test orderBy', inject(function (ngTableParams) { + var params = new ngTableParams({ + 'sorting[name]': 'asc' + }); + + expect(params.orderBy()).toEqual([ '+name' ]); // for angular sorting function + + params.sorting({ name: 'desc', age: 'asc' }); + + expect(params.orderBy()).toEqual([ '-name', '+age' ]); + })); + + it('ngTableParams test settings', inject(function (ngTableParams) { + var params = new ngTableParams(); + + expect(params.settings()).toEqual({ + $scope: null, + $loading: false, + data: null, + total: 0, + defaultSort : 'desc', + counts: [10, 25, 50, 100], + getData: params.getData, + getGroups: params.getGroups, + filterDelay: 750 + }); + + params = new ngTableParams({}, { total: 100 }); + + expect(params.settings()).toEqual({ + $scope: null, + $loading: false, + data: null, + total: 100, + defaultSort : 'desc', + counts: [10, 25, 50, 100], + getData: params.getData, + getGroups: params.getGroups, + filterDelay: 750 + }); + })); + + it('ngTableParams test getData', inject(function ($q, ngTableParams) { + var params = new ngTableParams(); + $defer = $q.defer(); + $defer.promise.then(function(data) { + expect(data).toEqual([]); + }); + params.getData($defer); + })); + + it('ngTableParams test grouping', inject(function ($q, ngTableParams) { + var params = new ngTableParams(); + params.getData = function ($defer) { + $defer.resolve(data); + }; + + $defer = $q.defer(); + $defer.promise.then(function (data) { + + expect(data).toEqual([ + { + value: 'Administrator', + data: [ + {name: "Moroni", age: 50, role: 'Administrator'}, + {name: "Tiancum", age: 43, role: 'Administrator'}, + {name: "Jacob", age: 27, role: 'Administrator'} + ] + }, + { + value: 'Moderator', + data: [ + {name: "Nephi", age: 29, role: 'Moderator'}, + {name: "Nephi", age: 29, role: 'Moderator'}, + {name: "Tiancum", age: 43, role: 'Moderator'}, + {name: "Enos", age: 34, role: 'Moderator'} + ] + }, + { + value: 'User', + data: [ + {name: "Enos", age: 34, role: 'User'}, + {name: "Tiancum", age: 43, role: 'User'}, + {name: "Jacob", age: 27, role: 'User'}, + {name: "Enos", age: 34, role: 'User'}, + {name: "Jacob", age: 27, role: 'User'}, + {name: "Nephi", age: 29, role: 'User'}, + {name: "Tiancum", age: 43, role: 'User'}, + {name: "Jacob", age: 27, role: 'User'}, + {name: "Nephi", age: 29, role: 'User'}, + {name: "Enos", age: 34, role: 'User'} + ] + } + ]); + }); + params.getGroups($defer, 'role'); + + $defer = $q.defer(); + $defer.promise.then(function (data) { + expect(data).toEqual([ + { + value: 50, + data: [ + {name: "Moroni", age: 50, role: 'Administrator'} + ] + }, + { + value: 43, + data: [ + {name: "Tiancum", age: 43, role: 'Administrator'}, + {name: "Tiancum", age: 43, role: 'User'}, + {name: "Tiancum", age: 43, role: 'Moderator'}, + {name: "Tiancum", age: 43, role: 'User'} + ] + }, + { + value: 27, + data: [ + {name: "Jacob", age: 27, role: 'Administrator'}, + {name: "Jacob", age: 27, role: 'User'}, + {name: "Jacob", age: 27, role: 'User'}, + {name: "Jacob", age: 27, role: 'User'} + ] + }, + { + value: 29, + data: [ + {name: "Nephi", age: 29, role: 'Moderator'}, + {name: "Nephi", age: 29, role: 'Moderator'}, + {name: "Nephi", age: 29, role: 'User'}, + {name: "Nephi", age: 29, role: 'User'} + ] + }, + { + value: 34, + data: [ + {name: "Enos", age: 34, role: 'User'}, + {name: "Enos", age: 34, role: 'User'}, + {name: "Enos", age: 34, role: 'Moderator'}, + {name: "Enos", age: 34, role: 'User'} + ] + } + ]); + }); + params.getGroups($defer, 'age'); + })); +}); diff --git a/public/app/bower_components/ng-table/test/tableSpec.js b/public/app/bower_components/ng-table/test/tableSpec.js new file mode 100644 index 00000000..c1177085 --- /dev/null +++ b/public/app/bower_components/ng-table/test/tableSpec.js @@ -0,0 +1,113 @@ +describe('ng-table', function () { + var elm, scope, data = [ + {id: 1, name: "Moroni", age: 50, money: -10}, + {id: 2, name: "Tiancum", age: 43, money: 120}, + {id: 3, name: "Jacob", age: 27, money: 5.5}, + {id: 4, name: "Nephi", age: 29, money: -54}, + {id: 5, name: "Enos", age: 34, money: 110}, + {id: 6, name: "Tiancum", age: 43, money: 1000}, + {id: 7, name: "Jacob", age: 27, money: -201}, + {id: 8, name: "Nephi", age: 29, money: 100}, + {id: 9, name: "Enos", age: 34, money: -52.5}, + {id: 10, name: "Tiancum", age: 43, money: 52.1}, + {id: 11, name: "Jacob", age: 27, money: 110}, + {id: 12, name: "Nephi", age: 29, money: -55}, + {id: 13, name: "Enos", age: 34, money: 551}, + {id: 14, name: "Tiancum", age: 43, money: -1410}, + {id: 15, name: "Jacob", age: 27, money: 410}, + {id: 16, name: "Nephi", age: 29, money: 100}, + {id: 17, name: "Enos", age: 34, money: -100} + ]; + + beforeEach(module('ngTable')); + + beforeEach(inject(function ($rootScope, $compile, $q) { + elm = angular.element( + '
' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
' + + '{{user.name}}' + + '' + + '{{user.age}}' + + '' + + '{{user.money}}' + + '
' + + '
'); + + scope = $rootScope.$new(true); + + scope.money = function() { + var def = $q.defer(); + + def.resolve([{ + 'id': 10, + 'title': '10' + }]); + return def; + }; + + $compile(elm)(scope); + scope.$digest(); + })); + + it('should create table header', inject(function ($compile, $rootScope) { + var thead = elm.find('thead'); + expect(thead.length).toBe(1); + + var rows = thead.find('tr'); + expect(rows.length).toBe(2); + + var titles = angular.element(rows[0]).find('th'); + + expect(titles.length).toBe(3); + expect(angular.element(titles[0]).text().trim()).toBe('Name of person'); + expect(angular.element(titles[1]).text().trim()).toBe('Age'); + expect(angular.element(titles[2]).text().trim()).toBe('Money'); + + var filters = angular.element(rows[1]).find('th'); + expect(filters.length).toBe(3); + })); + + it('should show scope data', inject(function ($compile, $rootScope, ngTableParams) { + debugger; + var tbody = elm.find('tbody'); + expect(tbody.length).toBe(1); + + var rows = tbody.find('tr'); + expect(rows.length).toBe(0); + + var params = new ngTableParams({ + page: 1, // show first page + count: 10 // count per page + }, { + total: data.length, // length of data + getData: function($defer, params) { + $defer.resolve(data.slice((params.page() - 1) * params.count(), params.page() * params.count())); + } + }); + scope.tableParams = params; + scope.$digest(); + + rows = tbody.find('tr'); + expect(rows.length).toBe(10); + + scope.tableParams.page(2); + scope.$digest(); + + rows = tbody.find('tr'); + expect(rows.length).toBe(7); + + params.total(20); + scope.$digest(); + + rows = tbody.find('tr'); + expect(rows.length).toBe(7); + })); + +}); diff --git a/public/app/index.html b/public/app/index.html index 5d789637..73697a39 100644 --- a/public/app/index.html +++ b/public/app/index.html @@ -17,6 +17,7 @@ + @@ -46,6 +47,7 @@ + @@ -62,7 +64,6 @@ - diff --git a/public/app/js/app.js b/public/app/js/app.js index 288226df..a0bad586 100644 --- a/public/app/js/app.js +++ b/public/app/js/app.js @@ -1,4 +1,5 @@ var app = angular.module( 'app', [ 'ui.router', 'nvd3ChartDirectives', 'angularMoment', - 'chieffancypants.loadingBar' ] ); + 'chieffancypants.loadingBar', + 'ngTable' ] ); diff --git a/public/app/js/main/filters/formatLedgerEntries.js b/public/app/js/main/filters/formatLedgerEntries.js deleted file mode 100644 index 457d9c9b..00000000 --- a/public/app/js/main/filters/formatLedgerEntries.js +++ /dev/null @@ -1,17 +0,0 @@ -app.filter( 'formatLedgerEntries', - [ '$sce', - function( $sce ) { - return function( entries ) { - return $sce.trustAsHtml( '' - + entries - .map( function( entry ) { - return ''; - } ) - .join( '' ) - + '
' - + entry.account - + '' - + entry.amount - +' €
' ); - }; - } ] ); diff --git a/public/app/js/main/templates/balance.tpl.html b/public/app/js/main/templates/balance.tpl.html index 5911cf0e..3d618f24 100644 --- a/public/app/js/main/templates/balance.tpl.html +++ b/public/app/js/main/templates/balance.tpl.html @@ -13,7 +13,7 @@

- Balance: {{( balance.income_total - balance.expenses_total ) | number:2}} € + Balance: {{( balance.income_total - balance.expenses_total ) | number:2}} €

@@ -38,7 +38,13 @@ - @@ -64,7 +70,13 @@ - diff --git a/public/bower.json b/public/bower.json index 1649310d..0af8aacc 100644 --- a/public/bower.json +++ b/public/bower.json @@ -12,8 +12,9 @@ "html5-boilerplate": "latest", "angularjs-nvd3-directives": "latest", "angular-bootstrap": "latest", - "bootstrap": "latest", - "angular-moment": "latest", - "angular-loading-bar": "latest" + "bootstrap": "latest", + "angular-moment": "latest", + "angular-loading-bar": "latest", + "ng-table": "latest" } }