Sha256: b3ebe295c9d3a9f407073cfd0b797253cd1f67ec04e7e4fc0630dd9b4a9a004f

Contents?: true

Size: 633 Bytes

Versions: 8

Compression:

Stored size: 633 Bytes

Contents

# -*- encoding: utf-8 -*-
module CiniiBooksHelper
  def link_to_import_from_cinii(ncid)
    if ncid.blank?
      t('enju_nii.not_available')
    else
      identifier_type = IdentifierType.where(:name => 'ncid').first
      if identifier_type
        manifestation = Identifier.where(:body => ncid, :identifier_type_id => identifier_type.id).first.try(:manifestation)
      end
      unless manifestation
        button_to t('enju_nii.add'), cinii_books_path(book: {ncid: ncid}), method: :post, data: {disable_with: t('page.saving')}
      else
        link_to t('enju_nii.already_exists'), manifestation
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
enju_nii-0.2.1 app/helpers/cinii_books_helper.rb
enju_nii-0.2.0 app/helpers/cinii_books_helper.rb
enju_nii-0.2.0.beta.3 app/helpers/cinii_books_helper.rb
enju_nii-0.2.0.beta.2 app/helpers/cinii_books_helper.rb
enju_nii-0.2.0.beta.1 app/helpers/cinii_books_helper.rb
enju_nii-0.1.1 app/helpers/cinii_books_helper.rb
enju_nii-0.1.0 app/helpers/cinii_books_helper.rb
enju_nii-0.1.0.pre14 app/helpers/cinii_books_helper.rb