# HG changeset patch # User Chloe Laisne # Date 1470415919 -7200 # Node ID 0be9770b09b415f08301ded7a639a2602b5447ae # Parent ba4fd614582adf8141b2a5e666abb016202bd7d5 Hide/show transcript button in the player - Do not request transscript when property is null in the document request diff -r ba4fd614582a -r 0be9770b09b4 cms/app-client/app/controllers/application.js --- a/cms/app-client/app/controllers/application.js Fri Aug 05 15:06:06 2016 +0200 +++ b/cms/app-client/app/controllers/application.js Fri Aug 05 18:51:59 2016 +0200 @@ -91,9 +91,13 @@ var self = this; this.store.findRecord('document', this.get('player').get('item'), { reload: true }).then(function(model){ self.get('player').set('model', model); - }); - this.store.findRecord('transcript', encodeURIComponent('11280.100/crdo-09-CAYCHAX_SOUND')).then(function(model) { - self.get('player').set('transcript', model); + if (self.get('player').get('model').get('transcript')) { + self.store.findRecord('transcript', encodeURIComponent(self.get('player').get('item'))).then(function(model) { + self.get('player').set('transcript', model); + }); + } else { + self.get('player').set('transcript', null); + } }); }), diff -r ba4fd614582a -r 0be9770b09b4 cms/app-client/app/models/document.js --- a/cms/app-client/app/models/document.js Fri Aug 05 15:06:06 2016 +0200 +++ b/cms/app-client/app/models/document.js Fri Aug 05 18:51:59 2016 +0200 @@ -9,6 +9,7 @@ title: DS.attr('string'), language: DS.attr('string'), publisher: DS.attr('string'), + transcript: DS.attr({ defaultValue: function() { return {}; } }), publishers: DS.attr({ defaultValue: function() { return []; } }), contributors: DS.attr({ defaultValue: function() { return []; } }), diff -r ba4fd614582a -r 0be9770b09b4 cms/app-client/app/services/player.js --- a/cms/app-client/app/services/player.js Fri Aug 05 15:06:06 2016 +0200 +++ b/cms/app-client/app/services/player.js Fri Aug 05 18:51:59 2016 +0200 @@ -5,6 +5,7 @@ items: [], item: null, model: null, + transcript: null, window: '', playing: false, diff -r ba4fd614582a -r 0be9770b09b4 cms/app-client/app/styles/components/player-component.scss --- a/cms/app-client/app/styles/components/player-component.scss Fri Aug 05 15:06:06 2016 +0200 +++ b/cms/app-client/app/styles/components/player-component.scss Fri Aug 05 18:51:59 2016 +0200 @@ -90,7 +90,7 @@ } .player-component #audio .progress .bar { - width: 226px; + width: 303px; height: 3px; background-color: $light-white; margin: -1px 60px 0 60px; @@ -100,6 +100,10 @@ cursor: pointer; } +.player-component #audio.extra .progress .bar { + width: 226px; +} + .player-component #audio .progress .bar .value { width: 0%; height: 100%; @@ -120,6 +124,10 @@ } .player-component #audio .meta p:first-child { + margin-left: 0px; +} + +.player-component #audio.extra .meta p:first-child { margin-left: 59px; } diff -r ba4fd614582a -r 0be9770b09b4 cms/app-client/app/styles/components/playlist-component.scss --- a/cms/app-client/app/styles/components/playlist-component.scss Fri Aug 05 15:06:06 2016 +0200 +++ b/cms/app-client/app/styles/components/playlist-component.scss Fri Aug 05 18:51:59 2016 +0200 @@ -54,6 +54,7 @@ border: 1px solid $dark-grey; cursor: pointer; color: inherit; + pointer-events: all; } .playlist-component ul li.playing .tools button, diff -r ba4fd614582a -r 0be9770b09b4 cms/app-client/app/templates/components/player-component.hbs --- a/cms/app-client/app/templates/components/player-component.hbs Fri Aug 05 15:06:06 2016 +0200 +++ b/cms/app-client/app/templates/components/player-component.hbs Fri Aug 05 18:51:59 2016 +0200 @@ -1,4 +1,4 @@ -
+
Backward {{#if player.playing}} @@ -14,9 +14,9 @@ - {{to-minutes remaining}}
- - Transcript - + {{#if player.transcript}} + Transcript + {{/if}}

diff -r ba4fd614582a -r 0be9770b09b4 cms/app-client/app/templates/components/toolbar-component.hbs --- a/cms/app-client/app/templates/components/toolbar-component.hbs Fri Aug 05 15:06:06 2016 +0200 +++ b/cms/app-client/app/templates/components/toolbar-component.hbs Fri Aug 05 18:51:59 2016 +0200 @@ -1,5 +1,9 @@

  • Notice
  • +{{#if player.transcript}}
  • Transcript
  • - {{#if player.model.video}}
  • Video
  • {{/if}} +{{/if}} +{{#if player.model.video}} +
  • Video
  • +{{/if}}
\ No newline at end of file