thredded 0.16.1 → 0.16.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -2
- data/app/controllers/thredded/post_previews_controller.rb +5 -0
- data/app/controllers/thredded/posts_controller.rb +18 -1
- data/app/controllers/thredded/private_post_previews_controller.rb +5 -0
- data/app/controllers/thredded/private_posts_controller.rb +13 -2
- data/app/controllers/thredded/private_topic_previews_controller.rb +4 -0
- data/app/controllers/thredded/topic_previews_controller.rb +4 -0
- data/app/helpers/thredded/urls_helper.rb +2 -2
- data/app/models/thredded/messageboard.rb +1 -0
- data/app/models/thredded/messageboard_notifications_for_followed_topics.rb +1 -1
- data/app/models/thredded/user_extender.rb +2 -0
- data/app/view_hooks/thredded/all_view_hooks.rb +12 -0
- data/app/view_models/thredded/post_view.rb +2 -5
- data/app/views/thredded/error_pages/forbidden.json.erb +5 -0
- data/app/views/thredded/error_pages/not_found.json.erb +5 -0
- data/app/views/thredded/topics/_header.html.erb +3 -1
- data/config/locales/pt-BR.yml +22 -22
- data/config/routes.rb +17 -2
- data/db/upgrade_migrations/20161113161801_upgrade_v0_8_to_v0_9.rb +4 -3
- data/lib/generators/thredded/install/templates/initializer.rb +1 -0
- data/lib/thredded.rb +1 -0
- data/lib/thredded/version.rb +1 -1
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70ed5d5d867753bfd5e7586702685ea7ccd08ec4a40413af3d61da3454188908
|
4
|
+
data.tar.gz: 77c4526fbd5d779651f571112b8b22aef3557340d4fceee20feb0e9397b6c5fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ef7aebf6723efd1ecbce8dd49337e31aee80977ed2eda4b5a9cb07bf05118f2bb0087c513f3977948db5c46ff665aa5c90a016cfefcf16dc3744cf6f1a9398d
|
7
|
+
data.tar.gz: e3030a49d320e4db4d5f97066dac4710837a63e638840f3e4dc9c3ab9dccf431897e4aaff642d4113922c9747c25193dc5965fa44a85a050cb5b9e2e16bee63a
|
data/README.md
CHANGED
@@ -95,7 +95,7 @@ Then, see the rest of this Readme for more information about using and customizi
|
|
95
95
|
Add the gem to your Gemfile:
|
96
96
|
|
97
97
|
```ruby
|
98
|
-
gem 'thredded', '~> 0.16.
|
98
|
+
gem 'thredded', '~> 0.16.3'
|
99
99
|
```
|
100
100
|
|
101
101
|
Add the Thredded [initializer] to your parent app by running the install generator.
|
@@ -359,6 +359,8 @@ If you use [Rails Email Preview], you can include Thredded emails into the list
|
|
359
359
|
You can also turn off the email notifier totally, or add other notifiers (e.g. Pushover, possibly Slack) by adjusting
|
360
360
|
the `Thredded.notifiers` configuration in your initializer. See the default initializer for examples.
|
361
361
|
|
362
|
+
You must configure the address the email appears to be from (`Thredded.email_from`). This address is also used as the "To" address for both email notifcations, as all the recipients are on bcc.
|
363
|
+
|
362
364
|
### Enabling auto-follow
|
363
365
|
|
364
366
|
In some cases, you'll want all users to auto-follow new messageboard topics by default. This might be useful
|
@@ -628,9 +630,13 @@ On Mac, run:
|
|
628
630
|
|
629
631
|
```bash
|
630
632
|
brew cask install chromium
|
631
|
-
brew install chromedriver
|
633
|
+
brew cask install chromedriver
|
632
634
|
```
|
633
635
|
|
636
|
+
To get better page saves (`page.save_and_open_page`) from local capybara specs ensure you are running the server locally
|
637
|
+
and set `export CAPYBARA_ASSET_HOST=http://localhost:3000` (or whatever host/port your server is on) before running your
|
638
|
+
test suite.
|
639
|
+
|
634
640
|
### Ruby
|
635
641
|
|
636
642
|
Thredded Ruby code formatting is ensured by [Rubocop](https://github.com/bbatsov/rubocop). Run `rubocop -a` to ensure a
|
@@ -4,16 +4,21 @@ module Thredded
|
|
4
4
|
class PostPreviewsController < Thredded::ApplicationController
|
5
5
|
include Thredded::RenderPreview
|
6
6
|
|
7
|
+
before_action :thredded_require_login!
|
8
|
+
after_action :verify_authorized
|
9
|
+
|
7
10
|
# Preview a new post
|
8
11
|
def preview
|
9
12
|
@post = Thredded::Post.new(post_params)
|
10
13
|
@post.postable = Thredded::Topic.friendly_find!(params[:topic_id])
|
14
|
+
authorize @post, :create?
|
11
15
|
render_preview
|
12
16
|
end
|
13
17
|
|
14
18
|
# Preview an update to an existing post
|
15
19
|
def update
|
16
20
|
@post = Thredded::Post.find!(params[:post_id])
|
21
|
+
authorize @post, :update?
|
17
22
|
@post.assign_attributes(post_params)
|
18
23
|
render_preview
|
19
24
|
end
|
@@ -7,6 +7,7 @@ module Thredded
|
|
7
7
|
include Thredded::NewPostParams
|
8
8
|
|
9
9
|
helper_method :topic
|
10
|
+
before_action :assign_messageboard_for_actions, only: %i[mark_as_read mark_as_unread]
|
10
11
|
after_action :update_user_activity
|
11
12
|
|
12
13
|
after_action :verify_authorized
|
@@ -53,10 +54,22 @@ module Thredded
|
|
53
54
|
notice: I18n.t('thredded.posts.deleted_notice')
|
54
55
|
end
|
55
56
|
|
57
|
+
def mark_as_read
|
58
|
+
authorize post, :read?
|
59
|
+
UserTopicReadState.touch!(thredded_current_user.id, post)
|
60
|
+
respond_to do |format|
|
61
|
+
format.html { redirect_back fallback_location: post_path(post, user: thredded_current_user) }
|
62
|
+
format.json { render(json: { read: true }) }
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
56
66
|
def mark_as_unread
|
57
67
|
authorize post, :read?
|
58
68
|
post.mark_as_unread(thredded_current_user)
|
59
|
-
|
69
|
+
respond_to do |format|
|
70
|
+
format.html { after_mark_as_unread } # customization hook
|
71
|
+
format.json { render(json: { read: false }) }
|
72
|
+
end
|
60
73
|
end
|
61
74
|
|
62
75
|
def quote
|
@@ -84,6 +97,10 @@ module Thredded
|
|
84
97
|
.friendly_find!(params[:topic_id])
|
85
98
|
end
|
86
99
|
|
100
|
+
def assign_messageboard_for_actions
|
101
|
+
@messageboard = post.postable.messageboard
|
102
|
+
end
|
103
|
+
|
87
104
|
def post
|
88
105
|
@post ||= Thredded::Post.find!(params[:id])
|
89
106
|
end
|
@@ -4,16 +4,21 @@ module Thredded
|
|
4
4
|
class PrivatePostPreviewsController < Thredded::ApplicationController
|
5
5
|
include Thredded::RenderPreview
|
6
6
|
|
7
|
+
before_action :thredded_require_login!
|
8
|
+
after_action :verify_authorized
|
9
|
+
|
7
10
|
# Preview a new post
|
8
11
|
def preview
|
9
12
|
@private_post = Thredded::PrivatePost.new(private_post_params)
|
10
13
|
@private_post.postable = Thredded::PrivateTopic.friendly_find!(params[:private_topic_id])
|
14
|
+
authorize @private_post, :create?
|
11
15
|
render_preview
|
12
16
|
end
|
13
17
|
|
14
18
|
# Preview an update to an existing post
|
15
19
|
def update
|
16
20
|
@private_post = Thredded::PrivatePost.find!(params[:private_post_id])
|
21
|
+
authorize @private_post, :update?
|
17
22
|
@private_post.assign_attributes(private_post_params)
|
18
23
|
render_preview
|
19
24
|
end
|
@@ -7,7 +7,6 @@ module Thredded
|
|
7
7
|
include NewPrivatePostParams
|
8
8
|
|
9
9
|
helper_method :topic
|
10
|
-
after_action :update_user_activity
|
11
10
|
|
12
11
|
after_action :verify_authorized
|
13
12
|
|
@@ -52,10 +51,22 @@ module Thredded
|
|
52
51
|
notice: I18n.t('thredded.posts.deleted_notice')
|
53
52
|
end
|
54
53
|
|
54
|
+
def mark_as_read
|
55
|
+
authorize post, :read?
|
56
|
+
UserPrivateTopicReadState.touch!(thredded_current_user.id, post)
|
57
|
+
respond_to do |format|
|
58
|
+
format.html { redirect_back fallback_location: post_path(post, user: thredded_current_user) }
|
59
|
+
format.json { render(json: { read: true }) }
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
55
63
|
def mark_as_unread
|
56
64
|
authorize post, :read?
|
57
65
|
post.mark_as_unread(thredded_current_user)
|
58
|
-
|
66
|
+
respond_to do |format|
|
67
|
+
format.html { after_mark_as_unread } # customization hook
|
68
|
+
format.json { render(json: { read: false }) }
|
69
|
+
end
|
59
70
|
end
|
60
71
|
|
61
72
|
def quote
|
@@ -5,8 +5,12 @@ module Thredded
|
|
5
5
|
include Thredded::NewPrivateTopicParams
|
6
6
|
include Thredded::RenderPreview
|
7
7
|
|
8
|
+
before_action :thredded_require_login!
|
9
|
+
after_action :verify_authorized
|
10
|
+
|
8
11
|
def preview
|
9
12
|
form = Thredded::PrivateTopicForm.new(new_private_topic_params)
|
13
|
+
authorize_creating form.private_topic
|
10
14
|
@private_post = form.post
|
11
15
|
@private_post.postable = form.private_topic
|
12
16
|
render_preview
|
@@ -5,8 +5,12 @@ module Thredded
|
|
5
5
|
include Thredded::NewTopicParams
|
6
6
|
include Thredded::RenderPreview
|
7
7
|
|
8
|
+
before_action :thredded_require_login!
|
9
|
+
after_action :verify_authorized
|
10
|
+
|
8
11
|
def preview
|
9
12
|
form = Thredded::TopicForm.new(new_topic_params)
|
13
|
+
authorize_creating form.topic
|
10
14
|
@post = form.post
|
11
15
|
@post.postable = form.topic
|
12
16
|
render_preview
|
@@ -126,9 +126,9 @@ module Thredded
|
|
126
126
|
|
127
127
|
def mark_unread_path(post, _params = {})
|
128
128
|
if post.private_topic_post?
|
129
|
-
|
129
|
+
mark_as_unread_private_post_path(post)
|
130
130
|
else
|
131
|
-
|
131
|
+
mark_as_unread_post_path(post)
|
132
132
|
end
|
133
133
|
end
|
134
134
|
|
@@ -8,7 +8,7 @@ module Thredded
|
|
8
8
|
inverse_of: :messageboard_notifications_for_followed_topics
|
9
9
|
belongs_to :user,
|
10
10
|
class_name: Thredded.user_class_name,
|
11
|
-
inverse_of: :
|
11
|
+
inverse_of: :thredded_messageboard_notifications_for_followed_topics
|
12
12
|
belongs_to :messageboard
|
13
13
|
scope :for_messageboard, ->(messageboard) { where(messageboard_id: messageboard.id) }
|
14
14
|
|
@@ -26,6 +26,8 @@ module Thredded
|
|
26
26
|
with_options dependent: :destroy, foreign_key: 'user_id', inverse_of: :user do
|
27
27
|
has_many :thredded_user_messageboard_preferences, class_name: 'Thredded::UserMessageboardPreference'
|
28
28
|
has_many :thredded_notifications_for_followed_topics, class_name: 'Thredded::NotificationsForFollowedTopics'
|
29
|
+
has_many :thredded_messageboard_notifications_for_followed_topics,
|
30
|
+
class_name: 'Thredded::MessageboardNotificationsForFollowedTopics'
|
29
31
|
has_many :thredded_notifications_for_private_topics, class_name: 'Thredded::NotificationsForPrivateTopics'
|
30
32
|
has_many :thredded_post_notifications, class_name: 'Thredded::UserPostNotification'
|
31
33
|
has_many :thredded_private_users, class_name: 'Thredded::PrivateUser'
|
@@ -12,6 +12,8 @@ module Thredded
|
|
12
12
|
attr_reader :messageboards_index
|
13
13
|
# @return [ModerationUserPage]
|
14
14
|
attr_reader :moderation_user_page
|
15
|
+
# @return [TopicPage]
|
16
|
+
attr_reader :topic_page
|
15
17
|
|
16
18
|
@instance = nil
|
17
19
|
class << self
|
@@ -31,6 +33,7 @@ module Thredded
|
|
31
33
|
@post_form = PostForm.new
|
32
34
|
@moderation_user_page = ModerationUserPage.new
|
33
35
|
@messageboards_index = MessageboardsIndex.new
|
36
|
+
@topic_page = TopicPage.new
|
34
37
|
end
|
35
38
|
|
36
39
|
# View hooks for collections of public or private posts.
|
@@ -110,6 +113,15 @@ module Thredded
|
|
110
113
|
end
|
111
114
|
end
|
112
115
|
|
116
|
+
class TopicPage
|
117
|
+
# @return [Thredded::AllViewHooks::ViewHook]
|
118
|
+
attr_reader :title
|
119
|
+
|
120
|
+
def initialize
|
121
|
+
@title = ViewHook.new
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
113
125
|
# Contains the view hook content and can render a view hook.
|
114
126
|
class ViewHook
|
115
127
|
# @return [Thredded::ViewHooks::Config]
|
@@ -12,6 +12,8 @@ module Thredded
|
|
12
12
|
:approved?,
|
13
13
|
:blocked?,
|
14
14
|
:last_moderation_record,
|
15
|
+
:cache_key,
|
16
|
+
:cache_key_with_version,
|
15
17
|
to: :@post
|
16
18
|
|
17
19
|
# @param post [Thredded::PostCommon]
|
@@ -71,11 +73,6 @@ module Thredded
|
|
71
73
|
Thredded::UrlsHelper.permalink_path(@post)
|
72
74
|
end
|
73
75
|
|
74
|
-
# This cache key is used only for caching the content.
|
75
|
-
def cache_key
|
76
|
-
@post.cache_key
|
77
|
-
end
|
78
|
-
|
79
76
|
POST_IS_READ = :read
|
80
77
|
POST_IS_UNREAD = :unread
|
81
78
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
<header class="thredded--topic-header">
|
2
|
-
|
2
|
+
<%= view_hooks.topic_page.title.render self, topic: topic do %>
|
3
|
+
<h1 class="thredded--topic-header--title"><%= topic.title %></h1>
|
4
|
+
<% end %>
|
3
5
|
<cite class="thredded--topic-header--started-by">
|
4
6
|
<%= t 'thredded.topics.started_by_html',
|
5
7
|
time_ago: time_ago(topic.created_at),
|
data/config/locales/pt-BR.yml
CHANGED
@@ -3,7 +3,7 @@ pt-BR:
|
|
3
3
|
thredded:
|
4
4
|
content_moderation_states:
|
5
5
|
content_blocked_notice: Bloqueado
|
6
|
-
content_blocked_notice_with_record_html:
|
6
|
+
content_blocked_notice_with_record_html: Bloqueado por %{moderator} %{time_ago}
|
7
7
|
email_notifier:
|
8
8
|
by_email: de e-mail
|
9
9
|
emails:
|
@@ -17,9 +17,9 @@ pt-BR:
|
|
17
17
|
text:
|
18
18
|
email_sent_reason: |-
|
19
19
|
Este e-mail foi enviado para você porque %{user} incluiu você em
|
20
|
-
|
20
|
+
um tópico privado "%{topic_title}".
|
21
21
|
|
22
|
-
|
22
|
+
Clique aqui para ver a conversa:
|
23
23
|
%{post_url}
|
24
24
|
post_lead: 'Uma nova mensagem de %{user} em "%{topic_title}":'
|
25
25
|
unsubscribe_instructions: :thredded.emails.post_notification.text.unsubscribe_instructions
|
@@ -59,7 +59,7 @@ pt-BR:
|
|
59
59
|
form:
|
60
60
|
create_btn_submitting: :thredded.form.create_btn_submitting
|
61
61
|
description_label: Descrição
|
62
|
-
locked_label:
|
62
|
+
locked_label: Bloqueado
|
63
63
|
locked_notice: Este quadro de mensagens está bloqueado. Somente os moderadores podem criar novos tópicos
|
64
64
|
aqui.
|
65
65
|
messageboard_group_id_label: grupo messageboard
|
@@ -85,22 +85,22 @@ pt-BR:
|
|
85
85
|
create: Criar um novo grupo de mensagens
|
86
86
|
form:
|
87
87
|
create_btn_submitting: :thredded.form.create_btn_submitting
|
88
|
-
saved:
|
88
|
+
saved: Grupo de mensagens %{name} criado
|
89
89
|
moderation:
|
90
90
|
approve_btn: Aprovar
|
91
|
-
block_btn:
|
91
|
+
block_btn: Bloquear
|
92
92
|
moderation_state:
|
93
93
|
name: Estado de moderação
|
94
94
|
pending:
|
95
95
|
empty:
|
96
|
-
content: Todas as mensagens
|
96
|
+
content: Todas as mensagens foram moderadas.
|
97
97
|
title: Bom trabalho!
|
98
|
-
post_approved_html:
|
99
|
-
post_blocked_html:
|
98
|
+
post_approved_html: Post aprovado por %{moderator} %{time_ago}.
|
99
|
+
post_blocked_html: Post bloqueado por %{moderator} %{time_ago}.
|
100
100
|
post_deleted_notice: Este post foi apagado.
|
101
101
|
posts_content_changed_since_moderation_html: >-
|
102
|
-
O <a href="%{post_url}">
|
103
|
-
|
102
|
+
O conteúdo do <a href="%{post_url}">post</a> foi alterado após a moderação. Abaixo está o conteúdo no momento
|
103
|
+
em que foi moderado.
|
104
104
|
search_users:
|
105
105
|
form_label: Buscar usuários
|
106
106
|
form_placeholder: :thredded.moderation.search_users.form_label
|
@@ -117,7 +117,7 @@ pt-BR:
|
|
117
117
|
mark_all_read: Marcar Como Lido
|
118
118
|
moderation: Moderação
|
119
119
|
moderation_activity: Atividade
|
120
|
-
moderation_history:
|
120
|
+
moderation_history: Histórico
|
121
121
|
moderation_pending: Pendente
|
122
122
|
moderation_users: Usuários
|
123
123
|
private_topics: Mensagens Privadas
|
@@ -136,7 +136,7 @@ pt-BR:
|
|
136
136
|
title_label: Adicionar um post
|
137
137
|
update_btn: Atualizar Post
|
138
138
|
update_btn_submitting: :thredded.form.update_btn_submitting
|
139
|
-
pending_moderation_notice: O
|
139
|
+
pending_moderation_notice: O seu post será publicado quando for revisado por um moderador.
|
140
140
|
quote_btn: Citar
|
141
141
|
spoiler_summary: Spoiler - clique para mostrar.
|
142
142
|
spoiler_summary_for_email: 'Spoiler - selecione o conteúdo abaixo para ver:'
|
@@ -164,7 +164,7 @@ pt-BR:
|
|
164
164
|
messageboard_notifications_for_followed_topics:
|
165
165
|
label: :thredded.preferences.form.notifications_for_followed_topics.label
|
166
166
|
notifications_for_followed_topics:
|
167
|
-
label: Notificações para tópicos
|
167
|
+
label: Notificações para tópicos seguidos
|
168
168
|
notifications_for_private_topics:
|
169
169
|
label: Notificações de mensagens privadas
|
170
170
|
submit_btn: Atualizar Configurações
|
@@ -232,20 +232,20 @@ pt-BR:
|
|
232
232
|
update_btn: Atualizar Tópico
|
233
233
|
in_messageboard_html: em %{messageboard_link}
|
234
234
|
locked:
|
235
|
-
label:
|
235
|
+
label: Bloqueado
|
236
236
|
message: Este tópico foi bloqueado por um moderador.
|
237
|
-
mark_as_unread:
|
237
|
+
mark_as_unread: Marcar como não lida a partir daqui
|
238
238
|
not_following: Você não está seguindo este tema.
|
239
239
|
search:
|
240
240
|
no_results_in_messageboard_message_html: Não há resultados para sua busca <q>%{query}</q> em %{messageboard}
|
241
241
|
no_results_message_html: Nenhum resultado encontrado para sua busca <q>%{query}</q>
|
242
242
|
page_title: Tópicos dos Resultados da Busca
|
243
|
-
results_in_messageboard_message_html: Resultados da
|
244
|
-
results_message_html: Resultados
|
243
|
+
results_in_messageboard_message_html: Resultados da busca para <q>%{query}</q> em %{messageboard}
|
244
|
+
results_message_html: Resultados da busca para <q>%{query}</q>
|
245
245
|
search_in_all_messageboards_btn: Buscar em todos os lugares
|
246
246
|
started_by_html: Iniciado %{time_ago} por %{user}
|
247
247
|
sticky:
|
248
|
-
label:
|
248
|
+
label: Fixo
|
249
249
|
unfollow: Pare de seguir
|
250
250
|
unfollowed_notice: Você não está mais seguindo este tópico
|
251
251
|
updated_notice: Tópico atualizado
|
@@ -257,11 +257,11 @@ pt-BR:
|
|
257
257
|
page_title_in_messageboard: "%{messageboard}: Tópicos não lidos"
|
258
258
|
users:
|
259
259
|
currently_online: Atualmente Online
|
260
|
-
last_active_html: Última %{time_ago}
|
260
|
+
last_active_html: Última atividade %{time_ago}
|
261
261
|
posted_in_topic_html: Postou em %{topic_link}
|
262
262
|
posts_count:
|
263
263
|
one: Postado uma vez
|
264
|
-
other:
|
264
|
+
other: Postado %{count} vezes
|
265
265
|
recent_activity: :thredded.recent_activity
|
266
266
|
send_private_message: Enviar mensagem privada
|
267
267
|
started_topic_html: Começou %{topic_link}
|
@@ -269,5 +269,5 @@ pt-BR:
|
|
269
269
|
one: Começou um tópico
|
270
270
|
other: tópicos iniciados %{count}
|
271
271
|
user_posted_in_topic_html: "%{user_link} postou em %{topic_link}"
|
272
|
-
user_since_html:
|
272
|
+
user_since_html: Usuário desde %{time_ago}
|
273
273
|
user_started_topic_html: "%{user_link} começou %{topic_link}"
|
data/config/routes.rb
CHANGED
@@ -19,7 +19,6 @@ Thredded::Engine.routes.draw do # rubocop:disable Metrics/BlockLength
|
|
19
19
|
resource :preview, only: [:update], controller: 'private_post_previews'
|
20
20
|
member do
|
21
21
|
get 'quote'
|
22
|
-
post 'mark_as_unread'
|
23
22
|
end
|
24
23
|
end
|
25
24
|
end
|
@@ -84,11 +83,27 @@ Thredded::Engine.routes.draw do # rubocop:disable Metrics/BlockLength
|
|
84
83
|
resource :preview, only: [:update], controller: 'post_previews'
|
85
84
|
member do
|
86
85
|
get 'quote'
|
87
|
-
post 'mark_as_unread'
|
88
86
|
end
|
89
87
|
end
|
90
88
|
end
|
91
89
|
end
|
92
90
|
|
91
|
+
scope path: 'action' do
|
92
|
+
# flat urls under here for anything which is non-visible to users & search engines (typically json actions)
|
93
|
+
resources :posts, only: %i[] do
|
94
|
+
member do
|
95
|
+
post 'mark_as_read'
|
96
|
+
post 'mark_as_unread'
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
resources :private_posts, only: %i[] do
|
101
|
+
member do
|
102
|
+
post 'mark_as_read'
|
103
|
+
post 'mark_as_unread'
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
93
108
|
root to: 'messageboards#index'
|
94
109
|
end
|
@@ -29,12 +29,13 @@ class UpgradeV08ToV09 < Thredded::BaseMigration
|
|
29
29
|
end
|
30
30
|
|
31
31
|
Thredded::UserPreference.all.each do |pref|
|
32
|
-
pref.notifications_for_private_topics.create(notifier_key: 'email', enabled: pref.notify_on_message)
|
33
|
-
pref.notifications_for_followed_topics.create(notifier_key: 'email', enabled: pref.followed_topic_emails)
|
32
|
+
pref.notifications_for_private_topics.create!(notifier_key: 'email', enabled: pref.notify_on_message)
|
33
|
+
pref.notifications_for_followed_topics.create!(notifier_key: 'email', enabled: pref.followed_topic_emails)
|
34
34
|
end
|
35
35
|
Thredded::UserMessageboardPreference.pluck(:user_id, :messageboard_id, :followed_topic_emails)
|
36
36
|
.each do |user_id, messageboard_id, emails|
|
37
|
-
Thredded::
|
37
|
+
Thredded::UserPreference.find_or_create_by!(user_id: user_id)
|
38
|
+
Thredded::MessageboardNotificationsForFollowedTopics.create!(
|
38
39
|
user_id: user_id,
|
39
40
|
messageboard_id: messageboard_id,
|
40
41
|
notifier_key: 'email',
|
@@ -75,6 +75,7 @@ Thredded.layout = 'thredded/application'
|
|
75
75
|
|
76
76
|
# ==> Email Configuration
|
77
77
|
# Email "From:" field will use the following
|
78
|
+
# (this is also used as the "To" address for both email notifcations, as all the recipients are on bcc)
|
78
79
|
# Thredded.email_from = 'no-reply@example.com'
|
79
80
|
|
80
81
|
# Emails going out will prefix the "Subject:" with the following string
|
data/lib/thredded.rb
CHANGED
data/lib/thredded/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thredded
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Oliveira
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-12-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: active_record_union
|
@@ -242,19 +242,19 @@ dependencies:
|
|
242
242
|
- !ruby/object:Gem::Version
|
243
243
|
version: '0'
|
244
244
|
- !ruby/object:Gem::Dependency
|
245
|
-
name:
|
245
|
+
name: sassc-rails
|
246
246
|
requirement: !ruby/object:Gem::Requirement
|
247
247
|
requirements:
|
248
248
|
- - ">="
|
249
249
|
- !ruby/object:Gem::Version
|
250
|
-
version:
|
250
|
+
version: 2.0.0
|
251
251
|
type: :runtime
|
252
252
|
prerelease: false
|
253
253
|
version_requirements: !ruby/object:Gem::Requirement
|
254
254
|
requirements:
|
255
255
|
- - ">="
|
256
256
|
- !ruby/object:Gem::Version
|
257
|
-
version:
|
257
|
+
version: 2.0.0
|
258
258
|
- !ruby/object:Gem::Dependency
|
259
259
|
name: sprockets-es6
|
260
260
|
requirement: !ruby/object:Gem::Requirement
|
@@ -541,14 +541,14 @@ dependencies:
|
|
541
541
|
requirements:
|
542
542
|
- - ">="
|
543
543
|
- !ruby/object:Gem::Version
|
544
|
-
version: 2.0
|
544
|
+
version: 2.1.0
|
545
545
|
type: :development
|
546
546
|
prerelease: false
|
547
547
|
version_requirements: !ruby/object:Gem::Requirement
|
548
548
|
requirements:
|
549
549
|
- - ">="
|
550
550
|
- !ruby/object:Gem::Version
|
551
|
-
version: 2.0
|
551
|
+
version: 2.1.0
|
552
552
|
- !ruby/object:Gem::Dependency
|
553
553
|
name: roadie-rails
|
554
554
|
requirement: !ruby/object:Gem::Requirement
|
@@ -869,7 +869,9 @@ files:
|
|
869
869
|
- app/views/layouts/thredded/application.html.erb
|
870
870
|
- app/views/thredded/categories/_category.html.erb
|
871
871
|
- app/views/thredded/error_pages/forbidden.html.erb
|
872
|
+
- app/views/thredded/error_pages/forbidden.json.erb
|
872
873
|
- app/views/thredded/error_pages/not_found.html.erb
|
874
|
+
- app/views/thredded/error_pages/not_found.json.erb
|
873
875
|
- app/views/thredded/kaminari/_first_page.html.erb
|
874
876
|
- app/views/thredded/kaminari/_gap.html.erb
|
875
877
|
- app/views/thredded/kaminari/_last_page.html.erb
|
@@ -1066,7 +1068,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1066
1068
|
version: '0'
|
1067
1069
|
requirements: []
|
1068
1070
|
rubyforge_project:
|
1069
|
-
rubygems_version: 2.7.
|
1071
|
+
rubygems_version: 2.7.8
|
1070
1072
|
signing_key:
|
1071
1073
|
specification_version: 4
|
1072
1074
|
summary: The best Rails forums engine ever.
|