Module: Autoselect::Levels::ColRecordInfo
- Defined in:
- lib/autoselect/levels/col_record_info.rb
Instance Method Summary collapse
Instance Method Details
#record_info(record) ⇒ Object
9 10 11 12 13 |
# File 'lib/autoselect/levels/col_record_info.rb', line 9 def record_info(record) col_ext = record._col_extension return [] unless col_ext [col_ext[:col_status].presence, col_ext[:col_rank].presence].compact end |
#record_info_html(record) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/autoselect/levels/col_record_info.rb', line 15 def record_info_html(record) col_ext = record._col_extension return '' unless col_ext parts = [] if (status = col_ext[:col_status].presence) # Anything other than an accepted name (synonym, ambiguous synonym, misapplied, …) # gets a more aggressive alert style to draw attention to the nomenclatural caveat. status_modifier = status.to_s.casecmp?('accepted') ? 'feedback-info' : 'feedback-warning' parts << "<span class=\"feedback feedback-thin #{status_modifier}\">#{ERB::Util.html_escape(status)}</span>" end if (rank = col_ext[:col_rank].presence) parts << "<span class=\"feedback feedback-thin feedback-light\">#{ERB::Util.html_escape(rank)}</span>" end parts.join(' ') end |