Module: Redmineup::JournalsHelper

Defined in:
lib/redmineup/helpers/journals_helper.rb

Instance Method Summary collapse

Instance Method Details

#up_journal_detail(detail, journal, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/redmineup/helpers/journals_helper.rb', line 3

def up_journal_detail(detail, journal, options = {})
  formatter = journal.journalized.up_journalized_options[:detail_formatter]
  text = formatter&.call(detail, journal)
  return text if text

  label, old_value, value = up_journal_detail_values(detail, journal)
  text =
    if detail.old_value.blank? && detail.value.present?
      l(:text_journal_set_to, label: label, value: value)
    elsif detail.value.blank?
      l(:text_journal_deleted, label: label, old: old_value)
    else
      l(:text_journal_changed, label: label, old: old_value, new: value)
    end
  options[:no_html] ? text : text.html_safe
end

#up_journal_new_markup? ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/redmineup/helpers/journals_helper.rb', line 24

def up_journal_new_markup?
  Gem::Version.new(Redmine::VERSION.to_s) >= Gem::Version.new('6.1')
end

#up_render_journal_history(journals, show_notes: true) ⇒ Object



20
21
22
# File 'lib/redmineup/helpers/journals_helper.rb', line 20

def up_render_journal_history(journals, show_notes: true)
  render partial: 'redmineup/journals/history', locals: { journals: journals, show_notes: show_notes }
end