Sha256: b7b4e81256400d347356a83c073d18257a689c879328634af12ca2dcf34203a8

Contents?: true

Size: 495 Bytes

Versions: 9

Compression:

Stored size: 495 Bytes

Contents

module Ecm::Downloads
  class DownloadDecorator < Draper::Decorator
    delegate_all

    def ecm_downloads_downloads_count_label
      h.content_tag(:span, ecm_downloads_downloads_count, class: 'badge')
    end

    def filesize
      h.number_to_human_size(asset_file_size)
    end

    def locale_label
      h.content_tag(:span, locale, class: 'label label-info')
    end

    def tree_name
      name
    end

    def display_code
      "<%= render_download '#{name}' %>"
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ecm_downloads2-5.0.4 app/decorators/ecm/downloads/download_decorator.rb
ecm_downloads2-5.0.2 app/decorators/ecm/downloads/download_decorator.rb
ecm_downloads2-5.0.1 app/decorators/ecm/downloads/download_decorator.rb
ecm_downloads2-5.0.0 app/decorators/ecm/downloads/download_decorator.rb
ecm_downloads2-4.0.1 app/decorators/ecm/downloads/download_decorator.rb
ecm_downloads2-3.0.0 app/decorators/ecm/downloads/download_decorator.rb
ecm_downloads2-2.0.3 app/decorators/ecm/downloads/download_decorator.rb
ecm_downloads2-2.0.2 app/decorators/ecm/downloads/download_decorator.rb
ecm_downloads2-2.0.0 app/decorators/ecm/downloads/download_decorator.rb