author | nowmad@23.1.168.192.in-addr.arpa |
Thu, 21 Jan 2016 21:07:02 +0100 | |
changeset 94 | 62984937a062 |
parent 91 | acfeddc7821d |
child 121 | 08c99d286e7c |
permissions | -rw-r--r-- |
91 | 1 |
import DS from 'ember-data'; |
2 |
import Ember from 'ember'; |
|
94
62984937a062
- add params when modal appear so we can come back right on this document modal
nowmad@23.1.168.192.in-addr.arpa
parents:
91
diff
changeset
|
3 |
import _ from 'lodash/lodash'; |
91 | 4 |
|
5 |
var Document = DS.Model.extend({ |
|
6 |
// id: DS.attr('string'), |
|
7 |
uri: DS.attr('string'), |
|
8 |
title: DS.attr('string'), |
|
9 |
language: DS.attr('string'), |
|
10 |
publishers: DS.attr({defaultValue: []}), |
|
11 |
contributors: DS.attr({defaultValue: []}), |
|
12 |
mediaArray: DS.attr({defaultValue: []}), |
|
13 |
mediaList: Ember.computed('mediaArray', function() { |
|
14 |
var res = []; |
|
15 |
var mp3 = null; |
|
94
62984937a062
- add params when modal appear so we can come back right on this document modal
nowmad@23.1.168.192.in-addr.arpa
parents:
91
diff
changeset
|
16 |
_.forEach(this.get('mediaArray'), function(m) { |
91 | 17 |
if(m.format === 'audio/mpeg') { |
18 |
mp3 = m; |
|
19 |
} else if (m.format.startsWith('audio/')) { |
|
20 |
res.push(m); |
|
21 |
} |
|
22 |
}); |
|
23 |
if(mp3) { |
|
24 |
res.unshift(mp3); |
|
25 |
} |
|
26 |
return res; |
|
27 |
}) |
|
28 |
}); |
|
29 |
||
30 |
Document.reopenClass({ |
|
31 |
FIXTURES: [ |
|
32 |
{ |
|
33 |
"id": "crdo-09-CAYCHAX_SOUND", |
|
34 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-09-CAYCHAX_SOUND", |
|
35 |
"title": "ALLOc : Caychax : Parabole", |
|
36 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
37 |
"modified": "2010-10-25T18:16:38+02:00", |
|
38 |
"publishers": [ ], |
|
39 |
"contributors": [ ], |
|
40 |
"mediaArray": [ ] |
|
41 |
}, |
|
42 |
{ |
|
43 |
"id": "crdo-09-DUN_SOUND", |
|
44 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-09-DUN_SOUND", |
|
45 |
"title": "ALLOc : Dun : Parabole", |
|
46 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
47 |
"modified": "2010-10-25T18:18:23+02:00", |
|
48 |
"publishers": [ ], |
|
49 |
"contributors": [ ], |
|
50 |
"mediaArray": [ ] |
|
51 |
}, |
|
52 |
{ |
|
53 |
"id": "crdo-09-LABASTIDE-DE-LORDAT_SOUND", |
|
54 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-09-LABASTIDE-DE-LORDAT_SOUND", |
|
55 |
"title": "ALLOc : La Bastide-de-Lordat : Parabole", |
|
56 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
57 |
"modified": "2010-10-25T18:20:08+02:00", |
|
58 |
"publishers": [ ], |
|
59 |
"contributors": [ ], |
|
60 |
"mediaArray": [ ] |
|
61 |
}, |
|
62 |
{ |
|
63 |
"id": "crdo-09-LOUBENS_SOUND", |
|
64 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-09-LOUBENS_SOUND", |
|
65 |
"title": "ALLOc : Loubens : Parabole", |
|
66 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
67 |
"modified": "2010-10-25T18:21:23+02:00", |
|
68 |
"publishers": [ ], |
|
69 |
"contributors": [ ], |
|
70 |
"mediaArray": [ ] |
|
71 |
}, |
|
72 |
{ |
|
73 |
"id": "crdo-09-MERENS-LES-VALS_SOUND", |
|
74 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-09-MERENS-LES-VALS_SOUND", |
|
75 |
"title": "ALLOc : Mérens-les-Vals : Parabole", |
|
76 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
77 |
"modified": "2010-10-25T18:22:24+02:00", |
|
78 |
"publishers": [ ], |
|
79 |
"contributors": [ ], |
|
80 |
"mediaArray": [ ] |
|
81 |
}, |
|
82 |
{ |
|
83 |
"id": "crdo-09-MONTSEGUR_SOUND", |
|
84 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-09-MONTSEGUR_SOUND", |
|
85 |
"title": "ALLOc : Montségur : Parabole", |
|
86 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
87 |
"modified": "2010-10-25T18:23:14+02:00", |
|
88 |
"publishers": [ ], |
|
89 |
"contributors": [ ], |
|
90 |
"mediaArray": [ ] |
|
91 |
}, |
|
92 |
{ |
|
93 |
"id": "crdo-09-PRAYOLS_SOUND", |
|
94 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-09-PRAYOLS_SOUND", |
|
95 |
"title": "ALLOc : Prayols : Parabole", |
|
96 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
97 |
"modified": "2010-10-25T18:24:06+02:00", |
|
98 |
"publishers": [ ], |
|
99 |
"contributors": [ ], |
|
100 |
"mediaArray": [ ] |
|
101 |
}, |
|
102 |
{ |
|
103 |
"id": "crdo-09-QUERIGUT_SOUND", |
|
104 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-09-QUERIGUT_SOUND", |
|
105 |
"title": "ALLOc : Quérigut : Parabole", |
|
106 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
107 |
"modified": "2010-10-25T18:24:56+02:00", |
|
108 |
"publishers": [ ], |
|
109 |
"contributors": [ ], |
|
110 |
"mediaArray": [ ] |
|
111 |
}, |
|
112 |
{ |
|
113 |
"id": "crdo-09-SIGUER_SOUND", |
|
114 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-09-SIGUER_SOUND", |
|
115 |
"title": "ALLOc : Siguer : Parabole", |
|
116 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
117 |
"modified": "2010-10-25T18:25:51+02:00", |
|
118 |
"publishers": [ ], |
|
119 |
"contributors": [ ], |
|
120 |
"mediaArray": [ ] |
|
121 |
}, |
|
122 |
{ |
|
123 |
"id": "crdo-09-ST-MARTIN-D-OYDES_SOUND", |
|
124 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-09-ST-MARTIN-D-OYDES_SOUND", |
|
125 |
"title": "ALLOc : Saint-Martin-d'Oydes : Parabole", |
|
126 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
127 |
"modified": "2010-10-25T18:26:22+02:00", |
|
128 |
"publishers": [ ], |
|
129 |
"contributors": [ ], |
|
130 |
"mediaArray": [ ] |
|
131 |
}, |
|
132 |
{ |
|
133 |
"id": "crdo-09-SURBA_SOUND", |
|
134 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-09-SURBA_SOUND", |
|
135 |
"title": "ALLOc : Surba : Parabole", |
|
136 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
137 |
"modified": "2010-10-25T18:26:42+02:00", |
|
138 |
"publishers": [ ], |
|
139 |
"contributors": [ ], |
|
140 |
"mediaArray": [ ] |
|
141 |
}, |
|
142 |
{ |
|
143 |
"id": "crdo-11-GRAMAZIE_SOUND", |
|
144 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-11-GRAMAZIE_SOUND", |
|
145 |
"title": "ALLOc : Gramazie : Parabole", |
|
146 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
147 |
"modified": "2010-10-25T18:27:39+02:00", |
|
148 |
"publishers": [ ], |
|
149 |
"contributors": [ ], |
|
150 |
"mediaArray": [ ] |
|
151 |
}, |
|
152 |
{ |
|
153 |
"id": "crdo-11-MOLLEVILLE_SOUND", |
|
154 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-11-MOLLEVILLE_SOUND", |
|
155 |
"title": "ALLOc : Molleville : Parabole", |
|
156 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
157 |
"modified": "2010-10-25T18:28:06+02:00", |
|
158 |
"publishers": [ ], |
|
159 |
"contributors": [ ], |
|
160 |
"mediaArray": [ ] |
|
161 |
}, |
|
162 |
{ |
|
163 |
"id": "crdo-11-PUIVERT_SOUND", |
|
164 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-11-PUIVERT_SOUND", |
|
165 |
"title": "ALLOc : Puivert : Parabole", |
|
166 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
167 |
"modified": "2010-10-25T18:28:40+02:00", |
|
168 |
"publishers": [ ], |
|
169 |
"contributors": [ ], |
|
170 |
"mediaArray": [ ] |
|
171 |
}, |
|
172 |
{ |
|
173 |
"id": "crdo-11-RIBOUISSE_SOUND", |
|
174 |
"uri": "http://purl.org/poi/corpusdelaparole.huma-num.fr/crdo-11-RIBOUISSE_SOUND", |
|
175 |
"title": "ALLOc : Ribouisse : Parabole", |
|
176 |
"language": "http://lexvo.org/id/iso639-3/oci", |
|
177 |
"modified": "2010-10-25T18:29:32+02:00", |
|
178 |
"publishers": [ ], |
|
179 |
"contributors": [ ], |
|
180 |
"mediaArray": [ ] |
|
181 |
} |
|
182 |
] |
|
183 |
}); |
|
184 |
||
185 |
export default Document; |