trainings feature

dev_trainings
p31729568 6 years ago
parent ce67c42c27
commit 66f52ddfcc

@ -1,7 +1,7 @@
#encoding: utf-8 #encoding: utf-8
class Training < ActiveRecord::Base class Training < ActiveRecord::Base
attr_accessible :address, :email, :name, :phone, :position, :school, :sex, :openid, :training_type, 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 工程教育认证 # 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 "技术体系", tech_system_managements_path %></li>
<li style="width: 120px"><%= link_to "升级通知", update_notice_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 "门户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> </ul>
</li> </li>
</ul> </ul>

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

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

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