Sha256: e45913a513e8f406a88719168e8fae095e4ffcd293a4d2dca65a3f5471db019b

Contents?: true

Size: 1.17 KB

Versions: 37

Compression:

Stored size: 1.17 KB

Contents

module ImportsHelper

  def import_page_controller import, offset, length
    if offset > 0
      left_path = import_path import, :offset => [ 0, offset - length ].max, :length => length
      left_classes = "previous btn"
    else
      left_path = "#"
      left_classes = "previous btn disabled"
    end

    if offset + length < import.rows.count
      right_path = import_path import, :offset => offset + length, :length => length
      right_classes = "next btn pull-right"
    else
      right_path = "#"
      right_classes = "next btn pull-right disabled"
    end

    left = link_to "Previous Page", left_path, :class => left_classes
    right = link_to "Next Page", right_path, :class => right_classes

    left + right
  end

  def describe_import_status(import)
    descriptions = {
      "caching" => "Your file is being processed.",
      "pending" => "This import is pending your approval.",
      "approved" => "You have approved this import and it will be procesed soon.",
      "importing" => "Artful.ly is currently importing this file.",
      "imported" => "This import is complete.",
      "failed" => "This import has failed."
    }
    descriptions[import.status]
  end

end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
artfully_ose-1.3.0.pre4 app/helpers/imports_helper.rb
artfully_ose-1.3.0.pre3 app/helpers/imports_helper.rb
artfully_ose-1.3.0.pre2 app/helpers/imports_helper.rb
artfully_ose-1.3.0.pre1 app/helpers/imports_helper.rb
artfully_ose-1.2.0 app/helpers/imports_helper.rb
artfully_ose-1.2.0.beta.1 app/helpers/imports_helper.rb
artfully_ose-1.2.0.alpha.2 app/helpers/imports_helper.rb
artfully_ose-1.2.0.alpha.1 app/helpers/imports_helper.rb
artfully_ose-1.2.0.pre.27 app/helpers/imports_helper.rb
artfully_ose-1.2.0.pre.26 app/helpers/imports_helper.rb
artfully_ose-1.2.0.pre.24 app/helpers/imports_helper.rb
artfully_ose-1.2.0.pre.23 app/helpers/imports_helper.rb
artfully_ose-1.2.0.pre.21 app/helpers/imports_helper.rb
artfully_ose-1.2.0.pre.20 app/helpers/imports_helper.rb
artfully_ose-1.2.0.pre.19 app/helpers/imports_helper.rb
artfully_ose-1.2.0.pre.18 app/helpers/imports_helper.rb
artfully_ose-1.2.0.pre.17 app/helpers/imports_helper.rb
artfully_ose-1.2.0.pre.16 app/helpers/imports_helper.rb
artfully_ose-1.2.0.pre.15 app/helpers/imports_helper.rb
artfully_ose-1.2.0.pre.12 app/helpers/imports_helper.rb