thredded 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -12
  3. data/app/assets/images/thredded/follow.svg +1 -0
  4. data/app/assets/images/thredded/unfollow.svg +1 -0
  5. data/app/assets/stylesheets/thredded/_thredded.scss +27 -28
  6. data/app/assets/stylesheets/thredded/components/_alerts.scss +5 -5
  7. data/app/assets/stylesheets/thredded/components/_base.scss +5 -5
  8. data/app/assets/stylesheets/thredded/components/_currently-online.scss +1 -1
  9. data/app/assets/stylesheets/thredded/components/_empty.scss +2 -2
  10. data/app/assets/stylesheets/thredded/components/_flash-message.scss +5 -5
  11. data/app/assets/stylesheets/thredded/components/_following.scss +17 -0
  12. data/app/assets/stylesheets/thredded/components/_form-list.scss +3 -3
  13. data/app/assets/stylesheets/thredded/components/_icons.scss +1 -1
  14. data/app/assets/stylesheets/thredded/components/_main-section.scss +1 -1
  15. data/app/assets/stylesheets/thredded/components/_messageboard.scss +6 -6
  16. data/app/assets/stylesheets/thredded/components/_pagination.scss +1 -1
  17. data/app/assets/stylesheets/thredded/components/_post-form.scss +1 -1
  18. data/app/assets/stylesheets/thredded/components/_post.scss +12 -11
  19. data/app/assets/stylesheets/thredded/components/_preferences.scss +1 -1
  20. data/app/assets/stylesheets/thredded/components/_select2.scss +4 -4
  21. data/app/assets/stylesheets/thredded/components/_topic-delete.scss +4 -8
  22. data/app/assets/stylesheets/thredded/components/_topic-header.scss +25 -11
  23. data/app/assets/stylesheets/thredded/components/_topics.scss +37 -15
  24. data/app/assets/stylesheets/thredded/layout/_main-container.scss +1 -1
  25. data/app/assets/stylesheets/thredded/layout/_main-navigation.scss +2 -2
  26. data/app/assets/stylesheets/thredded/layout/_moderation.scss +16 -15
  27. data/app/assets/stylesheets/thredded/layout/_navigation.scss +6 -6
  28. data/app/assets/stylesheets/thredded/layout/_search-navigation.scss +1 -1
  29. data/app/assets/stylesheets/thredded/layout/_user-navigation.scss +13 -13
  30. data/app/assets/stylesheets/thredded/layout/_user.scss +1 -1
  31. data/app/assets/stylesheets/thredded/utilities/_is-compact.scss +1 -1
  32. data/app/assets/stylesheets/thredded/utilities/_is-expanded.scss +1 -1
  33. data/app/commands/thredded/notify_following_users.rb +1 -1
  34. data/app/controllers/thredded/messageboard_groups_controller.rb +3 -1
  35. data/app/controllers/thredded/messageboards_controller.rb +1 -3
  36. data/app/controllers/thredded/private_topics_controller.rb +1 -1
  37. data/app/controllers/thredded/topics_controller.rb +16 -9
  38. data/app/helpers/thredded/application_helper.rb +36 -0
  39. data/app/models/concerns/thredded/topic_common.rb +2 -2
  40. data/app/models/concerns/thredded/user_topic_read_state_common.rb +1 -1
  41. data/app/models/thredded/messageboard.rb +34 -7
  42. data/app/models/thredded/messageboard_group.rb +8 -1
  43. data/app/models/thredded/null_user.rb +4 -0
  44. data/app/models/thredded/post_moderation_record.rb +1 -1
  45. data/app/models/thredded/private_post.rb +5 -1
  46. data/app/models/thredded/stats.rb +1 -1
  47. data/app/models/thredded/topic.rb +5 -3
  48. data/app/models/thredded/user_detail.rb +2 -0
  49. data/app/models/thredded/user_extender.rb +4 -2
  50. data/app/models/thredded/user_topic_follow.rb +12 -1
  51. data/app/view_models/thredded/base_topic_view.rb +1 -1
  52. data/app/view_models/thredded/messageboard_group_view.rb +11 -0
  53. data/app/view_models/thredded/topic_view.rb +15 -2
  54. data/app/views/thredded/messageboards/_messageboard.html.erb +2 -2
  55. data/app/views/thredded/moderation/_post.html.erb +1 -1
  56. data/app/views/thredded/moderation/_post_moderation_record.html.erb +1 -1
  57. data/app/views/thredded/moderation/user.html.erb +1 -1
  58. data/app/views/thredded/moderation/users.html.erb +1 -1
  59. data/app/views/thredded/private_topic_mailer/message_notification.html.erb +1 -1
  60. data/app/views/thredded/private_topic_mailer/message_notification.text.erb +1 -1
  61. data/app/views/thredded/private_topics/_private_topic.html.erb +1 -1
  62. data/app/views/thredded/shared/_currently_online.html.erb +1 -1
  63. data/app/views/thredded/shared/_nav.html.erb +1 -1
  64. data/app/views/thredded/shared/_page.html.erb +2 -2
  65. data/app/views/thredded/topics/_followers.html.erb +12 -0
  66. data/app/views/thredded/topics/_header.html.erb +10 -9
  67. data/app/views/thredded/topics/_topic.html.erb +13 -2
  68. data/app/views/thredded/topics/index.html.erb +5 -0
  69. data/app/views/thredded/users/_link.html.erb +2 -2
  70. data/config/locales/en.yml +20 -18
  71. data/config/locales/pt-BR.yml +14 -9
  72. data/db/migrate/20160329231848_create_thredded.rb +4 -0
  73. data/db/upgrade_migrations/20160611094616_upgrade_v0_5_to_v0_6.rb +1 -1
  74. data/db/upgrade_migrations/20160723012349_upgrade_v0_6_to_v0_7.rb +43 -0
  75. data/lib/generators/thredded/install/templates/initializer.rb +15 -0
  76. data/lib/html/pipeline/at_mention_filter.rb +1 -1
  77. data/lib/thredded.rb +24 -0
  78. data/lib/thredded/database_seeder.rb +15 -5
  79. data/lib/thredded/version.rb +1 -1
  80. metadata +8 -9
  81. data/CHANGELOG.md +0 -399
  82. data/Procfile +0 -1
  83. data/config.ru +0 -3
  84. data/heroku.gemfile +0 -28
  85. data/heroku.gemfile.lock +0 -268
  86. data/thredded.gemspec +0 -78
