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