hoshinotsuyoshi/s3_explorer

View on GitHub
app/views/prefix/show.html.slim

Summary

Maintainability
Test Coverage
p#notice = notice

.panel.panel-default
  table.table
    thead
    tbody
      - @folders.each do |folder|
        tr
          td
            i.fa.fa-folder-o aria-hidden=true
            span  
            = link_to folder.basename, bucket_prefix_path(bucket_id: @bucket, prefix_id: folder.prefix)
      - @files.each do |file|
        tr
          td
            i.fa.fa-file-text-o aria-hidden=true
            span  
            = file.basename
          td
            /! modals
            /! Small modal
            button.btn.btn-default.btn-xs data-target="#bs-example-modal-sm-#{file.hash}" data-toggle="modal" type="button"
              span.glyphicon.glyphicon-paperclip aria-hidden="true"
            .modal.fade.modal-presigned-url aria-hidden="true" role="dialog" style=("display: none;") tabindex="-1" id=("bs-example-modal-sm-#{file.hash}")
              .modal-dialog.modal-sm
                .modal-content
                  .modal-header.modal-presigned-url
                    button.close aria-label="Close" data-dismiss="modal" type="button"
                      span aria-hidden="true"  ×
                    h4#myModalLabel2.modal-title Get shareable link
                    p Expire In 1 day
                  .modal-body.modal-presigned-url
                    = link_to([@bucket, file], remote: true, class: 'fetch-url') do
                      button.btn.btn-default.btn-xs type="button" Get
                    input.url value="" id=("got-url-#{file.hash}")
                    button.btn.btn-default.btn-xs data-clipboard-target="#got-url-#{file.hash}" id=("clipboard-#{file.hash}") data-toggle="tooltip" data-placement="bottom" title="Copy to clipboard"
                      img.clippy src="/assets/Octicons-clippy.svg" width="13" alt="Copy to clipboard"
                  .modal-footer.modal-presigned-url
                    button.btn.btn-default data-dismiss="modal" type="button"  Close
            /! /modals
          td
            = link_to([@bucket, file], remote: true, class: 'download-file') do
              button.btn.btn-default.btn-xs type="button"
                i.fa.fa-download aria-hidden=true