2023-12-28 13:32:03 -05:00
|
|
|
<div id="related-topics" class="more-topics__list " role="complementary" aria-labelledby="related-topics-title">
|
|
|
|
<h3 id="related-topics-title" class="more-topics__list-title">
|
|
|
|
<%= t 'js.discourse_ai.related_topics.title' %>
|
|
|
|
</h3>
|
|
|
|
<div class="topic-list-container" itemscope itemtype='http://schema.org/ItemList'>
|
|
|
|
<meta itemprop='itemListOrder' content='http://schema.org/ItemListOrderDescending'>
|
|
|
|
<table class='topic-list'>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th><%= t 'js.topic.title' %></th>
|
|
|
|
<th></th>
|
|
|
|
<th class="replies"><%= t 'js.replies' %></th>
|
|
|
|
<th class="views"><%= t 'js.views' %></th>
|
|
|
|
<th><%= t 'js.activity' %></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-01-10 22:52:50 -05:00
|
|
|
<% @list.each_with_index do |topic, idx| %>
|
|
|
|
<tr class="topic-list-item" id="topic-list-item-<%= topic.id %>">
|
2023-12-28 13:32:03 -05:00
|
|
|
<td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
|
2024-01-10 22:52:50 -05:00
|
|
|
<meta itemprop='position' content='<%= idx + 1 %>'>
|
2023-12-28 13:32:03 -05:00
|
|
|
<span class="link-top-line">
|
2024-01-10 22:52:50 -05:00
|
|
|
<a itemprop='url' href='<%= topic.url %>' class='title raw-link raw-topic-link'><%= topic.title %></a>
|
2023-12-28 13:32:03 -05:00
|
|
|
</span>
|
|
|
|
<div class="link-bottom-line">
|
2024-01-10 22:52:50 -05:00
|
|
|
<% if (!@category || @category.has_children?) && topic.category && !topic.category.uncategorized? %>
|
|
|
|
<a href='<%= topic.category.url %>' class='badge-wrapper bullet'>
|
|
|
|
<span class='badge-category-bg' style='background-color: #<%= topic.category.color %>'></span>
|
2023-12-28 13:32:03 -05:00
|
|
|
<span class='badge-category clear-badge'>
|
2024-01-10 22:52:50 -05:00
|
|
|
<span class='category-name'><%= topic.category.name %></span>
|
2023-12-28 13:32:03 -05:00
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
<% end %>
|
2024-01-10 22:52:50 -05:00
|
|
|
<% if tags = topic.visible_tags(guardian) %>
|
2023-12-28 13:32:03 -05:00
|
|
|
<div class="discourse-tags">
|
|
|
|
<% tags.each_with_index do |tag, index| %>
|
|
|
|
<a href='<%= tag.full_url %>' class='discourse-tag'><%= tag.name %></a>
|
|
|
|
<% if index < tags.size - 1 %>, <% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<td class="replies">
|
2024-01-10 22:52:50 -05:00
|
|
|
<span class='posts' title='<%= t 'posts' %>'><%= topic.posts_count - 1 %></span>
|
2023-12-28 13:32:03 -05:00
|
|
|
</td>
|
|
|
|
<td class="views">
|
2024-01-10 22:52:50 -05:00
|
|
|
<span class='views' title='<%= t 'views' %>'><%= topic.views %></span>
|
2023-12-28 13:32:03 -05:00
|
|
|
</td>
|
|
|
|
<td>
|
2024-01-10 22:52:50 -05:00
|
|
|
<%= I18n.l(topic.last_posted_at || topic.created_at, format: :date_only) %>
|
2023-12-28 13:32:03 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|