mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-30 11:41:19 +08:00
Merge pull request #3324 from aignatov-bio/ai-sci-5551-add-search-field-to-reports
Add search field to reports page [SCI-5551]
This commit is contained in:
commit
8e3e72654c
5 changed files with 23 additions and 0 deletions
|
@ -374,6 +374,10 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('.reports-index').on('change', '.report-search', function() {
|
||||||
|
REPORTS_TABLE.search($(this).val()).draw();
|
||||||
|
});
|
||||||
|
|
||||||
$('#show_report_preview').click();
|
$('#show_report_preview').click();
|
||||||
|
|
||||||
initDatatable();
|
initDatatable();
|
||||||
|
|
|
@ -18,6 +18,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-report-container {
|
||||||
|
display: inline-block;
|
||||||
|
float: right;
|
||||||
|
margin-right: 2em;
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.reports-datatable {
|
.reports-datatable {
|
||||||
|
|
|
@ -103,5 +103,12 @@ class ReportDatatable < CustomDatatable
|
||||||
Report.from(res, :reports)
|
Report.from(res, :reports)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def filter_records(records)
|
||||||
|
records.where_attributes_like(
|
||||||
|
['project_name', 'reports.name', 'reports.description'],
|
||||||
|
dt_params.dig(:search, :value)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
# ==== Insert 'presenter'-like methods below if necessary
|
# ==== Insert 'presenter'-like methods below if necessary
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,4 +46,8 @@
|
||||||
<span class="hidden-xs"><%=t "projects.reports.index.delete" %></span>
|
<span class="hidden-xs"><%=t "projects.reports.index.delete" %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="sci-input-container left-icon search-report-container">
|
||||||
|
<input type="text" class="sci-input-field report-search" placeholder="<%= t("projects.reports.index.search_reports") %>"></input>
|
||||||
|
<i class="fas fa-search"></i>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -495,6 +495,7 @@ en:
|
||||||
report_button: "Report"
|
report_button: "Report"
|
||||||
update_pdf: "Update PDF"
|
update_pdf: "Update PDF"
|
||||||
save_pdf_to_inventory: "Save PDF to Inventory"
|
save_pdf_to_inventory: "Save PDF to Inventory"
|
||||||
|
search_reports: "Find Reports"
|
||||||
request_docx: "Generate DOCX"
|
request_docx: "Generate DOCX"
|
||||||
update_docx: "Update DOCX"
|
update_docx: "Update DOCX"
|
||||||
edit: "Edit"
|
edit: "Edit"
|
||||||
|
|
Loading…
Reference in a new issue