class FeedReaderBlock < Block include DatesHelper settings_items :address, :type => :string settings_items :limit, :type => :integer settings_items :fetched_at, :type => :date settings_items :feed_title, :type => :string settings_items :feed_items, :type => :array before_create do |block| block.limit = 5 block.feed_items = [] end def self.description _('List the latest N posts from a given RSS feed.') end def help _('This block can be used to create a list of latest N posts from a given RSS feed. You should only enter the RSS feed address.') end def default_title self.feed_title.nil? ? _('Feed Reader') : self.feed_title end def formatted_feed_content return "