Sha256: a91cea28f5f9953e2272c056dc9ba865f670493aa3edf0b6299dbe035ad04877

Contents?: true

Size: 999 Bytes

Versions: 49

Compression:

Stored size: 999 Bytes

Contents

module EnjuCirculation
  module ManifestationsHelper
    def link_to_reservation(manifestation, reserve)
      unless current_user
        unless manifestation.items.for_checkout.empty?
          link_to t('manifestation.reserve_this'), new_reserve_path(:manifestation_id => manifestation.id)
        end
      else
        if current_user.has_role?('Librarian')
          link_to t('manifestation.reserve_this'), new_reserve_path(:manifestation_id => manifestation.id)
        else
          if manifestation.is_checked_out_by?(current_user)
            I18n.t('manifestation.currently_checked_out')
          else
            if manifestation.is_reserved_by?(current_user)
              link_to t('manifestation.cancel_reservation'), reserve, :confirm => t('page.are_you_sure'), :method => :delete 
            else
              link_to t('manifestation.reserve_this'), new_reserve_path(:manifestation_id => manifestation.id)
            end
          end
        end
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
enju_circulation-0.1.0.pre42 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre41 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre40 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre39 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre38 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre37 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre36 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre35 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre34 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre33 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre32 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre31 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre30 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre29 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre28 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre27 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre26 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre25 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre24 lib/enju_circulation/helper.rb
enju_circulation-0.1.0.pre23 lib/enju_circulation/helper.rb