added period

This commit is contained in:
Harry Bomrah 2016-04-06 14:31:26 +08:00
parent fc95e27412
commit 4106d684f4
2 changed files with 14 additions and 0 deletions

View File

@ -39,6 +39,8 @@ class PersonalConferencesController < ApplicationController
t << {"value" => (writing_conference.send(fs).strftime("%Y/%m/%d") rescue "")}
when "author_type"
t << {"value" => (writing_conference.conference_author_types.collect{|cat| cat.title}.join(", ") rescue "")}
when "period"
t << {"value" => writing_conference.duration}
else
t << {"value" => writing_conference.send(fs)}
end
@ -76,6 +78,7 @@ class PersonalConferencesController < ApplicationController
"location",
"period_start_date",
"period_end_date",
"period",
"paper_type",
"paper_level",
"sponsor",
@ -103,6 +106,7 @@ class PersonalConferencesController < ApplicationController
"location",
"period_start_date",
"period_end_date",
"period",
"paper_type",
"paper_level",
"sponsor",

View File

@ -64,6 +64,14 @@ class WritingConference
title.join(', ')
end
def duration
if !self.send('period_start_date').nil? or !self.send('period_end_date').nil?
date = (self.send('period_start_date').strftime('%Y.%m.%d') rescue "")+' ~ '+(self.send('period_end_date').strftime('%Y.%m.%d') rescue I18n.t('personal_project.up_to_today'))
else
date = ""
end
end
def self.get_plugin_datas_to_member(datas)
@ -121,6 +129,8 @@ class WritingConference
pd_data << {"data_title" => ( !p.conference_paper_levels.blank? ? p.conference_paper_levels.collect{|x| x.title}.join(', ') : "")}
when "author_type"
pd_data << {"data_title" => (p.conference_author_types.collect{|cat| cat.title}.join(", ") rescue "")}
when "period"
pd_data << {"data_title" => p.duration}
else
pd_data << { "data_title" => p.send(t) }
end