dev_aliyun
jingquan huang 5 years ago
commit d7659f8f3c

@ -377,10 +377,10 @@ class AccountController < ApplicationController
else
us = UsersService.new
@user = us.register user_params.merge(:should_confirmation_password => false)
# # 注册时,记录是否是引流用户
# ip = request.remote_ip
# ua = UserAgent.find_by_ip(ip)
# ua.update_column(:type, UserAgent::REGISTER) if ua
# 注册时,记录是否是引流用户
ip = request.remote_ip
ua = UserAgent.find_by_ip(ip)
ua.update_column(:type, UserAgent::REGISTER) if ua
if !@user.new_record?
self.logged_user = @user
flash[:notice] = l(:notice_account_activated)

@ -114,9 +114,7 @@ class CompetitionTeamsController < ApplicationController
new_team.team_members.create!(user_id: user_id, role: 3, competition_id: @competition.id, is_teacher: 1)
end
# 创建时,记录是否是引流用户
# ip = request.remote_ip
# ua = UserAgent.find_by_ip(ip)
# ua.update_column(:type, UserAgent::COMPETITION) if ua
record_agent_user_action
end
end
@ -230,10 +228,8 @@ class CompetitionTeamsController < ApplicationController
end
team.team_members.create!(user_id: User.current.id, role: 2, competition_id: @competition.id)
# # 创建时,记录是否是引流用户
# ip = request.remote_ip
# ua = UserAgent.find_by_ip(ip)
# ua.update_column(:type, UserAgent::COMPETITION) if ua
# 记录引流
record_agent_user_action
end
end
@ -351,7 +347,7 @@ class CompetitionTeamsController < ApplicationController
end
def record_agent_user_action
# 注册时,记录是否是引流用户
# 记录是否是引流用户的行为
ip = request.remote_ip
ua = UserAgent.find_by_ip(ip)
ua.update_column(:type, UserAgent::COMPETITION) if ua

@ -23,6 +23,7 @@
<%= f.text_field :author_name, placeholder: '请输入姓名', class: 'greyInput winput-300-35 mr20 fl winput150', width: '163', size: 30 %>
<p style="height:20px;line-height:20px;"><span class="color-red none" id="author_name_notice">请输入姓名</span></p>
</li>
<span class="color-red none" id="title_author_name">字数不能超过10个字</span>
<li class="fl">
<%= f.text_field :author_school_name, placeholder: '请输入作者单位名称', class: 'greyInput winput-300-35 mr20 fl', width: '163', size: 30 %>
<p style="height:20px;line-height:20px;"><span class="color-red none" id="author_school_name_notice">请输入作者单位名称</span></p>
@ -151,13 +152,13 @@
$("#title_notice").addClass("none");
}
if (!title || title.length >10) {
$("#title_notice").removeClass("none");
$("#title_notice").html("字数不能超过10个字");
return
}else{
$("#title_notice").addClass("none");
}
// if (!title || title.length >10) {
// $("#title_notice").removeClass("none");
// $("#title_notice").html("字数不能超过10个字");
// return
// }else{
// $("#title_notice").addClass("none");
// }
if (!content || content.length == 0) {
@ -166,13 +167,24 @@
}else{
$("#des_notice").addClass("none");
}
if (!author_name || author_name.length == 0) {
$("#author_name_notice").removeClass("none");
return
}else{
$("#author_name_notice").addClass("none");
}
if (!author_school_name || author_school_name.length == 0) {
if (!author_name || author_name.length >10) {
$("#title_author_name").removeClass("none");
return
}else{
$("#title_author_name").addClass("none");
}
if (!author_school_name || author_school_name.length == 0) {
$("#author_school_name_notice").removeClass("none");
return
}else{

@ -299,12 +299,12 @@ class NewHeader extends Component {
</ul>
</div>
</li>
{/* <li><a href="/libraries">教学案例</a></li> */}
<li className={`${competitions === true ? 'active' : ''}`} >
<a href="/competitions">在线竞赛</a>
<img className="roundedRectangles" src="/images/educoder/roundedRectangle.png"/>
</li>
<li><a href="/moop_cases">教学案例</a></li>
<li className={`${competitions === true ? 'active' : ''}`} style={{display:project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'none':'block'}} >
<a href="/crowdsourcing">
{project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'':'众包'}

Loading…
Cancel
Save