@@ -3,6 +3,19 @@ module Thredded
3
3
  module ApplicationHelper
4
4
  include ::Thredded::UrlsHelper
5
5
 
6
+ def thredded_container_data
7
+ {
8
+ 'thredded-page-id' => content_for(:thredded_page_id),
9
+ 'thredded-root-url' => thredded.root_path
10
+ }
11
+ end
12
+
13
+ def thredded_container_classes
14
+ ['thredded--main-container', content_for(:thredded_page_id)].tap do |classes|
15
+ classes << 'thredded--is-moderator' if moderatable_messageboards_ids
16
+ end
17
+ end
18
+
6
19
  # Render the page container with the supplied block as content.
7
20
  def thredded_page(&block)
8
21
  # enable the host app to easily check whether a thredded view is being rendered:
@@ -17,6 +30,17 @@ module Thredded
17
30
  render partial: 'thredded/users/link', locals: { user: user }
18
31
  end
19
32
 
33
+ # @param user [Thredded.user_class]
34
+ # @return [String] wrapped @mention string
35
+ def user_mention(user)
36
+ username = user.send(Thredded.user_name_column)
37
+ if username.include?(' ')
38
+ %(@"#{username}")
39
+ else
40
+ "@#{username}"
41
+ end
42
+ end
43
+
20
44
  # @param datetime [DateTime]
21
45
  # @param default [String] a string to return if time is nil.
22
46
  # @return [String] html_safe datetime presentation
@@ -42,6 +66,18 @@ module Thredded
42
66
  ]
43
67
  end
44
68
 
69
+ # @param follow_reason ['manual', 'posted', 'mentioned', nil]
70
+ def topic_follow_reason_text(follow_reason)
71
+ if follow_reason
72
+ # rubocop:disable Metrics/LineLength
73
+ # i18n-tasks-use t('thredded.topics.following.manual') t('thredded.topics.following.posted') t('thredded.topics.following.mentioned')
74
+ # rubocop:enable Metrics/LineLength
75
+ t("thredded.topics.following.#{follow_reason}")
76
+ else
77
+ t('thredded.topics.not_following')
78
+ end
79
+ end
80
+
45
81
  def unread_private_topics_count
46
82
  @unread_private_topics_count ||=
47
83
  if signed_in?
@@ -9,7 +9,7 @@ module Thredded
9
9
  class_name: Thredded.user_class,
10
10
  foreign_key: 'last_user_id'
