cms/app-client/app/components/notice-component.js
changeset 270 6ddc52965fb8
parent 228 a2497a2b6224
child 271 e234339fe8df
equal deleted inserted replaced
269:9659e91242e1 270:6ddc52965fb8
    13     participants: Ember.computed('item.contributors', function() {
    13     participants: Ember.computed('item.contributors', function() {
    14         var participants = [];
    14         var participants = [];
    15         if(this.get('item')) {
    15         if(this.get('item')) {
    16             this.get('item').get('contributors').forEach(function(contributor) {
    16             this.get('item').get('contributors').forEach(function(contributor) {
    17                 if(contributor.name) {
    17                 if(contributor.name) {
    18                     participants.push({ name: contributor.name, role: contributor.role.split('/').pop() });
    18                     var participant = participants.find(participant => participant.name === contributor.name);
       
    19                     if(participant) {
       
    20                         participant['role'].push(contributor.role.split('/').pop())
       
    21                     } else {
       
    22                         participants.push({ name: contributor.name, role: [ contributor.role.split('/').pop() ] });
       
    23                     }    
    19                 }
    24                 }
    20             });
    25             });
    21         }
    26         }
    22         return participants;
    27         return participants;
       
    28     }),
       
    29 
       
    30     subjects: Ember.computed('item.subjects', function() {
       
    31         var subjects = [];
       
    32         if(this.get('item')) {
       
    33             this.get('subjects').forEach(function(subject) {
       
    34                 var object = {};
       
    35                 if(typeof subject === 'object') {
       
    36                     if(subject.datatype) {
       
    37                         object['url'] = subject.datatype;
       
    38                     }
       
    39                     if(subject.value) {
       
    40                         object['name'] = subject.value;
       
    41                     }
       
    42                 } else {
       
    43                     object['url'] = subject;
       
    44                 }
       
    45                 subjects.push(object);
       
    46             });
       
    47         }
       
    48         return subjects;
    23     }),
    49     }),
    24 
    50 
    25     location: Ember.computed('item.geoInfo', function() {
    51     location: Ember.computed('item.geoInfo', function() {
    26         var location = '';
    52         var location = '';
    27         if(this.get('item')) {
    53         if(this.get('item')) {