forked from saurabh/personal-diploma
19 lines
609 B
Ruby
19 lines
609 B
Ruby
|
module Admin::PersonalDiplomasHelper
|
||
|
|
||
|
def get_paper_list
|
||
|
user = current_user.nil? ? OrbitHelper.current_user : current_user
|
||
|
user_profile = user.member_profile
|
||
|
diplomas = Diploma.where(:member_profile_id => user_profile.id)
|
||
|
|
||
|
diplomas = diplomas.collect do |d|
|
||
|
{
|
||
|
"id" => d.id.to_s,
|
||
|
"edit_url" => "/#{I18n.locale.to_s}/admin/members/#{user_profile.to_param}/diplomas/#{d.to_param}/edit",
|
||
|
"delete_url" => "/#{I18n.locale.to_s}/admin/diplomas/#{d.id.to_s}",
|
||
|
"paper_title" => d.school_name,
|
||
|
"files" => []
|
||
|
}
|
||
|
end
|
||
|
diplomas
|
||
|
end
|
||
|
end
|