From 25062d9ce0ecef0ca1aeac50d5d03f957e02184f Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 26 Sep 2019 09:04:43 +0800 Subject: [PATCH] traning educoder 2019 --- app/controllers/trainings_controller.rb | 1 + app/models/training.rb | 2 +- app/views/managements/training_2018.html.erb | 1 + app/views/trainings/enroll.html.erb | 66 +++++++++++++++++++- app/views/trainings/trainingsInfo.html.erb | 28 +++++++++ 5 files changed, 96 insertions(+), 2 deletions(-) diff --git a/app/controllers/trainings_controller.rb b/app/controllers/trainings_controller.rb index 8650a5a7..6fb1061f 100644 --- a/app/controllers/trainings_controller.rb +++ b/app/controllers/trainings_controller.rb @@ -255,6 +255,7 @@ class TrainingsController < ApplicationController case friendly_id when 'aeee0601_2019' then 3 when 'ceeaa06_2019' then 4 + when 'educoder_2019' then 5 end end diff --git a/app/models/training.rb b/app/models/training.rb index 76e8a773..d7e99620 100644 --- a/app/models/training.rb +++ b/app/models/training.rb @@ -3,7 +3,7 @@ class Training < ActiveRecord::Base attr_accessible :address, :email, :name, :phone, :position, :school, :sex, :openid, :training_type, :major, :student_id, :job_title, :uncertified_major - # training_type 1 2018-培训会 2 警察学院大数据培训会 3 大数据和人工智能 4 工程教育认证 + # training_type 1 2018-培训会 2 警察学院大数据培训会 3 大数据和人工智能 4 工程教育认证 5 EduCoder-创先源于实践 has_one :training_payinfo diff --git a/app/views/managements/training_2018.html.erb b/app/views/managements/training_2018.html.erb index 8ddea516..678d4a08 100644 --- a/app/views/managements/training_2018.html.erb +++ b/app/views/managements/training_2018.html.erb @@ -7,6 +7,7 @@ + + +
  • + 单位 + +
  • + +
  • + 手机号码 + +
  • + +

    + <%= @training.new_record? ? '提交' : '保存' %> + <% end %> + + + +<% end %> \ No newline at end of file diff --git a/app/views/trainings/trainingsInfo.html.erb b/app/views/trainings/trainingsInfo.html.erb index 4233f05f..6ce4a8e6 100644 --- a/app/views/trainings/trainingsInfo.html.erb +++ b/app/views/trainings/trainingsInfo.html.erb @@ -1,3 +1,4 @@ +<% if [3,4].include?(@training.training_type) %>

    报名成功

    @@ -61,4 +62,31 @@ <%= link_to '支付详情', pay_training_path(id: @friendly_id, pay_type: @training.training_payinfo.pay_type), class: 'rightbtn', style: 'width: 100%;' %>
    +<% end %> +<% end %> + +<% if @training.training_type == 5 %> +
    +
    +

    提交成功

    +
    +
    + +
    +

    基本信息

    +
  • + 姓名 + <%= @training.name %> +
  • +
  • + 单位 + <%= @training.school %> +
  • +
  • + 手机号 + <%= @training.phone %> +
  • +
    + + <%= link_to('修改资料', enroll_training_path(id: @friendly_id, disable_redirect: true), class: 'info_updateBtn') %> <% end %> \ No newline at end of file