docbrown/app/views/articles/feed.rss.builder
Julianna Tetreault ca6ba1af7d
Replace collective_noun with community_name (#11846) [deploy]
* Removes collective_noun and collective_noun_disabled from app

* Config Generalization: replaces community_qualified_name with community_name
  - Generalizes SiteConfig after the removal of collective_noun field
  - Updates copy where necessary to be readable with community_name
  - Makes the community_name SiteConfig description more explicit
  - Adds flexibility for Admins by removing appended "community"

* Adds a data_update script to remove collective_noun and collective_noun_disabled

* Removes appended community from stories_controller.rb

* Removes unnecessary quotation marks around SiteConfig.community_name.to_s

* Makes SiteConfig community_name description more explicit

* Removes topic from #email_from and replaces arg with _

* Removes argument from #email_from (facepalm)

* Reverts changes to application_mailer and notify_mailer_spec

* Removes default "Community" topic from application_mailer and makes topic optional

* Refactors #prepopulate_new_form to resolve Code Climate failures

* Refactors #email_from even further by use of a ternary operator per review suggestion

* Simplifies the data_update script used to remove collective_noun per review request

* Adds a data_update script to append community to community_name

* Updates data_update script to correctly append Community to community_name

* Removes RemoveCollectiveNounFromConfig and updates other script

* Removes superfluous false from data_update script

* Updates data_update script to be more idiomatic
2020-12-28 09:34:17 -07:00

35 lines
1.1 KiB
Ruby

# encoding: UTF-8
# rubocop:disable Metrics/BlockLength
xml.instruct! :xml, version: "1.0"
xml.rss version: "2.0" do
xml.channel do
xml.title user ? user.name : community_name
xml.author user ? user.name : community_name
xml.description user ? user.summary : SiteConfig.community_description
xml.link user ? app_url(user.path) : app_url
xml.language "en"
if user
xml.image do
xml.url user.profile_image_90
xml.title "#{user.name} profile image"
xml.link app_url(user.path)
end
end
articles.each do |article|
xml.item do
xml.title article.title
xml.author(user.instance_of?(User) ? user.name : article.user.name)
xml.pubDate article.published_at.to_s(:rfc822) if article.published_at
xml.link app_url(article.path)
xml.guid app_url(article.path)
xml.description sanitize(article.processed_html, tags: allowed_tags, attributes: allowed_attributes)
article.tag_list.each do |tag_name|
xml.category tag_name
end
end
end
end
end
# rubocop:enable Metrics/BlockLength