thredded 0.7.0 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +119 -17
  3. data/app/assets/javascripts/thredded/components/currently_online.es6 +3 -3
  4. data/app/assets/javascripts/thredded/components/flash_messages.es6 +11 -0
  5. data/app/assets/javascripts/thredded/components/post_form.es6 +21 -4
  6. data/app/assets/javascripts/thredded/components/time_stamps.es6 +8 -6
  7. data/app/assets/javascripts/thredded/components/topic_form.es6 +14 -3
  8. data/app/assets/javascripts/thredded/components/topics.es6 +3 -3
  9. data/app/assets/javascripts/thredded/components/turboforms.es6 +15 -0
  10. data/app/assets/javascripts/thredded/components/user_preferences_form.es6 +47 -20
  11. data/app/assets/javascripts/thredded/components/users_select.es6 +25 -9
  12. data/app/assets/javascripts/thredded/core/hide_soft_keyboard.es6 +6 -0
  13. data/app/assets/javascripts/thredded/core/mention_autocompletion.es6 +54 -0
  14. data/app/assets/javascripts/thredded/core/on_page_load.es6 +46 -0
  15. data/app/assets/javascripts/thredded/dependencies.js +2 -1
  16. data/app/assets/javascripts/thredded/dependencies/jquery.js +1 -0
  17. data/app/assets/javascripts/thredded/thredded.es6 +1 -0
  18. data/app/assets/stylesheets/thredded/_thredded.scss +1 -0
  19. data/app/assets/stylesheets/thredded/base/_alerts.scss +5 -1
  20. data/app/assets/stylesheets/thredded/base/_grid.scss +8 -0
  21. data/app/assets/stylesheets/thredded/base/_nav.scss +0 -5
  22. data/app/assets/stylesheets/thredded/components/_following.scss +0 -3
  23. data/app/assets/stylesheets/thredded/components/_mention-autocomplete.scss +35 -0
  24. data/app/assets/stylesheets/thredded/components/_topic-header.scss +37 -17
  25. data/app/assets/stylesheets/thredded/components/_topics.scss +13 -0
  26. data/app/assets/stylesheets/thredded/layout/_main-navigation.scss +57 -14
  27. data/app/assets/stylesheets/thredded/layout/_moderation.scss +5 -0
  28. data/app/assets/stylesheets/thredded/layout/_navigation.scss +14 -17
  29. data/app/assets/stylesheets/thredded/layout/_search-navigation.scss +15 -3
  30. data/app/assets/stylesheets/thredded/layout/_user-navigation.scss +3 -11
  31. data/app/commands/thredded/at_notification_extractor.rb +2 -2
  32. data/app/commands/thredded/autofollow_mentioned_users.rb +2 -2
  33. data/app/commands/thredded/create_messageboard.rb +45 -0
  34. data/app/commands/thredded/notify_following_users.rb +10 -0
  35. data/app/controllers/thredded/autocomplete_users_controller.rb +2 -3
  36. data/app/controllers/thredded/messageboards_controller.rb +1 -24
  37. data/app/controllers/thredded/moderation_controller.rb +1 -1
  38. data/app/controllers/thredded/post_permalinks_controller.rb +1 -1
  39. data/app/controllers/thredded/preferences_controller.rb +4 -2
  40. data/app/controllers/thredded/private_post_permalinks_controller.rb +1 -1
  41. data/app/controllers/thredded/theme_previews_controller.rb +1 -1
  42. data/app/controllers/thredded/topics_controller.rb +0 -1
  43. data/app/forms/thredded/user_preferences_form.rb +4 -2
  44. data/app/helpers/thredded/application_helper.rb +5 -0
  45. data/app/helpers/thredded/nav_helper.rb +41 -0
  46. data/app/mailer_previews/thredded/base_mailer_preview.rb +0 -1
  47. data/app/mailers/thredded/post_mailer.rb +0 -1
  48. data/app/mailers/thredded/private_topic_mailer.rb +0 -1
  49. data/app/models/concerns/thredded/user_topic_read_state_common.rb +2 -2
  50. data/app/models/thredded/messageboard.rb +0 -1
  51. data/app/models/thredded/null_preference.rb +5 -1
  52. data/app/models/thredded/private_post.rb +2 -2
  53. data/app/policies/thredded/messageboard_group_policy.rb +1 -1
  54. data/app/view_hooks/thredded/all_view_hooks.rb +68 -0
  55. data/app/view_models/thredded/post_view.rb +3 -3
  56. data/app/view_models/thredded/topic_email_view.rb +0 -4
  57. data/app/view_models/thredded/topics_page_view.rb +12 -1
  58. data/app/views/layouts/thredded/application.html.erb +5 -2
  59. data/app/views/thredded/messageboard_groups/new.html.erb +3 -1
  60. data/app/views/thredded/messageboards/edit.html.erb +3 -1
  61. data/app/views/thredded/messageboards/new.html.erb +3 -1
  62. data/app/views/thredded/moderation/_users_search_form.html.erb +4 -1
  63. data/app/views/thredded/moderation/user.html.erb +34 -28
  64. data/app/views/thredded/posts_common/_form.html.erb +6 -1
  65. data/app/views/thredded/posts_common/form/_content_field.html.erb +5 -3
  66. data/app/views/thredded/preferences/_form.html.erb +30 -12
  67. data/app/views/thredded/private_topics/_form.html.erb +4 -3
  68. data/app/views/thredded/private_topics/index.html.erb +5 -5
  69. data/app/views/thredded/search/_form.html.erb +2 -1
  70. data/app/views/thredded/shared/_flash_messages.html.erb +1 -1
  71. data/app/views/thredded/shared/_page.html.erb +10 -1
  72. data/app/views/thredded/shared/nav/_moderation.html.erb +3 -2
  73. data/app/views/thredded/shared/nav/_notification_preferences.html.erb +5 -3
  74. data/app/views/thredded/shared/nav/_private_topics.html.erb +3 -2
  75. data/app/views/thredded/topics/_form.html.erb +6 -1
  76. data/app/views/thredded/topics/_header.html.erb +8 -5
  77. data/config/locales/en.yml +15 -7
  78. data/config/locales/pt-BR.yml +21 -13
  79. data/config/routes.rb +4 -2
  80. data/db/migrate/20160329231848_create_thredded.rb +5 -5
  81. data/db/upgrade_migrations/20161019150201_upgrade_v0_7_to_v0_8.rb +31 -0
  82. data/lib/generators/thredded/install/templates/initializer.rb +20 -8
  83. data/lib/tasks/thredded_tasks.rake +0 -7
  84. data/lib/thredded.rb +19 -5
  85. data/lib/thredded/content_formatter.rb +43 -8
  86. data/lib/thredded/database_seeder.rb +7 -1
  87. data/lib/thredded/engine.rb +2 -21
  88. data/lib/{html/pipeline → thredded/html_pipeline}/at_mention_filter.rb +4 -4
  89. data/lib/thredded/html_pipeline/autolink_filter.rb +14 -0
  90. data/lib/thredded/html_pipeline/kramdown_filter.rb +34 -0
  91. data/lib/thredded/version.rb +1 -1
  92. data/lib/thredded/view_hooks/config.rb +36 -0
  93. data/lib/thredded/view_hooks/renderer.rb +29 -0
  94. data/vendor/assets/javascripts/jquery.textcomplete.js +1488 -0
  95. metadata +65 -52
  96. data/app/commands/thredded/messageboard_destroyer.rb +0 -65
  97. data/lib/html/pipeline/bbcode_filter.rb +0 -33
  98. data/lib/thredded/main_app_route_delegator.rb +0 -25
