scinote-web/app/views/reports/new/modal/_step_contents.html.erb
2016-07-21 13:11:15 +02:00

19 lines
No EOL
695 B
Text

<%= bootstrap_form_tag remote: true, url: step_contents_project_reports_path(project, format: :json), method: :post, html: { id: "add-contents-form" } do |f| %>
<%= hidden_field_tag :id, step.id %>
<%= render partial: "reports/new/modal/step_contents_inner.html.erb", locals: { form: f, step: step } %>
<% end %>
<script type="javascript">
$(function() {
var form = $("#add-contents-form");
var checkAll = form.find(".step-check-all");
var others = form.find("input:checkbox:not(.step-check-all)");
checkAll.click(function() {
others.prop("checked", this.checked);
});
others.click(function() {
checkAll.prop("checked", false);
});
});
</script>