This commit is contained in:
Sebastian Peterschmidt 2018-09-19 19:17:18 +00:00 committed by GitHub
commit 0fc4e0c340
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,3 +1,18 @@
:javascript
$(document).ready(function(){
var originalState = true;
$('form.splashpage .inputs:first .input.checkbox input[type=checkbox]:not(.select-all)').each(function() {
originalState = originalState && $(this).is(':checked');
});
$('form.splashpage .select-all').prop('checked', originalState);
$('form.splashpage').on('change', '.select-all', function(e) {
var value = $(this).is(':checked');
var parent = $(this).parents('.inputs:first');
parent.find('.input.checkbox input[type=checkbox]').prop('checked', value);
});
});
.row .row
.col-md-12 .col-md-12
.page-header .page-header
@ -8,6 +23,13 @@
.col-md-12 .col-md-12
= f.inputs name: 'Components' do = f.inputs name: 'Components' do
%ul.fa-ul %ul.fa-ul
%li
.boolean.input.optional.form-group.checkbox
%span.form-wrapper
%label.control-label
%input.select-all{ type: 'checkbox' }
%em Select all
%li %li
= f.input :include_cfp, label: 'Display call for papers and call for tracks, while open', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_cfp) } = f.input :include_cfp, label: 'Display call for papers and call for tracks, while open', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_cfp) }
%li %li