views: refactor atom feed links.
* Fix comment & forum feeds to include search params. * Remove global post feeds (only include post feeds on post index).
This commit is contained in:
@@ -297,6 +297,10 @@ module ApplicationHelper
|
||||
end
|
||||
end
|
||||
|
||||
def atom_feed_tag(title, url = {})
|
||||
content_for(:html_header, auto_discovery_link_tag(:atom, url, title: title))
|
||||
end
|
||||
|
||||
def show_moderation_notice?
|
||||
CurrentUser.can_approve_posts? && (cookies[:moderated].blank? || Time.at(cookies[:moderated].to_i) < 72.hours.ago)
|
||||
end
|
||||
|
||||
@@ -16,5 +16,3 @@
|
||||
</div>
|
||||
|
||||
<%= numbered_paginator(@comments) %>
|
||||
|
||||
<% content_for(:html_header, auto_discovery_link_tag(:atom, comments_url(format: "atom"), title: "Comments")) %>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
<% meta_description "See comments on #{Danbooru.config.app_name}." %>
|
||||
|
||||
<div id="p-index-by-post">
|
||||
<% if !CurrentUser.user.is_builder? %>
|
||||
<div style="margin-bottom: 1em;">
|
||||
@@ -24,5 +22,3 @@
|
||||
</div>
|
||||
|
||||
<%= numbered_paginator(@posts) %>
|
||||
|
||||
<% content_for(:html_header, auto_discovery_link_tag(:atom, comments_url(:atom, search: { do_not_bump_post: true }), title: "Comments")) %>
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
<% meta_description "See comments on #{Danbooru.config.app_name}." %>
|
||||
|
||||
<% atom_feed_tag "Comments", comments_url(:atom, search: params.fetch(:search, {}).permit!) %>
|
||||
<%= render "secondary_links" %>
|
||||
|
||||
<div id="c-comments">
|
||||
<div id="a-index">
|
||||
<h1>Comments</h1>
|
||||
@@ -11,5 +16,3 @@
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<% page_title "Forum" %>
|
||||
|
||||
<% atom_feed_tag "Forum Topics", forum_topics_url(:atom, search: params.fetch(:search, {}).permit!) %>
|
||||
<%= render "secondary_links" %>
|
||||
|
||||
<div id="c-forum-topics">
|
||||
@@ -19,5 +21,3 @@
|
||||
<%= numbered_paginator(@forum_topics) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% content_for(:html_header, auto_discovery_link_tag(:atom, forum_topics_url(:atom), title: "Forum Topics")) %>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<% page_title @forum_topic.title %>
|
||||
<% meta_description(DText.excerpt(@forum_topic.original_post&.body)) %>
|
||||
|
||||
<% atom_feed_tag(@forum_topic.title, forum_topic_url(@forum_topic.id, format: :atom)) %>
|
||||
<%= render "secondary_links" %>
|
||||
|
||||
<div id="c-forum-topics">
|
||||
<div id="a-show">
|
||||
<h1>
|
||||
@@ -39,11 +42,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
|
||||
<% content_for(:html_header) do %>
|
||||
<%= auto_discovery_link_tag(:atom, {format: :atom}, {title: @forum_topic.title}) %>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$("#new-response-link").click(function(e) {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
|
||||
<link rel="top" title="<%= Danbooru.config.app_name %>" href="/">
|
||||
<%= csrf_meta_tag %>
|
||||
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
|
||||
<%= raw Danbooru.config.custom_html_header_content %>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||
<%= javascript_pack_tag "application" %>
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<% if CurrentUser.user.blacklisted_tags.present? %>
|
||||
<meta name="blacklisted-tags" content="<%= CurrentUser.user.blacklisted_tags.gsub(/(?:\r|\n)+/, ",") %>">
|
||||
<% end %>
|
||||
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
||||
<%= javascript_pack_tag "application" %>
|
||||
<%= stylesheet_pack_tag "application" %>
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
<% if @post_set.is_empty_tag? %>
|
||||
<% page_title("#{Danbooru.config.app_name}: Anime Image Board", suffix: nil) %>
|
||||
<% meta_description("#{Danbooru.config.canonical_app_name} is the original anime image 'booru. Find over 3.75 million anime pictures categorized by over 100 million tags.") %>
|
||||
|
||||
<% atom_feed_tag "Posts", posts_url(format: :atom) %>
|
||||
<% else %>
|
||||
<% page_title("#{@post_set.humanized_tag_string} Art") %>
|
||||
<% meta_description("See over #{number_with_delimiter(@post_set.post_count)} #{@post_set.humanized_tag_string} images on #{Danbooru.config.app_name}. #{DText.excerpt(@post_set.wiki_page&.body)}") %>
|
||||
|
||||
<% atom_feed_tag "Posts: #{@post_set.tag_string}", posts_url(tags: @post_set.tag_string, format: :atom) %>
|
||||
<% end %>
|
||||
|
||||
<%= tag.link href: posts_path(format: "atom", tags: params[:tags]), rel: "alternate", title: "ATOM", type: "application/atom+xml" %>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<% page_title @post.presenter.humanized_essential_tag_string %>
|
||||
<% meta_description "View this #{@post.image_width}x#{@post.image_height} #{number_to_human_size(@post.file_size)} image" %>
|
||||
|
||||
<% atom_feed_tag "Comments for post ##{@post.id}", comments_url(:atom, search: { post_id: @post.id }) %>
|
||||
<%= render "posts/partials/common/secondary_links" %>
|
||||
|
||||
<% content_for(:sidebar) do %>
|
||||
@@ -187,6 +188,4 @@
|
||||
|
||||
<%= tag.meta name: "og:type", content: "website" %>
|
||||
<%= tag.meta name: "og:site", content: Danbooru.config.app_name %>
|
||||
|
||||
<%= auto_discovery_link_tag(:atom, comments_url(:atom, search: { post_id: @post.id }), title: "Comments for post ##{@post.id}") %>
|
||||
<% end %>
|
||||
|
||||
@@ -20,5 +20,5 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% content_for(:html_header, auto_discovery_link_tag(:atom, comments_url(:atom, search: { post_tags_match: "user:#{@user.name}" }), title: "Comments on #{@user.name}'s uploads")) %>
|
||||
<% content_for(:html_header, auto_discovery_link_tag(:atom, comments_url(:atom, search: { post_tags_match: "commenter:#{@user.name}" }), title: "Comments on posts commented on by #{@user.name}")) %>
|
||||
<% atom_feed_tag "Comments on #{@user.pretty_name}'s uploads", comments_url(:atom, search: { post_tags_match: "user:#{@user.name}" }) %>
|
||||
<% atom_feed_tag "Comments on posts commented on by #{@user.pretty_name}", comments_url(:atom, search: { post_tags_match: "commenter:#{@user.name}" }) %>
|
||||
|
||||
Reference in New Issue
Block a user