Sha256: 70046392e7ffd0e82c6c8e65416af8091e5be0041a24d8b1d05c6894ad9e36e7

Contents?: true

Size: 650 Bytes

Versions: 14

Compression:

Stored size: 650 Bytes

Contents

# -*- encoding: utf-8 -*-
module NdlBooksHelper
  def link_to_import_from_ndl(iss_itemno)
    if iss_itemno.blank?
      t('enju_ndl.not_available')
    else
      identifier_type = IdentifierType.where(name: 'iss_itemno').first
      if identifier_type
        manifestation = Identifier.where(body: iss_itemno, identifier_type_id: identifier_type.id).first.try(:manifestation)
      end
      if manifestation
        link_to t('enju_ndl.already_exists'), manifestation
      else
        button_to t('enju_ndl.add'), ndl_books_path(book: {iss_itemno: iss_itemno}), method: :post, data: {disable_with: t('page.saving')}
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
enju_ndl-0.2.3 app/helpers/ndl_books_helper.rb
enju_ndl-0.2.2 app/helpers/ndl_books_helper.rb
enju_ndl-0.2.1 app/helpers/ndl_books_helper.rb
enju_ndl-0.2.0 app/helpers/ndl_books_helper.rb
enju_ndl-0.2.0.beta.3 app/helpers/ndl_books_helper.rb
enju_ndl-0.2.0.beta.2 app/helpers/ndl_books_helper.rb
enju_ndl-0.2.0.beta.1 app/helpers/ndl_books_helper.rb
enju_ndl-0.1.1 app/helpers/ndl_books_helper.rb
enju_ndl-0.1.0 app/helpers/ndl_books_helper.rb
enju_ndl-0.1.0.pre38 app/helpers/ndl_books_helper.rb
enju_ndl-0.1.0.pre37 app/helpers/ndl_books_helper.rb
enju_ndl-0.1.0.pre36 app/helpers/ndl_books_helper.rb
enju_ndl-0.1.0.pre35 app/helpers/ndl_books_helper.rb
enju_ndl-0.1.0.pre34 app/helpers/ndl_books_helper.rb