module Decidim::Meetings::MeetingsHelper

def meeting_description(meeting, max_length = 120)

Returns the meeting's description truncated.

max_length - a number to limit the length of the description
meeting - a Decidim::Meeting instance

Public: truncates the meeting description
def meeting_description(meeting, max_length = 120)
  link = resource_locator(meeting).path
  description = translated_attribute(meeting.description)
  tail = "... #{link_to(t("read_more", scope: "decidim.meetings"), link)}".html_safe
  CGI.unescapeHTML html_truncate(description, max_length: max_length, tail: tail)
end