This commit is contained in:
manson 2014-07-03 12:52:47 +08:00
parent f976d7aba1
commit de48a045ab
4 changed files with 62 additions and 1 deletions

View File

@ -0,0 +1,56 @@
class PersonalDiplomasController < ApplicationController
def index
diplomas = Diploma.all
diploma_list = diplomas.collect do |diploma|
{
"member" => diploma.member_profile.name,
"duration" => diploma.duration,
"school_name" => diploma.school_name,
"degree" => diploma.degree,
"link_to_show" => OrbitHelper.url_to_show(diploma.to_param)
}
end
{
"diplomas" => diploma_list,
"extras" => {
"widget-title" => t("module_name.personal_diploma"),
"th_member" => t('users.name'),
"th_duration" => t('personal_diploma.duration'),
"th_school_name" => t('personal_diploma.school_name'),
"th_degree" => t('personal_diploma.degree'),
"th_detail" => t('detail')
}
}
end
def show
params = OrbitHelper.params
diploma = Diploma.find_by(uid: params[:uid])
{
"school_name" => diploma.school_name,
"country" => diploma.country,
"department" => diploma.department,
"degree" => diploma.degree,
"language" => t(diploma.language),
"keywords" => diploma.keywords,
"start_date" => diploma.start_date,
"end_date" => diploma.end_date,
"duration" => diploma.duration,
"url" => diploma.url,
"note" => diploma.note,
"th_school_name" => t("personal_diploma.school_name"),
"th_country" => t("personal_diploma.country"),
"th_department" => t("personal_diploma.department"),
"th_degree" => t("personal_diploma.degree"),
"th_language" => t("personal_diploma.language"),
"th_keywords" => t("personal_diploma.keywords"),
"th_start_date" => t("personal_diploma.start_date"),
"th_end_date" => t("personal_diploma.end_date"),
"th_duration" => t("personal_diploma.duration"),
"th_url" => t("personal_diploma.url"),
"th_note" => t("personal_diploma.note")
}
end
end

View File

@ -0,0 +1 @@
<%= render_view %>

View File

@ -0,0 +1 @@
<%= render_view %>

View File

@ -4,13 +4,16 @@ module PersonalDiploma
OrbitApp.registration "PersonalDiploma",:type=> 'ModuleApp' do OrbitApp.registration "PersonalDiploma",:type=> 'ModuleApp' do
module_label 'module_name.personal_journal' module_label 'module_name.personal_journal'
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true, :sort_number => '40', :app_name=>"Diploma", :intro_app_name=>"PersonalDiplomaIntro",:path=>"/plugin/personal_diploma/profile",:front_path=>"/profile",:admin_path=>"/admin/diplomas",:i18n=>'module_name.personal_diploma' personal_plugin :enable => true, :sort_number => '40', :app_name=>"Diploma", :intro_app_name=>"PersonalDiplomaIntro",:path=>"/plugin/personal_diploma/profile",:front_path=>"/profile",:admin_path=>"/admin/diplomas",:i18n=>'module_name.personal_diploma', :module_app_name=>'PersonalDiploma'
version "0.1" version "0.1"
organization "Rulingcom" organization "Rulingcom"
author "RD dep" author "RD dep"
intro "I am intro" intro "I am intro"
update_info 'some update_info' update_info 'some update_info'
frontend_enabled
icon_class_no_sidebar "icons-user"
end end
end end
end end