personal-experience/app/helpers/admin/personal_experiences_helper.rb

20 lines
706 B
Ruby

module Admin::PersonalExperiencesHelper
def get_paper_list
user = current_user.nil? ? OrbitHelper.current_user : current_user
user_profile = user.member_profile
experiences = Experience.where(:member_profile_id => user_profile.id)
experiences = experiences.collect do |e|
{
"id" => e.id.to_s,
"edit_url" => "/#{I18n.locale.to_s}/admin/members/#{user_profile.to_param}/experiences/#{e.to_param}/edit",
"delete_url" => "/#{I18n.locale.to_s}/admin/experiences/#{e.id.to_s}",
"paper_title" => e.organizationt_title,
"keywords" => e.keywords,
"abstract" => [],
"files" => []
}
end
experiences
end
end