Sha256: 10623f325037334961fd87257d9ec9c1946ca2a91f175465de4eed7bb34d830a

Contents?: true

Size: 1.73 KB

Versions: 34

Compression:

Stored size: 1.73 KB

Contents

#add_photo.modal.fade
  .modal-dialog
    .modal-content
      .modal-header
        %button.close{ type: 'button', aria_label: 'Close', data: { dismiss: 'modal' } }
          %span{ aria_hidden: "true" }
            ×
        %h4.modal-title
          = t('.add_new_photo')
      .modal-body
        %p= t('my_forum.attachments.allowed_extensions', ext: upload_allowed_extensions.join(', '))
        = form_for MyForum::Attachment.new, url: attachments_path, multipart: true, remote: true do |f|
          = f.file_field 'file[]', multiple: true, id: 'attachment_files'

        #loaded-content

      .modal-footer
        %button.btn.btn-default{ type: 'button', aria_label: 'Close', data: { dismiss: 'modal' } }
          Close

      :coffee
        $('#attachment_files').change ->
          form_data = new FormData()

          files_count = $('#attachment_files').prop('files').length
          form_data.append('files[]', $('#attachment_files').prop('files')[c]) for c in [0...files_count]

          $.ajax({
            url: "#{attachments_path}"
            dataType: 'html'
            cache: false
            contentType: false
            processData: false
            data: form_data
            type: 'post',
            success: (data, textStatus, jqXHR) ->
              response = $.parseJSON(data)
              bbcode_attachments = ''
              bbcode_attachments += ('[attachment=' + id + '] \n') for id in response.attachments
              text = $('##{textarea}').val()
              $('##{textarea}').val(text + '\n' + bbcode_attachments + '\n')
              $('#loaded-content').html('#{t('my_forum.successfull_aploaded')}')
              $('#add_photo').modal('hide')
              $('#attachment_files').val('')
          })

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
my_forum-0.0.2.4 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.2.3 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.2.2 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.2.1 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.2 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta60 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta59 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta58 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta57 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta56 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta55 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta54 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta53 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta52 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta51 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta50 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta49 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta48 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta47 app/views/my_forum/shared/_upload_photo.haml
my_forum-0.0.1.beta46 app/views/my_forum/shared/_upload_photo.haml