mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
add threads you follow to discussions data vault
This commit is contained in:
parent
4424d00277
commit
68dfd907ee
@ -31,6 +31,8 @@ class DataController < ApplicationController
|
||||
@private_posts = Thredded::PrivatePost.where(user_id: current_user.id)
|
||||
|
||||
@threads_posted_to = Thredded::Topic.where(id: @posts.pluck(:postable_id) - @topics.pluck(:id))
|
||||
|
||||
@followed_topics = current_user.thredded_topic_follows.includes(:topic)
|
||||
end
|
||||
|
||||
def collaboration
|
||||
|
||||
@ -170,6 +170,7 @@
|
||||
<ul class="tabs tabs-fixed-width">
|
||||
<li class="tab"><a href="#threads-created">Threads you created</a></li>
|
||||
<li class="tab"><a href="#threads-replied">Threads you posted to</a></li>
|
||||
<li class="tab"><a href="#threads-followed">Threads you follow</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-content grey lighten-4">
|
||||
@ -205,6 +206,23 @@
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="threads-followed" style="display: none">
|
||||
<ul>
|
||||
<% @followed_topics.order('id desc').each do |follow| %>
|
||||
<% topic = follow.topic %>
|
||||
<li class="clearfix">
|
||||
<div>
|
||||
<i class="material-icons blue-text left">forum</i>
|
||||
<%= link_to topic.title, thredded.messageboard_topic_path(messageboard_id: topic.messageboard_id, id: topic.slug) %>
|
||||
<span class="grey-text">started <%= time_ago_in_words topic.created_at %> ago</span>
|
||||
</div>
|
||||
<div>
|
||||
<%= pluralize topic.posts_count - 1, 'reply' %>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user