2015-05-01 00:46:19 +08:00
|
|
|
<h1>
|
2015-02-13 19:34:22 +08:00
|
|
|
<%= render_topic_title(@topic_view.topic) %>
|
2015-05-01 00:46:19 +08:00
|
|
|
</h1>
|
2013-02-13 14:43:21 +08:00
|
|
|
|
2015-06-03 16:13:33 +08:00
|
|
|
<% @breadcrumbs = categories_breadcrumb(@topic_view.topic)
|
|
|
|
if @breadcrumbs.present? %>
|
2015-06-09 16:48:06 +08:00
|
|
|
<div id='breadcrumbs'>
|
2015-06-03 16:13:33 +08:00
|
|
|
<% @breadcrumbs.each_with_index do |c,i| %>
|
2015-06-09 16:48:06 +08:00
|
|
|
<div id="breadcrumb-<%=i%>" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"
|
|
|
|
<%-if (i+1) < @breadcrumbs.length%>
|
|
|
|
itemref="breadcrumb-<%=(i+1)%>"
|
|
|
|
<%-end%>>
|
2019-04-03 17:58:00 +08:00
|
|
|
<a href="<%=c[:url]%>" itemprop="url" class='badge-wrapper bullet'>
|
|
|
|
<span class="badge-category-bg"></span>
|
|
|
|
<span itemprop="title" class='category-title'><%=c[:name]%></span>
|
2015-06-09 16:48:06 +08:00
|
|
|
</a>
|
|
|
|
</div>
|
2013-04-12 04:04:20 +08:00
|
|
|
<% end %>
|
2015-02-13 19:34:22 +08:00
|
|
|
</div>
|
2015-06-03 16:13:33 +08:00
|
|
|
<% end %>
|
2016-04-26 03:55:15 +08:00
|
|
|
|
2017-02-07 07:10:42 +08:00
|
|
|
<% if SiteSetting.tagging_enabled %>
|
|
|
|
<% @tags = @topic_view.topic.tags %>
|
|
|
|
<% if @tags.present? %>
|
|
|
|
<div class='tags-list' itemscope itemtype='http://schema.org/ItemList'>
|
|
|
|
<% @tags.each do |tag| %>
|
|
|
|
<div itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
|
|
|
|
<meta itemprop='url' content='<%= "#{Discourse.base_url}/tags/#{tag.name}" %>'>
|
|
|
|
<a href='<%= "#{Discourse.base_url}/tags/#{tag.name}" %>' itemprop='item'>
|
|
|
|
<span itemprop='name'><%= tag.name -%></span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
2015-06-03 02:27:52 +08:00
|
|
|
<%= server_plugin_outlet "topic_header" %>
|
2016-04-26 03:55:15 +08:00
|
|
|
|
2016-03-17 12:09:08 +08:00
|
|
|
<%- if include_crawler_content? %>
|
2015-11-09 11:55:17 +08:00
|
|
|
|
2015-02-13 19:34:22 +08:00
|
|
|
<% @topic_view.posts.each do |post| %>
|
2019-04-03 17:58:00 +08:00
|
|
|
<div itemscope itemtype='http://schema.org/DiscussionForumPosting' class='topic-body crawler-post'>
|
2015-02-13 19:34:22 +08:00
|
|
|
<% if (u = post.user) %>
|
|
|
|
<div class='creator'>
|
|
|
|
<span>
|
2017-03-29 02:27:54 +08:00
|
|
|
<a href='<%= Discourse.base_uri %>/u/<%= u.username %>'><b itemprop='author'><%= u.username %></b></a>
|
2019-01-29 01:21:06 +08:00
|
|
|
<%= "(#{u.name})" if (SiteSetting.display_name_on_posts && SiteSetting.enable_names? && !u.name.blank?) %>
|
|
|
|
<%
|
|
|
|
who_username = post.custom_fields["action_code_who"] || ""
|
|
|
|
if post.action_code
|
|
|
|
%>
|
|
|
|
<%= t("js.action_codes.#{post.action_code}", when: "", who: who_username).html_safe %>
|
|
|
|
<% end %>
|
2019-02-11 19:54:02 +08:00
|
|
|
<% if post.updated_at > post.created_at %>
|
|
|
|
<meta itemprop='datePublished' content='<%= post.created_at.to_formatted_s(:iso8601) %>'>
|
2019-04-03 17:58:00 +08:00
|
|
|
<time itemprop='dateModified' datetime='<%= post.updated_at.to_formatted_s(:iso8601) %>' class='post-time'>
|
|
|
|
<%= l post.updated_at, format: :long %>
|
2019-02-11 19:54:02 +08:00
|
|
|
</time>
|
|
|
|
<% else %>
|
2019-04-03 17:58:00 +08:00
|
|
|
<time itemprop='datePublished' datetime='<%= post.created_at.to_formatted_s(:iso8601) %>' class='post-time'>
|
|
|
|
<%= l post.created_at, format: :long %>
|
2019-02-11 19:54:02 +08:00
|
|
|
</time>
|
|
|
|
<% end %>
|
2015-02-13 19:34:22 +08:00
|
|
|
</span>
|
|
|
|
<span itemprop='position'>#<%= post.post_number %></span>
|
|
|
|
</div>
|
|
|
|
<div class='post' itemprop='articleBody'>
|
|
|
|
<%= post.hidden ? t('flagging.user_must_edit').html_safe : post.cooked.html_safe %>
|
|
|
|
</div>
|
|
|
|
<meta itemprop='interactionCount' content='UserLikes:<%= post.like_count %>'>
|
|
|
|
<meta itemprop='interactionCount' content='UserComments:<%= post.reply_count %>'>
|
2017-03-03 01:35:50 +08:00
|
|
|
<meta itemprop='headline' content='<%= @topic_view.title %>'>
|
2019-04-03 17:58:00 +08:00
|
|
|
<div class='clearfix'>
|
|
|
|
<span class='post-likes'><%= t('post.has_likes', count: post.like_count) %></span>
|
|
|
|
</div>
|
2015-02-13 19:34:22 +08:00
|
|
|
<hr>
|
2017-02-13 02:28:52 +08:00
|
|
|
<% if @topic_view.link_counts[post.id] && @topic_view.link_counts[post.id].length > 0 %>
|
|
|
|
<% @topic_view.link_counts[post.id].each do |link| %>
|
|
|
|
<% if link[:reflection] && link[:title].present? %>
|
|
|
|
<a href="<%=link[:url]%>"><%=link[:title]%></a>
|
|
|
|
<hr>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2015-02-13 19:34:22 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2014-03-01 18:16:40 +08:00
|
|
|
|
2015-02-13 19:34:22 +08:00
|
|
|
<% if @topic_view.prev_page || @topic_view.next_page %>
|
|
|
|
<div role='navigation' itemscope itemtype='http://schema.org/SiteNavigationElement'>
|
|
|
|
<% if @topic_view.prev_page %>
|
2019-01-23 22:47:39 +08:00
|
|
|
<span itemprop='name'><%= link_to t(:prev_page), @topic_view.prev_page_path, rel: 'prev', itemprop: 'url' %></span>
|
2015-02-13 19:34:22 +08:00
|
|
|
<% end %>
|
|
|
|
<% if @topic_view.next_page %>
|
2019-01-23 22:47:39 +08:00
|
|
|
<span itemprop='name'><b><%= link_to t(:next_page), @topic_view.next_page_path, rel: 'next', itemprop: 'url' %></b></span>
|
2015-02-13 19:34:22 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2013-02-13 14:43:21 +08:00
|
|
|
|
2015-11-09 11:55:17 +08:00
|
|
|
<% end %>
|
|
|
|
|
2013-02-22 02:20:00 +08:00
|
|
|
<% content_for :head do %>
|
2014-01-08 14:20:46 +08:00
|
|
|
<%= 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') %>
|
2018-07-30 18:52:51 +08:00
|
|
|
<%= 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-08 05:11:06 +08: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 %>
|
|
|
|
<% end %>
|
2013-02-22 02:20:00 +08:00
|
|
|
<% end %>
|
2013-03-19 02:24:27 +08:00
|
|
|
|
2017-06-13 01:50:30 +08:00
|
|
|
<% content_for(:title) { @title || "#{gsub_emoji_to_unicode(@topic_view.page_title)} - #{SiteSetting.title}" } %>
|
2016-08-01 13:06:55 +08:00
|
|
|
|
|
|
|
<% if @topic_view.print %>
|
|
|
|
<% content_for :after_body do %>
|
2018-10-25 21:52:01 +08:00
|
|
|
<%= preload_script('print-page') %>
|
2016-08-01 13:06:55 +08:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|