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: `
-
- NOTE: If you use a customer template, you may need to define a `ui-view` placeholder for the child content panes in the same HTML view template eg. ``.
-
-## Tips
-
-* UI Bootstrap Tabs will not select a tab by default. If you want it to, specify the target sub-route when you
- show the tabs (ie. link the `ui-view` containing the tabs with the default (first) element as the sub-route `example/#/user/settings` in the example.)
-* You can override the default directive template by specifying `template-url="my_template.html"` on the `` element.
-* You can enable / disable tabs by specifying `disable: true` in the `tabData` (can be dynamically set).
-* You can use `` in a custom directive template to add any HTML into the tab title.
-* You can update the `tabData` variable dynamically, if you want to.
-* You can move the `` tag around to wherever you want the tab listing to appear. (left-positioned is the best spot to enable responsive design.).
-
-
-## Running Locally
-
-1. Checkout git repository locally: `git clone git@github.com:rpocklin/ui-router-tabs.git`
-1. `npm install`
-1. `bower install`
-1. `grunt serve`
-1. View `http://localhost:9000/example/` in your browser to see the example.
-
-
-## Contributing
-
-1. Fork it
-2. Create your feature branch (`git checkout -b my-new-feature`)
-3. Commit your changes (`git commit -am 'Added some feature'`) - please consider adding tests!
-4. Push to the branch (`git push origin my-new-feature`)
-5. Run `grunt` and ensure there are no errors.
-6. Create a new Pull Request
-
-
-## History
-* 1.8.0 Added inline template by default (as requested) and allowed customer classes parameter.
-* 1.7.0 Added `uib` prefix for UI Bootstrap elements (as per v0.14.0). See [#47](/../../pull/47).
-* 1.6.0 Renamed `disabled` attribute to `disable` in line with UI Bootstrap ``. See [#39](/../../issues/39).
-* 1.5.1 Removed `bower_components` from repository. See [#40](/../../pull/40).
-* 1.5.0 Bumped `angular-bootstrap` dependency to v0.13.0 (fixes default tab being auto-selected).
-* 1.4.3 Added handling of `$stateChangeCancel`, `$stateChangeError` and `$stateNotFound` to reset active tab.
-* 1.4.2 Added feature to update tabs if state change event is cancelled. See [#19](/../../pull/19).
-* 1.4.1 Bumped angular-bootstrap dependency to v0.12.1.
-* 1.4.0 Removed default `$state.go(..)` route option, added `disabled` option and updated jsbeautifier. See [#16](/../../pull/16).
-* 1.3.0 Improved state equality checking to include params and options.
-* 1.2.0 Prevented reload of current state again. See [#11](/../../pull/11).
-* 1.1.4 Added support for `strict-di` mode.
-* 1.1.3 Fixed tab switching when using `ngTouch`. See [#2](/../../issues/2).
-* 1.1.2 Added `$stateChangeSuccess` watcher to update parent tab(s) when using
`ui-sref` or `$state.go()`. See [#1](/../../issues/1).
-* 1.1.0 Added nested tab support (tabs within tabs)
-* 1.0.0 Initial release
-
-## License
-
-Released under the MIT License. See the [LICENSE][license] file for further details.
-
-[license]: https://github.com/rpocklin/ui-router-tabs/blob/master/LICENSE
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 98fe3f2..0000000
--- a/vendor/assets/bower_components/angular-ui-router-tabs/bower.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "name": "angular-ui-router-tabs",
- "version": "1.7.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"
- }
-}
diff --git a/vendor/assets/bower_components/angular-ui-router-tabs/src/ui-router-tabs.js b/vendor/assets/javascripts/angular-ui-router-tabs.js
similarity index 96%
rename from vendor/assets/bower_components/angular-ui-router-tabs/src/ui-router-tabs.js
rename to vendor/assets/javascripts/angular-ui-router-tabs.js
index 5aebde7..16d5db0 100644
--- a/vendor/assets/bower_components/angular-ui-router-tabs/src/ui-router-tabs.js
+++ b/vendor/assets/javascripts/angular-ui-router-tabs.js
@@ -78,6 +78,9 @@ angular.module('ui.router.tabs').directive(
/* whether to highlight given route as part of the current state */
$scope.active = function(tab) {
+ if (typeof tab.isActive === 'function') {
+ return tab.isActive();
+ }
var isAncestorOfCurrentRoute = $state.includes(tab.route, tab.params, tab.options);
return isAncestorOfCurrentRoute;
@@ -94,14 +97,14 @@ angular.module('ui.router.tabs').directive(
};
$scope.update_tabs();
- }],
+ }],
templateUrl: function(element, attributes) {
return attributes.templateUrl || 'ui-router-tabs-default-template.html';
}
};
-}]
+ }]
).run(
-['$templateCache', function($templateCache) {
+ ['$templateCache', function($templateCache) {
var CUSTOM_UI_VIEW_TEMPLATE = '' +
'' +
'