Files
danbooru/app/views/posts/index.atom.erb
ghostrigger 1e82fe58c1 possible fix for issue #1340
added paragraph tag containing post.tag_string as child element of div inside content; also, as minor edit, modified post/atom to posts.atom and post/index to posts in the link href.
2013-04-16 02:46:19 +08:00

37 lines
1.5 KiB
Plaintext

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><%= Danbooru.config.app_name %></title>
<link href="http://<%= Danbooru.config.hostname %>/posts.atom" rel="self"/>
<link href="http://<%= Danbooru.config.hostname %>/posts" rel="alternate"/>
<id>http://<%= Danbooru.config.hostname %>/posts.atom?tags=<%= params[:tags] %></id>
<% if @posts.any? %>
<updated><%= @posts[0].created_at.gmtime.xmlschema %></updated>
<% end %>
<author><name><%= Danbooru.config.app_name %></name></author>
<% Danbooru.config.select_posts_visible_to_user(CurrentUser.user, @posts).each do |post| %>
<entry>
<title><%= post.presenter.humanized_essential_tag_string %></title>
<link href="http://<%= Danbooru.config.hostname %>/posts/<%= post.id %>" rel="alternate"/>
<% if post.source =~ /^http/ %>
<link href="<%= post.source %>" rel="related"/>
<% end %>
<id>http://<%= Danbooru.config.hostname %>/posts/<%= post.id %></id>
<updated><%= post.created_at.gmtime.xmlschema %></updated>
<summary><%= post.tag_string %></summary>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<a href="http://<%= Danbooru.config.hostname %>/posts/<%= post.id %>">
<img src="http://<%= Danbooru.config.hostname %><%= post.preview_file_url %>"/>
</a>
<p><%= post.tag_string %></p>
</div>
</content>
<author>
<name><%= post.uploader_name %></name>
</author>
</entry>
<% end %>
</feed>