11
11
 
12
- scope :order_recently_updated_first, -> { order(updated_at: :desc, id: :desc) }
12
+ scope :order_recently_posted_first, -> { order(last_post_at: :desc, id: :desc) }
13
13
  scope :on_page, -> (page_num) { page(page_num) }
14
14
 
15
15
  validates :hash_id, presence: true, uniqueness: true
@@ -51,7 +51,7 @@ module Thredded
51
51
  reads = reads_class.arel_table
52
52
  joins(topics.join(reads, Arel::Nodes::OuterJoin)
53
53
  .on(topics[:id].eq(reads[:postable_id]).and(reads[:user_id].eq(user.id))).join_sources)
54
- .merge(reads_class.where(reads[:id].eq(nil).or(reads[:read_at].lt(topics[:updated_at]))))
54
+ .merge(reads_class.where(reads[:id].eq(nil).or(reads[:read_at].lt(topics[:last_post_at]))))
55
55
  end
56
56
 
57
57
  private
@@ -9,7 +9,7 @@ module Thredded
9
9
 
10
10
  # @return [Boolean]
11
11
  def read?
12
- postable.updated_at.to_i <= read_at.to_i
12
+ postable.last_post_at <= read_at
13
13
  end
14
14
 
15
15
  module ClassMethods
@@ -20,6 +20,12 @@ module Thredded
20
20
 
21
21
  validates :name, uniqueness: true, length: { maximum: 60 }, presence: true
22
22
  validates :topics_count, numericality: true
23
+ validates :position, presence: true, on: :update
24
+ before_save :ensure_position, on: :create
25
+
26
+ def ensure_position
27
+ self.position ||= (created_at || Time.zone.now).to_i
28
+ end
23
29
 
24
30
  has_many :categories, dependent: :destroy
25
31
  has_many :user_messageboard_preferences, dependent: :destroy
@@ -31,7 +37,8 @@ module Thredded
31
37
  has_many :user_details, through: :posts
32
38
  has_many :messageboard_users,
33
39
  inverse_of: :messageboard,
34
- foreign_key: :thredded_messageboard_id
40
+ foreign_key: :thredded_messageboard_id,
41
+ dependent: :destroy
35
42
  has_many :recently_active_user_details,
36
43
  -> { merge(Thredded::MessageboardUser.recently_active) },
37
44
  class_name: 'Thredded::UserDetail',
@@ -49,11 +56,32 @@ module Thredded
49
56
 
50
57
  has_many :post_moderation_records, inverse_of: :messageboard, dependent: :delete_all
51
58
 
52
- default_scope { where(closed: false).order(topics_count: :desc) }
53
-
59
+ default_scope { where(closed: false) }
60
+ # rubocop:disable Style/Lambda
54
61
  scope :top_level_messageboards, -> { where(group: nil) }
55
62
  scope :by_messageboard_group, ->(group) { where(group: group.id) }
56
-
63
+ scope :ordered, ->(order = Thredded.messageboards_order) {
64
+ case order
65
+ when :position
66
+ self
67
+ when :created_at_asc
68
+ ordered_by_created_at_asc
69
+ when :last_post_at_desc
70
+ ordered_by_last_post_at_desc
71
+ when :topics_count_desc
72
+ ordered_by_topics_count_desc
73
+ end.ordered_by_position.order(id: :asc)
74
+ }
75
+ scope :ordered_by_position, ->() { order(position: :asc) }
76
+ scope :ordered_by_created_at_asc, ->() { order(created_at: :asc) }
77
+ scope :ordered_by_last_post_at_desc, ->() {
78
+ joins('LEFT JOIN thredded_topics AS last_topics ON thredded_messageboards.last_topic_id = last_topics.id')
79
+ .order('COALESCE(last_topics.last_post_at, thredded_messageboards.created_at) DESC')
80
+ }
81
+ scope :ordered_by_topics_count_desc, ->() {
82
+ order(topics_count: :desc)
83
+ }
84
+ # rubocop:enable Style/Lambda
57
85
  def last_user
58
86
  last_topic.try(:last_user)
59
87
  end
@@ -67,9 +95,8 @@ module Thredded
67
95
 
68
96
  def update_last_topic!
69
97
  return if destroyed?
70
- update_column(
71
- :last_topic_id, topics.order_recently_updated_first.moderation_state_visible_to_all.select(:id).first.try(:id)
72
- )
98
+ self.last_topic = topics.order_recently_posted_first.moderation_state_visible_to_all.first
99
+ save! if last_topic_id_changed?
73
100
  end
