views: factor out paginator component.
* Refactor the paginator into a ViewComponent.
* Fix inconsistent spacing between paginator items.
* Fix a bug where the sequential paginator generated the wrong next /
previous page links in the <link rel="{next|prev}"> tags in the <head>.
* Always include the final page as a hidden html element, so that it can
be unhidden with custom CSS.
* Make it easier to change the pagination window.
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
<%# collection %>
|
||||
|
||||
<% content_for(:html_header) do %>
|
||||
<% if collection.try(:prev_page) %>
|
||||
<%= tag.link rel: "prev", href: url_for(nav_params_for(collection.prev_page)) %>
|
||||
<% end %>
|
||||
|
||||
<% if collection.try(:next_page) %>
|
||||
<%= tag.link rel: "next", href: url_for(nav_params_for(collection.next_page)) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -1,5 +1,5 @@
|
||||
<% page_title "Favgroup: #{@favorite_group.pretty_name}" %>
|
||||
<%= render "meta_links", collection: @posts %>
|
||||
<%= render_meta_links @posts %>
|
||||
<%= render "secondary_links" %>
|
||||
|
||||
<div id="c-favorite-groups">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<% meta_description(DText.excerpt(@forum_topic.original_post&.body)) %>
|
||||
|
||||
<% atom_feed_tag(@forum_topic.title, forum_topic_url(@forum_topic.id, format: :atom)) %>
|
||||
<%= render "meta_links", collection: @forum_posts %>
|
||||
<%= render_meta_links @forum_posts %>
|
||||
<%= render "secondary_links" %>
|
||||
|
||||
<div id="c-forum-topics">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<title><%= page_title %></title>
|
||||
|
||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
|
||||
<%= render "meta_links", collection: @current_item %>
|
||||
<%= render_meta_links @current_item if @current_item.respond_to?(:paginate) %>
|
||||
<%= tag.link rel: "canonical", href: canonical_url %>
|
||||
<%= tag.link rel: "search", type: "application/opensearchdescription+xml", href: opensearch_url(format: :xml, version: 2), title: "Search posts" %>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<% page_title @pool.pretty_name %>
|
||||
<% meta_description("#{number_with_delimiter(@pool.post_count)} posts. #{DText.excerpt(@pool.description)}") %>
|
||||
|
||||
<%= render "meta_links", collection: @posts %>
|
||||
<%= render_meta_links @posts %>
|
||||
<%= render "secondary_links" %>
|
||||
|
||||
<div id="c-pools">
|
||||
|
||||
Reference in New Issue
Block a user