This commit is contained in:
manson 2014-07-03 12:53:38 +08:00
parent 22d437b74c
commit a6821b0437
4 changed files with 55 additions and 1 deletions

View File

@ -0,0 +1,50 @@
class PersonalHonorsController < ApplicationController
def index
honors = Honor.all
honor_list = honors.collect do |honor|
{
"year" => honor.year,
"award_name" => honor.award_name,
"awarding_unit" => honor.awarding_unit,
"award_winner" => honor.member_profile.name,
"link_to_show" => OrbitHelper.url_to_show(honor.to_param)
}
end
{
"honors" => honor_list,
"extras" => {
"widget-title" => t("module_name.personal_honor"),
"th_year" => t('personal_honor.year'),
"th_award_name" => t('personal_honor.award_name'),
"th_awarding_unit" => t('personal_honor.awarding_unit'),
"th_award_winner" => t('personal_honor.award_winner'),
"th_detail" => t('detail')
}
}
end
def show
params = OrbitHelper.params
honor = Honor.find_by(uid: params[:uid])
{
"year" => honor.year,
"honor_type" => honor.honor_type.title,
"award_name" => honor.award_name,
"awarding_unit" => honor.awarding_unit,
"language" => t(honor.language),
"keywords" => honor.keywords,
"url" => honor.url,
"note" => honor.note,
"th_year" => t("personal_honor.year"),
"th_honor_type" => t("personal_honor.honor_category"),
"th_award_name" => t("personal_honor.award_name"),
"th_awarding_unit" => t("personal_honor.awarding_unit"),
"th_language" => t("personal_honor.language"),
"th_keywords" => t("personal_honor.keywords"),
"th_url" => t("personal_honor.url"),
"th_note" => t("personal_honor.note")
}
end
end

View File

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

View File

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

View File

@ -4,7 +4,7 @@ module PersonalHonor
OrbitApp.registration "PersonalHonor",:type=> 'ModuleApp' do
module_label 'module_name.personal_honor'
base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true, :sort_number => '50', :app_name=>"Honor", :intro_app_name=>"PersonalHonorIntro",:path=>"/plugin/personal_honor/profile",:front_path=>"/profile",:admin_path=>"/admin/honors",:i18n=>'module_name.personal_honor'
personal_plugin :enable => true, :sort_number => '50', :app_name=>"Honor", :intro_app_name=>"PersonalHonorIntro",:path=>"/plugin/personal_honor/profile",:front_path=>"/profile",:admin_path=>"/admin/honors",:i18n=>'module_name.personal_honor', :module_app_name=>'PersonalHonor'
version "0.1"
organization "Rulingcom"
@ -12,6 +12,8 @@ module PersonalHonor
intro "I am intro"
update_info 'some update_info'
frontend_enabled
icon_class_no_sidebar "icons-user"
end
end
end