lib/enju_circulation/helper.rb in enju_circulation-0.2.5 vs lib/enju_circulation/helper.rb in enju_circulation-0.3.0.beta.1
- old
+ new
@@ -1,24 +1,24 @@
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
if current_user.has_role?('Librarian')
- link_to t('manifestation.reserve_this'), new_reserve_path(:manifestation_id => manifestation.id)
+ 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
+ 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)
+ link_to t('manifestation.reserve_this'), new_reserve_path(manifestation_id: manifestation.id)
end
end
+ end
+ else
+ unless manifestation.items.for_checkout.empty?
+ link_to t('manifestation.reserve_this'), new_reserve_path(manifestation_id: manifestation.id)
end
end
end
end
end