Sha256: 9c032503690149379da7eae976f3e2dc705583fe00abf218d5bc96e00e8f1ae0

Contents?: true

Size: 598 Bytes

Versions: 13

Compression:

Stored size: 598 Bytes

Contents

module HydraDjatokaHelper
  
  def hydra_djatoka_url_for(document, opts={})
    
    if document.kind_of?(SolrDocument)
      pid = document.id
    elsif document.kind_of?(Mash) 
      pid = document[:id]
    elsif document.respond_to?(:pid)
        pid = document.pid
    end
    
    if !pid.nil?
      if opts[:scale]
        result = url_for(:controller=>:get,:action=>"show",:id=>pid, :format=>"jp2", "image_server[scale]"=>opts[:scale])
      else
        result = url_for(:controller=>:get,:action=>"show",:id=>pid, :format=>"jp2", "image_server"=>true)
      end
    end
      
  end
  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
hydra-head-3.1.0.pre5 app/helpers/hydra_djatoka_helper.rb
hydra-head-3.1.0.pre4 app/helpers/hydra_djatoka_helper.rb
hydra-head-3.1.0.pre3 app/helpers/hydra_djatoka_helper.rb
hydra-head-3.0.1 app/helpers/hydra_djatoka_helper.rb
hydra-head-3.1.0.pre2 app/helpers/hydra_djatoka_helper.rb
hydra-head-3.0.0 app/helpers/hydra_djatoka_helper.rb
hydra-head-3.1.0.pre1 app/helpers/hydra_djatoka_helper.rb
hydra-head-3.0.0.rc2 app/helpers/hydra_djatoka_helper.rb
hydra-head-3.0.0.rc1 app/helpers/hydra_djatoka_helper.rb
hydra-head-3.0.0pre4 app/helpers/hydra_djatoka_helper.rb
hydra-head-3.0.0pre3 app/helpers/hydra_djatoka_helper.rb
hydra-head-3.0.0pre2 app/helpers/hydra_djatoka_helper.rb
hydra-head-3.0.0pre1 app/helpers/hydra_djatoka_helper.rb