74
101
  end
75
102
  end
@@ -6,6 +6,13 @@ module Thredded
6
6
  foreign_key: :messageboard_group_id,
7
7
  dependent: :nullify
8
8
 
9
- validates :name, presence: true
9
+ scope :ordered, -> { order(position: :asc, id: :asc) }
10
+ validates :name, presence: true, uniqueness: true
11
+ validates :position, presence: true, on: :update
12
+ before_save :ensure_position, on: :create
13
+
14
+ def ensure_position
15
+ self.position ||= Time.zone.now.to_i
16
+ end
10
17
  end
11
18
  end
@@ -38,5 +38,9 @@ module Thredded
38
38
  def thredded_user_preference
39
39
  Thredded::UserPreference.new
40
40
  end
41
+
42
+ def thredded_display_name
43
+ to_s
44
+ end
41
45
  end
42
46
  end
@@ -39,7 +39,7 @@ module Thredded
39
39
  post: post,
40
40
  post_content: post.content,
41
41
  post_user: post.user,
42
- post_user_name: post.user.try(:send, Thredded.user_name_column),
42
+ post_user_name: post.user.try(:thredded_display_name),
43
43
  messageboard_id: post.messageboard_id,
44
44
  )
45
45
  end
@@ -47,7 +47,11 @@ module Thredded
47
47
  else
48
48
  self
49
49
  end
50
- postable.update_columns(last_user_id: last_post.user_id, updated_at: last_post.updated_at)
50
+ postable.update_columns(
51
+ last_user_id: last_post.user_id,
52
+ last_post_at: last_post.updated_at,
53
+ updated_at: Time.zone.now
54
+ )
51
55
  end
52
56
  end
53
57
  end
@@ -18,7 +18,7 @@ module Thredded
18
18
  private
19
19
 
20
20
  def messageboards
21
- @messageboards ||= Messageboard.all
21
+ @messageboards ||= Messageboard.ordered
22
22
  end
23
23
  end
24
24
  end
@@ -67,11 +67,13 @@ module Thredded
67
67
  class_name: 'Thredded::UserTopicFollow',
68
68
  inverse_of: :topic,
69
69
  dependent: :destroy
70
- has_many :following_users,
70
+ has_many :followers,
71
71
  class_name: Thredded.user_class,
72
72
  source: :user,
73
73
  through: :user_follows
74
74
 
75
+ delegate :name, to: :messageboard, prefix: true
76
+
75
77
  after_commit :update_messageboard_last_topic, on: :update, if: -> { previous_changes.include?('moderation_state') }
76
78
  after_update :update_last_user_and_time_from_last_post!, if: -> { previous_changes.include?('moderation_state') }
77
79
 
@@ -126,11 +128,11 @@ module Thredded
126
128
  scope = scope.moderation_state_visible_to_all if moderation_state_visible_to_all?
127
129
  last_post = scope.select(:user_id, :created_at).first
128
130
  if last_post
129
- update_columns(last_user_id: last_post.user_id, updated_at: last_post.created_at)
131
+ update_columns(last_user_id: last_post.user_id, last_post_at: last_post.created_at, updated_at: Time.zone.now)
130
132
  else
131
133
  # Either a visible topic is left with no visible posts, or an invisible topic is left with no posts at all.
132
134
  # This shouldn't happen in stock Thredded.
133
- update_columns(last_user_id: nil, updated_at: created_at)
135
+ update_columns(last_user_id: nil, last_post_at: created_at, updated_at: Time.zone.now)
134
136
  end
135
137
  end
136
138
 
@@ -10,6 +10,8 @@ module Thredded
10
10
  has_many :private_topics, class_name: 'Thredded::PrivateTopic', foreign_key: :user_id, primary_key: :user_id
11
11
  has_many :posts, class_name: 'Thredded::Post', foreign_key: :user_id, primary_key: :user_id
12
12
  has_many :private_posts, class_name: 'Thredded::PrivatePost', foreign_key: :user_id, primary_key: :user_id
13
+ has_many :messageboard_users, class_name: 'Thredded::MessageboardUser', foreign_key: :thredded_user_detail_id,
14
+ inverse_of: :user_detail, dependent: :destroy
13
15
 
14
16
  scope :recently_active, -> { where(arel_table[:last_seen_at].gt(Thredded.active_user_threshold.ago)) }
15
17
 
@@ -62,8 +62,10 @@ module Thredded
62
62
  false