@@ -84,7 +84,6 @@ MARKDOWN
84
84
  name: 'A test messageboard',
85
85
  slug: 'a-test-messageboard',
86
86
  description: 'Test messageboard description',
87
- closed: false,
88
87
  created_at: 1.month.ago,
89
88
  id: 1 + rand(1334),
90
89
  posts_count: rand(1337),
@@ -10,7 +10,6 @@ module Thredded
10
10
  mail from: email_details.no_reply,
11
11
  to: email_details.no_reply,
12
12
  bcc: emails,
13
- reply_to: email_details.reply_to,
14
13
  subject: email_details.subject
15
14
  end
16
15
  end
@@ -10,7 +10,6 @@ module Thredded
10
10
  mail from: email_details.no_reply,
11
11
  to: email_details.no_reply,
12
12
  bcc: emails,
13
- reply_to: email_details.reply_to,
14
13
  subject: email_details.subject
15
14
  end
16
15
  end
@@ -23,8 +23,8 @@ module Thredded
23
23
  # Upsert gem: https://github.com/seamusabshere/upsert
24
24
  state = find_or_initialize_by(user_id: user_id, postable_id: topic_id)
25
25
  fail ArgumentError, "expected post_page >= 1, given #{post_page.inspect}" if post_page < 1
26
- return unless !state.read_at? || state.read_at < post.updated_at
27
- state.update!(read_at: post.updated_at, page: post_page)
26
+ return unless !state.read_at? || state.read_at < post.created_at
27
+ state.update!(read_at: post.created_at, page: post_page)
28
28
  end
