diff --git a/Bowerfile b/Bowerfile index 00cae7b..b227818 100644 --- a/Bowerfile +++ b/Bowerfile @@ -19,7 +19,6 @@ asset 'angular-devise' asset 'ng-focus-if' asset 'angular-ui-router' asset 'intl-tel-input' -asset 'angular-ui-router-tabs' asset 'angular-bootstrap-datetimepicker', github: 'dalelotts/angular-bootstrap-datetimepicker' asset 'angular-ui-router-anim-in-out' asset 'angular-credit-cards' diff --git a/app/assets/javascripts/angular/controllers/dashboard_controller.coffee.erb b/app/assets/javascripts/angular/controllers/dashboard_controller.coffee.erb index 139b8dc..bc16f1a 100644 --- a/app/assets/javascripts/angular/controllers/dashboard_controller.coffee.erb +++ b/app/assets/javascripts/angular/controllers/dashboard_controller.coffee.erb @@ -22,7 +22,7 @@ class DashboardController extends @NGController { heading: 'Profil' route: 'dashboard.profile.personal' - routeActive: 'dashboard.profile' + isActive: @state.includes.bind(@state, 'dashboard.profile') banner: "<%= asset_path('dashboard-banners/profil.jpg') %>" } { @@ -33,13 +33,13 @@ class DashboardController extends @NGController { heading: 'Mes réservations' route: 'dashboard.reservations.current' - routeActive: 'dashboard.reservations' + isActive: @state.includes.bind(@state, 'dashboard.reservations') banner: "<%= asset_path('dashboard-banners/mes-reservations.jpg') %>" } { heading: 'Compte' route: 'dashboard.account.payment' - routeActive: 'dashboard.account' + isActive: @state.includes.bind(@state, 'dashboard.account') banner: "<%= asset_path('dashboard-banners/compte.jpg') %>" } ] diff --git a/app/assets/javascripts/angular/controllers/profile.controller.coffee b/app/assets/javascripts/angular/controllers/profile.controller.coffee index 84a9f6b..b35fbb9 100644 --- a/app/assets/javascripts/angular/controllers/profile.controller.coffee +++ b/app/assets/javascripts/angular/controllers/profile.controller.coffee @@ -9,11 +9,6 @@ class ProfileController extends @NGController '$state' ] - tabs2: [ - { heading: 'Profil', route: 'dashboard.profile.personal' } - { heading: 'Commentaires', route: 'dashboard.profile.reviews.received', routeActive: 'dashboard.profile.reviews' } - ] - tabsReviews: [ { heading: 'Reçus', route: 'dashboard.profile.reviews.received' } { heading: 'Envoyés', route: 'dashboard.profile.reviews.sent' } @@ -23,6 +18,17 @@ class ProfileController extends @NGController map: null init: => + @scope.tabs2 = [ + { + heading: 'Profil' + route: 'dashboard.profile.personal' + } + { + heading: 'Commentaires' + route: 'dashboard.profile.reviews.received' + isActive: @state.includes.bind(@state, 'dashboard.profile.reviews') + } + ] @User .get(1) .then (user)=> diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index e9f6a47..9f59d39 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -32,7 +32,7 @@ //= require angular-bootstrap/ui-bootstrap-tpls.min //= require angular-devise/lib/devise-min //= require ng-focus-if/focusIf.min -//= require angular-ui-router-tabs/src/ui-router-tabs +//= require angular-ui-router-tabs //= require angular-bootstrap-datetimepicker/src/js/datetimepicker //= require angular-bootstrap-datetimepicker/src/js/datetimepicker.templates //= require angular-animate/angular-animate.min diff --git a/vendor/assets/bower_components/angular-ui-router-tabs/.bower.json b/vendor/assets/bower_components/angular-ui-router-tabs/.bower.json deleted file mode 100644 index 993ce30..0000000 --- a/vendor/assets/bower_components/angular-ui-router-tabs/.bower.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "angular-ui-router-tabs", - "version": "1.8.0", - "license": "MIT", - "main": "src/ui-router-tabs.js", - "keywords": [ - "angular, tabs, ui-router, bootstrap" - ], - "ignore": [ - "**/.*", - "*.yml", - ".jshintrc", - "src/*.spec.js", - "node_modules", - "bower_components", - "example", - "Gruntfile.js", - "package.json", - "component.json", - "bower.json", - "karma.conf.js" - ], - "dependencies": { - "angular": "^1.3.15", - "angular-bootstrap": "^0.14.0", - "angular-ui-router": "^0.2.14" - }, - "devDependencies": { - "angular-mocks": "^1.3.15", - "es5-shim": "^4.5.7", - "sinon": "1.9.0", - "jasmine-sinon": "0.3.1", - "underscore": "~1.7.0", - "jquery": "~2.1.1", - "bootstrap": "~3.2.0" - }, - "homepage": "https://github.com/rpocklin/ui-router-tabs", - "_release": "1.8.0", - "_resolution": { - "type": "version", - "tag": "v1.8.0", - "commit": "231eef3b3a2bb674810b90943d221e1ec9f123e3" - }, - "_source": "https://github.com/rpocklin/ui-router-tabs.git", - "_target": "*", - "_originalSource": "angular-ui-router-tabs" -} \ No newline at end of file diff --git a/vendor/assets/bower_components/angular-ui-router-tabs/LICENSE b/vendor/assets/bower_components/angular-ui-router-tabs/LICENSE deleted file mode 100644 index b43ce84..0000000 --- a/vendor/assets/bower_components/angular-ui-router-tabs/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2015 Robert Pocklington -http://github.com/rpocklin/ui-router-tabs - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/assets/bower_components/angular-ui-router-tabs/README.md b/vendor/assets/bower_components/angular-ui-router-tabs/README.md deleted file mode 100644 index ee09513..0000000 --- a/vendor/assets/bower_components/angular-ui-router-tabs/README.md +++ /dev/null @@ -1,125 +0,0 @@ -# UI Router Tabs - -Leverages [UI Bootstrap](http://angular-ui.github.io/bootstrap/) and [UI Router](https://github.com/angular-ui/ui-router) to give you full-strength route-driven tabs in Angular.js. - -[![Build Status](https://secure.travis-ci.org/rpocklin/ui-router-tabs.svg)](http:/travis-ci.org/rpocklin/ui-router-tabs) -[![Coverage Status](https://coveralls.io/repos/rpocklin/ui-router-tabs/badge.svg)](https://coveralls.io/r/rpocklin/ui-router-tabs) -    -[![Gratipay](https://img.shields.io/gratipay/rpocklin.svg)](https://gratipay.com/rpocklin/) - - -## Example / Demo -[Link](http://rpocklin.github.io/ui-router-tabs/example/index.html) - -## How to Install / Usage - -1. Install the plugin into your Angular.js project, manually or via `bower install angular-ui-router-tabs` -1. Add `ui.router.tabs` as a new module dependency in your angular app. - -1. Define your routes in a hierarchy that makes sense for a tabbed layout, Eg: - ```javascript - $stateProvider.state('user', { - url: '', - controller: 'UserCtrl', - templateUrl: 'example.html' - }).state('user.settings', { - url: '/user/settings', - templateUrl: 'user/settings.html' - }).state('user.accounts', { - url: '/user/accounts', - templateUrl: 'user/accounts.html' - }); - ``` - -1. Define your `tabData` (or similiar variable) in the root view controller of your tabs (ie. `UserCtrl` in the case above) Eg: - ```javascript - $scope.tabData = [ - { - heading: 'Settings', - route: 'user.settings' - }, - { - heading: 'Accounts', - route: 'user.accounts', - disable: true - } - ]; - ``` - - NOTE: You can also specify `params` and `options` to pass special parameters or options for the target route to UI Router, Eg: - ```javascript - { - heading: 'Accounts', - route: 'user.accounts', - params: { - accountId: account.id - }, - options: {} - } - ``` - -1. Declare the following in your the parent HTML view template ``. - - Optional attributes for the `` (which are passed on to the UI Bootstrap component) are: - - * `type: [ 'tabs' | 'pills' ]` - * `vertical: boolean` - * `justified: boolean` - * `class: string` - * `templateUrl: