mconf/mconf-web

View on GitHub
app/views/attachments/_single_attachment.html.haml

Summary

Maintainability
Test Coverage
%tr{:class => "attachment"}
  %td
    = check_box_tag attachment.id, attachment.id, false, :class => "attachment-checkbox", :data => { :"can-destroy" => can?(:destroy, attachment) }
  %td
    = link_to attachment.title, space_attachment_path(@space, attachment), :download => attachment.title
  %td
    - if attachment.author
      = link_to attachment.author.full_name, user_path(attachment.author)
  %td
    %span{title: attachment.created_at}
      - if attachment.created_at
        = time_ago_in_words(attachment.created_at, highest_measures: 2) + " " + t('.ago')
  %td
    = link_to space_attachment_path(@space, attachment), :download => attachment.title do
      = icon_download :class => "tooltipped", :title => t(".download_tooltip")
    - if can?(:destroy, attachment)
      = link_to [@space, attachment], :rel => 'nofollow', :'data-confirm' => t('.delete_confirmation'), :'data-method' => 'delete' do
        = icon_delete :class => "tooltipped", :title => t(".delete_tooltip")