personal-experience/app/controllers/personal_experiences_contro...

58 lines
2.3 KiB
Ruby

class PersonalExperiencesController < ApplicationController
def index
experiences = Experience.where(:is_hidden=>false).all
experience_list = experiences.collect do |experience|
{
"member" => experience.member_profile.name,
"duration" => experience.duration,
"organizationt_title" => experience.organizationt_title,
"department" => experience.department,
"job_title" => experience.job_title,
"link_to_show" => OrbitHelper.url_to_show(experience.to_param)
}
end
{
"experiences" => experience_list,
"extras" => {
"widget-title" => t("module_name.personal_experience"),
"th_member" => t('users.name'),
"th_duration" => t('personal_experience.duration'),
"th_organizationt_title" => t('personal_experience.organizationt_title'),
"th_department" => t('personal_experience.department'),
"th_job_title" => t('personal_experience.job_title'),
"th_detail" => t('detail')
}
}
end
def show
params = OrbitHelper.params
experience = Experience.where(:is_hidden=>false).find_by(uid: params[:uid])
{
"organizationt_title" => experience.organizationt_title,
"department" => experience.department,
"job_title" => experience.job_title,
"experience_type" => experience.experience_type.title,
"language" => t(experience.language),
"start_date" => experience.start_date,
"end_date" => experience.end_date,
"duration" => experience.duration,
"keywords" => experience.keywords,
"url" => experience.url,
"note" => experience.note,
"th_organizationt_title" =>t("personal_experience.organizationt_title") ,
"th_department" =>t("personal_experience.department") ,
"th_job_title" =>t("personal_experience.job_title") ,
"th_experience_type" =>t("personal_experience.experience_category") ,
"th_language" =>t("personal_experience.language") ,
"th_start_date" =>t("personal_experience.start_date") ,
"th_end_date" =>t("personal_experience.end_date") ,
"th_duration" =>t("personal_experience.duration") ,
"th_keywords" =>t("personal_experience.keywords") ,
"th_url" =>t("personal_experience.url") ,
"th_note" =>t("personal_experience.note")
}
end
end