# HG changeset patch # User Chloe Laisne # Date 1466674526 -7200 # Node ID b7c691c6179d4ca7bf043365c812382d95b19dec # Parent 541e26eb356f98f2e3b334853d9a6876174f333d Set location filter label Fix query parameters when navigating through tabs diff -r 541e26eb356f -r b7c691c6179d cms/app-client/app/index.html --- a/cms/app-client/app/index.html Thu Jun 23 10:41:57 2016 +0200 +++ b/cms/app-client/app/index.html Thu Jun 23 11:35:26 2016 +0200 @@ -33,7 +33,6 @@
- diff -r 541e26eb356f -r b7c691c6179d cms/app-client/app/router.js --- a/cms/app-client/app/router.js Thu Jun 23 10:41:57 2016 +0200 +++ b/cms/app-client/app/router.js Thu Jun 23 11:35:26 2016 +0200 @@ -14,9 +14,4 @@ this.route('tabs/chrono', { path: '/chronologie' }); }); -Router.reopen({ - onUrlChange: function() { - }.observes('currentPath') -}); - export default Router; diff -r 541e26eb356f -r b7c691c6179d cms/app-client/app/routes/application.js --- a/cms/app-client/app/routes/application.js Thu Jun 23 10:41:57 2016 +0200 +++ b/cms/app-client/app/routes/application.js Thu Jun 23 11:35:26 2016 +0200 @@ -27,16 +27,23 @@ actions: { willTransition: function() { - var _this = this; - var queryParams = {}; - this.controller.get('queryParams').map(function(elt){ - queryParams[elt] = _this.controller.get(elt); + // Prevent navigation from removing query parameters + var _this = this, + queryParams = {}; + this.controller.get('queryParams').map(function(parameter){ + if(typeof parameter === 'object') { + Object.keys(parameter).forEach(function(value, key, array) { + queryParams[value] = _this.controller.get(value); + }); + } else { + queryParams[parameter] = _this.controller.get(parameter); + } }); this.transitionTo({ queryParams: queryParams }); }, didTransition: function() { - this._super(...arguments); + // Append body classname depending on the route Ember.$('body').removeClass((this.controller.get('currentPath') || '').replace(/\//g, '-').dasherize()); Ember.run.once(this, function() { Ember.$('body').addClass((this.controller.get('currentPath') ||'').replace(/\//g, '-').dasherize()); diff -r 541e26eb356f -r b7c691c6179d cms/app-client/app/styles/components/filter-component.scss --- a/cms/app-client/app/styles/components/filter-component.scss Thu Jun 23 10:41:57 2016 +0200 +++ b/cms/app-client/app/styles/components/filter-component.scss Thu Jun 23 11:35:26 2016 +0200 @@ -30,4 +30,20 @@ .filter-component ul li span { padding-left: 10px; +} + +.filter-component ul li .label { + margin: 0; + padding: 0; +} + +.filter-component ul li .label, +.filter-component ul li .label a { + display: inline-block; +} + +.filter-component ul li .label a { + text-decoration: none; + text-transform: capitalize; + color: inherit; } \ No newline at end of file diff -r 541e26eb356f -r b7c691c6179d cms/app-client/app/templates/components/filter-component.hbs --- a/cms/app-client/app/templates/components/filter-component.hbs Thu Jun 23 10:41:57 2016 +0200 +++ b/cms/app-client/app/templates/components/filter-component.hbs Thu Jun 23 11:35:26 2016 +0200 @@ -4,7 +4,7 @@
  • {{filter.location}}
  • {{/if}} {{#if filter.language}} -
  • {{filter.language}}
  • +
  • {{doc-language class="label" url=filter.language}}
  • {{/if}} {{#if filter.discourse}}
  • {{filter.discourse}}