Skip to content

Commit

Permalink
Attempted XML fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thesecretmaster committed Jul 4, 2018
1 parent c35edae commit 1a90efe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/controllers/rss_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def autoflagged
respond_to do |format|
format.html
format.rss { render layout: false }
format.xml { render 'autoflagged.rss', layout: false }
end
end
end
25 changes: 22 additions & 3 deletions app/views/rss/autoflagged.rss.builder
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,33 @@ xml.rss version: '2.0' do
xml.title 'Autoflagged Posts'
xml.description 'Posts which have been autoflagged by Charcoal HQ'
xml.link root_url
# category
xml.copyright 'Copyright 2018 CharcoalHQ'

This comment has been minimized.

Copy link
@ArtOfCode-

ArtOfCode- Jul 4, 2018

Member

Knock the HQ off the end and you have it: see https://charcoal-se.org/files/branding-guide-latest.pdf, "Who We Are"

# docs
xml.language 'en-us'
xml.lastBuildDate DateTime.now.strftime('%a, %-d %b %Y %T %z')
xml.managingEditor 'admin@charcoalhq.org'

This comment has been minimized.

Copy link
@ArtOfCode-

ArtOfCode- Jul 4, 2018

Member

This and xml.webMaster should both be smokey@charcoal-se.org

This comment has been minimized.

Copy link
@thesecretmaster

thesecretmaster Jul 4, 2018

Author Member

OK, but can we just deploy this for testing?

xml.pubDate DateTime.now.strftime('%a, %-d %b %Y %T %z')
xml.webMaster 'webmaster@charcoalhq.org'
xml.generator 'Ruby on Rails XML generator'

xml.image do
xml.url 'https://charcoal-se.org/assets/images/charcoal.png'
xml.title 'Autoflagged Posts'
xml.link root_url

This comment has been minimized.

Copy link
@ArtOfCode-

ArtOfCode- Jul 4, 2018

Member

Does this make sense as root_url or should it point to /flagging/logs?

xml.description 'Posts which have been autoflagged by Charcoal HQ'
xml.width 516
xml.height 516
end

@posts.each do |post|
xml.item do
xml.title post.title
xml.description post.body
xml.pubDate post.created_at.iso8601
xml.link url_for(controller: 'posts', action: 'show', id: post.id)
xml.link url_for(controller: 'posts', action: 'show', id: post.id)
xml.link url_for(controller: 'posts', action: 'show', id: post.id, only_path: false)
# category
# comments
xml.pubDate post.created_at.strftime('%a, %-d %b %Y %T %z')
end
end
end
Expand Down

0 comments on commit 1a90efe

Please sign in to comment.