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-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
|
|
|
"author" => writing_conference.member_profile.name,
|
|
|
|
"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-07-03 11:30:55 +00:00
|
|
|
writing_conference = WritingConference.where(:is_hidden=>false).find_by(uid: params[:uid])
|
2014-07-03 04:52:21 +00:00
|
|
|
|
|
|
|
files = writing_conference.writing_conference_files.map do |file|
|
|
|
|
{
|
|
|
|
"file_url" => file.file.url,
|
|
|
|
"file_title" => (file.title.blank? ? File.basename(file.file.path) : file.title),
|
|
|
|
"file_ext" => File.extname(file.file.path).sub('.',''),
|
|
|
|
"file_description" => file.description
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
paper_types = writing_conference.conference_paper_types.map do |type|
|
|
|
|
{"paper_type"=>type.title}
|
|
|
|
end
|
|
|
|
|
|
|
|
author_types = writing_conference.conference_author_types.map do |type|
|
|
|
|
{"author_type"=>type.title}
|
|
|
|
end
|
|
|
|
|
|
|
|
paper_levels = writing_conference.conference_paper_levels.map do |level|
|
|
|
|
{"paper_level"=>level.title}
|
|
|
|
end
|
|
|
|
|
|
|
|
{
|
|
|
|
"files" => files,
|
|
|
|
"paper_types" => paper_types,
|
|
|
|
"author_types" => author_types,
|
|
|
|
"paper_levels" => paper_levels,
|
|
|
|
|
|
|
|
"data" => {
|
|
|
|
"paper_title" => writing_conference.paper_title,
|
|
|
|
"conference_title" => writing_conference.conference_title,
|
|
|
|
"authors" => writing_conference.authors,
|
|
|
|
"location" => writing_conference.location,
|
|
|
|
"sponsor" => writing_conference.sponsor,
|
|
|
|
"year" => writing_conference.year,
|
2014-07-18 06:31:29 +00:00
|
|
|
"language" => (t(writing_conference.language) rescue ""),
|
2014-07-03 04:52:21 +00:00
|
|
|
"keywords" => writing_conference.keywords,
|
|
|
|
"abstract" => writing_conference.abstract,
|
|
|
|
"publication_date" => writing_conference.publication_date,
|
|
|
|
"period_start_date"=> writing_conference.period_start_date,
|
|
|
|
"period_end_date" => writing_conference.period_end_date,
|
|
|
|
"url" => writing_conference.url,
|
|
|
|
"note" => writing_conference.note,
|
|
|
|
"isbn" => writing_conference.isbn,
|
|
|
|
"isi_number" => writing_conference.isi_number,
|
|
|
|
|
|
|
|
"td_year" => t("personal_conference.year"),
|
|
|
|
"td_paper_title" => t("personal_conference.paper_title"),
|
|
|
|
"td_conference_title" => t("personal_conference.conference_title"),
|
|
|
|
"td_location" => t("personal_conference.location"),
|
|
|
|
"td_period_start_date" => t("personal_conference.period_start_date"),
|
|
|
|
"td_period_end_date" => t("personal_conference.period_end_date"),
|
|
|
|
"td_duration" => t("personal_conference.duration"),
|
|
|
|
"td_publication_date" => t("personal_conference.publication_date"),
|
|
|
|
"td_sponsor" => t("personal_conference.sponsor"),
|
|
|
|
"td_authors" => t("personal_conference.authors"),
|
|
|
|
"td_language" => t("personal_conference.language"),
|
|
|
|
"td_isbn" => t("personal_conference.isbn"),
|
|
|
|
"td_isi_number" => t("personal_conference.isi_number"),
|
|
|
|
"td_url" => t("personal_conference.url"),
|
|
|
|
"td_keywords" => t("personal_conference.keywords"),
|
|
|
|
"td_abstract" => t("personal_conference.abstract"),
|
|
|
|
"td_note" => t("personal_conference.note"),
|
|
|
|
"td_paper_type" => t("personal_conference.paper_type"),
|
|
|
|
"td_author_type" => t("personal_conference.author_type"),
|
|
|
|
"td_paper_level" => t("personal_conference.paper_level"),
|
|
|
|
"td_files" => t(:file_)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|