Sha256: 8e0d6e7f4edb193ffb5ab00bb01a6ddbb43e8993f5b000cc58bad612d8969f63

Contents?: true

Size: 624 Bytes

Versions: 8

Compression:

Stored size: 624 Bytes

Contents

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

8 entries across 8 versions & 1 rubygems

Version Path
enju_ndl-0.3.3 app/helpers/ndl_books_helper.rb
enju_ndl-0.3.2 app/helpers/ndl_books_helper.rb
enju_ndl-0.4.0.rc.1 app/helpers/ndl_books_helper.rb
enju_ndl-0.4.0.beta.1 app/helpers/ndl_books_helper.rb
enju_ndl-0.3.1 app/helpers/ndl_books_helper.rb
enju_ndl-0.3.0 app/helpers/ndl_books_helper.rb
enju_ndl-0.3.0.rc.1 app/helpers/ndl_books_helper.rb
enju_ndl-0.3.0.beta.1 app/helpers/ndl_books_helper.rb