* Add <meta> descriptions to more pages. * Adjust wiki/pool/forum pages to use an excerpt of the first paragraph.
57 lines
1.9 KiB
Plaintext
57 lines
1.9 KiB
Plaintext
<% page_title @forum_topic.title %>
|
|
<% meta_description(DText.excerpt(@forum_topic.original_post&.body)) %>
|
|
|
|
<div id="c-forum-topics">
|
|
<div id="a-show">
|
|
<h1>
|
|
<%= @forum_topic.title %>
|
|
|
|
<% if @forum_topic.min_level >= User::Levels::MODERATOR %>
|
|
<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 %>
|
|
|
|
<%= render "forum_posts/listing", forum_posts: @forum_posts, original_forum_post_id: @forum_topic.original_post&.id, dtext_data: DText.preprocess(@forum_posts.map(&:body)), moderation_reports: @forum_topic.viewable_moderation_reports %>
|
|
|
|
<% if CurrentUser.is_member? %>
|
|
<% if CurrentUser.is_moderator? || !@forum_topic.is_locked? %>
|
|
<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 %>
|
|
<% end %>
|
|
|
|
<%= numbered_paginator(@forum_posts) %>
|
|
</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) {
|
|
$("#topic-response").show();
|
|
document.body.scrollIntoView(false);
|
|
e.preventDefault();
|
|
})
|
|
});
|
|
</script>
|
|
<% end %>
|