_form.html.haml 1.73 KB
/ Author Igor Amorim - www.igoramorim.com
= javascript_include_tag "site/videos"
= form_for @video, url: videos_path(@video), html: {method: "post"} do |f|
  - if @video.errors.any?
    #error_explanation
      %p/
      %h4
        = pluralize(@video.errors.count, "erro")
        impede o vídeo de ser salvo:
      %ul
        - @video.errors.full_messages.each do |msg|
          %li.error= msg
  .field
    = label_tag :choice, t('videos.video_type'), :class => 'bold'
    %label.radio
      = f.radio_button :closed_caption, '1', :id => "link_cc"
      Closed Caption (legenda embutida)
    %label.radio
      = f.radio_button :closed_caption, '3', :id => "link_recognize"
      Voz
    %label.radio
      = f.radio_button :closed_caption, '2', :id => "link_normal"
      Legenda (.SRT)
  #url
    = f.label :url, t('videos.url'), :class => "bold"
    = f.file_field :url, :onchange => "return check_video(this)"
  #legend
    = f.label :legend, t('videos.subtitle'), :class => "bold"
    = f.file_field :legend, :prompt => "LEGENDA", :onchange => "return check_subtitle(this)"
  .field
    = f.label :window_size, t('videos.window_size'), :class => "bold"
    = f.select :window_size, [['Pequena', '1'], ['Média', '2'], ['Grande', '3']]
  .field
    %p
      %b
        = f.label :window_position,  t('videos.window_position'), :class => "bold"
  = f.select :window_position, [[t('videos.top_left'), '1'], [t('videos.top_right'), '2'], [t('videos.bottom_right'),'3'], [t('videos.bottom_left'), '4']]
  .field
    = f.label :transparency, t('videos.transparency'), :class => "bold"
    = f.select :transparency, [['Opaco', '0'], ['Transparente', '1']]
  = f.hidden_field :user_id, :value => current_user.id
  = f.submit "Confirmar", :class => "btn btn-primary actions"