Merge branch 'develop' into dev_aliyun

dev_auth
cxt 5 years ago
commit 536fca9608

@ -144,7 +144,8 @@ $(document).on('turbolinks:load', function(){
var html='<div class="row mt-2 align-items-center linkFormItem">\n' +
' <div class="col-1 text-right">\n' +
' <label class="checkbox checkbox-primary mt-1">\n' +
' <input type="checkbox" name="navbar[][hidden]" value="0" class="font-16" checked="checked">\n' +
' <input type="checkbox" name="navbar[][hidden]" value="0" hidden class="font-16" checked="checked">\n' +
' <input type="checkbox" value="0" class="font-16 module_hidden" checked="checked">\n' +
' </label>\n' +
' </div>\n' +
' <div class="col-md-label mt-1"><input type="hidden" value="md" name="navbar[][module_type]">\n' +
@ -203,6 +204,15 @@ $(document).on('turbolinks:load', function(){
$(this).parents(".requireForm_item").remove();
});
$('.nav-setting-form').on('click', '.module_hidden', function(){
var checkEle = $(this);
if (checkEle.is(':checked')) {
checkEle.prev().val(0);
} else {
checkEle.prev().val(1);
}
});
$('.competition-staff-settings').on('click', '.mutiple-limited-radio', function(){
var radio = $(this);
if (radio.is(':checked')) {

@ -21,7 +21,7 @@ class Admins::CompetitionNavSettingService < ApplicationService
else
com_module = CompetitionModule.create!(competition_id: competition.id, module_type: 'md')
end
com_module.update_attributes!(hidden: nav["hidden"] ? 0 : 1, position: nav["position"] ? nav["position"] : params[:navbar].length, name: nav["name"], url: nav["url"])
com_module.update_attributes!(hidden: nav["hidden"] && nav["hidden"].to_i == 0 ? 0 : 1, position: nav["position"] ? nav["position"] : params[:navbar].length, name: nav["name"], url: nav["url"])
end
delete_module_ids = old_module_ids - module_ids

@ -189,7 +189,8 @@
<div class="row mt-2">
<div class="col-1 text-right">
<label class="checkbox checkbox-primary mt-1">
<%= check_box_tag('navbar[][hidden]', 0, !com_module.hidden, id: nil, class: 'font-16') %>
<input type="checkbox" name="navbar[][hidden]" value="<%= com_module.hidden ? 1 : 0 %>" hidden class="font-16" checked="checked">
<%= check_box_tag('', 0, !com_module.hidden, id: nil, class: 'font-16 module_hidden') %>
</label>
</div>
<div class="col-md-8 color-blue mt-1">
@ -259,7 +260,8 @@
<div class="row mt-2 new_module_div linkFormItem">
<div class="col-1 text-right">
<label class="checkbox checkbox-primary mt-1">
<%= check_box_tag('navbar[][hidden]', 0, !com_module.hidden, id: nil, class: 'font-16') %>
<input type="checkbox" name="navbar[][hidden]" value="<%= com_module.hidden ? 1 : 0 %>" hidden class="font-16" checked="checked">
<%= check_box_tag('', 0, !com_module.hidden, id: nil, class: 'font-16 module_hidden') %>
</label>
</div>
<div class="col-md-label mt-2">
@ -282,7 +284,8 @@
<div class="row mt-2 align-items-center linkFormItem">
<div class="col-1 text-right">
<label class="checkbox checkbox-primary mt-1">
<%= check_box_tag('navbar[][hidden]', 0, !com_module.hidden, id: nil, class: 'font-16') %>
<input type="checkbox" name="navbar[][hidden]" value="<%= com_module.hidden ? 1 : 0 %>" hidden class="font-16" checked="checked">
<%= check_box_tag('', 0, !com_module.hidden, id: nil, class: 'font-16 module_hidden') %>
</label>
</div>
<div class="col-md-label mt-1">

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save