personal-conference/app/controllers/personal_conferences_contro...

53 lines
2.1 KiB
Ruby
Raw Normal View History

2014-07-03 04:52:21 +00:00
class PersonalConferencesController < ApplicationController
def index
2014-07-18 06:31:29 +00:00
writing_conferences = WritingConference.where(:is_hidden=>false).order_by(:year=>'desc').page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
2014-10-03 06:14:27 +00:00
2014-07-03 04:52:21 +00:00
writing_conference_list = writing_conferences.collect do |writing_conference|
{
"year" => writing_conference.year,
2014-07-04 04:06:42 +00:00
"paper_title" => writing_conference.create_link,
2014-10-03 06:14:27 +00:00
"author" => (writing_conference.member_profile.name rescue ""),
2014-07-03 04:52:21 +00:00
"link_to_show" => OrbitHelper.url_to_show(writing_conference.to_param)
}
end
{
"writing_conferences" => writing_conference_list,
"extras" => {
"widget-title" => t("module_name.personal_conference"),
"th_year" => t('personal_plugins.year'),
"th_title" => t("personal_conference.paper_title"),
"th_author" => t('personal_plugins.author')
2014-07-18 06:31:29 +00:00
},
"total_pages" => writing_conferences.total_pages
2014-07-03 04:52:21 +00:00
}
end
def show
params = OrbitHelper.params
2014-08-01 11:04:43 +00:00
plugin = WritingConference.where(:is_hidden=>false).find_by(uid: params[:uid])
fields_to_show = [
"paper_title",
"conference_title",
"paper_level",
"paper_type",
2014-08-11 11:18:02 +00:00
"author_name",
2014-08-01 11:04:43 +00:00
"authors",
2014-08-11 11:18:02 +00:00
"number_of_authors",
2014-08-01 11:04:43 +00:00
"author_type",
"year",
"language",
"isi_number",
"period_start_date",
"period_end_date",
"url",
"isbn",
"note",
"location",
"sponsor",
"file"
]
{"plugin_datas"=>plugin.get_plugin_data(fields_to_show)}
2014-07-03 04:52:21 +00:00
end
end