simple_discussion 0.9.4 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +5 -5
  2. data/.github/FUNDING.yml +12 -0
  3. data/.github/workflows/ci.yml +44 -0
  4. data/Appraisals +16 -0
  5. data/CHANGELOG.md +13 -0
  6. data/Gemfile +8 -1
  7. data/README.md +5 -3
  8. data/Rakefile +25 -3
  9. data/app/assets/stylesheets/simple_discussion.scss +40 -2
  10. data/app/controllers/simple_discussion/application_controller.rb +15 -3
  11. data/app/controllers/simple_discussion/forum_categories_controller.rb +5 -5
  12. data/app/controllers/simple_discussion/forum_posts_controller.rb +20 -14
  13. data/app/controllers/simple_discussion/forum_threads_controller.rb +10 -10
  14. data/app/controllers/simple_discussion/notifications_controller.rb +3 -3
  15. data/app/helpers/simple_discussion/forum_posts_helper.rb +7 -1
  16. data/app/helpers/simple_discussion/forum_threads_helper.rb +4 -4
  17. data/app/jobs/simple_discussion/forum_post_notification_job.rb +3 -3
  18. data/app/jobs/simple_discussion/forum_thread_notification_job.rb +2 -2
  19. data/app/mailers/simple_discussion/user_mailer.rb +4 -4
  20. data/app/models/forum_category.rb +1 -1
  21. data/app/models/forum_post.rb +1 -2
  22. data/app/models/forum_subscription.rb +4 -4
  23. data/app/models/forum_thread.rb +12 -12
  24. data/app/views/layouts/simple_discussion.html.erb +61 -18
  25. data/app/views/simple_discussion/forum_posts/_form.html.erb +2 -2
  26. data/app/views/simple_discussion/forum_posts/_forum_post.html.erb +16 -9
  27. data/app/views/simple_discussion/forum_posts/edit.html.erb +7 -3
  28. data/app/views/simple_discussion/forum_threads/_form.html.erb +8 -8
  29. data/app/views/simple_discussion/forum_threads/_forum_thread.html.erb +5 -5
  30. data/app/views/simple_discussion/forum_threads/edit.html.erb +1 -1
  31. data/app/views/simple_discussion/forum_threads/index.html.erb +11 -9
  32. data/app/views/simple_discussion/forum_threads/new.html.erb +1 -1
  33. data/app/views/simple_discussion/forum_threads/show.html.erb +15 -10
  34. data/bin/rails +14 -0
  35. data/config/locales/en.yml +46 -0
  36. data/config/locales/es.yml +41 -0
  37. data/config/locales/fr.yml +47 -0
  38. data/db/migrate/20170417012930_create_forum_categories.rb +6 -6
  39. data/db/migrate/20170417012931_create_forum_threads.rb +1 -1
  40. data/db/migrate/20170417012932_create_forum_posts.rb +3 -3
  41. data/db/migrate/20170417012933_create_forum_subscriptions.rb +2 -2
  42. data/gemfiles/.bundle/config +2 -0
  43. data/gemfiles/rails_5_2.gemfile +12 -0
  44. data/gemfiles/rails_5_2.gemfile.lock +191 -0
  45. data/gemfiles/rails_6.gemfile +12 -0
  46. data/gemfiles/rails_6.gemfile.lock +207 -0
  47. data/gemfiles/rails_6_1.gemfile +12 -0
  48. data/gemfiles/rails_6_1.gemfile.lock +210 -0
  49. data/gemfiles/rails_master.gemfile +12 -0
  50. data/gemfiles/rails_master.gemfile.lock +222 -0
  51. data/lib/generators/simple_discussion/controllers_generator.rb +2 -2
  52. data/lib/generators/simple_discussion/helpers_generator.rb +2 -2
  53. data/lib/generators/simple_discussion/views_generator.rb +2 -2
  54. data/lib/simple_discussion.rb +8 -9
  55. data/lib/simple_discussion/engine.rb +1 -1
  56. data/lib/simple_discussion/slack.rb +6 -6
  57. data/lib/simple_discussion/version.rb +1 -1
  58. data/lib/simple_discussion/will_paginate.rb +12 -12
  59. data/simple_discussion.gemspec +15 -17
  60. metadata +27 -25
@@ -8,7 +8,7 @@ class SimpleDiscussion::ForumPostNotificationJob < ApplicationJob
8
8
 
9
9
  def send_emails(forum_post)
