# HG changeset patch # User ymh # Date 1484675845 -3600 # Node ID 0161e028afb7ec2d673050518dba76ee23f387f1 # Parent 514dc9b6f875ef634357e28289d5909b892f55bf Correct bug on display of notices on permalinks. Correct bug #0025750 diff -r 514dc9b6f875 -r 0161e028afb7 cms/app-client/app/models/document.js --- a/cms/app-client/app/models/document.js Tue Jan 17 13:30:54 2017 +0100 +++ b/cms/app-client/app/models/document.js Tue Jan 17 18:57:25 2017 +0100 @@ -34,18 +34,18 @@ }), media: Ember.computed('mediaArray', function() { - var array = []; + var arrayMedia = []; var master = null; _.forEach(this.get('mediaArray'), function(media) { - var index = array.findIndex(element => element.format === media.format); + var index = arrayMedia.findIndex(element => element.format === media.format); if(media.master) { master = media; } if(index === -1 && !media.master) { - array.push(media); + arrayMedia.push(media); } }); - array.sort((m1, m2) => { + arrayMedia.sort((m1, m2) => { const f1 = m1.format; const f2 = m2.format; @@ -54,17 +54,17 @@ return w1-w2; }); - if(array.length === 0 && master) { - array.push(master); + if(arrayMedia.length === 0 && master) { + arrayMedia.push(master); } - return array; + return arrayMedia; }), video: Ember.computed('media', function() { return this.get('media').findIndex(element => element.format.match(new RegExp('^video/'))) > -1; }), - duration: Ember.computed('duration_ms', function() { + duration: Ember.computed( 'duration_ms', function() { return this.get('duration_ms')/1000; }), diff -r 514dc9b6f875 -r 0161e028afb7 cms/app-client/app/templates/components/notice-component.hbs --- a/cms/app-client/app/templates/components/notice-component.hbs Tue Jan 17 13:30:54 2017 +0100 +++ b/cms/app-client/app/templates/components/notice-component.hbs Tue Jan 17 18:57:25 2017 +0100 @@ -1,5 +1,5 @@

{{ item.title }}

-
permalien
+
{{#if item.id }}permalien{{/if}}
Editeur{{#if (if-operator item.publishers.length '>' 1)}}s{{/if}}