63
63
  end
64
64
 
65
- def following?(topic)
66
- UserTopicFollow.find_by(topic_id: topic.id, user: self)
65
+ def thredded_display_name
66
+ send(Thredded.user_display_name_method).presence || fail(<<-ERROR)
67
+ User.#{Thredded.user_display_name_method} must not be empty: please set make sure non nil or configure Thredded.user_display_name_method")
68
+ ERROR
67
69
  end
68
70
  end
69
71
  end
@@ -13,8 +13,19 @@ module Thredded
13
13
  alias_attribute :postable_id, :topic_id
14
14
  alias_attribute :postable, :topic
15
15
 
16
+ # Creates a follow or finds the existing one.
17
+ #
18
+ # This method is safe to call concurrently from different processes. Lookup and creation happen in a transaction.
19
+ # If an ActiveRecord::RecordNotUnique error is raised, the find is retried.
20
+ #
21
+ # @return [Thredded::UserTopicFollow]
16
22
  def self.create_unless_exists(user_id, topic_id, reason = :manual)
17
- create_with(reason: reason).find_or_create_by(user_id: user_id, topic_id: topic_id)
23
+ transaction(requires_new: true) do
24
+ create_with(reason: reason).find_or_create_by(user_id: user_id, topic_id: topic_id)
25
+ end
26
+ rescue ActiveRecord::RecordNotUnique
27
+ # The record has been created from another connection, retry to find it.
28
+ retry
18
29
  end
19
30
  end
20
31
  end
@@ -5,7 +5,7 @@ module Thredded
5
5
  class BaseTopicView
6
6
  delegate :title,
7
7
  :posts_count,
8
- :updated_at,
8
+ :last_post_at,
9
9
  :created_at,
10
10
  :user,
11
11
  :last_user,
@@ -4,6 +4,17 @@ module Thredded
4
4
  class MessageboardGroupView
5
5
  delegate :name, to: :@group, allow_nil: true
6
6
  attr_reader :group, :messageboards
7
+
8
+ # @param messageboard_scope [ActiveRecord::Relation]
9
+ # @return [Array<MessageboardGroupView>]
10
+ def self.grouped(messageboard_scope)
11
+ messageboard_scope.preload(last_topic: [:last_user])
12
+ .eager_load(:group)
13
+ .order('coalesce(thredded_messageboard_groups.position, 0) asc, thredded_messageboard_groups.id asc').ordered
14
+ .group_by(&:group)
15
+ .map { |(group, messageboards)| MessageboardGroupView.new(group, messageboards) }
16
+ end
17
+
7
18
  # @param group Thredded::MessageboardGroup
8
19
  # @param messageboards [Thredded::TopicCommon]
9
20
  def initialize(group, messageboards)
@@ -2,8 +2,8 @@
2
2
  module Thredded
3
3
  # A view model for Topic.
4
4
  class TopicView < BaseTopicView
5
- delegate :categories, :id, :blocked?, :last_moderation_record,
6
- :last_post,
5
+ delegate :categories, :id, :blocked?, :last_moderation_record, :followers,
6
+ :last_post, :messageboard_id, :messageboard_name,
7
7
  to: :@topic
8
8
 
9
9
  # @param topic [TopicCommon]
@@ -31,6 +31,15 @@ module Thredded
31
31
  ].compact
32
32
  end
33
33
 
34
+ # @return [Boolean] whether the topic is followed by the current user.
35
+ def followed?
36
+ @follow
37
+ end
38
+
39
+ def follow_reason
40
+ @follow.try(:reason)
41
+ end
42
+
34
43
  def can_moderate?
35
44
  @policy.moderate?
36
45
  end
@@ -50,5 +59,9 @@ module Thredded
50
59
  def unfollow_path
51
60
  Thredded::UrlsHelper.unfollow_messageboard_topic_path(@topic.messageboard, @topic)
52
61
  end
62
+
63
+ def messageboard_path
64
+ Thredded::UrlsHelper.messageboard_topics_path(@topic.messageboard)
65
+ end
53
66
  end
54
67
  end
@@ -14,8 +14,8 @@
14
14
  <% if messageboard.last_topic %>
15
15
  <p class="thredded--messageboard--byline">
16
16
  <%= t 'thredded.messageboard.last_updated_by_html',
17
- time_ago: time_ago(messageboard.last_topic.updated_at),
18
- user: messageboard.last_user %>
17
+ time_ago: time_ago(messageboard.last_topic.last_post_at),
18
+ user: messageboard.last_user.thredded_display_name %>
19
19
  </p>
