mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-08 14:15:35 +08:00
Fix Hound errors.
This commit is contained in:
parent
a2935c6620
commit
16955dcee6
1 changed files with 16 additions and 5 deletions
|
@ -110,13 +110,13 @@ class SampleDatatable < AjaxDatatablesRails::Base
|
|||
'1': assigned_cell(record),
|
||||
'2': record.name,
|
||||
'3': record.sample_type.nil? ? I18n.t('samples.table.no_type') : record.sample_type.name,
|
||||
'4': record.sample_group.nil? ?
|
||||
"<span class='glyphicon glyphicon-asterisk'></span> " + I18n.t("samples.table.no_group") :
|
||||
"<span class='glyphicon glyphicon-asterisk' style='color: #{record.sample_group.color}'></span> " + record.sample_group.name,
|
||||
'4': sample_group_cell(record),
|
||||
"5": I18n.l(record.created_at, format: :full),
|
||||
"6": record.user.full_name,
|
||||
"sampleInfoUrl": Rails.application.routes.url_helpers.sample_path(record.id),
|
||||
"sampleUpdateUrl": Rails.application.routes.url_helpers.sample_path(record.id)
|
||||
"sampleInfoUrl":
|
||||
Rails.application.routes.url_helpers.sample_path(record.id),
|
||||
"sampleUpdateUrl":
|
||||
Rails.application.routes.url_helpers.sample_path(record.id)
|
||||
}
|
||||
|
||||
# Add custom attributes
|
||||
|
@ -137,6 +137,17 @@ class SampleDatatable < AjaxDatatablesRails::Base
|
|||
"<span class='circle disabled'> </span>"
|
||||
end
|
||||
|
||||
def sample_group_cell(record)
|
||||
if record.sample_group.nil?
|
||||
"<span class='glyphicon glyphicon-asterisk'></span> " \
|
||||
"#{I18n.t('samples.table.no_group')}"
|
||||
else
|
||||
"<span class='glyphicon glyphicon-asterisk' " \
|
||||
"style='color: #{record.sample_group.color}'></span> " \
|
||||
"#{record.sample_group.name}"
|
||||
end
|
||||
end
|
||||
|
||||
# Query database for records (this will be later paginated and filtered)
|
||||
# after that "data" function will return json
|
||||
def get_raw_records
|
||||
|
|
Loading…
Add table
Reference in a new issue