10
10
  forum_thread = forum_post.forum_thread
11
- users = forum_thread.subscribed_users - [forum_post.user]
11
+ users = forum_thread.subscribed_users - [forum_post.user]
12
12
  users.each do |user|
13
13
  SimpleDiscussion::UserMailer.new_post(forum_post, user).deliver_later
14
14
  end
@@ -31,8 +31,8 @@ class SimpleDiscussion::ForumPostNotificationJob < ApplicationJob
31
31
  {
32
32
  title: "Posted By",
33
33
  value: forum_post.user.name,
34
- short: true,
35
- },
34
+ short: true
35
+ }
36
36
  ],
37
37
  ts: forum_post.created_at.to_i
38
38
  }
@@ -29,8 +29,8 @@ class SimpleDiscussion::ForumThreadNotificationJob < ApplicationJob
29
29
  {
30
30
  title: "Posted By",
31
31
  value: forum_post.user.name,
32
- short: true,
33
- },
32
+ short: true
33
+ }
34
34
  ],
35
35
  ts: forum_post.created_at.to_i
36
36
  }
@@ -6,8 +6,8 @@ class SimpleDiscussion::UserMailer < ApplicationMailer
6
6
 
7
7
  def new_thread(forum_thread, recipient)
8
8
  @forum_thread = forum_thread
9
- @forum_post = forum_thread.forum_posts.first
10
- @recipient = recipient
9
+ @forum_post = forum_thread.forum_posts.first
10
+ @recipient = recipient
11
11
 
