page id
This commit is contained in:
parent
456c698d31
commit
f8f86f7b57
|
@ -1,34 +1,35 @@
|
||||||
class DigitalArchivesController < ApplicationController
|
class DigitalArchivesController < ApplicationController
|
||||||
def index
|
def index
|
||||||
if OrbitHelper.params[:item_date_low].nil?
|
params = OrbitHelper.params
|
||||||
@digital_content_archives = DigitalContentArchive.where(:title => /#{OrbitHelper.params[:title]}/ ,
|
if params[:item_date_low].nil?
|
||||||
:character => /#{OrbitHelper.params[:character]}/ ,
|
@digital_content_archives = DigitalContentArchive.where(:title => /#{params[:title]}/ ,
|
||||||
:location => /#{OrbitHelper.params[:location]}/,
|
:character => /#{params[:character]}/ ,
|
||||||
:description =>/#{OrbitHelper.params[:description]}/)
|
:location => /#{params[:location]}/,
|
||||||
elsif OrbitHelper.params[:item_date_low].empty? && OrbitHelper.params[:item_date_high].empty?
|
:description =>/#{params[:description]}/)
|
||||||
@digital_content_archives = DigitalContentArchive.where(:title => /#{OrbitHelper.params[:title]}/ ,
|
elsif params[:item_date_low].empty? && params[:item_date_high].empty?
|
||||||
:character => /#{OrbitHelper.params[:character]}/ ,
|
@digital_content_archives = DigitalContentArchive.where(:title => /#{params[:title]}/ ,
|
||||||
:location => /#{OrbitHelper.params[:location]}/,
|
:character => /#{params[:character]}/ ,
|
||||||
:description =>/#{OrbitHelper.params[:description]}/)
|
:location => /#{params[:location]}/,
|
||||||
elsif OrbitHelper.params[:item_date_low].empty? && !OrbitHelper.params[:item_date_high].empty?
|
:description =>/#{params[:description]}/)
|
||||||
@digital_content_archives = DigitalContentArchive.where(:title => /#{OrbitHelper.params[:title]}/ ,
|
elsif params[:item_date_low].empty? && !params[:item_date_high].empty?
|
||||||
:character => /#{OrbitHelper.params[:character]}/ ,
|
@digital_content_archives = DigitalContentArchive.where(:title => /#{params[:title]}/ ,
|
||||||
:location => /#{OrbitHelper.params[:location]}/,
|
:character => /#{params[:character]}/ ,
|
||||||
:description =>/#{OrbitHelper.params[:description]}/,
|
:location => /#{params[:location]}/,
|
||||||
:item_date.lte => OrbitHelper.params[:item_date_high])
|
:description =>/#{params[:description]}/,
|
||||||
elsif !OrbitHelper.params[:item_date_low].empty? && OrbitHelper.params[:item_date_high].empty?
|
:item_date.lte => params[:item_date_high])
|
||||||
@digital_content_archives = DigitalContentArchive.where(:title => /#{OrbitHelper.params[:title]}/ ,
|
elsif !params[:item_date_low].empty? && params[:item_date_high].empty?
|
||||||
:character => /#{OrbitHelper.params[:character]}/ ,
|
@digital_content_archives = DigitalContentArchive.where(:title => /#{params[:title]}/ ,
|
||||||
:location => /#{OrbitHelper.params[:location]}/,
|
:character => /#{params[:character]}/ ,
|
||||||
:description =>/#{OrbitHelper.params[:description]}/,
|
:location => /#{params[:location]}/,
|
||||||
:item_date.gte => OrbitHelper.params[:item_date_low])
|
:description =>/#{params[:description]}/,
|
||||||
|
:item_date.gte => params[:item_date_low])
|
||||||
else
|
else
|
||||||
@digital_content_archives = DigitalContentArchive.where(:title => /#{OrbitHelper.params[:title]}/ ,
|
@digital_content_archives = DigitalContentArchive.where(:title => /#{params[:title]}/ ,
|
||||||
:character => /#{OrbitHelper.params[:character]}/ ,
|
:character => /#{params[:character]}/ ,
|
||||||
:location => /#{OrbitHelper.params[:location]}/,
|
:location => /#{params[:location]}/,
|
||||||
:description =>/#{OrbitHelper.params[:description]}/,
|
:description =>/#{params[:description]}/,
|
||||||
:item_date.gte => OrbitHelper.params[:item_date_low],
|
:item_date.gte => params[:item_date_low],
|
||||||
:item_date.lte => OrbitHelper.params[:item_date_high])
|
:item_date.lte => params[:item_date_high])
|
||||||
end
|
end
|
||||||
|
|
||||||
dcas = @digital_content_archives.collect do |dca|
|
dcas = @digital_content_archives.collect do |dca|
|
||||||
|
@ -48,9 +49,11 @@ class DigitalArchivesController < ApplicationController
|
||||||
"files" => dcafs
|
"files" => dcafs
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
page = Page.where(:page_id => params[:page_id]).first rescue nil
|
||||||
|
url = page.nil? ? "#" : "/#{I18n.locale.to_s}/#{page.url}"
|
||||||
{
|
{
|
||||||
"digital_content_archives" => dcas
|
"digital_content_archives" => dcas,
|
||||||
|
"page_url" => url
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue