source: main/trunk/model-interfaces-dev/atea/transform/pages/asr.xsl@ 35284

Last change on this file since 35284 was 35284, checked in by davidb, 3 years ago

Convert error templating to Vue

File size: 6.6 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
7 xmlns:gslib="http://www.greenstone.org/skinning"
8 xmlns:v-bind="http://vuejs.org"
9 xmlns:v-on="http://vuejs.org"
10 extension-element-prefixes="java util"
11 exclude-result-prefixes="java util">
12
13 <!-- use the 'main' layout -->
14 <xsl:import href="layouts/main.xsl"/>
15
16 <xsl:variable name="groupPath"><xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/></xsl:variable>
17 <!-- set page title -->
18 <xsl:template name="pageTitle"><gslib:collectionName/></xsl:template>
19
20 <!-- set page breadcrumbs -->
21 <xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/>
22 <xsl:if test="$groupPath != ''">
23 <xsl:for-each select="/page/pageResponse/pathList/group">
24 <xsl:sort data-type="number" select="@position"/>
25 <a>
26 <xsl:attribute name="href"><gslib:groupHref path="{@path}"/></xsl:attribute>
27 <xsl:attribute name="title"><gslib:groupName path="{@path}"/></xsl:attribute>
28 <gslib:groupName path="{@path}"/>
29 </a>
30 <gslib:rightArrow/>
31 </xsl:for-each>
32 </xsl:if>
33 </xsl:template>
34
35 <!-- the page content -->
36 <xsl:template match="/page">
37 <xsl:call-template name="audio-transcription"/>
38 </xsl:template>
39
40 <!-- <xsl:attribute-set name="vue">
41 <xsl:attribute name="v-on" />
42 <xsl:attribute name="v-bind" />
43 </xsl:attribute-set> -->
44
45 <!-- Template for processing audio file uploads -->
46 <xsl:template name="audio-transcription">
47 <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
48 <link href="interfaces/{$interface_name}/style/asr.css" rel="stylesheet" type="text/css" />
49
50 <section id="audio-transcription-container" class="paper">
51 <!-- Used to calculate the character size of our monospace font -->
52 <span class="monospace-font-size">ngā tama a rangi</span>
53
54 <!-- Contains the file input, transcribe button and transcription progress indicator -->
55 <div id="audioUploadContainer">
56 <button type="button" v-on:click="openFilePicker"
57 v-bind:disabled="isTranscribing">
58 <span class="material-icons">&#xE2C6;</span> <!-- file_upload -->
59 <span>Upload Audio Files</span>
60 </button>
61
62 <input id="audioFileInput" type="file" v-on:input="onFilesChanged"
63 accept="audio/wav" multiple="multiple" v-bind:disabled="isTranscribing" />
64
65 <button style="float: right;" type="submit"
66 v-bind:disabled="!canTranscribe" v-on:click="doTranscription">
67 <span class="material-icons">&#xEA3E;</span> <!-- history_edu -->
68 <span>Transcribe</span>
69 </button>
70
71 <progress v-if="isTranscribing" class="indeterminateLoadingBar" />
72 </div>
73
74 <!-- Contains the audio element and transcription list -->
75 <div id="transcriptionsDisplayContainer">
76
77 <audio id="transcriptionAudio">
78 <source id="transcriptionAudioSource" />
79 </audio>
80
81 <ul class="transcription__list">
82 <li v-for="transcription in transcriptions" class="transcription__container">
83 {{ transcription.transcription }}
84 </li>
85 <li v-for="failure in failures" class="transcription__error-container">
86 Failed to transcribe <i v-if="failure.file">{{ failure.file }}</i><br/>
87 <span v-if="failure.message">Reason: {{ failure.message }}</span>
88 </li>
89 </ul>
90
91 <ul class="transcription__list">
92
93 </ul>
94
95 <!-- <ul id="transcriptionsList" class="transcription__list"></ul> -->
96
97 <template id="transcriptionTemplate">
98 <li class="transcription__container">
99
100 <div class="transcription__header">
101 <button class="btn-fab transcription__play-button theme-flat" type="button">
102 <span class="material-icons">&#xE037;</span> <!-- play_arrow -->
103 </button>
104 <button class="btn-fab transcription__remove-button theme-error" type="button">
105 <span class="material-icons">&#xE872;</span> <!-- delete -->
106 </button>
107 <p class="transcription__text"></p>
108 <p class="body2 transcription__file-name">test</p>
109 </div>
110
111 <gsf:div class="transcription__word-list" id="transcriptionWordList">
112 <ul class="transcription__list">
113 <li v-for="line in lines" style="display: flex">
114 <span v-for="word in line.words" style="border: 1px solid blue">{{ word }}</span>
115 </li>
116 </ul>
117 </gsf:div>
118
119 <div class="audio-slider-container">
120 <input type="range" min="0" value="0" class="audio-slider" />
121 </div>
122
123 <hr class="divider" />
124
125 </li>
126 </template>
127 </div>
128
129 <!-- <div class="audio-slider__container">
130 <button type="button" class="btn-fab">
131 <span class="material-icons mdi-xl">&#xE037;</span>
132 </button>
133 <input type="range" min="0" value="0" class="audio-slider__range" />
134 <span class="audio-slider__value">1:23</span>
135 </div> -->
136 </section>
137
138 <!-- TODO: Switch to production version for release builds -->
139 <gsf:script src="https://unpkg.com/vue@next"></gsf:script>
140 <gsf:script src="interfaces/{$interface_name}/js/asr/asr-controller.js" type="module"></gsf:script>
141 <!-- <script type="module" src="interfaces/{$interface_name}/js/asr/asr-controller.js">
142 <xsl:comment>Filler</xsl:comment>>
143 </script> -->
144 </xsl:template>
145
146</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.