2019-07-04 04:12:39 -04:00
|
|
|
<% if @topic_view %>
|
2020-04-29 14:40:21 -04:00
|
|
|
<div id="topic-title">
|
|
|
|
<h1>
|
|
|
|
<%= render_topic_title(@topic_view.topic) %>
|
|
|
|
</h1>
|
2019-07-04 04:12:39 -04:00
|
|
|
|
2020-05-11 13:37:50 -04:00
|
|
|
<% if @breadcrumbs.present? %>
|
2020-05-11 10:45:28 -04:00
|
|
|
<div class="topic-category" itemscope itemtype="http://schema.org/BreadcrumbList">
|
2020-04-29 14:40:21 -04:00
|
|
|
<% @breadcrumbs.each_with_index do |c, i| %>
|
|
|
|
<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
|
|
|
|
<a href="<%= Discourse.base_url %><%= c[:url] %>" class="badge-wrapper bullet" itemprop="item">
|
2020-05-11 13:37:50 -04:00
|
|
|
<span class='badge-category-bg' style='background-color: #<%= c[:color] %>'></span>
|
|
|
|
<span class='badge-category clear-badge'>
|
|
|
|
<span class='category-name' itemprop='name'><%= c[:name] %></span>
|
|
|
|
</span>
|
2019-07-04 04:12:39 -04:00
|
|
|
</a>
|
2020-04-29 14:40:21 -04:00
|
|
|
<meta itemprop="position" content="<%= i + 1 %>" />
|
|
|
|
</span>
|
|
|
|
<% end %>
|
2020-05-11 13:37:50 -04:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2020-04-29 14:40:21 -04:00
|
|
|
|
2020-05-11 13:37:50 -04:00
|
|
|
<% if @tags.present? %>
|
|
|
|
<div class="topic-category">
|
|
|
|
<div class='discourse-tags list-tags'>
|
|
|
|
<% @tags.each_with_index do |tag, i| %>
|
|
|
|
<a href='<%= "#{Discourse.base_url}/tag/#{tag.name}" %>' class='discourse-tag' rel="tag"><%= tag.name -%></a><% if i < @tags.size - 1 %>, <% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2020-05-11 10:45:28 -04:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2020-04-29 14:40:21 -04:00
|
|
|
</div>
|
2017-02-06 18:10:42 -05:00
|
|
|
|
2019-07-04 04:12:39 -04:00
|
|
|
<%= server_plugin_outlet "topic_header" %>
|
|
|
|
|
|
|
|
<%- if include_crawler_content? %>
|
|
|
|
|
2020-05-11 13:37:50 -04:00
|
|
|
<% @topic_view.posts.each_with_index do |post, idx| %>
|
2020-05-14 03:42:01 -04:00
|
|
|
<% if (u = post.user) %>
|
|
|
|
<div itemscope itemtype='http://schema.org/DiscussionForumPosting' class='topic-body crawler-post'>
|
2019-07-04 04:12:39 -04:00
|
|
|
<div class='crawler-post-meta'>
|
2020-05-14 03:42:01 -04:00
|
|
|
<div itemprop='publisher' itemscope itemtype="http://schema.org/Organization">
|
|
|
|
<meta itemprop='name' content='<%= SiteSetting.company_name.presence || SiteSetting.title %>'>
|
|
|
|
<% if application_logo_url.present? %>
|
|
|
|
<div itemprop='logo' itemscope itemtype="http://schema.org/ImageObject">
|
|
|
|
<meta itemprop='url' content='<%= application_logo_url %>'>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2019-07-04 04:12:39 -04:00
|
|
|
<span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person">
|
2020-01-21 16:27:21 -05:00
|
|
|
<a itemprop="url" href='<%= Discourse.base_url %>/u/<%= u.username %>'><span itemprop='name'><%= u.username %></span></a>
|
2019-07-04 04:12:39 -04:00
|
|
|
<%= "(#{u.name})" if (SiteSetting.display_name_on_posts && SiteSetting.enable_names? && !u.name.blank?) %>
|
|
|
|
<%
|
|
|
|
post_custom_fields = @topic_view.post_custom_fields[post.id] || {}
|
|
|
|
who_username = post_custom_fields["action_code_who"] || ""
|
2021-11-07 22:32:17 -05:00
|
|
|
small_action_href = post_custom_fields["action_code_path"] || ""
|
2019-07-04 04:12:39 -04:00
|
|
|
if post.action_code
|
|
|
|
%>
|
2021-11-07 16:24:44 -05:00
|
|
|
<%= t("js.action_codes.#{post.action_code}", when: "", who: who_username, href: small_action_href).html_safe %>
|
2019-07-04 04:12:39 -04:00
|
|
|
<% end %>
|
|
|
|
</span>
|
|
|
|
|
2020-05-14 03:42:01 -04:00
|
|
|
<link itemprop="mainEntityOfPage" href="<%= post.topic.url %>">
|
|
|
|
|
2020-05-11 13:37:50 -04:00
|
|
|
<% if post.image_url %>
|
2021-07-26 12:09:51 -04:00
|
|
|
<link itemprop="image" href="<%= post.image_url %>">
|
2020-05-11 13:37:50 -04:00
|
|
|
<% end %>
|
|
|
|
|
2019-07-04 04:12:39 -04:00
|
|
|
<span class="crawler-post-infos">
|
|
|
|
<time itemprop='datePublished' datetime='<%= post.created_at.to_formatted_s(:iso8601) %>' class='post-time'>
|
|
|
|
<%= l post.created_at, format: :long %>
|
|
|
|
</time>
|
2021-09-08 05:03:55 -04:00
|
|
|
<% if post.version > 1 %>
|
|
|
|
<meta itemprop='dateModified' content='<%= post.last_version_at.to_formatted_s(:iso8601) %>'>
|
|
|
|
<% else %>
|
|
|
|
<meta itemprop='dateModified' content='<%= post.created_at.to_formatted_s(:iso8601) %>'>
|
2019-07-04 04:12:39 -04:00
|
|
|
<% end %>
|
|
|
|
<span itemprop='position'>#<%= post.post_number %></span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class='post' itemprop='articleBody'>
|
|
|
|
<%= post.hidden ? t('flagging.user_must_edit').html_safe : post.cooked.html_safe %>
|
|
|
|
</div>
|
2019-06-02 22:03:16 -04:00
|
|
|
|
2019-07-04 04:12:39 -04:00
|
|
|
<meta itemprop='headline' content='<%= @topic_view.title %>'>
|
2020-05-11 13:37:50 -04:00
|
|
|
<% if idx == 0 %>
|
|
|
|
<meta itemprop='keywords' content='<%= @tags.map(&:name).join(', ') %>'>
|
|
|
|
<% end %>
|
2019-06-02 22:03:16 -04:00
|
|
|
|
2019-07-04 04:12:39 -04:00
|
|
|
<div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter">
|
|
|
|
<meta itemprop="interactionType" content="http://schema.org/LikeAction"/>
|
|
|
|
<meta itemprop="userInteractionCount" content="<%= post.like_count %>" />
|
|
|
|
<span class='post-likes'><%= post.like_count > 0 ? t('post.has_likes', count: post.like_count) : '' %></span>
|
|
|
|
</div>
|
2019-06-02 22:03:16 -04:00
|
|
|
|
2019-07-04 04:12:39 -04:00
|
|
|
<div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter">
|
|
|
|
<meta itemprop="interactionType" content="http://schema.org/CommentAction"/>
|
|
|
|
<meta itemprop="userInteractionCount" content="<%= post.reply_count %>" />
|
|
|
|
</div>
|
2019-06-02 22:03:16 -04:00
|
|
|
|
2020-05-11 13:37:50 -04:00
|
|
|
<% if @topic_view.link_counts[post.id] && @topic_view.link_counts[post.id].filter { |l| l[:reflection] }.length > 0 %>
|
2019-07-04 04:12:39 -04:00
|
|
|
<div class='crawler-linkback-list' itemscope itemtype='http://schema.org/ItemList'>
|
|
|
|
<% @topic_view.link_counts[post.id].each_with_index do |link, i| %>
|
|
|
|
<% if link[:reflection] && link[:title].present? %>
|
|
|
|
<div itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
|
2020-09-03 19:05:32 -04:00
|
|
|
<a href="<%=link[:url]%>" itemscope itemtype='http://schema.org/DiscussionForumPosting' itemprop='item'>
|
2019-07-04 04:12:39 -04:00
|
|
|
<meta itemprop='url' content='<%=link[:url]%>'>
|
|
|
|
<span itemprop='name'><%=link[:title]%></span>
|
|
|
|
</a>
|
2020-09-03 19:05:32 -04:00
|
|
|
<meta itemprop='position' content='<%= i+1 %>'>
|
2019-07-04 04:12:39 -04:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2019-06-02 22:03:16 -04:00
|
|
|
<% end %>
|
2019-07-04 04:12:39 -04:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2020-05-14 03:42:01 -04:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2019-07-04 04:12:39 -04:00
|
|
|
<% end %>
|
2014-03-01 05:16:40 -05:00
|
|
|
|
2019-07-04 04:12:39 -04:00
|
|
|
<% if @topic_view.prev_page || @topic_view.next_page %>
|
|
|
|
<div role='navigation' itemscope itemtype='http://schema.org/SiteNavigationElement' class="topic-body crawler-post">
|
|
|
|
<% if @topic_view.prev_page %>
|
|
|
|
<span itemprop='name'><%= link_to t(:prev_page), @topic_view.prev_page_path, rel: 'prev', itemprop: 'url' %></span>
|
|
|
|
<% end %>
|
|
|
|
<% if @topic_view.next_page %>
|
|
|
|
<span itemprop='name'><b><%= link_to t(:next_page), @topic_view.next_page_path, rel: 'next', itemprop: 'url' %></b></span>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2013-02-13 01:43:21 -05:00
|
|
|
|
2019-07-04 04:12:39 -04:00
|
|
|
<% end %>
|
2015-11-08 22:55:17 -05:00
|
|
|
|
2019-07-04 04:12:39 -04:00
|
|
|
<% content_for :head do %>
|
|
|
|
<%= auto_discovery_link_tag(@topic_view, {action: :feed, slug: @topic_view.topic.slug, topic_id: @topic_view.topic.id}, title: t('rss_posts_in_topic', topic: @topic_view.title), type: 'application/rss+xml') %>
|
|
|
|
<%= raw crawlable_meta_data(title: @topic_view.title, description: @topic_view.summary(strip_images: true), image: @topic_view.image_url, read_time: @topic_view.read_time, like_count: @topic_view.like_count, ignore_canonical: true, published_time: @topic_view.published_time) %>
|
2017-02-07 16:11:06 -05:00
|
|
|
|
2019-07-04 04:12:39 -04:00
|
|
|
<% if @topic_view.prev_page || @topic_view.next_page %>
|
|
|
|
<% if @topic_view.prev_page %>
|
|
|
|
<link rel="prev" href="<%= @topic_view.prev_page_path -%>">
|
|
|
|
<% end %>
|
|
|
|
<% if @topic_view.next_page %>
|
|
|
|
<link rel="next" href="<%= @topic_view.next_page_path -%>">
|
|
|
|
<% end %>
|
2017-02-07 16:11:06 -05:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2013-03-18 14:24:27 -04:00
|
|
|
|
2019-07-04 04:12:39 -04:00
|
|
|
<% content_for(:title) { @title || "#{gsub_emoji_to_unicode(@topic_view.page_title)} - #{SiteSetting.title}" } %>
|
2016-08-01 01:06:55 -04:00
|
|
|
|
2019-07-04 04:12:39 -04:00
|
|
|
<% if @topic_view.print %>
|
|
|
|
<% content_for :after_body do %>
|
|
|
|
<%= preload_script('print-page') %>
|
|
|
|
<% end %>
|
2016-08-01 01:06:55 -04:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|