29
29
 
30
30
  def read_on_first_post!(user, topic)
@@ -56,7 +56,6 @@ module Thredded
56
56
 
57
57
  has_many :post_moderation_records, inverse_of: :messageboard, dependent: :delete_all
58
58
 
59
- default_scope { where(closed: false) }
60
59
  # rubocop:disable Style/Lambda
61
60
  scope :top_level_messageboards, -> { where(group: nil) }
62
61
  scope :by_messageboard_group, ->(group) { where(group: group.id) }
@@ -1,12 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
  module Thredded
3
3
  class NullPreference
4
- def notify_on_mention
4
+ def follow_topics_on_mention
5
5
  true
6
6
  end
7
7
 
8
8
  def notify_on_message
9
9
  true
10
10
  end
11
+
12
+ def followed_topic_emails
13
+ true
14
+ end
11
15
  end
12
16
  end
@@ -43,13 +43,13 @@ module Thredded
43
43
  def update_parent_last_user_and_timestamp
44
44
  return if postable.destroyed?
45
45
  last_post = if destroyed?
46
- postable.posts.order_oldest_first.select(:user_id, :updated_at).last
46
+ postable.posts.order_oldest_first.select(:user_id, :created_at).last
47
47
  else
48
48
  self
49
49
  end
50
50
  postable.update_columns(
51
51
  last_user_id: last_post.user_id,
52
- last_post_at: last_post.updated_at,
52
+ last_post_at: last_post.created_at,
53
53
  updated_at: Time.zone.now
54
54
  )
55
55
  end
@@ -2,7 +2,7 @@
2
2
  module Thredded
3
3
  class MessageboardGroupPolicy
4
4
  # @param user [Thredded.user_class]
5
- # @param messageboard_group [Thredded::MessageboardGroup]
5
+ # @param group [Thredded::MessageboardGroup]
6
6
  def initialize(user, group)
7
7
  @user = user
