Files
danbooru/app/views/forum_topics/show.html.erb
evazion c1805cc4e0 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.
2021-02-18 02:47:21 -06:00

45 lines
1.5 KiB
Plaintext

<% 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_meta_links @forum_posts %>
<%= render "secondary_links" %>
<div id="c-forum-topics">
<div id="a-show">
<h1>
<%= @forum_topic.title %>
<% if @forum_topic.is_private? %>
<span class="level-topic">(<%= User.level_string(@forum_topic.min_level).downcase %>+ only)</span>
<% end %>
<% if @forum_topic.is_deleted? %>
<span class="locked-topic">(deleted)</span>
<% end %>
</h1>
<p class="fineprint">Posted under <%= link_to @forum_topic.category_name, forum_topics_path(:search => {:category_id => @forum_topic.category_id}) %></p>
<% if @forum_topic.is_locked? %>
<div class="notice">
<p>This topic has been locked.</p>
</div>
<% end %>
<div class="list-of-forum-posts list-of-messages">
<%= render ForumPostComponent.with_collection(@forum_posts, forum_topic: @forum_topic, current_user: CurrentUser.user) %>
</div>
<% if policy(ForumPost.new(topic: @forum_topic)).create? %>
<p><%= link_to "Post reply", new_forum_post_path(topic_id: @forum_topic.id), id: "new-response-link" %></p>
<div style="display: none;" id="topic-response">
<%= render "forum_posts/partials/new/form", forum_post: ForumPost.new(topic_id: @forum_topic.id) %>
</div>
<% end %>
<%= numbered_paginator(@forum_posts) %>
</div>
</div>