Commit 104cb330f5801629627e783fd5b2fe925e496c0b
1 parent
78ae61e2
Exists in
master
Adicionado ícone de loading e coluna com o número de correções
Showing
5 changed files
with
125 additions
and
90 deletions
Show diff stats
.gitignore
view/assets/css/main.css
@@ -9,7 +9,13 @@ video { | @@ -9,7 +9,13 @@ video { | ||
9 | } | 9 | } |
10 | */ | 10 | */ |
11 | .video-body { | 11 | .video-body { |
12 | - height: 350px; | 12 | + height: 50%; |
13 | + width: 85%; | ||
14 | +} | ||
15 | + | ||
16 | +.video-container { | ||
17 | + padding-left: 40px; | ||
18 | + padding-right: 0px; | ||
13 | } | 19 | } |
14 | 20 | ||
15 | .row { | 21 | .row { |
@@ -25,8 +31,8 @@ video { | @@ -25,8 +31,8 @@ video { | ||
25 | } | 31 | } |
26 | 32 | ||
27 | /* Fontes */ | 33 | /* Fontes */ |
28 | -.table-responsive, .btn-default, .finish-task-button, #upload-button, h1, h2, | ||
29 | - h3, h4, h5, h6 { | 34 | +.table-responsive, .btn-default, .finish-task-button, #upload-button, h1, |
35 | + h2, h3, h4, h5, h6 { | ||
30 | font-family: 'Titillium Web', sans-serif; | 36 | font-family: 'Titillium Web', sans-serif; |
31 | } | 37 | } |
32 | 38 | ||
@@ -114,22 +120,12 @@ h6 { | @@ -114,22 +120,12 @@ h6 { | ||
114 | } | 120 | } |
115 | 121 | ||
116 | .progress-bar { | 122 | .progress-bar { |
117 | - height: 5px; | 123 | + height: 100%; |
118 | } | 124 | } |
119 | 125 | ||
120 | .progress { | 126 | .progress { |
121 | background-color: rgba(218, 228, 232, 1.0); | 127 | background-color: rgba(218, 228, 232, 1.0); |
122 | - height: 5px; | ||
123 | -} | ||
124 | - | ||
125 | -#avatar-container { | ||
126 | - padding-left: 40px; | ||
127 | - padding-right: 0px; | ||
128 | -} | ||
129 | - | ||
130 | -#ref-container { | ||
131 | - padding-left: 60px; | ||
132 | - padding-right: 0px; | 128 | + height: 7px; |
133 | } | 129 | } |
134 | 130 | ||
135 | #upload-form { | 131 | #upload-form { |
@@ -161,7 +157,7 @@ h6 { | @@ -161,7 +157,7 @@ h6 { | ||
161 | #upload-file-name { | 157 | #upload-file-name { |
162 | text-overflow: ellipsis; | 158 | text-overflow: ellipsis; |
163 | overflow: hidden; | 159 | overflow: hidden; |
164 | - padding: 6px 0px; | 160 | + padding: 7px 11px 7px 0px; |
165 | color: #9e9fa0; | 161 | color: #9e9fa0; |
166 | font-style: italic; | 162 | font-style: italic; |
167 | } | 163 | } |
@@ -172,6 +168,8 @@ h6 { | @@ -172,6 +168,8 @@ h6 { | ||
172 | 168 | ||
173 | #upload-progress { | 169 | #upload-progress { |
174 | margin-bottom: 0px; | 170 | margin-bottom: 0px; |
171 | + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); | ||
172 | + box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); | ||
175 | } | 173 | } |
176 | 174 | ||
177 | #upload-msg { | 175 | #upload-msg { |
@@ -188,6 +186,10 @@ h6 { | @@ -188,6 +186,10 @@ h6 { | ||
188 | padding-right: 40px; | 186 | padding-right: 40px; |
189 | } | 187 | } |
190 | 188 | ||
189 | +#fix-button { | ||
190 | + display: none; | ||
191 | +} | ||
192 | + | ||
191 | .finish-task-button { | 193 | .finish-task-button { |
192 | float: right; | 194 | float: right; |
193 | padding-bottom: 0px; | 195 | padding-bottom: 0px; |
@@ -195,11 +197,6 @@ h6 { | @@ -195,11 +197,6 @@ h6 { | ||
195 | color: rgba(94, 199, 189, 1.0); | 197 | color: rgba(94, 199, 189, 1.0); |
196 | } | 198 | } |
197 | 199 | ||
198 | -.enabled-button { | ||
199 | - filter: alpha(opacity = 100); | ||
200 | - opacity: 1; | ||
201 | -} | ||
202 | - | ||
203 | .enabled-button:hover { | 200 | .enabled-button:hover { |
204 | cursor: pointer; | 201 | cursor: pointer; |
205 | filter: alpha(opacity = 50); | 202 | filter: alpha(opacity = 50); |
@@ -209,4 +206,28 @@ h6 { | @@ -209,4 +206,28 @@ h6 { | ||
209 | .disabled-button { | 206 | .disabled-button { |
210 | filter: alpha(opacity = 50); | 207 | filter: alpha(opacity = 50); |
211 | opacity: 0.5; | 208 | opacity: 0.5; |
209 | +} | ||
210 | + | ||
211 | +.mask { | ||
212 | + filter: alpha(opacity = 50); | ||
213 | + opacity: 0.5; | ||
214 | +} | ||
215 | + | ||
216 | +#loading-container { | ||
217 | + display: none; | ||
218 | + position: fixed; | ||
219 | + top: 0; | ||
220 | + right: 0; | ||
221 | + bottom: 0; | ||
222 | + left: 0; | ||
223 | + z-index: 1040; | ||
224 | +} | ||
225 | + | ||
226 | + | ||
227 | + | ||
228 | +#loading-container img { | ||
229 | + position: absolute; | ||
230 | + width: 80px; | ||
231 | + top: 37%; | ||
232 | + left: 47%; | ||
212 | } | 233 | } |
213 | \ No newline at end of file | 234 | \ No newline at end of file |
6.84 KB
78 KB
view/template.html
@@ -5,6 +5,9 @@ | @@ -5,6 +5,9 @@ | ||
5 | <script src="{{ server }}/assets/js/jquery.fileupload.js"></script> | 5 | <script src="{{ server }}/assets/js/jquery.fileupload.js"></script> |
6 | <script src="{{ server }}/assets/js/moment.js"></script> | 6 | <script src="{{ server }}/assets/js/moment.js"></script> |
7 | 7 | ||
8 | +<div id="loading-container"> | ||
9 | + <img src="{{ server }}/img/loading.gif"> | ||
10 | +</div> | ||
8 | <div class="row"> | 11 | <div class="row"> |
9 | <div id="success" class="alert alert-success" style="display: none;"> | 12 | <div id="success" class="alert alert-success" style="display: none;"> |
10 | <strong>Parabéns!</strong> <span>Tarefa concluída.</span> | 13 | <strong>Parabéns!</strong> <span>Tarefa concluída.</span> |
@@ -28,7 +31,7 @@ | @@ -28,7 +31,7 @@ | ||
28 | <th>SELO DO SINAL</th> | 31 | <th>SELO DO SINAL</th> |
29 | <th>DATA DE SUBMISSÃO</th> | 32 | <th>DATA DE SUBMISSÃO</th> |
30 | <th>ÚLTIMA EDIÇÃO</th> | 33 | <th>ÚLTIMA EDIÇÃO</th> |
31 | - <th>ÚLTIMA EDIÇÃO POR</th> | 34 | + <th>NÚMERO DE CORREÇÕES</th> |
32 | </tr> | 35 | </tr> |
33 | </thead> | 36 | </thead> |
34 | <tbody> | 37 | <tbody> |
@@ -37,14 +40,14 @@ | @@ -37,14 +40,14 @@ | ||
37 | <td><span id="sign-seal">WIKILIBRAS</span></td> | 40 | <td><span id="sign-seal">WIKILIBRAS</span></td> |
38 | <td><span id="submission-date"></span></td> | 41 | <td><span id="submission-date"></span></td> |
39 | <td><span id="last-edit-date">-</span></td> | 42 | <td><span id="last-edit-date">-</span></td> |
40 | - <td><span id="last-edit-by">-</span></td> | 43 | + <td><span id="number-of-fixes">-</span></td> |
41 | </tr> | 44 | </tr> |
42 | </tbody> | 45 | </tbody> |
43 | </table> | 46 | </table> |
44 | </div> | 47 | </div> |
45 | <div class="line-separator"></div> | 48 | <div class="line-separator"></div> |
46 | <div id="corretor-container" class="row body-container"> | 49 | <div id="corretor-container" class="row body-container"> |
47 | - <div id="avatar-container" class="col-sm-6"> | 50 | + <div id="avatar-container" class="col-sm-6 video-container"> |
48 | <div class="row"> | 51 | <div class="row"> |
49 | <h6> | 52 | <h6> |
50 | ANIMAÇÃO ATUAL "<span class="sign-label"></span>": | 53 | ANIMAÇÃO ATUAL "<span class="sign-label"></span>": |
@@ -56,31 +59,28 @@ | @@ -56,31 +59,28 @@ | ||
56 | <source type="video/webm"> | 59 | <source type="video/webm"> |
57 | </video> | 60 | </video> |
58 | </div> | 61 | </div> |
59 | - <div class="row"> | 62 | + <div class="row link-container"> |
60 | <a id="blend-link" href="" class="btn btn-default" download>DOWNLOAD | 63 | <a id="blend-link" href="" class="btn btn-default" download>DOWNLOAD |
61 | ARQUIVO DE ANIMAÇÃO .BLENDER <img | 64 | ARQUIVO DE ANIMAÇÃO .BLENDER <img |
62 | src="{{ server }}/img/blender.svg" | 65 | src="{{ server }}/img/blender.svg" |
63 | style="width: 22px; height: 22px"></img> | 66 | style="width: 22px; height: 22px"></img> |
64 | </a> | 67 | </a> |
65 | </div> | 68 | </div> |
66 | - <div class="row"> | 69 | + <!-- <div class="row"></div> --> |
70 | + <div id="upload-container" class="row"> | ||
67 | <h6 id="upload-msg">ENVIAR ARQUIVO DE ANIMAÇÃO BLENDER | 71 | <h6 id="upload-msg">ENVIAR ARQUIVO DE ANIMAÇÃO BLENDER |
68 | CORRIGIDO:</h6> | 72 | CORRIGIDO:</h6> |
69 | - </div> | ||
70 | - <div class="row"> | ||
71 | - <div id="upload-form-container" class="col-sm-8"> | ||
72 | - <div id="upload-button-container" class="col-sm-5"> | ||
73 | - <form id="upload-form" method="post" enctype="multipart/form-data"> | ||
74 | - <input id="file-upload" type="file" name="file" /> | ||
75 | - </form> | ||
76 | - <div id="upload-button" class="enabled-button"> | ||
77 | - <img id="upload-icon" class="icon" | ||
78 | - src="{{ server }}/img/paperclip.svg"></img>ENVIAR | ||
79 | - </div> | 73 | + <div id="upload-button-container" class="col-sm-3"> |
74 | + <form id="upload-form" method="post" enctype="multipart/form-data"> | ||
75 | + <input id="file-upload" type="file" name="file" /> | ||
76 | + </form> | ||
77 | + <div id="upload-button" class="enabled-button"> | ||
78 | + <img id="upload-icon" class="icon" | ||
79 | + src="{{ server }}/img/paperclip.svg"></img>ENVIAR | ||
80 | </div> | 80 | </div> |
81 | - <span id="upload-file-name" class="col-sm-7"> Escolha um | ||
82 | - arquivo </span> | ||
83 | </div> | 81 | </div> |
82 | + <span id="upload-file-name" class="col-sm-5">Escolha um | ||
83 | + arquivo</span> | ||
84 | <div id="upload-progress-container" class="col-sm-4"> | 84 | <div id="upload-progress-container" class="col-sm-4"> |
85 | <div id="upload-progress" class="progress"> | 85 | <div id="upload-progress" class="progress"> |
86 | <div class="progress-bar" role="progressbar" aria-valuenow="0" | 86 | <div class="progress-bar" role="progressbar" aria-valuenow="0" |
@@ -89,7 +89,7 @@ | @@ -89,7 +89,7 @@ | ||
89 | </div> | 89 | </div> |
90 | </div> | 90 | </div> |
91 | </div> | 91 | </div> |
92 | - <div id="ref-container" class="col-sm-6"> | 92 | + <div id="ref-container" class="col-sm-6 video-container"> |
93 | <div class="row"> | 93 | <div class="row"> |
94 | <h6> | 94 | <h6> |
95 | VÍDEO DE REFERÊNCIA “<span class="sign-label"></span>”: | 95 | VÍDEO DE REFERÊNCIA “<span class="sign-label"></span>”: |
@@ -101,7 +101,7 @@ | @@ -101,7 +101,7 @@ | ||
101 | <source type="video/webm"> | 101 | <source type="video/webm"> |
102 | </video> | 102 | </video> |
103 | </div> | 103 | </div> |
104 | - <div class="row"> | 104 | + <div class="row link-container"> |
105 | <a id="ref-video-link" href="" class="btn btn-default" download>DOWNLOAD | 105 | <a id="ref-video-link" href="" class="btn btn-default" download>DOWNLOAD |
106 | VÍDEO DE REFERÊNCIA DO SINAL <img | 106 | VÍDEO DE REFERÊNCIA DO SINAL <img |
107 | src="{{ server }}/img/download.svg" | 107 | src="{{ server }}/img/download.svg" |
@@ -110,7 +110,11 @@ | @@ -110,7 +110,11 @@ | ||
110 | </div> | 110 | </div> |
111 | <div id="finish-task-container" class="row"> | 111 | <div id="finish-task-container" class="row"> |
112 | <div id="finish-button" class="finish-task-button disabled-button "> | 112 | <div id="finish-button" class="finish-task-button disabled-button "> |
113 | - FINALIZAR<img class="icon" src="{{ server }}/img/finish.svg"></img> | 113 | + <span id="finish-button-text">FINALIZAR</span><img class="icon" |
114 | + src="{{ server }}/img/finish.svg"></img> | ||
115 | + </div> | ||
116 | + <div id="fix-button" class="finish-task-button enabled-button"> | ||
117 | + CORRIGIR<img class="icon" src="{{ server }}/img/fix.png"></img> | ||
114 | </div> | 118 | </div> |
115 | <div id="skip-button" class="finish-task-button enabled-button"> | 119 | <div id="skip-button" class="finish-task-button enabled-button"> |
116 | PULAR<img class="icon" src="{{ server }}/img/skip.svg"></img> | 120 | PULAR<img class="icon" src="{{ server }}/img/skip.svg"></img> |
@@ -118,49 +122,16 @@ | @@ -118,49 +122,16 @@ | ||
118 | </div> | 122 | </div> |
119 | </div> | 123 | </div> |
120 | </div> | 124 | </div> |
121 | - <div id="approval-container" class="row body-container"> | ||
122 | - <div id="avatar-container" class="col-sm-6"> | ||
123 | - <div class="row"> | ||
124 | - <h6> | ||
125 | - ANIMAÇÃO"<span class="sign-label"></span>": | ||
126 | - </h6> | ||
127 | - </div> | ||
128 | - <div class="row"> | ||
129 | - <video id="avatar-video" | ||
130 | - src="{{ server }}/videos/ENSINADO_AVATAR.webm" preload="metadata" | ||
131 | - class="video-body" autoplay loop controls> | ||
132 | - <source type="video/webm"> | ||
133 | - </video> | ||
134 | - </div> | ||
135 | - </div> | ||
136 | - <div id="ref-container" class="col-sm-6"> | ||
137 | - <div class="row"> | ||
138 | - <h6> | ||
139 | - VÍDEO DE REFERÊNCIA “<span class="sign-label"></span>”: | ||
140 | - </h6> | ||
141 | - </div> | ||
142 | - <div class="row"> | ||
143 | - <video src="{{ server }}/videos/ENSINADO_REF.webm" | ||
144 | - preload="metadata" class="video-body" autoplay loop controls> | ||
145 | - <source type="video/mp4"> | ||
146 | - </video> | ||
147 | - </div> | ||
148 | - <div id="approval-task-container" class="row"> | ||
149 | - <div id="approved-button" class="finish-task-button enabled-button"> | ||
150 | - APROVADO<img class="icon" src="{{ server }}/img/finish.svg"></img> | ||
151 | - </div> | ||
152 | - <div id="fix-button" class="finish-task-button enabled-button"> | ||
153 | - CORRIGIR<img class="icon" src="{{ server }}/img/skip.svg"></img> | ||
154 | - </div> | ||
155 | - </div> | ||
156 | - </div> | ||
157 | - </div> | ||
158 | </div> | 125 | </div> |
159 | 126 | ||
160 | <script type="text/javascript"> | 127 | <script type="text/javascript"> |
161 | var base_url = "{{ server }}/videos/"; | 128 | var base_url = "{{ server }}/videos/"; |
162 | var upload_session_id = generateSessionID(); | 129 | var upload_session_id = generateSessionID(); |
163 | var current_task_id = -1; | 130 | var current_task_id = -1; |
131 | + var status_dict = { | ||
132 | + "APROVAR" : "APPROVED", | ||
133 | + "FINALIZAR" : "FINISHED" | ||
134 | + }; | ||
164 | 135 | ||
165 | function generateSessionID() { | 136 | function generateSessionID() { |
166 | return (Math.random() + " ").substring(2, 10) | 137 | return (Math.random() + " ").substring(2, 10) |
@@ -177,16 +148,47 @@ | @@ -177,16 +148,47 @@ | ||
177 | $("#finish-button").off("click").on("click", function() { | 148 | $("#finish-button").off("click").on("click", function() { |
178 | // endpoint - /finish_task | 149 | // endpoint - /finish_task |
179 | // enviar mensagem via POST para renderizar video - upload/<session_hash>/<task.info.sign_name>_CORRIGIDO.blend | 150 | // enviar mensagem via POST para renderizar video - upload/<session_hash>/<task.info.sign_name>_CORRIGIDO.blend |
180 | - saveAnswer(task, deferred, "FINISHED"); | 151 | + enableLoading(); |
152 | + setTimeout(function() { | ||
153 | + disableLoading(); | ||
154 | + status = status_dict[$("#finish-button").text().trim()]; | ||
155 | + saveAnswer(task, deferred, status); | ||
156 | + }, 3000); | ||
181 | }); | 157 | }); |
182 | } | 158 | } |
183 | 159 | ||
160 | + function enableLoading() { | ||
161 | + $("#loading-container").show(); | ||
162 | + $("#main-container").addClass("mask"); | ||
163 | + } | ||
164 | + | ||
165 | + function disableLoading() { | ||
166 | + $("#loading-container").hide(); | ||
167 | + $("#main-container").removeClass("mask"); | ||
168 | + } | ||
169 | + | ||
184 | function disableFinishButton() { | 170 | function disableFinishButton() { |
185 | $("#finish-button").off("click"); | 171 | $("#finish-button").off("click"); |
186 | $("#finish-button").removeClass("enabled-button"); | 172 | $("#finish-button").removeClass("enabled-button"); |
187 | $("#finish-button").addClass("disabled-button"); | 173 | $("#finish-button").addClass("disabled-button"); |
188 | } | 174 | } |
189 | 175 | ||
176 | + function showApprovalGUI(task, deferred) { | ||
177 | + $("#upload-container").hide(); | ||
178 | + $(".link-container").hide(); | ||
179 | + $("#fix-button").show(); | ||
180 | + $("#finish-button-text").text("APROVAR"); | ||
181 | + enableFinishButton(task, deferred); | ||
182 | + } | ||
183 | + | ||
184 | + function showFixGUI() { | ||
185 | + disableFinishButton(); | ||
186 | + $("#upload-container").show(); | ||
187 | + $(".link-container").show(); | ||
188 | + $("#finish-button-text").text("FINALIZAR"); | ||
189 | + $("#fix-button").hide(); | ||
190 | + } | ||
191 | + | ||
190 | function setupButtons(task, deferred) { | 192 | function setupButtons(task, deferred) { |
191 | disableFinishButton(); | 193 | disableFinishButton(); |
192 | resetUploadProgress(); | 194 | resetUploadProgress(); |
@@ -228,23 +230,34 @@ | @@ -228,23 +230,34 @@ | ||
228 | saveAnswer(task, deferred, "SKIP"); | 230 | saveAnswer(task, deferred, "SKIP"); |
229 | }); | 231 | }); |
230 | $("#fix-button").off("click").on("click", function() { | 232 | $("#fix-button").off("click").on("click", function() { |
231 | - $("#approval-container").hide(); | ||
232 | - $("#corretor-container").show(); | ||
233 | - }); | ||
234 | - $("#approved-button").off("click").on("click", function() { | ||
235 | - saveAnswer(task, deferred, "FINISHED"); | 233 | + showFixGUI(); |
236 | }); | 234 | }); |
237 | } | 235 | } |
238 | 236 | ||
239 | - function saveAnswer(task, deferred, status) { | 237 | + function createAnswer(task, status) { |
240 | var answer = { | 238 | var answer = { |
241 | - "status" : status | 239 | + "status" : status, |
240 | + "number_of_fixes" : 0, | ||
241 | + "number_of_approval" : 0 | ||
242 | }; | 242 | }; |
243 | + var last_answer = task.info.last_answer; | ||
244 | + var hasLastAnswer = typeof last_answer != "undefined"; | ||
245 | + if (hasLastAnswer) { | ||
246 | + answer = last_answer; | ||
247 | + } | ||
243 | if (status == "FINISHED") { | 248 | if (status == "FINISHED") { |
244 | answer["last_edit_date"] = moment(new Date()).format( | 249 | answer["last_edit_date"] = moment(new Date()).format( |
245 | "YYYY-MM-DDTHH:mm:ss") | 250 | "YYYY-MM-DDTHH:mm:ss") |
246 | answer["last_upload_session_id"] = upload_session_id; | 251 | answer["last_upload_session_id"] = upload_session_id; |
252 | + answer["number_of_fixes"] = answer.number_of_fixes + 1; | ||
253 | + } else if (status == "APPROVED") { | ||
254 | + answer["number_of_approval"] = answer.number_of_approval + 1; | ||
247 | } | 255 | } |
256 | + return answer; | ||
257 | + } | ||
258 | + | ||
259 | + function saveAnswer(task, deferred, status) { | ||
260 | + var answer = createAnswer(task, status); | ||
248 | pybossa.saveTask(task.id, answer).done(function() { | 261 | pybossa.saveTask(task.id, answer).done(function() { |
249 | $("#success").fadeIn(500); | 262 | $("#success").fadeIn(500); |
250 | $("#main-container").hide(); | 263 | $("#main-container").hide(); |
@@ -271,9 +284,10 @@ | @@ -271,9 +284,10 @@ | ||
271 | var last_answer = task.info.last_answer; | 284 | var last_answer = task.info.last_answer; |
272 | var hasLastAnswer = typeof last_answer != "undefined"; | 285 | var hasLastAnswer = typeof last_answer != "undefined"; |
273 | if (hasLastAnswer && last_answer.status == "FINISHED") { | 286 | if (hasLastAnswer && last_answer.status == "FINISHED") { |
287 | + console.log(last_answer); | ||
274 | $("#last-edit-date").text( | 288 | $("#last-edit-date").text( |
275 | moment(last_answer.last_edit_date).format("DD/MM/YYYY")); | 289 | moment(last_answer.last_edit_date).format("DD/MM/YYYY")); |
276 | - $("#last-edit-by").text(last_answer.last_edit_by); | 290 | + $("#number-of-fixes").text(last_answer.number_of_fixes); |
277 | } | 291 | } |
278 | } | 292 | } |
279 | 293 | ||
@@ -285,8 +299,7 @@ | @@ -285,8 +299,7 @@ | ||
285 | $("#main-container").fadeIn(500); | 299 | $("#main-container").fadeIn(500); |
286 | var hasLastAnswer = typeof task.info.last_answer != "undefined"; | 300 | var hasLastAnswer = typeof task.info.last_answer != "undefined"; |
287 | if (hasLastAnswer && task.info.last_answer.status == "FINISHED") { | 301 | if (hasLastAnswer && task.info.last_answer.status == "FINISHED") { |
288 | - $("#corretor-container").hide(); | ||
289 | - $("#approval-container").show(); | 302 | + showApprovalGUI(task, deferred); |
290 | } | 303 | } |
291 | } else { | 304 | } else { |
292 | $("#main-container").hide(); | 305 | $("#main-container").hide(); |