Commit 9a1204f4d2db07b760f9ceafa93e602e3ee6a7aa
1 parent
62612710
Exists in
master
and in
2 other branches
Add wait instruction video after created request
Showing
4 changed files
with
29 additions
and
3 deletions
Show diff stats
app/assets/javascripts/v_libras/videos/index.js.erb
... | ... | @@ -9,6 +9,13 @@ $(function() { |
9 | 9 | // bind to a channel event |
10 | 10 | channel.bind('update', function(data) { |
11 | 11 | /* alert("Um vídeo que estava em processamento está disponível. Sua página será atualizada automaticamente.") */ |
12 | - location.reload(); | |
12 | + | |
13 | + if ($('#modal-wait').hasClass('in')) { | |
14 | + $('#modal-wait').on('hidden', function () { | |
15 | + window.location = window.location.pathname; | |
16 | + }) | |
17 | + } else { | |
18 | + window.location = window.location.pathname; | |
19 | + } | |
13 | 20 | }); |
14 | 21 | }); |
15 | 22 | \ No newline at end of file | ... | ... |
app/assets/stylesheets/bootstrap.css.less
app/controllers/v_libras/requests_controller.rb
... | ... | @@ -20,7 +20,7 @@ class VLibras::RequestsController < ApplicationController |
20 | 20 | |
21 | 21 | flash[:success] = 'Sua requisição foi submetida com sucesso!' |
22 | 22 | |
23 | - redirect_to v_libras_videos_path | |
23 | + redirect_to v_libras_videos_path('video-wait' => true) | |
24 | 24 | else |
25 | 25 | flash[:error] = 'Algo deu errado com a sua requisição. Por favor verifique opções escolhidas.' |
26 | 26 | flash[:warning] = @request.errors.full_messages.to_sentence.humanize | ... | ... |
app/views/v_libras/videos/index.haml
... | ... | @@ -4,7 +4,6 @@ |
4 | 4 | .breadcrumb |
5 | 5 | %h3= t('videos.list') |
6 | 6 | |
7 | - | |
8 | 7 | - @videos.in_groups_of(3, false) do |group| |
9 | 8 | .row-fluid.text-center |
10 | 9 | - for video in group |
... | ... | @@ -46,4 +45,20 @@ |
46 | 45 | %td.span5= time_ago_in_words(request.created_at) |
47 | 46 | |
48 | 47 | |
48 | +- if params['video-wait'] | |
49 | + #modal-wait.modal.fade | |
50 | + .modal-header | |
51 | + %button.close{"aria-hidden" => "true", "data-dismiss" => "modal", type: "button"} × | |
52 | + %h3 Aguarde... | |
53 | + .modal-body | |
54 | + = html5_video_tag(['/system/videos/aguarde.webm', '/system/videos/aguarde.mp4'], 'video-wait', 'video-instructions auto-margin') | |
55 | + .modal-footer | |
56 | + %a.btn{"aria-hidden" => "true", "data-dismiss" => "modal", href: "#"} Fechar | |
57 | + | |
58 | + - content_for :javascript_code do | |
59 | + :javascript | |
60 | + $(function () { | |
61 | + videojs("video-wait", { "controls": false, "autoplay": true, "preload": "true", "width": "400px", "height": "300px" }); | |
49 | 62 | |
63 | + $('#modal-wait').modal(); | |
64 | + }) | |
50 | 65 | \ No newline at end of file | ... | ... |