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

52 lines
1.5 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-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 = [
2015-01-09 07:32:31 +00:00
"year",
"authors",
"paper_title",
"conference_title",
"location",
"period_start_date",
"period_end_date",
"paper_type",
"paper_level",
"sponsor",
"author_type",
"number_of_authors",
"abstract",
"url",
"file",
"publication_date",
"isbn",
"isi_number" ,
"language"
]
2014-08-01 11:04:43 +00:00
{"plugin_datas"=>plugin.get_plugin_data(fields_to_show)}
2014-07-03 04:52:21 +00:00
end
end