Merge remote-tracking branch 'origin/develop' into develop

dev_aliyun
杨树明 5 years ago
commit 0fcca262b8

@ -487,7 +487,7 @@ class CompetitionsController < ApplicationController
if params[:competition_module]
@competition.competition_modules.where(:id => params[:competition_module], :md_edit => false).update_all(:hidden => 0)
none_modules = @competition.competition_modules.where("name != '首页' and md_edit = false").map(&:id).join(",").split(",") - params[:competition_module]
none_modules = @competition.competition_modules.where("name != '首页' and md_edit = false").pluck(:id) - params[:competition_module].map(&:to_i)
@competition.competition_modules.where(:id => none_modules).update_all(:hidden => 1)
end
if params[:name]

@ -1,7 +1,7 @@
<div id="competition-content">
<% if @competition.identifier == "hn" %>
<%= render :partial => "hn_competition" %>
<% elsif @competition.identifier == "ccf-se-2018" %>
<% elsif @competition.identifier == "ccf-se-2018" || @competition.identifier == "ccf-se-2019" %>
<%= render :partial => "ccf_competition" %>
<% elsif @competition.identifier == "gcc-dev-2018" %>
<%= render :partial => "qg_competition" %>

@ -46,6 +46,10 @@
<% else %>
<li class="clearfix<%= com_module.name == "通知公告" ? " noticeLi" : "" %>">
<div class="fl">
<% if com_module.name == "首页" %> <!-- disabled导致competition_module为空 -->
<input type="hidden" name="competition_module[]" value="<%= com_module.id %>" />
<% end %>
<input type="checkbox" value="<%= com_module.id %>" name="competition_module[]" <%= com_module.hidden ? "" : "checked" %> <%= com_module.name == "首页" ? "disabled" : "" %> class="magic-checkbox" id="com_module_<%= com_module.id %>">
<label for="com_module_<%= com_module.id %>" style="top:0px">
<% if com_module.name != "首页" && com_module.name != "报名" && com_module.name != "通知公告" && com_module.name != "排行榜" && com_module.name != "资料下载" %>

Loading…
Cancel
Save