20
20
  <% end %>
21
21
  <% end %>
@@ -3,7 +3,7 @@
3
3
  <%= render 'thredded/posts_common/header_with_user_and_topic',
4
4
  post: post,
5
5
  post_user_link: if post.user
6
- link_to(post.user, user_moderation_path(post.user.id))
6
+ link_to(post.user.thredded_display_name, user_moderation_path(post.user.id))
7
7
  else
8
8
  content_tag :em, t('thredded.null_user_name')
9
9
  end
@@ -28,7 +28,7 @@
28
28
  <article class="thredded--post">
29
29
  <% post_user_link = capture do %>
30
30
  <% if record.post_user %>
31
- <%= link_to record.post_user, user_moderation_path(record.post_user.id) %>
31
+ <%= link_to record.post_user.thredded_display_name, user_moderation_path(record.post_user.id) %>
32
32
  <% else %>
33
33
  <%= safe_join [record.post_user_name, content_tag(:em, t('thredded.null_user_name'))].compact, ', ' %>
34
34
  <% end %>
@@ -7,7 +7,7 @@
7
7
  <%= render 'nav' %>
8
8
  <%= thredded_page do %>
9
9
  <h1 class="thredded--moderation--user--title">
10
- <%= image_tag Thredded.avatar_url.call(user), class: 'thredded--user--avatar' %><%= user %>
10
+ <%= image_tag Thredded.avatar_url.call(user), class: 'thredded--user--avatar' %><%= user.thredded_display_name %>
11
11
  </h1>
12
12
  <ul class="thredded--moderation--user--info">
13
13
  <li><%= t 'thredded.users.user_since_html', time_ago: time_ago(user.created_at) %></li>
@@ -20,7 +20,7 @@
20
20
  <% @users.each do |user| %>
21
21
  <tr>
22
22
  <td>
23
- <%= link_to user, user_moderation_path(user.id), class: 'thredded--link' %>
23
+ <%= link_to user.thredded_display_name, user_moderation_path(user.id), class: 'thredded--link' %>
24
24
  </td>
25
25
  <td>
26
26
  <%= render 'user_moderation_state', user: user %>
@@ -3,7 +3,7 @@
3
3
  <hr />
4
4
 
5
5
  <p>
6
- This email was sent to you because <%= @topic.user %> included you in a
6
+ This email was sent to you because <%= @topic.user.thredded_display_name %> included you in a
7
7
  private topic, "<%= link_to @topic.title, @topic %>".
8
8
  <%= link_to 'Go here', @topic %> to view the conversation.
9
9
  </p>
@@ -2,7 +2,7 @@
2
2
  <% # as this is only sent on first post, doesn't need to define order %>
3
3
  ---
4
4
 
5
- This email was sent to you because <%= @topic.user %>
5
+ This email was sent to you because <%= @topic.user.thredded_display_name %>
6
6
  included you in the private topic "<%= @topic.title %>".
7
7
  Go here to view the conversation:
8
8
  <%= url_for @topic %>
@@ -8,7 +8,7 @@
8
8
  </h1>
9
9
 
10
10
  <cite class="thredded--topics--updated-by">
11
- <%= time_ago private_topic.updated_at %>
11
+ <%= time_ago private_topic.last_post_at%>
12
12
  <%= user_link private_topic.last_user %>
13
13
  </cite>
14
14
 
@@ -8,7 +8,7 @@
8
8
  <% users.each do |user| %>
9
9
  <li class="thredded--currently-online--user">
10
10
  <img class="thredded--currently-online--avatar" src="<%= Thredded.avatar_url.call(user) %>" alt=""/>
11
- <%= user %>
11
+ <%= user.thredded_display_name %>
12
12
  </li>
13
13
  <% end %>
14
14
  </ul>
@@ -2,7 +2,7 @@
2
2
  <ul class="thredded--user-navigation<%= ' thredded--user-navigation-standalone' if Thredded.standalone_layout? %>">
3
3
  <% if signed_in? && Thredded.standalone_layout? %>
4
4
  <li class="thredded--user-navigation--profile thredded--user-navigation--item">
5
- <%= link_to thredded_current_user, user_path(thredded_current_user) %>
5
+ <%= link_to thredded_current_user.thredded_display_name, user_path(thredded_current_user) %>
6
6
  </li>
7
7
  <% end %>
8
8