2016-02-12 23:52:43 +08:00
|
|
|
<%= 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");
|
2017-05-09 20:22:26 +08:00
|
|
|
var checkAll = form.find("#_step_content_all");
|
|
|
|
var others = form.find("input:checkbox:not(#_step_content_all)");
|
2016-02-12 23:52:43 +08:00
|
|
|
checkAll.click(function() {
|
|
|
|
others.prop("checked", this.checked);
|
|
|
|
});
|
|
|
|
others.click(function() {
|
|
|
|
checkAll.prop("checked", false);
|
|
|
|
});
|
|
|
|
});
|
2017-05-09 20:22:26 +08:00
|
|
|
</script>
|