Sha256: 93dabdc0471d247d60393a70e46030807362c2aa74c58d8a5224c056bf557931

Contents?: true

Size: 896 Bytes

Versions: 4

Compression:

Stored size: 896 Bytes

Contents

module FileAttachmentsHelper

  def description_display(file_attachment)
    return unless has_authorization?(:read, file_attachment)
    content_tag :p, {
      :id => "file_attachment_#{file_attachment.id}_description",
      :class => 'file_attachment_description'
    } do
      file_attachment.description
    end
  end
  
  def name_display(file_attachment)
    content_tag :p, {
      :id => "file_attachment_#{file_attachment.id}_name",
      :class => 'file_attachment_name'
    } do
      link_to_download_file_attachment(file_attachment)
    end
  end
  
  def file_container_data(file_attachment)
    return unless has_authorization?(:update, file_attachment)
    content_tag :span, file_attachment.file_container, {
      :id => "file_attachment_#{file_attachment.id}_file_container",
      :class => "file_attachment_file_container",
      :style => "display:none;"
    }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
file_share-0.1.16 app/helpers/file_attachments_helper.rb
file_share-0.1.15 app/helpers/file_attachments_helper.rb
file_share-0.1.13 app/helpers/file_attachments_helper.rb
file_share-0.1.12 app/helpers/file_attachments_helper.rb