8
8
  @group = group
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+ require_dependency 'thredded/view_hooks/config'
3
+ require_dependency 'thredded/view_hooks/renderer'
4
+
5
+ module Thredded
6
+ class AllViewHooks
7
+ # @return [PostForm]
8
+ attr_reader :post_form
9
+ # @return [ModerationUserPage]
10
+ attr_reader :moderation_user_page
11
+
12
+ @instance = nil
13
+ class << self
14
+ # @return [Thredded::AllViewHooks]
15
+ attr_reader :instance
16
+
17
+ # Called when the class is reloaded so that server restart is not required
18
+ # when changing view hooks in development.
19
+ def reset_instance!
20
+ @instance = Thredded::AllViewHooks.new
21
+ end
22
+ end
23
+
24
+ def initialize
25
+ @post_form = PostForm.new
26
+ @moderation_user_page = ModerationUserPage.new
27
+ end
28
+
29
+ class PostForm
30
+ # @return [Thredded::AllViewHooks::ViewHook]
31
+ attr_reader :content_text_area
32
+
33
+ def initialize
34
+ @content_text_area = ViewHook.new
35
+ end
36
+ end
37
+
38
+ class ModerationUserPage
39
+ # @return [Thredded::AllViewHooks::ViewHook]
40
+ attr_reader :user_title
41
+ # @return [Thredded::AllViewHooks::ViewHook]
42
+ attr_reader :user_info
43
+ # @return [Thredded::AllViewHooks::ViewHook]
44
+ attr_reader :user_moderation_actions
45
+
46
+ def initialize
47
+ @user_title = ViewHook.new
48
+ @user_info = ViewHook.new
49
+ @user_moderation_actions = ViewHook.new
50
+ end
51
+ end
52
+
53
+ # Contains the view hook content and can render a view hook.
54
+ class ViewHook
55
+ # @return [Thredded::ViewHooks::Config]
56
+ attr_reader :config
57
+
58
+ def initialize
59
+ @config = Thredded::ViewHooks::Config.new
60
+ end
61
+
62
+ # @return [String]
63
+ def render(view_context, **args, &block)
64
+ Thredded::ViewHooks::Renderer.new(view_context, @config).render(**args, &block)
65
+ end
66
+ end
67
+ end
68
+ end
@@ -56,14 +56,14 @@ module Thredded
56
56
  end
57
57
  [
58
58
  I18n.locale,
59
- @post,
60
- @post.user,
59
+ @post.cache_key,
60
+ @post.user ? @post.user.cache_key : 'users/nil',
61
61
  moderation_state || '+',
62
62
  [
63
63
  can_update?,
64
64
  can_destroy?
65
65
  ].map { |p| p ? '+' : '-' } * ''
66
- ]
66
+ ].join('/')
67
67
  end
68
68
  # rubocop:enable Metrics/CyclomaticComplexity
69
69
  end
@@ -14,10 +14,6 @@ module Thredded
14
14
  "#{Thredded.email_outgoing_prefix} #{@topic.title}"
15
15
  end
16
16
 
17
- def reply_to
18
- Thredded.email_reply_to.call(@topic)
19
- end
20
-
21
17
  def no_reply
22
18
  Thredded.email_from
23
19
  end
@@ -16,10 +16,21 @@ module Thredded
16
16
  # @param topics_page_scope [ActiveRecord::Relation<Thredded::Topic>]
17
17
  # @param topic_view_class [Class] view_model for topic instances
18
18
  def initialize(user, topics_page_scope, topic_view_class: TopicView)
19
- @topics_page_scope = topics_page_scope
19
+ @topics_page_scope = refine_scope(topics_page_scope)
20
20
  @topic_views = @topics_page_scope.with_read_and_follow_states(user).map do |(topic, read_state, follow)|
21
21
  topic_view_class.new(topic, read_state, follow, Pundit.policy!(user, topic))
22
22
  end
23
23
  end
24
+
25
+ protected
26
+
27
+ def refine_scope(topics_page_scope)
28
+ scope = topics_page_scope.includes(:categories, :last_user, :user)
29
+ if Thredded.show_topic_followers
30
+ scope.includes(:followers)
31
+ else
32
+ scope
33
+ end
34
+ end
24
35
  end
25
36
  end
@@ -3,9 +3,12 @@
3
3
  <head>
4
4
  <title>Thredded | <%= yield :thredded_page_title %></title>
5
5
  <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
6
- <%= stylesheet_link_tag 'thredded' %>
6
+ <%= stylesheet_link_tag 'thredded', 'data-turbolinks-track': 'reload' %>
7
7
  <%= csrf_meta_tag %>
8
- <%= javascript_include_tag 'thredded' %>
8
+ <%= javascript_include_tag 'thredded',
9
+ async: !Rails.application.config.assets.debug,
10
+ defer: true,
11
+ 'data-turbolinks-track': 'reload'%>
9
12
  <%== Gravatar.prefetch_dns %>
10
13
  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
