mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-29 11:12:01 +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();
|
||||
|
||||
initDatatable();
|
||||
|
|
|
@ -18,6 +18,13 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search-report-container {
|
||||
display: inline-block;
|
||||
float: right;
|
||||
margin-right: 2em;
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
.reports-datatable {
|
||||
|
|
|
@ -103,5 +103,12 @@ class ReportDatatable < CustomDatatable
|
|||
Report.from(res, :reports)
|
||||
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
|
||||
end
|
||||
|
|
|
@ -46,4 +46,8 @@
|
|||
<span class="hidden-xs"><%=t "projects.reports.index.delete" %></span>
|
||||
<% end %>
|
||||
</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 %>
|
||||
|
|
|
@ -495,6 +495,7 @@ en:
|
|||
report_button: "Report"
|
||||
update_pdf: "Update PDF"
|
||||
save_pdf_to_inventory: "Save PDF to Inventory"
|
||||
search_reports: "Find Reports"
|
||||
request_docx: "Generate DOCX"
|
||||
update_docx: "Update DOCX"
|
||||
edit: "Edit"
|
||||
|
|
Loading…
Reference in a new issue