app/controllers/collections_controller.rb
# TODO - review these. There are too many and as a result there's some redundancy in, for example, checking whether the user is logged in on unpublished
# collections
review these. There are too many and as a result there's some redundancy in, for example, checking whether the user is logged in on unpublished
collections
review these . There are too many and as a result there ' s some redundancy in for example checking whether the user is logged in on unpublished collections
def choose_collect_target
    return must_be_logged_in unless logged_in?
    @collections = current_user.all_collections || []
    @sorts = {
      I18n.t(:sort_by_alphabetical_option) => :alpha,
      I18n.t(:sort_by_recently_updated_option) => :recent,
    }
    Collection.preload_associations(@collections, [ :resource, :resource_preview ])
    @collections.delete_if { |c| c.is_resource_collection? }
    @collections_recently_updated = @collections.sort_by(&:updated_at).reverse
    raise EOL::Exceptions::ObjectNotFound unless @item
    @page_title = I18n.t(:collect_item) + " - " + @item.summary_name
    respond_to do |format|
      format.html do
        render 'choose_collect_target', layout: 'choose_collect_target'
      end
      format.js { render partial: 'choose_collect_target' }
    end
  end
def choose_collect_target return must_be_logged_in unless logged_in? @collections = current_user . all_collections || [ ] @sorts = { I18n . t ( :sort_by_alphabetical_option ) => :alpha , I18n . t ( :sort_by_recently_updated_option ) => :recent , } Collection . preload_associations ( @collections , [ :resource , :resource_preview ] ) @collections . delete_if { | c | c . is_resource_collection? } @collections_recently_updated = @collections . sort_by ( & :updated_at ) . reverse raise EOL :: Exceptions :: ObjectNotFound unless @item @page_title = I18n . t ( :collect_item ) + " - " + @item . summary_name respond_to do | format | format . html do render 'choose_collect_target' , layout : 'choose_collect_target' end format . js { render partial : 'choose_collect_target' } end end
TODO - review these.
TODO - review these .