11
14
  </head>
@@ -2,7 +2,9 @@
2
2
  <% content_for :thredded_page_id, 'thredded--messageboard-groups-new' %>
3
3
  <% content_for :thredded_breadcrumbs do %>
4
4
  <ul class="thredded--navigation-breadcrumbs">
5
- <li><%= t('thredded.messageboard_group.create') %></li>
5
+ <li class="thredded--navigation-breadcrumbs--item-no-link">
6
+ <%= t('thredded.messageboard_group.create') %>
7
+ </li>
6
8
  </ul>
7
9
  <% end %>
8
10
 
@@ -2,7 +2,9 @@
2
2
  <% content_for :thredded_page_id, 'thredded--messageboard-edit' %>
3
3
  <% content_for :thredded_breadcrumbs do %>
4
4
  <ul class="thredded--navigation-breadcrumbs">
5
- <li><%= t('thredded.nav.edit_messageboard') %></li>
5
+ <li class="thredded--navigation-breadcrumbs--item-no-link">
6
+ <%= t('thredded.nav.edit_messageboard') %>
7
+ </li>
6
8
  </ul>
7
9
  <% end %>
8
10
 
@@ -2,7 +2,9 @@
2
2
  <% content_for :thredded_page_id, 'thredded--messageboards-new' %>
3
3
  <% content_for :thredded_breadcrumbs do %>
4
4
  <ul class="thredded--navigation-breadcrumbs">
5
- <li><%= t('thredded.messageboard.create') %></li>
5
+ <li class="thredded--navigation-breadcrumbs--item-no-link">
6
+ <%= t('thredded.messageboard.create') %>
7
+ </li>
6
8
  </ul>
7
9
  <% end %>
8
10
 
@@ -1,4 +1,7 @@
1
- <%= form_tag users_moderation_path, class: 'thredded--form thredded--navigation--search', method: 'get' do %>
1
+ <%= form_tag users_moderation_path,
2
+ method: 'get',
3
+ class: 'thredded--form thredded--navigation--search',
4
+ 'data-thredded-turboform' => true do %>
2
5
  <%= label_tag :q, t('thredded.moderation.search_users.form_label') %>
3
6
  <%= text_field_tag :q, @query,
4
7
  type: 'search',
@@ -6,34 +6,40 @@
6
6
  <% content_for :thredded_page_id, 'thredded--moderation-user' %>
7
7
  <%= render 'nav' %>
8
8
  <%= thredded_page do %>
