Sha256: af0fbdd249a05c3120d60d75cc6412f4ffa98f3858100d6eef18eeb61ff084f5

Contents?: true

Size: 1.02 KB

Versions: 5

Compression:

Stored size: 1.02 KB

Contents

# http://cyber.law.harvard.edu/rss/rss.html
items  = controller.controller_name
item   = items.singularize
assets = instance_variable_get("@#{items}")

if item == 'task'
  assets = assets.values.flatten
  title  = t(:"#{@view}_tab") << ' ' << t(items.to_sym)
end

xml.instruct! :xml, version: "1.0"
xml.rss version: "2.0" do
  xml.channel do
    xml.generator  "Fat Free CRM v#{FatFreeCRM::VERSION::STRING}"
    xml.link       send(:"#{items}_url")
    xml.pubDate    Time.now.to_s(:rfc822)
    xml.title      title || t(items.to_sym)

    assets.each do |asset|
      xml.item do
        url = send(:"#{item}_url", asset)
        xml.author      !asset.is_a?(User) ? asset.try(:user).try(:full_name) : asset.full_name
        xml.description send(:"#{item}_summary", asset) if respond_to?(:"#{item}_summary")
        xml.guid        url
        xml.link        url
        xml.pubDate     asset.created_at.to_s(:rfc822)
        xml.title       !asset.is_a?(User) ? asset.name : "#{asset.full_name} (#{asset.username})"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fat_free_crm-0.16.4 app/views/application/index.rss.builder
fat_free_crm-0.16.3 app/views/application/index.rss.builder
fat_free_crm-0.16.2 app/views/application/index.rss.builder
fat_free_crm-0.16.1 app/views/application/index.rss.builder
fat_free_crm-0.16.0 app/views/application/index.rss.builder