12
12
  mail(
13
13
  to: "#{@recipient.name} <#{@recipient.email}>",
@@ -16,9 +16,9 @@ class SimpleDiscussion::UserMailer < ApplicationMailer
16
16
  end
17
17
 
18
18
  def new_post(forum_post, recipient)
19
- @forum_post = forum_post
19
+ @forum_post = forum_post
20
20
  @forum_thread = forum_post.forum_thread
21
- @recipient = recipient
21
+ @recipient = recipient
22
22
 
23
23
  mail(
24
24
  to: "#{@recipient.name} <#{@recipient.email}>",
@@ -2,7 +2,7 @@ class ForumCategory < ApplicationRecord
2
2
  extend FriendlyId
3
3
  friendly_id :name, use: :slugged
4
4
 
5
- scope :sorted, ->{ order(name: :asc) }
5
+ scope :sorted, -> { order(name: :asc) }
6
6
 
7
7
  validates :name, :slug, :color, presence: true
8
8
 
@@ -1,11 +1,10 @@
1
1
  class ForumPost < ApplicationRecord
2
2
  belongs_to :forum_thread, counter_cache: true, touch: true
3
3
  belongs_to :user
4
- has_many :reactions, as: :reactable
5
4
 
6
5
  validates :user_id, :body, presence: true
7
6
 
8
- scope :sorted, ->{ order(:created_at) }
7
+ scope :sorted, -> { order(:created_at) }
9
8
 
10
9
  after_update :solve_forum_thread, if: :solved?
11
10
 
@@ -2,11 +2,11 @@ class ForumSubscription < ApplicationRecord
2
2
  belongs_to :forum_thread
3
3
  belongs_to :user
4
4
 
5
- scope :optin, ->{ where(subscription_type: :optin) }
6
- scope :optout, ->{ where(subscription_type: :optout) }
5
+ scope :optin, -> { where(subscription_type: :optin) }
6
+ scope :optout, -> { where(subscription_type: :optout) }
7
7
 
8
- validates :subscription_type, presence: true, inclusion: { in: %w{ optin optout } }
9
- validates :user_id, uniqueness: { scope: :forum_thread_id }
8
+ validates :subscription_type, presence: true, inclusion: {in: %w[optin optout]}
9
+ validates :user_id, uniqueness: {scope: :forum_thread_id}
10
10
 
11
11
  def toggle!
12
12
  case subscription_type
@@ -6,8 +6,8 @@ class ForumThread < ApplicationRecord
6
6
  belongs_to :user
7
7
  has_many :forum_posts
8
8
  has_many :forum_subscriptions
9
- has_many :optin_subscribers, ->{ where(forum_subscriptions: { subscription_type: :optin }) }, through: :forum_subscriptions, source: :user
10
- has_many :optout_subscribers, ->{ where(forum_subscriptions: { subscription_type: :optout }) }, through: :forum_subscriptions, source: :user
9
+ has_many :optin_subscribers, -> { where(forum_subscriptions: {subscription_type: :optin}) }, through: :forum_subscriptions, source: :user
10
+ has_many :optout_subscribers, -> { where(forum_subscriptions: {subscription_type: :optout}) }, through: :forum_subscriptions, source: :user
11
11
  has_many :users, through: :forum_posts
12
12
 
13
13
  accepts_nested_attributes_for :forum_posts
@@ -16,11 +16,11 @@ class ForumThread < ApplicationRecord
16
16
  validates :user_id, :title, presence: true
17
17
  validates_associated :forum_posts
18
18
 
19
- scope :pinned_first, ->{ order(pinned: :desc) }
20
- scope :solved, ->{ where(solved: true) }
21
- scope :sorted, ->{ order(updated_at: :desc) }
22
- scope :unpinned, ->{ where.not(pinned: true) }
23
- scope :unsolved, ->{ where.not(solved: true) }
19
+ scope :pinned_first, -> { order(pinned: :desc) }
20
+ scope :solved, -> { where(solved: true) }
21
+ scope :sorted, -> { order(updated_at: :desc) }
22
+ scope :unpinned, -> { where.not(pinned: true) }
23
+ scope :unsolved, -> { where.not(solved: true) }
24
24
 
25
25
  def subscribed_users
26
26
  (users + optin_subscribers).uniq - optout_subscribers
@@ -56,20 +56,20 @@ class ForumThread < ApplicationRecord
56
56
  end
57
57
 
58
58
  def subscribed_reason(user)
59
- return "You’re not receiving notifications from this thread." if user.nil?
59
+ return I18n.t(".not_receiving_notifications") if user.nil?
60
60
 
61
61
  subscription = subscription_for(user)
62
62
 
63
63
  if subscription.present?
64
64
  if subscription.subscription_type == "optout"
65
- "You're ignoring this thread."
65
+ I18n.t(".ignoring_thread")
66
66
  elsif subscription.subscription_type == "optin"
67
- "You're receiving notifications because you've subscribed to this thread."
67
+ I18n.t(".receiving_notifications_because_subscribed")
68
68
  end
69
69
  elsif forum_posts.where(user_id: user.id).any?
70
- "You're receiving notifications because you've posted in this thread."
70
+ I18n.t(".receiving_notifications_because_posted")
71
71
  else
72
- "You're not receiving notifications from this thread."
72
+ I18n.t(".not_receiving_notifications")
73
73
  end
74
74
  end
75
75
 
@@ -1,30 +1,68 @@
1
- <div class="row">
2
- <div class="col-sm-3">
1
+ <div class="row col-md-12">
2
+ <h1>
3
+ <%= t('community') %>
4
+ </h1>
5
+ </div>
6
+
7
+ <div class="row simple_discussion">
8
+ <div class="col-md-3 mb-3">
3
9
 
4
- <div class="card card-block">
5
- <%= link_to 'Ask A Question', simple_discussion.new_forum_thread_path, class: "btn btn-outline-primary btn-block" %>
10
+ <div class="card card-body">
11
+ <%= link_to t('ask_a_question'), simple_discussion.new_forum_thread_path, class: "btn btn-outline-primary btn-block" %>
6
12
  <hr />
7
13
 
8
14
  <div class="forum-thread-filters">
9
- <h5><strong>Filters</strong></h5>
10
- <div><%= forum_link_to simple_discussion.forum_threads_path, exact: true do %><%= icon "bars" %> All Threads <% end %></div>
15
+ <h5>
16
+ <strong>
17
+ <%= t('filters') %>
18
+ </strong>
19
+ </h5>
20
+ <div>
21
+ <%= forum_link_to simple_discussion.forum_threads_path, exact: true do %>
22
+ <%= icon "fa-fw fas", "bars" %>
23
+ <%= t('.all_threads') %>
24
+ <% end %>
25
+ </div>
11
26
  <% if user_signed_in? %>
12
- <div><%= forum_link_to simple_discussion.mine_forum_threads_path do %><%= icon "user-circle-o" %> My Questions<% end %></div>
13
- <div><%= forum_link_to simple_discussion.participating_forum_threads_path do %><%= icon "comments-o" %> Participating<% end %></div>
27
+ <div>
28
+ <%= forum_link_to simple_discussion.mine_forum_threads_path do %><%= icon "fa-fw far", "user-circle" %>
29
+ <%= t('.my_questions') %>
30
+ <% end %>
31
+ </div>
32
+ <div>
33
+ <%= forum_link_to simple_discussion.participating_forum_threads_path do %>
34
+ <%= icon "fa-fw far", "comments" %>
35
+ <%= t('.participating') %>
36
+ <% end %>
37
+ </div>
14
38
  <% end %>
15
- <div><%= forum_link_to simple_discussion.answered_forum_threads_path do %><%= icon "check" %> Answered<% end %></div>
16
- <div><%= forum_link_to simple_discussion.unanswered_forum_threads_path do %><%= icon "question" %> Unanswered<% end %></div>
39
+ <div>
40
+ <%= forum_link_to simple_discussion.answered_forum_threads_path do %>
41
+ <%= icon "fa-fw fas", "check" %>
42
+ <%= t('.answered') %>
43
+ <% end %>
44
+ </div>
45
+ <div>
46
+ <%= forum_link_to simple_discussion.unanswered_forum_threads_path do %>
47
+ <%= icon "fa-fw fas", "question" %>
48
+ <%= t('.unanswered') %>
49
+ <% end %>
50
+ </div>
17
51
  </div>
18
52
 
19
53
  <hr />
20
54
 
21
55
  <div class="forum-thread-filters">
22
- <p><strong>By Category</strong></p>
23
- <div><%= forum_link_to simple_discussion.forum_threads_path, exact: true do %><%= icon "circle" %> All<% end %></div>
56
+ <h6>
57
+ <strong>
58
+ <%= t('.by_category') %>
59
+ </strong>
60
+ </h6>
61
+ <div><%= forum_link_to simple_discussion.forum_threads_path, exact: true do %><%= icon "fa-fw fas", "circle" %> All<% end %></div>
24
62
  <% ForumCategory.sorted.each do |category| %>
25
63
  <div>
26
64
  <%= forum_link_to simple_discussion.forum_category_forum_threads_path(category) do %>
27
- <%= icon "circle", style: "color: #{category.color}" %>
65
+ <%= icon "fa-fw fas", "circle", style: "color: #{category.color}" %>
28
66
  <%= category.name %>
29
67
  <% end %>
30
68
  </div>
@@ -35,13 +73,14 @@
35
73
  <hr />
36
74
 
37
75
  <%# User has not posted in the thread or subscribed %>
38
- <h5>Notifications</h5>
76
+ <h5><%= t('.notifications') %></h5>
39
77
 
40
78
  <%= link_to simple_discussion.forum_thread_notifications_path(@forum_thread), method: :post, class: "btn btn-secondary btn-sm btn-block mb-2" do %>
41
79
  <% if @forum_thread.subscribed? current_user %>
42
- <%= icon "bell-slash" %> Unsubscribe
80
+ <%= icon "fa-fw fas", "bell-slash" %> <%= t('.unsubscribe') %>
43
81
  <% else %>
44
- <%= icon "bell" %> Subscribe
82
+ <%= icon "fa-fw fas", "bell" %>
83
+ <%= t('.suscribe') %>
45
84
  <% end %>
46
85
  <% end %>
47
86
 
@@ -51,8 +90,12 @@
51
90
 
52
91
  </div>
53
92
 
54
- <div class="col">
55
- <%= yield %>
93
+ <div class="col-md-9 mb-3">
94
+
95
+ <div class="card card-body">
96
+ <%= yield %>
97
+ </div>
98
+
56
99
  </div>
57
100
  </div>
58
101
 
@@ -15,7 +15,7 @@
15
15
  <% end %>
16
16
 
17
17
  <div class="form-group">
18
- <%= f.text_area :body, placeholder: "Add a comment", rows: 8, class: "form-control simplemde", data: { behavior: "comment-body" } %>
18
+ <%= f.text_area :body, placeholder: t('add_a_comment'), rows: 8, class: "form-control simplemde", data: { behavior: "comment-body" } %>
19
19
  </div>
20
20
 
21
21
  <div class="text-right">
@@ -26,7 +26,7 @@
26
26
  </small>
27
27
  </div>
28
28
 
29
- <%= f.button "#{"Update" unless f.object.new_record?} Comment", class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> Saving comment..."} %>
29
+ <%= f.button "#{f.object.new_record? ? t('comment') : t('update_comment') }", class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving_comment')}"} %>
30
30
  </div>
31
31
 
32
32
  <% end %>
@@ -4,11 +4,18 @@
4
4
  <div class="card-header">
5
5
 
6
6
  <% if is_moderator_or_owner?(forum_post) %>
7
- <div class="pull-right">
8
- <%= link_to icon("pencil"), simple_discussion.edit_forum_thread_forum_post_path(@forum_thread, forum_post),
7
+ <div class="float-right">
8
+ <%= link_to icon("fas","edit"), simple_discussion.edit_forum_thread_forum_post_path(@forum_thread, forum_post),
9
9
  class: "text-muted",
10
10
  data: { toggle: "tooltip", placement: "left" },
11
- title: "Edit this post"
11
+ title: t('edit_this_post')
12
+ %>
13
+ &nbsp;
14
+ <%= link_to icon("fas","trash"), simple_discussion.forum_thread_forum_post_path(@forum_thread, forum_post),
15
+ class: "text-muted",
16
+ method: :delete,
17
+ data: { toggle: "tooltip", placement: "left", confirm: "Are you sure you want to delete this post?" },
18
+ title: t('delete_this_post')
12
19
  %>
13
20
  </div>
14
21
  <% end %>
@@ -20,24 +27,24 @@
20
27
  <%= forum_post.user.name %> <%= forum_user_badge(forum_post.user) %>
21
28
  </strong>
22
29
  <small>
23
- commented on
30
+ <%= t('commented_on') %>
24
31
  <%= link_to forum_post.created_at.strftime("%b %d, %Y"), simple_discussion.forum_thread_path(@forum_thread, anchor: "forum_post_#{forum_post.id}") %>:
25
32
  </small>
26
33
  </div>
27
34
  </div>
28
35
 
29
- <div class="card-block">
36
+ <div class="card-body">
30
37
  <%= formatted_content forum_post.body %>
31
38
  </div>
32
39
 
33
40
  <% if @forum_thread.solved? && forum_post.solved? %>
34
41
  <div class="card-footer">
35
42
  <div class="pull-right">
36
- <strong class="text-success"><%= icon("check") %> Solved</strong>
43
+ <strong class="text-success"><%= icon("fas","check") %> <%= t('solved') %></strong>
37
44
 
38
45
  <% if is_moderator_or_owner?(@forum_thread) %>
39
46
  <small>
40
- <%= link_to "Undo", simple_discussion.unsolved_forum_thread_forum_post_path(@forum_thread, forum_post), method: :put %>
47
+ <%= link_to t('undo'), simple_discussion.unsolved_forum_thread_forum_post_path(@forum_thread, forum_post), method: :put %>
41
48
  </small>
42
49
  <% end %>
43
50
  </div>
@@ -48,8 +55,8 @@
48
55
  <div class="pull-right">
49
56
  <small>
50
57
  <%= link_to simple_discussion.solved_forum_thread_forum_post_path(@forum_thread, forum_post), method: :put do %>
51
- <%= icon("check") %>
52
- This solved my question
58
+ <%= icon("fas","fas","check") %>
59
+ <%= t('this_solved_my_question') %>
53
60
  <% end %>
54
61
  </small>
55
62
  </div>
@@ -4,7 +4,8 @@
4
4
 
5
5
  <p class="thread-details">
6
6
  <strong><%= category_link(@forum_thread.forum_category) %></strong>
7
- Asked <%= time_ago_in_words @forum_thread.created_at %> by <%= @forum_thread.user.name %>
7
+ • <%= t('asked_time_ago', time: time_ago_in_words(@forum_thread.created_at), author: @forum_thread.user.name) %>
8
+ </p>
8
9
  </p>
9
10
 
10
11
  <br />
@@ -14,11 +15,14 @@
14
15
  <div>
15
16
  <%= avatar_tag(@forum_post.user.email) %>
16
17
  <strong class="forum-post-user"><%= @forum_post.user.name %></strong>
17
- <small> commented on <%= link_to @forum_post.created_at.strftime("%b %d, %Y"), simple_discussion.forum_thread_url(@forum_thread, anchor: "forum_post_#{@forum_post.id}") %>:</small>
18
+ <small>
19
+ <%= t('commented_on')%>
20
+ <%= link_to @forum_post.created_at.strftime("%b %d, %Y"), simple_discussion.forum_thread_url(@forum_thread, anchor: "forum_post_#{@forum_post.id}") %>:
21
+ </small>
18
22
  </div>
19
23
  </div>
20
24
 
21
- <div class="card-block">
25
+ <div class="card-body">
22
26
  <%= render "form" %>
23
27
  </div>
24
28
  <% end %>
@@ -15,29 +15,29 @@
15
15
  <% end %>
16
16
 
17
17
  <div class="form-group">
18
- <%= f.label :forum_category_id, "Choose a Category" %>
19
- <%= f.collection_select :forum_category_id, ForumCategory.sorted, :id, :name, {include_blank: "Pick a category..."}, {autofocus: true, class: "form-control"} %>
18
+ <%= f.label :forum_category_id, t('choose_a_category') %>
19
+ <%= f.collection_select :forum_category_id, ForumCategory.sorted, :id, :name, {include_blank: t('pick_a_category')}, {autofocus: true, class: "form-control"} %>
20
20
  </div>
21
21
 
22
22
  <div class="form-group">
23
- <%= f.label :title %>
24
- <%= f.text_field :title, placeholder: "How do I...?", class: "form-control" %>
23
+ <%= f.label t('title') %>
24
+ <%= f.text_field :title, placeholder: t('how_do_i'), class: "form-control" %>
25
25
  </div>
26
26
 
27
27
  <% if local_assigns.fetch(:posts, true) %>
28
28
  <%= f.fields_for :forum_posts do |p| %>
29
29
  <div class="form-group">
30
- <%= p.label :body, "What do you need help with?" %>
31
- <%= p.text_area :body, placeholder: "Add a comment", rows: 10, class: "form-control simplemde", data: { behavior: "comment-body" } %>
30
+ <%= p.label :body, t('what_help_needed') %>
31
+ <%= p.text_area :body, placeholder: t('add_a_comment'), rows: 10, class: "form-control simplemde", data: { behavior: "comment-body" } %>
32
32
  </div>
33
33
  <% end %>
34
34
  <% end %>
35
35
 
36
36
  <div class="form-group text-right">
37
37
  <% if f.object.new_record? %>
38
- <%= f.button "Ask Your Question", class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> Saving..."} %>
38
+ <%= f.button t('ask_your_question'), class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
39
39
  <% else %>
40
- <%= f.button "Update Thread", class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> Saving..."} %>
40
+ <%= f.button "Update Thread", class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
41
41
  <% end %>
42
42
  </div>
43
43
 
@@ -9,26 +9,26 @@
9
9
  <div class="col">
10
10
  <h4>
11
11
  <% if forum_thread.solved? %>
12
- <span class="text-success"><%= icon "check-circle" %></span>
12
+ <span class="text-success"><%= icon "fas", "check-circle" %></span>
13
13
  <% end %>
14
14
 
15
15
  <%= link_to simple_discussion.forum_thread_path(forum_thread) do %>
16
- <%= icon "thumb-tack", class: "text-muted" if forum_thread.pinned? %> <%= forum_thread.title %>
16
+ <%= icon "fas", "thumb-tack", class: "text-muted" if forum_thread.pinned? %> <%= forum_thread.title %>
17
17
  <% end %>
18
18
  </h4>
19
19
 
20
20
  <div class="thread-details">
21
21
  <strong><%= category_link(forum_thread.forum_category) %></strong>
22
- Asked <%= time_ago_in_words forum_thread.created_at %> by <%= forum_thread.user.name %>
22
+ • <%= t('asked_time_ago', time: time_ago_in_words(forum_thread.created_at), author: forum_thread.user.name) %>
23
23
  </div>
24
24
 
25
25
  <p class="text-muted"><%= truncate(forum_thread.forum_posts.first.body, length: 200) %></p>
26
26
  </div>
27
27
 
28
- <div class="col-sm-1 text-center">
28
+ <div class="col-sm-2 text-center">
29
29
  <%= link_to simple_discussion.forum_thread_path(forum_thread), class: "thread-posts-count" do %>
30
30
  <span class="count"><%= forum_thread.forum_posts_count %></span>
31
- <small><%= "post".pluralize(forum_thread.forum_posts_count) %></small>
31
+ <small><%= t("post", count: forum_thread.forum_posts_count) %></small>
32
32
  <% end %>
33
33
  </div>
34
34
 
@@ -1,6 +1,6 @@
1
1
  <%= content_for :title, "Edit Thread" %>
2
2
 
3
- <h1>Edit Thread</h1>
3
+ <h1><%= t('edit_thread') %></h1>
4
4
 
5
5
  <div class="forum_post">
6
6
  <%= render 'form', posts: false %>