9
- <h1 class="thredded--moderation--user--title">
10
- <%= image_tag Thredded.avatar_url.call(user), class: 'thredded--user--avatar' %><%= user.thredded_display_name %>
11
- </h1>
12
- <ul class="thredded--moderation--user--info">
13
- <li><%= t 'thredded.users.user_since_html', time_ago: time_ago(user.created_at) %></li>
14
- <% if user_detail.last_seen_at %>
15
- <li><%= t 'thredded.users.last_active_html', time_ago: time_ago(user_detail.last_seen_at) %></li>
16
- <% end %>
17
- <% if user_detail.topics_count > 0 %>
18
- <li><%= t 'thredded.users.started_topics_count', count: user_detail.topics_count %></li>
19
- <% end %>
20
- <% if user_detail.posts_count > 0 %>
21
- <li><%= t 'thredded.users.posts_count', count: user_detail.posts_count %></li>
22
- <% end %>
23
- <li><%= render 'user_moderation_state', user: @user %></li>
24
- </ul>
25
- <div class="thredded--user--moderation-actions">
26
- <% unless user_detail.approved? %>
27
- <%= button_to t('thredded.moderation.approve_btn'), moderate_user_path,
28
- class: 'thredded--button',
29
- params: { id: user.to_model.id, moderation_state: 'approved' } %>
30
- <% end %>
31
- <% unless user_detail.blocked? %>
32
- <%= button_to t('thredded.moderation.block_btn'), moderate_user_path,
33
- class: 'thredded--button',
34
- params: { id: user.to_model.id, moderation_state: 'blocked' } %>
35
- <% end %>
36
- </div>
9
+ <%= view_hooks.moderation_user_page.user_title.render self, user: user do %>
10
+ <h1 class="thredded--moderation--user--title">
11
+ <%= image_tag Thredded.avatar_url.call(user), class: 'thredded--user--avatar' %><%= user.thredded_display_name %>
12
+ </h1>
13
+ <% end %>
14
+ <%= view_hooks.moderation_user_page.user_info.render self, user: user do %>
15
+ <ul class="thredded--moderation--user--info">
16
+ <li><%= t 'thredded.users.user_since_html', time_ago: time_ago(user.created_at) %></li>
17
+ <% if user_detail.last_seen_at %>
18
+ <li><%= t 'thredded.users.last_active_html', time_ago: time_ago(user_detail.last_seen_at) %></li>
19
+ <% end %>
20
+ <% if user_detail.topics_count > 0 %>
21
+ <li><%= t 'thredded.users.started_topics_count', count: user_detail.topics_count %></li>
22
+ <% end %>
23
+ <% if user_detail.posts_count > 0 %>
24
+ <li><%= t 'thredded.users.posts_count', count: user_detail.posts_count %></li>
25
+ <% end %>
26
+ <li><%= render 'user_moderation_state', user: @user %></li>
27
+ </ul>
28
+ <% end %>
29
+ <%= view_hooks.moderation_user_page.user_moderation_actions.render self, user: user do %>
30
+ <div class="thredded--user--moderation-actions">
31
+ <% unless user_detail.approved? %>
32
+ <%= button_to t('thredded.moderation.approve_btn'), moderate_user_path,
33
+ class: 'thredded--button',
34
+ params: { id: user.to_model.id, moderation_state: 'approved' } %>
35
+ <% end %>
36
+ <% unless user_detail.blocked? %>
37
+ <%= button_to t('thredded.moderation.block_btn'), moderate_user_path,
38
+ class: 'thredded--button',
39
+ params: { id: user.to_model.id, moderation_state: 'blocked' } %>
40
+ <% end %>
41
+ </div>
42
+ <% end %>
37
43
  <% if @posts.present? %>
38
44
  <h2><%= t 'thredded.users.recent_activity' %></h2>
39
45
  <%= render partial: 'user_post', collection: @posts, as: :post %>
@@ -1,5 +1,10 @@
1
1
  <%= form_for (post.private_topic_post? ? [topic, post] : [messageboard, topic, post]), as: :post,
2
- html: { class: 'thredded--form thredded--post-form', 'data-thredded-post-form' => true } do |form| %>
2
+ html: {
3
+ class: 'thredded--form thredded--post-form',
4
+ 'data-thredded-post-form' => true,
5
+ 'data-autocomplete-url' => autocomplete_users_path,
6
+ 'data-autocomplete-min-length' => Thredded.autocomplete_min_length,
7
+ } do |form| %>
3
8
  <ul class="thredded--form-list">
4
9
  <%= render 'thredded/posts_common/form/content_field', form: form, content_label: content_label %>
5
10
 
@@ -1,6 +1,8 @@
1
1
  <li>
2
2
  <%= form.label :content, content_label %>
3
- <%= render 'thredded/posts_common/form/before_content', form: form %>
4
- <%= form.text_area :content, { rows: 5, required: true } %>
5
- <%= render 'thredded/posts_common/form/after_content', form: form %>
3
+ <%= view_hooks.post_form.content_text_area.render self, form: form, content_label: content_label do %>
4
+ <%= render 'thredded/posts_common/form/before_content', form: form %>
5
+ <%= form.text_area :content, {rows: 5, required: true} %>
6
+ <%= render 'thredded/posts_common/form/after_content', form: form %>
7
+ <% end %>
6
8
  </li>
@@ -10,20 +10,29 @@
10
10
  <h3><%= t 'thredded.preferences.form.global_preferences_label' %></h3>
11
11
  <ul class="thredded--form-list">
12
12
  <li>
