2014-07-03 11:25:50 +00:00
|
|
|
class PersonalLabsController < ApplicationController
|
|
|
|
def index
|
2014-07-18 07:04:34 +00:00
|
|
|
labs = Lab.where(:is_hidden=>false).order_by(:year=>'desc').page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
|
2014-07-03 11:25:50 +00:00
|
|
|
lab_list = labs.collect do |lab|
|
|
|
|
{
|
|
|
|
"year" => lab.year,
|
|
|
|
"lab_title" => lab.lab_title,
|
|
|
|
"location" => lab.location,
|
|
|
|
"member" => lab.member_profile.name,
|
|
|
|
"link_to_show" => OrbitHelper.url_to_show(lab.to_param)
|
|
|
|
}
|
|
|
|
end
|
|
|
|
{
|
|
|
|
"labs" => lab_list,
|
|
|
|
"extras" => {
|
|
|
|
"widget-title" => t("module_name.personal_lab"),
|
|
|
|
"th_year" => t('personal_lab.year'),
|
|
|
|
"th_lab_title" => t('module_name.personal_lab'),
|
|
|
|
"th_location" => t('personal_lab.location'),
|
|
|
|
"th_member" => t('users.name'),
|
|
|
|
"th_detail" => t('detail')
|
2014-07-18 07:04:34 +00:00
|
|
|
},
|
|
|
|
"total_pages" => labs.total_pages
|
2014-07-03 11:25:50 +00:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
|
|
|
params = OrbitHelper.params
|
2014-08-01 11:48:33 +00:00
|
|
|
plugin = Lab.where(:is_hidden=>false).find_by(uid: params[:uid])
|
|
|
|
fields_to_show = [
|
|
|
|
"lab_title",
|
|
|
|
"location",
|
|
|
|
"participating_professor",
|
|
|
|
"participating_student",
|
|
|
|
"research_direction",
|
|
|
|
"facility",
|
|
|
|
"year",
|
|
|
|
"keywords",
|
|
|
|
"extension_no",
|
|
|
|
"url",
|
|
|
|
"note",
|
|
|
|
"file"
|
|
|
|
]
|
2014-07-03 11:25:50 +00:00
|
|
|
|
2014-08-01 11:48:33 +00:00
|
|
|
{"plugin_datas"=>plugin.get_plugin_data(fields_to_show)}
|
2014-07-03 11:25:50 +00:00
|
|
|
end
|
|
|
|
end
|