Merge branch 'dev_trainings' into develop

dev_bj
p31729568 6 years ago
commit e7364ee9e9

@ -1,7 +1,7 @@
#encoding: utf-8
class Training < ActiveRecord::Base
attr_accessible :address, :email, :name, :phone, :position, :school, :sex, :openid, :training_type,
:major, :student_id
:major, :student_id, :job_title, :uncertified_major
# training_type 1 2018-培训会 2 警察学院大数据培训会 3 大数据和人工智能 4 工程教育认证

@ -137,7 +137,7 @@
<li style="width: 120px"><%= link_to "技术体系", tech_system_managements_path %></li>
<li style="width: 120px"><%= link_to "升级通知", update_notice_managements_path %></li>
<li style="width: 120px"><%= link_to "门户banner设置", setting_banner_managements_path %></li>
<li style="width: 120px"><%= link_to "2018培训会", training_2018_managements_path %></li>
<li style="width: 120px"><%= link_to "培训会", training_2018_managements_path %></li>
</ul>
</li>
</ul>

@ -152,6 +152,16 @@
name="position"
value="<%= @training.position %>"/>
</li>
<% if @training_type == 4 %>
<li class="clearfix infoBar">
<span class="left_tag fl">职务</span>
<input type="text" class="right_input" placeholder="请输入职务" id="jobTitle"
name="job_title"
value="<%= @training.job_title %>"/>
</li>
<% end %>
<li class="clearfix infoBar">
<span class="left_tag fl">手机号码</span>
<input type="text" class="right_input" placeholder="请输入手机号" id="userphone"
@ -159,6 +169,15 @@
value="<%= @training.phone %>"/>
</li>
<% if @training_type == 4 %>
<li class="clearfix infoBar">
<span class="left_tag fl">待认证专业</span>
<input type="text" class="right_input" placeholder="请输入专业名称" id="uncertifiedMajor"
name="uncertified_major"
value="<%= @training.uncertified_major %>"/>
</li>
<% end %>
<% if @training_type == 3 %>
<p class="subtitle">您关注的课程类型最少选1项</p>
@ -242,6 +261,13 @@
return;
}
<% if @training_type == 4 %>
if ($("#uncertifiedMajor").val() == '') {
alert("请输入专业名称");
return;
}
<% end %>
<% if @training_type == 3 %>
if ($("input[type='checkbox'][name='research_field[]']:checked").length == 0) {
alert('请选择您关注的课程类型');

@ -17,10 +17,22 @@
<label>职位</label>
<span><%= @training.position %></span>
</p>
<% if @training_type == 4 %>
<p class="clearfix">
<label>职位</label>
<span><%= @training.job_title %></span>
</p>
<% end %>
<p class="clearfix">
<label>手机号</label>
<span><%= @training.phone %></span>
</p>
<% if @training_type == 4 %>
<p class="clearfix">
<label>待认证专业</label>
<span><%= @training.uncertified_major %></span>
</p>
<% end %>
</div>
<!-- 地址<div class="df showPanel">
@ -85,18 +97,20 @@
<% end %>
</div>
<div class="showPanel">
<% if @training.training_payinfo.info.present? %>
<p class="clearfix mb5"><label>备注信息</label></p>
<p class="mb5 line20"><%= @training.training_payinfo.info %></p>
<% end %>
<% if @training.training_payinfo.attachment_id.to_i > 0 || @training.training_payinfo.pay_type != TrainingPayinfo::PayType_Wechat %>
<p class="clearfix mb5"><label>支付凭证</label></p>
<!--图片上传-->
<%= render partial: 'upload_img', locals: { training: @training, disabled: true } %>
<% end %>
</div>
<% if @training.training_payinfo.info.present? || (@training.training_payinfo.attachment_id.to_i > 0 || @training.training_payinfo.pay_type != TrainingPayinfo::PayType_Wechat) %>
<div class="showPanel">
<% if @training.training_payinfo.info.present? %>
<p class="clearfix mb5"><label>备注信息</label></p>
<p class="mb5 line20"><%= @training.training_payinfo.info %></p>
<% end %>
<% if @training.training_payinfo.attachment_id.to_i > 0 || @training.training_payinfo.pay_type != TrainingPayinfo::PayType_Wechat %>
<p class="clearfix mb5"><label>支付凭证</label></p>
<!--图片上传-->
<%= render partial: 'upload_img', locals: { training: @training, disabled: true } %>
<% end %>
</div>
<% end %>
<br/>
<br/>

@ -21,10 +21,22 @@
<span>职称</span>
<span><%= @training.position %></span>
</li>
<% if @training_type == 4 %>
<li class="clearfix">
<span>职务</span>
<span><%= @training.job_title %></span>
</li>
<% end %>
<li class="clearfix">
<span>手机号</span>
<span><%= @training.phone %></span>
</li>
<% if @training_type == 4 %>
<li class="clearfix">
<span>待认证专业</span>
<span><%= @training.uncertified_major %></span>
</li>
<% end %>
</div>
<% if @training.training_type == 3 %>

@ -0,0 +1,6 @@
class AddColumnsToTrainings < ActiveRecord::Migration
def change
add_column :trainings, :job_title, :string
add_column :trainings, :uncertified_major, :string
end
end
Loading…
Cancel
Save