fix
This commit is contained in:
parent
d4962d20b3
commit
88c57e0b0c
|
@ -43,12 +43,12 @@ class Survey
|
||||||
|
|
||||||
def time_range
|
def time_range
|
||||||
r = "#{self.postdate.to_date}"
|
r = "#{self.postdate.to_date}"
|
||||||
r += "- #{self.deadline.to_date}" unless self.deadline.nil?
|
r += "- #{self.deadline.to_date}" if self.deadline
|
||||||
r
|
r
|
||||||
end
|
end
|
||||||
|
|
||||||
def result
|
def result
|
||||||
if ( self.result_type == Survey::ResultChart && Time.now > self.deadline ) ||
|
if ( self.result_type == Survey::ResultChart && self.deadline && Time.now > self.deadline ) ||
|
||||||
( self.result_type == Survey::ResultExtern && !self.extern_link.blank? ) ||
|
( self.result_type == Survey::ResultExtern && !self.extern_link.blank? ) ||
|
||||||
( self.result_type == Survey::ResultFile && self.upload_file? )
|
( self.result_type == Survey::ResultFile && self.upload_file? )
|
||||||
('<a href="'+Rails.application.routes.url_helpers.result_panel_survey_front_end_survey_path(self) + '"><img src="/assets/result.png" /></a>').html_safe
|
('<a href="'+Rails.application.routes.url_helpers.result_panel_survey_front_end_survey_path(self) + '"><img src="/assets/result.png" /></a>').html_safe
|
||||||
|
@ -58,7 +58,7 @@ class Survey
|
||||||
end
|
end
|
||||||
|
|
||||||
def write
|
def write
|
||||||
if Time.now < self.deadline
|
if self.deadline || Time.now < self.deadline
|
||||||
('<a href="' + Rails.application.routes.url_helpers.panel_survey_front_end_survey_path(self) + '"><img src="/assets/write.png" /></a>').html_safe
|
('<a href="' + Rails.application.routes.url_helpers.panel_survey_front_end_survey_path(self) + '"><img src="/assets/write.png" /></a>').html_safe
|
||||||
else
|
else
|
||||||
''
|
''
|
||||||
|
|
Loading…
Reference in New Issue