Sha256: 44f3be8ecccb13152c3fe756524d6b2ab37f7112f6dbb00ab25a4eebca6318a8

Contents?: true

Size: 1.29 KB

Versions: 32

Compression:

Stored size: 1.29 KB

Contents

require 'ostruct'

module SearchHelper

  def search_result_target_window
    umlaut_config.lookup!("search.result_link_target","")
  end

  # pass in an openurl context obj.
  # return an OpenStruct with atitle_label, title_label
  def referent_labels(context_obj = @current_context_object)
    ref_meta = context_obj.referent.metadata
    
    result = OpenStruct.new
    
    if ref_meta['genre'].blank?
      case @current_context_object.referent.format 
      when  'book'
        result.atitle = 'Chapter/Part Title'
      when @current_context_object.referent.format == 'journal'
        result.atitle = 'Article Title'
      end
      result.title = 'Title'      
    else
      case ref_meta["genre"]
      when /article|journal|issue/
        result.atitle = 'Article Title'
        result.title = 'Journal Title'
      when /bookitem|book/
        result.atitle = 'Chapter/Part Title'
        result.title = 'Book Title'
      when /proceeding|conference/
        result.atitle = 'Proceeding Title'
        result.title = 'Conference Name'
      when 'report'
        result.atitle = 'Report Title'
        result.title = 'Report'
      end
    end

    return result    
  end
  
  # A-Z buttons in search page
  def group_list
    group_list ||= ('A'..'Z').to_a.push('0-9').push('Other')  
  end
  

end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
umlaut-3.0.5 app/helpers/search_helper.rb
umlaut-3.0.4 app/helpers/search_helper.rb
umlaut-3.0.3 app/helpers/search_helper.rb
umlaut-3.0.2 app/helpers/search_helper.rb
umlaut-3.0.1 app/helpers/search_helper.rb
umlaut-3.0.0 app/helpers/search_helper.rb
umlaut-3.0.0rc1 app/helpers/search_helper.rb
umlaut-3.0.0beta10 app/helpers/search_helper.rb
umlaut-3.0.0beta9 app/helpers/search_helper.rb
umlaut-3.0.0beta8 app/helpers/search_helper.rb
umlaut-3.0.0beta7 app/helpers/search_helper.rb
umlaut-3.0.0beta6 app/helpers/search_helper.rb
umlaut-3.0.0beta5 app/helpers/search_helper.rb
umlaut-3.0.0beta4 app/helpers/search_helper.rb
umlaut-3.0.0beta3 app/helpers/search_helper.rb
umlaut-3.0.0beta2 app/helpers/search_helper.rb
umlaut-3.0.0beta1 app/helpers/search_helper.rb
umlaut-3.0.0alpha15 app/helpers/search_helper.rb
umlaut-3.0.0alpha14 app/helpers/search_helper.rb
umlaut-3.0.0alpha13 app/helpers/search_helper.rb