# HG changeset patch # User Chloe Laisne # Date 1466694572 -7200 # Node ID a441c40f9c5e526cbceec9013c5e37082d1b71cf # Parent b7c691c6179d4ca7bf043365c812382d95b19dec Fix playlist filtering Minor design changes diff -r b7c691c6179d -r a441c40f9c5e cms/app-client/app/components/playlist-component.js --- a/cms/app-client/app/components/playlist-component.js Thu Jun 23 11:35:26 2016 +0200 +++ b/cms/app-client/app/components/playlist-component.js Thu Jun 23 17:09:32 2016 +0200 @@ -2,6 +2,39 @@ export default Ember.Component.extend({ - classNames: ['playlist-component'] + classNames: ['playlist-component'], + + filter: Ember.inject.service(), + + documents: Ember.computed('model', 'filter.location', 'filter.language', 'filter.discourse', 'filter.date', 'filter.theme', function() { + var documents = this.get('model'); + if (this.get('filter.date').length > 0) { + var copy = documents; + documents.map(function(document) { + if (this.get('filter.date').indexOf(document.get('created')) === -1){ + copy = copy.without(document); + } + }); + documents = copy; + } + if (this.get('filter.discourse')) { + documents = documents.filterBy('type', this.get('filter.discourse')); + } + if (this.get('filter.language')) { + documents = documents.filterBy('language', this.get('filter.language')); + } + if (this.get('filter.location')) { + documents = documents.filterBy('spatial', this.get('filter.location')); + } + if (this.get('filter.theme')) { + documents = documents.filterBy('thematique', this.get('filter.theme')); + } + return documents; + }), + + didRender: function() { + this._super(...arguments); + this.$().find('ul').height(Ember.$('.corpus-app-wrapper').outerHeight() - (Ember.$('.filter-component').outerHeight() + this.$().find('h2').outerHeight())); + } }); diff -r b7c691c6179d -r a441c40f9c5e cms/app-client/app/components/visu-carto.js --- a/cms/app-client/app/components/visu-carto.js Thu Jun 23 11:35:26 2016 +0200 +++ b/cms/app-client/app/components/visu-carto.js Thu Jun 23 17:09:32 2016 +0200 @@ -8,6 +8,8 @@ didInsertElement: function(){ var _this = this; + this.$('#mapdiv').height(Ember.$('.corpus-app-container').height()); + var franceDataProvider = { mapVar: AmCharts.maps.france2016Low, getAreasFromMap:true, diff -r b7c691c6179d -r a441c40f9c5e cms/app-client/app/controllers/application.js --- a/cms/app-client/app/controllers/application.js Thu Jun 23 11:35:26 2016 +0200 +++ b/cms/app-client/app/controllers/application.js Thu Jun 23 17:09:32 2016 +0200 @@ -56,39 +56,6 @@ return this.store.findRecord('document', this.get('detail')); }), - filteredDocuments: Ember.computed('filter.location', 'filter.langue', 'filter.discours', 'filter.date', 'filter.thematique', 'model', function() { - var location = this.get('location'); - var langue = this.get('langue'); - var discours = this.get('discours'); - var date = this.get('date'); - var thematique = this.get('thematique'); - - var documents = this.get('model'); - - if (location) { - documents = documents.filterBy('spatial', location); - } - if (langue) { - documents = documents.filterBy('language', langue); - } - if (discours) { - documents = documents.filterBy('type', discours); - } - if (date.length > 0) { - var temp = documents; - documents.map(function(elt){ - if (date.indexOf(elt.get('created')) === -1){ - temp = temp.without(elt); - } - }); - documents = temp; - } - if (thematique) { - documents = documents.filterBy('thematique', thematique); - } - return documents; - }), - actions: { deleteTag: function(key, value){ diff -r b7c691c6179d -r a441c40f9c5e cms/app-client/app/styles/app.scss --- a/cms/app-client/app/styles/app.scss Thu Jun 23 11:35:26 2016 +0200 +++ b/cms/app-client/app/styles/app.scss Thu Jun 23 17:09:32 2016 +0200 @@ -10,7 +10,7 @@ #corpus-app { border: 1px solid; width: 1108px; - height: 600px; + overflow: hidden; display: block; margin-left: auto; margin-right: auto; @@ -44,8 +44,6 @@ } .corpus-app-container { - background-color: #becfd4; - padding: 0 20px; color: #687a84; box-sizing: border-box; } @@ -54,8 +52,23 @@ padding: 20px; } +body.tabs-thematiques .corpus-app-container { + padding: 0px 20px; +} + +body.tabs-langues .corpus-app-container { + padding: 0px; +} + +body.tabs-carto .corpus-app-container, +body.tabs-chrono .corpus-app-container, +body.tabs-thematiques .corpus-app-container { + background-color: #becfd4; +} + .corpus-app-wrapper { background-color: #253946; + box-shadow: -4px 0px 8px -4px #59626b; } .corpus-app-container, diff -r b7c691c6179d -r a441c40f9c5e cms/app-client/app/styles/components/playlist-component.scss --- a/cms/app-client/app/styles/components/playlist-component.scss Thu Jun 23 11:35:26 2016 +0200 +++ b/cms/app-client/app/styles/components/playlist-component.scss Thu Jun 23 17:09:32 2016 +0200 @@ -14,6 +14,7 @@ margin: 0; padding: 0; font-size: 0px; + overflow-y: scroll; } .playlist-component ul li { diff -r b7c691c6179d -r a441c40f9c5e cms/app-client/app/styles/tabs/carto.scss --- a/cms/app-client/app/styles/tabs/carto.scss Thu Jun 23 11:35:26 2016 +0200 +++ b/cms/app-client/app/styles/tabs/carto.scss Thu Jun 23 17:09:32 2016 +0200 @@ -1,4 +1,3 @@ #mapdiv{ width: 100%; - height: 600px; } diff -r b7c691c6179d -r a441c40f9c5e cms/app-client/app/styles/tabs/langues.scss --- a/cms/app-client/app/styles/tabs/langues.scss Thu Jun 23 11:35:26 2016 +0200 +++ b/cms/app-client/app/styles/tabs/langues.scss Thu Jun 23 17:09:32 2016 +0200 @@ -22,11 +22,7 @@ } .grandparent rect { - fill: green; -} - -.grandparent:hover rect { - fill: lightgreen; + fill: #becfd4; } .children rect.parent, diff -r b7c691c6179d -r a441c40f9c5e cms/app-client/app/templates/application.hbs --- a/cms/app-client/app/templates/application.hbs Thu Jun 23 11:35:26 2016 +0200 +++ b/cms/app-client/app/templates/application.hbs Thu Jun 23 17:09:32 2016 +0200 @@ -19,7 +19,7 @@ {{filter-component}} - {{playlist-component filteredDocuments=filteredDocuments}} + {{playlist-component model=model}} diff -r b7c691c6179d -r a441c40f9c5e cms/app-client/app/templates/components/playlist-component.hbs --- a/cms/app-client/app/templates/components/playlist-component.hbs Thu Jun 23 11:35:26 2016 +0200 +++ b/cms/app-client/app/templates/components/playlist-component.hbs Thu Jun 23 17:09:32 2016 +0200 @@ -1,13 +1,13 @@

Résultats

\ No newline at end of file