Module: ApplicationHelper

Includes:
Atrium::ApplicationHelper, Atrium::CollectionsHelper, Atrium::ShowcasesHelper, NavigationHelper, SolrHelper
Included in:
AtriumBaseController, DescriptionsController
Defined in:
lib/generators/atrium/install/templates/helpers/application_helper.rb

Instance Method Summary collapse

Methods included from SolrHelper

#__initialize_collection, #get_current_browse_level, #get_exhibit_navigation_data

Methods included from NavigationHelper

#add_browse_facet_params, #get_browse_facet_path, #get_selected_browse_facet_path, #get_selected_browse_facets, #remove_related_facet_params

Methods included from Atrium::ShowcasesHelper

#facet_element, #get_parent_path, #get_showcase_parent_edit_path, #get_showcase_parent_show_path, #render_showcase_facet_selection

Methods included from Atrium::CollectionsHelper

#get_saved_items, #get_saved_search, #saved_searches_for_select

Instance Method Details

#application_nameObject



29
30
31
# File 'lib/generators/atrium/install/templates/helpers/application_helper.rb', line 29

def application_name
  "Digitial Collections — Rare Books & Special Collections".html_safe
end

TODO: Improve the robustness of this implementation



21
22
23
# File 'lib/generators/atrium/install/templates/helpers/application_helper.rb', line 21

def breadcrumb_builder
  @collection.pretty_title
end


16
17
18
# File 'lib/generators/atrium/install/templates/helpers/application_helper.rb', line 16

def breadcrumb_links
  in_collection_context? ? breadcrumb_builder : "Search Across Collections"
end

#collection_titleObject



33
34
35
36
37
38
39
40
41
# File 'lib/generators/atrium/install/templates/helpers/application_helper.rb', line 33

def collection_title
  if @collection
    if @collection.title_markup.blank?
      "<h1 id=\"collection-title\">#{@collection.title}</h1>".html_safe
    else
      "<div id=\"collection-title\">#{@collection.title_markup}\n</div>".html_safe
    end
  end
end

#if_browsing_facet?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/generators/atrium/install/templates/helpers/application_helper.rb', line 25

def if_browsing_facet?
  params[:f] && current_user
end

#in_collection_context?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/generators/atrium/install/templates/helpers/application_helper.rb', line 12

def in_collection_context?
  !defined?(@collection).nil?
end

#in_unscoped_catalog_search?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/generators/atrium/install/templates/helpers/application_helper.rb', line 8

def in_unscoped_catalog_search?
  (params[:controller] == "catalog") && !params[:id]
end