cms/app-client/app/templates/components/transcript-component.hbs
changeset 257 eba9edbd8f46
parent 256 18f0c3ee9aa5
child 258 12c694392e8e
--- a/cms/app-client/app/templates/components/transcript-component.hbs	Thu Aug 18 17:02:02 2016 +0200
+++ b/cms/app-client/app/templates/components/transcript-component.hbs	Sun Aug 21 13:51:22 2016 +0200
@@ -1,44 +1,38 @@
 <h2>
-	{{player.transcript.title.original}}
+    {{player.transcript.title.original}}
 {{#if player.transcript.title.translation}}
-	<span>{{player.transcript.title.translation}}</span>
+    <span>{{player.transcript.title.translation}}</span>
 {{/if}}
 </h2>
 <ol class="transcript">
 {{#each player.transcript.annotations as |annotation|}}
-{{log 'each-annotation'}}
-	{{#if (if-and (if-operator player.progress '>=' annotation.start) (if-operator player.progress '<' annotation.end))}}
-	<li class="sentence active">
-		<i class="fa fa-play" {{action 'play' annotation.start}}>Play</i>
-		{{#if annotation.content}}<p class="original">{{annotation.content}}</p>{{/if}}
-		{{#if annotation.words}}
-		<div class="words">
-		{{#each annotation.words as |word|}}
-			<div class="word">
-				<p class="original">{{word.content}}</p>
-				<p class="translation">{{word.translation}}</p>
-			</div>
-		{{/each}}
-		</div>
-		{{/if}}
-		{{#if annotation.translation}}<p class="translation">{{annotation.translation}}</p>{{/if}}
-	</li>
-	{{else}}
-	<li class="sentence" {{action 'play' annotation.start}}>
-		<i class="fa fa-play">Play</i>
-		{{#if annotation.content}}<p class="original">{{annotation.content}}</p>{{/if}}
-		{{#if annotation.words}}
-		<div class="words">
-		{{#each annotation.words as |word|}}
-			<div class="word">
-				<p class="original">{{word.content}}</p>
-				<p class="translation">{{word.translation}}</p>
-			</div>
-		{{/each}}
-		</div>
-		{{/if}}
-		{{#if annotation.translation}}<p class="translation">{{annotation.translation}}</p>{{/if}}
-	</li>
-	{{/if}}
+    <li class="sentence {{if (if-and (if-operator player.progress '>=' annotation.begin) (if-operator player.progress '<' annotation.end)) 'active'}}" {{action 'play' annotation.begin}}>
+        <i class="fa fa-play" {{action 'play' annotation.begin}}>Play</i>
+        {{#if annotation.title}}<span class="title">{{annotation.title}}</span>{{/if}}
+        {{#each annotation.fragments as |fragment|}}
+        <div class="fragment">
+            
+            {{#if fragment.original}}
+            <p class="original">
+                {{#if fragment.speaker}}<span class="speaker">{{fragment.speaker}} :</span>{{/if}}
+                {{fragment.original}}
+            </p>
+            {{/if}}
+            {{#if fragment.literal}}
+            <div class="words">
+                {{#each fragment.literal as |word|}}
+                <div class="word">
+                    <p class="original">{{word.original}}</p>
+                    <p class="translation">{{word.translation}}</p>
+                </div>
+                {{/each}}
+            </div>
+            {{/if}}
+            {{#if fragment.translation}}
+            <p class="translation">{{fragment.translation}}</p>
+            {{/if}}
+        </div>
+        {{/each}}   
+    </li>
 {{/each}}
 </ol>
\ No newline at end of file