Sha256: 50f081653c210fee9da2d0dea53064393e57a40276dc1d82dfcf56c14e3b9b9e

Contents?: true

Size: 1.35 KB

Versions: 16

Compression:

Stored size: 1.35 KB

Contents

module DmEvent::WorkshopsHelper
  
  #------------------------------------------------------------------------------
  def render_workshop_description(workshop)
    if workshop.description.nil?
      description = ""
    else
      # --- process as markdown
      x           = render :inline => workshop.description
      description = liquidize_markdown(x, {})
    end
    return description
  end

  #------------------------------------------------------------------------------
  def render_workshop_sidebar(workshop)
    return '' if workshop.sidebar.nil?

    liquidize_markdown(render(:inline => workshop.sidebar), {})
  end

  # Convert the financial "collected" data into json for pie charts
  #------------------------------------------------------------------------------
  def financial_collected_json(collected)
    json = []
    collected.sort.each do |item|
      json << { label: "#{item[0]}: #{item[1].format(:no_cents_if_whole => true, :symbol => true)}", data: item[1].to_f }
    end
    json.to_json
  end

  # Convert the financial "collected" data into json for pie charts
  #------------------------------------------------------------------------------
  def financial_collected_monthly_json(collected)
    json = []
    collected.sort.each do |item|
      json << [ "#{item[0].localize("%b")}", collected[item[0]].to_f ]
    end
    json.to_json
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dm_event-4.2.3.10 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.3.9 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.3.8 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.3.7 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.3.6 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.3.5 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.3.4 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.3.3 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.3.2 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.3.1 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.3 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.2.3 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.2.2 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.2.1 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.2 app/helpers/dm_event/workshops_helper.rb
dm_event-4.2.1.5 app/helpers/dm_event/workshops_helper.rb