diff --git a/app/assets/javascripts/v_libras/videos/index.js.erb b/app/assets/javascripts/v_libras/videos/index.js.erb index 245a751..65fe566 100644 --- a/app/assets/javascripts/v_libras/videos/index.js.erb +++ b/app/assets/javascripts/v_libras/videos/index.js.erb @@ -9,6 +9,13 @@ $(function() { // bind to a channel event channel.bind('update', function(data) { /* alert("Um vídeo que estava em processamento está disponível. Sua página será atualizada automaticamente.") */ - location.reload(); + + if ($('#modal-wait').hasClass('in')) { + $('#modal-wait').on('hidden', function () { + window.location = window.location.pathname; + }) + } else { + window.location = window.location.pathname; + } }); }); \ No newline at end of file diff --git a/app/assets/stylesheets/bootstrap.css.less b/app/assets/stylesheets/bootstrap.css.less index 869d7bf..22f0513 100644 --- a/app/assets/stylesheets/bootstrap.css.less +++ b/app/assets/stylesheets/bootstrap.css.less @@ -18,6 +18,10 @@ body { @linkColor: #888; @linkColorHover: darken(@linkColor, 15%); +.auto-margin { + margin: auto; +} + footer { margin-top: 20px; background-color: #d6d6d6; diff --git a/app/controllers/v_libras/requests_controller.rb b/app/controllers/v_libras/requests_controller.rb index 08230d4..9850dfa 100644 --- a/app/controllers/v_libras/requests_controller.rb +++ b/app/controllers/v_libras/requests_controller.rb @@ -20,7 +20,7 @@ class VLibras::RequestsController < ApplicationController flash[:success] = 'Sua requisição foi submetida com sucesso!' - redirect_to v_libras_videos_path + redirect_to v_libras_videos_path('video-wait' => true) else flash[:error] = 'Algo deu errado com a sua requisição. Por favor verifique opções escolhidas.' flash[:warning] = @request.errors.full_messages.to_sentence.humanize diff --git a/app/views/v_libras/videos/index.haml b/app/views/v_libras/videos/index.haml index 9b04a0c..11d6b2f 100644 --- a/app/views/v_libras/videos/index.haml +++ b/app/views/v_libras/videos/index.haml @@ -4,7 +4,6 @@ .breadcrumb %h3= t('videos.list') - - @videos.in_groups_of(3, false) do |group| .row-fluid.text-center - for video in group @@ -46,4 +45,20 @@ %td.span5= time_ago_in_words(request.created_at) +- if params['video-wait'] + #modal-wait.modal.fade + .modal-header + %button.close{"aria-hidden" => "true", "data-dismiss" => "modal", type: "button"} × + %h3 Aguarde... + .modal-body + = html5_video_tag(['/system/videos/aguarde.webm', '/system/videos/aguarde.mp4'], 'video-wait', 'video-instructions auto-margin') + .modal-footer + %a.btn{"aria-hidden" => "true", "data-dismiss" => "modal", href: "#"} Fechar + + - content_for :javascript_code do + :javascript + $(function () { + videojs("video-wait", { "controls": false, "autoplay": true, "preload": "true", "width": "400px", "height": "300px" }); + $('#modal-wait').modal(); + }) \ No newline at end of file -- libgit2 0.21.2