show page

This commit is contained in:
Ruling-Mac 2015-10-21 18:32:10 +08:00
parent ce7fb013d0
commit 2b51e31dd9
1 changed files with 52 additions and 0 deletions

View File

@ -44,6 +44,7 @@ class DigitalArchivesController < ApplicationController
end
end
{
"link_to_show" => OrbitHelper.url_to_show(dca.to_param),
"title" => (dca.title rescue ""),
"item-date" => (dca.item_date rescue ""),
"location" => (dca.location rescue ""),
@ -83,5 +84,56 @@ class DigitalArchivesController < ApplicationController
end
def show
params = OrbitHelper.params
dca = DigitalContentArchive.find_by_param(params[:uid])
dcafs = dca.digital_content_archive_files.collect do |file|
if file.choose_lang.include?(I18n.locale.to_s)
title = (file.file_title.blank? ? File.basename(file.file.path) : file.file_title) rescue ""
extension = file.file.file.extension.downcase rescue ""
# url = file.file.url rescue ""
{
"file-name" => title
}
end
end
url = page.nil? ? "#" : "/#{I18n.locale.to_s}#{page.url}"
dca = {
"title" => (dca.title rescue ""),
"item-date" => (dca.item_date rescue ""),
"location" => (dca.location rescue ""),
"department" => (dca.department rescue ""),
"character" => (dca.character rescue ""),
"description" => (dca.description rescue ""),
"detail-description" => (dca.detail_description rescue ""),
"material" => (dca.material rescue ""),
"size" => (dca.size rescue ""),
"item-id" => (dca.item_id rescue ""),
"item-from" => (dca.item_from rescue ""),
"item-status" => (dca.item_status rescue ""),
"album-content" => (dca.album_content rescue ""),
"files" => dcafs
}
dcas =
{
"digital_content_archives" => dca,
"extras" => {
"th_title" => t('title'),
"th_location" => t("digital_archive.location"),
"th_department" => t('digital_archive.department'),
"th_character" => t('digital_archive.character'),
"th_description" => t('digital_archive.description'),
"th_detaildes" => t('digital_archive.detail_description'),
"th_material" => t('digital_archive.material'),
"th_size" => t('digital_archive.size'),
"th_item_date" => t('digital_archive.item_date'),
"th_item_id" => t('digital_archive.item_id'),
"th_item_from" => t('digital_archive.item_from'),
"th_item_status" => t('digital_archive.item_status')
}
}
end
end