Add display agree reviewers in backend page.

This commit is contained in:
BoHung Chiu 2022-06-26 17:01:35 +08:00
parent 49e2e3c7c7
commit 24473a13b1
1 changed files with 18 additions and 2 deletions

View File

@ -107,14 +107,30 @@ class ApplicationFormSignup
self.process_stage = new_stage
self.save
end
def review_progress
def review_progress(with_details=true)
stage_trans = I18n.t('application_form.stage')
max_stage = @max_stage
if max_stage.nil?
max_stage = self.application_form_main.get_max_stage
end
max_stage += 1
" #{I18n.t('application_form.num.'+self.process_stage.to_s)}#{stage_trans} / #{I18n.t('application_form.num.'+max_stage.to_s)}#{stage_trans} : #{I18n.t('application_form.status.'+review_status.to_s)}"
text = "#{I18n.t('application_form.num.'+self.process_stage.to_s)}#{stage_trans} / #{I18n.t('application_form.num.'+max_stage.to_s)}#{stage_trans} : #{I18n.t('application_form.status.'+review_status.to_s)}"
if with_details
text += "<br>"
text += review_details
end
text
end
def review_details
text = ""
stage_trans = I18n.t('application_form.stage')
self.agree_reviewer_ids.each do |i, member_id|
m = MemberProfile.find(member_id) rescue nil
if m
text += "#{I18n.t('application_form.num.'+(i.to_i+1).to_s)}#{stage_trans}: #{m.tmp_name}<br>"
end
end
text
end
def get_reviewer_email(stage=self.process_stage, override_reviewer_ids_list=nil, only_email=false)
stage = stage - 1