13
- <%= f.label :notify_on_message do %>
14
- <%= f.check_box :notify_on_message %>
15
- <%= t 'thredded.preferences.form.notify_on_message.label' %>
13
+ <%= f.label :follow_topics_on_mention do %>
14
+ <%= f.check_box :follow_topics_on_mention %>
15
+ <%= t 'thredded.preferences.form.follow_topics_on_mention.label' %>
16
16
  <p class="thredded--form-list--hint">
17
- <%= t 'thredded.preferences.form.notify_on_message.hint' %>
17
+ <%= t 'thredded.preferences.form.follow_topics_on_mention.hint' %>
18
+ </p>
19
+ <% end %>
20
+ </li>
21
+ <li>
22
+ <%= f.label :followed_topic_emails do %>
23
+ <%= f.check_box :followed_topic_emails %>
24
+ <%= t 'thredded.preferences.form.followed_topic_emails.label' %>
25
+ <p class="thredded--form-list--hint">
26
+ <%= t 'thredded.preferences.form.followed_topic_emails.hint' %>
18
27
  </p>
19
28
  <% end %>
20
29
  </li>
21
30
  <li>
22
- <%= f.label :notify_on_mention do %>
23
- <%= f.check_box :notify_on_mention %>
24
- <%= t 'thredded.preferences.form.notify_on_mention.label' %>
31
+ <%= f.label :notify_on_message do %>
32
+ <%= f.check_box :notify_on_message %>
33
+ <%= t 'thredded.preferences.form.notify_on_message.label' %>
25
34
  <p class="thredded--form-list--hint">
26
- <%= t 'thredded.preferences.form.notify_on_mention.hint' %>
35
+ <%= t 'thredded.preferences.form.notify_on_message.hint' %>
27
36
  </p>
28
37
  <% end %>
29
38
  </li>
@@ -34,11 +43,20 @@
34
43
  </h3>
35
44
  <ul class="thredded--form-list" data-thredded-user-preferences-form-messageboard-fields>
36
45
  <li>
37
- <%= f.label :messageboard_notify_on_mention do %>
38
- <%= f.check_box :messageboard_notify_on_mention %>
39
- <%= t 'thredded.preferences.form.messageboard_notify_on_mention.label' %>
46
+ <%= f.label :messageboard_follow_topics_on_mention do %>
47
+ <%= f.check_box :messageboard_follow_topics_on_mention %>
48
+ <%= t 'thredded.preferences.form.messageboard_follow_topics_on_mention.label' %>
49
+ <p class="thredded--form-list--hint">
50
+ <%= t 'thredded.preferences.form.messageboard_follow_topics_on_mention.hint' %>
51
+ </p>
52
+ <% end %>
53
+ </li>
54
+ <li>
55
+ <%= f.label :messageboard_followed_topic_emails do %>
56
+ <%= f.check_box :messageboard_followed_topic_emails %>
57
+ <%= t 'thredded.preferences.form.messageboard_followed_topic_emails.label' %>
40
58
  <p class="thredded--form-list--hint">
41
- <%= t 'thredded.preferences.form.messageboard_notify_on_mention.hint' %>
59
+ <%= t 'thredded.preferences.form.messageboard_followed_topic_emails.hint' %>
42
60
  </p>
43
61
  <% end %>
44
62
  </li>
@@ -10,9 +10,10 @@
10
10
  <li>
11
11
  <%= form.label :user_ids, t('thredded.private_topics.form.users_label') %>
12
12
  <%= form.text_field :user_ids,
13
- placeholder: t('thredded.private_topics.form.users_placeholder'),
14
- 'data-thredded-users-select' => true,
15
- 'data-autocomplete-url' => autocomplete_users_path %>
13
+ placeholder: t('thredded.private_topics.form.users_placeholder'),
14
+ 'data-thredded-users-select' => true,
15
+ 'data-autocomplete-url' => autocomplete_users_path,
16
+ 'data-autocomplete-min-length' => Thredded.autocomplete_min_length %>
16
17
  </li>
17
18
 
18
19
  <%= render 'thredded/posts_common/form/content_field',