academic_advising/app/helpers/admin/personal_honors_helper.rb

19 lines
628 B
Ruby
Raw Normal View History

2014-12-04 09:55:01 +00:00
module Admin::PersonalHonorsHelper
def get_paper_list
user = current_user.nil? ? OrbitHelper.current_user : current_user
user_profile = user.member_profile
honors = Honor.where(:member_profile_id => user_profile.id)
honors = honors.collect do |h|
{
"id" => h.id.to_s,
"edit_url" => "/#{I18n.locale.to_s}/admin/members/#{user_profile.to_param}/honors/#{h.to_param}/edit",
"delete_url" => "/#{I18n.locale.to_s}/admin/honors/#{h.id.to_s}",
"paper_title" => h.award_name,
"keywords" => h.keywords,
"files" => []
}
end
honors
end
end