thredded 0.12.1 → 0.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/commands/thredded/at_notification_extractor.rb +1 -0
- data/app/commands/thredded/autofollow_users.rb +1 -0
- data/app/commands/thredded/create_messageboard.rb +1 -0
- data/app/commands/thredded/mark_all_read.rb +1 -0
- data/app/commands/thredded/moderate_post.rb +1 -0
- data/app/commands/thredded/notify_following_users.rb +1 -0
- data/app/commands/thredded/notify_private_topic_users.rb +1 -0
- data/app/controllers/concerns/thredded/new_post_params.rb +1 -0
- data/app/controllers/concerns/thredded/new_private_post_params.rb +1 -0
- data/app/controllers/concerns/thredded/new_private_topic_params.rb +1 -0
- data/app/controllers/concerns/thredded/new_topic_params.rb +1 -0
- data/app/controllers/concerns/thredded/render_preview.rb +1 -0
- data/app/controllers/thredded/application_controller.rb +1 -0
- data/app/controllers/thredded/autocomplete_users_controller.rb +1 -0
- data/app/controllers/thredded/messageboards_controller.rb +4 -3
- data/app/controllers/thredded/moderation_controller.rb +1 -0
- data/app/controllers/thredded/post_permalinks_controller.rb +1 -0
- data/app/controllers/thredded/post_previews_controller.rb +1 -0
- data/app/controllers/thredded/posts_controller.rb +1 -0
- data/app/controllers/thredded/preferences_controller.rb +4 -3
- data/app/controllers/thredded/private_post_permalinks_controller.rb +1 -0
- data/app/controllers/thredded/private_post_previews_controller.rb +1 -0
- data/app/controllers/thredded/private_posts_controller.rb +1 -0
- data/app/controllers/thredded/private_topic_previews_controller.rb +1 -0
- data/app/controllers/thredded/private_topics_controller.rb +1 -0
- data/app/controllers/thredded/read_states_controller.rb +1 -0
- data/app/controllers/thredded/theme_previews_controller.rb +1 -0
- data/app/controllers/thredded/topic_previews_controller.rb +1 -0
- data/app/controllers/thredded/topics_controller.rb +5 -4
- data/app/forms/thredded/edit_topic_form.rb +1 -0
- data/app/forms/thredded/post_form.rb +2 -0
- data/app/forms/thredded/private_post_form.rb +2 -0
- data/app/forms/thredded/private_topic_form.rb +1 -0
- data/app/forms/thredded/topic_form.rb +1 -0
- data/app/forms/thredded/user_preferences_form.rb +1 -0
- data/app/helpers/thredded/application_helper.rb +1 -0
- data/app/helpers/thredded/nav_helper.rb +7 -6
- data/app/helpers/thredded/render_helper.rb +1 -0
- data/app/helpers/thredded/urls_helper.rb +1 -0
- data/app/jobs/thredded/activity_updater_job.rb +1 -0
- data/app/jobs/thredded/auto_follow_and_notify_job.rb +1 -0
- data/app/jobs/thredded/notify_private_topic_users_job.rb +1 -0
- data/app/mailer_previews/thredded/base_mailer_preview.rb +2 -1
- data/app/mailer_previews/thredded/post_mailer_preview.rb +3 -2
- data/app/mailer_previews/thredded/private_topic_mailer_preview.rb +2 -1
- data/app/mailers/thredded/base_mailer.rb +1 -0
- data/app/mailers/thredded/post_mailer.rb +1 -0
- data/app/mailers/thredded/private_topic_mailer.rb +1 -0
- data/app/models/concerns/thredded/content_moderation_state.rb +1 -0
- data/app/models/concerns/thredded/friendly_id_reserved_words_and_pagination.rb +1 -0
- data/app/models/concerns/thredded/moderation_state.rb +2 -1
- data/app/models/concerns/thredded/notifier_preference.rb +1 -0
- data/app/models/concerns/thredded/post_common.rb +1 -0
- data/app/models/concerns/thredded/search_parser.rb +3 -2
- data/app/models/concerns/thredded/topic_common.rb +2 -1
- data/app/models/concerns/thredded/topics_search.rb +1 -0
- data/app/models/concerns/thredded/user_topic_read_state_common.rb +1 -0
- data/app/models/thredded/category.rb +2 -1
- data/app/models/thredded/messageboard.rb +5 -4
- data/app/models/thredded/messageboard_group.rb +1 -0
- data/app/models/thredded/messageboard_notifications_for_followed_topics.rb +2 -1
- data/app/models/thredded/messageboard_user.rb +1 -0
- data/app/models/thredded/notifications_for_followed_topics.rb +2 -1
- data/app/models/thredded/notifications_for_private_topics.rb +2 -1
- data/app/models/thredded/null_user.rb +1 -0
- data/app/models/thredded/null_user_topic_read_state.rb +1 -0
- data/app/models/thredded/post.rb +4 -3
- data/app/models/thredded/post_moderation_record.rb +3 -2
- data/app/models/thredded/private_post.rb +3 -2
- data/app/models/thredded/private_topic.rb +4 -3
- data/app/models/thredded/private_user.rb +2 -1
- data/app/models/thredded/stats.rb +1 -0
- data/app/models/thredded/topic.rb +6 -5
- data/app/models/thredded/topic_category.rb +1 -0
- data/app/models/thredded/user_detail.rb +2 -1
- data/app/models/thredded/user_extender.rb +2 -1
- data/app/models/thredded/user_messageboard_preference.rb +2 -1
- data/app/models/thredded/user_permissions/admin/if_admin_column_true.rb +1 -0
- data/app/models/thredded/user_permissions/admin/none.rb +1 -0
- data/app/models/thredded/user_permissions/message/readers_of_writeable_boards.rb +1 -0
- data/app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb +1 -0
- data/app/models/thredded/user_permissions/moderate/none.rb +1 -0
- data/app/models/thredded/user_permissions/read/all.rb +1 -0
- data/app/models/thredded/user_permissions/write/all.rb +1 -0
- data/app/models/thredded/user_permissions/write/none.rb +1 -0
- data/app/models/thredded/user_post_notification.rb +2 -1
- data/app/models/thredded/user_preference.rb +2 -1
- data/app/models/thredded/user_private_topic_read_state.rb +2 -1
- data/app/models/thredded/user_topic_follow.rb +3 -2
- data/app/models/thredded/user_topic_read_state.rb +2 -1
- data/app/notifiers/thredded/base_notifier.rb +1 -1
- data/app/notifiers/thredded/email_notifier.rb +1 -0
- data/app/policies/thredded/messageboard_group_policy.rb +1 -0
- data/app/policies/thredded/messageboard_policy.rb +1 -0
- data/app/policies/thredded/post_policy.rb +1 -0
- data/app/policies/thredded/private_post_policy.rb +1 -0
- data/app/policies/thredded/private_topic_policy.rb +1 -0
- data/app/policies/thredded/topic_policy.rb +1 -0
- data/app/view_hooks/thredded/all_view_hooks.rb +1 -0
- data/app/view_models/thredded/base_topic_view.rb +1 -0
- data/app/view_models/thredded/messageboard_group_view.rb +1 -0
- data/app/view_models/thredded/post_view.rb +1 -0
- data/app/view_models/thredded/posts_page_view.rb +1 -0
- data/app/view_models/thredded/private_topic_view.rb +1 -0
- data/app/view_models/thredded/private_topics_page_view.rb +1 -0
- data/app/view_models/thredded/topic_email_view.rb +1 -0
- data/app/view_models/thredded/topic_posts_page_view.rb +1 -0
- data/app/view_models/thredded/topic_view.rb +1 -0
- data/app/view_models/thredded/topics_page_view.rb +1 -0
- data/app/views/thredded/messageboards/index.html.erb +2 -2
- data/app/views/thredded/posts_common/actions/_edit.html.erb +2 -1
- data/app/views/thredded/private_topics/_header.html.erb +2 -1
- data/app/views/thredded/topics/_header.html.erb +2 -1
- data/app/views/thredded/topics/index.html.erb +1 -1
- data/bin/rails +1 -0
- data/bin/rubocop +1 -0
- data/config/routes.rb +13 -12
- data/db/migrate/20160329231848_create_thredded.rb +75 -66
- data/db/upgrade_migrations/20160611094616_upgrade_v0_5_to_v0_6.rb +6 -3
- data/db/upgrade_migrations/20160723012349_upgrade_v0_6_to_v0_7.rb +4 -1
- data/db/upgrade_migrations/20161019150201_upgrade_v0_7_to_v0_8.rb +4 -1
- data/db/upgrade_migrations/20161113161801_upgrade_v0_8_to_v0_9.rb +11 -8
- data/db/upgrade_migrations/20170125033319_upgrade_v0_9_to_v0_10.rb +12 -6
- data/db/upgrade_migrations/20170312131417_upgrade_thredded_v0_10_to_v0_11.rb +6 -3
- data/db/upgrade_migrations/20170420163138_upgrade_thredded_v0_11_to_v0_12.rb +4 -1
- data/lib/generators/thredded/install/install_generator.rb +1 -0
- data/lib/generators/thredded/install/templates/initializer.rb +1 -0
- data/lib/tasks/thredded_tasks.rake +1 -0
- data/lib/thredded.rb +7 -0
- data/lib/thredded/base_migration.rb +14 -0
- data/lib/thredded/collection_to_strings_with_cache_renderer.rb +1 -0
- data/lib/thredded/content_formatter.rb +7 -6
- data/lib/thredded/database_seeder.rb +1 -0
- data/lib/thredded/db_tools.rb +9 -8
- data/lib/thredded/email_transformer.rb +1 -0
- data/lib/thredded/email_transformer/onebox.rb +1 -0
- data/lib/thredded/engine.rb +3 -2
- data/lib/thredded/errors.rb +1 -0
- data/lib/thredded/formatting_demo_content.rb +1 -0
- data/lib/thredded/html_pipeline/at_mention_filter.rb +3 -2
- data/lib/thredded/html_pipeline/autolink_filter.rb +1 -0
- data/lib/thredded/html_pipeline/kramdown_filter.rb +2 -1
- data/lib/thredded/html_pipeline/onebox_filter.rb +2 -1
- data/lib/thredded/html_pipeline/wrap_iframes_filter.rb +1 -0
- data/lib/thredded/version.rb +2 -1
- data/lib/thredded/view_hooks/config.rb +1 -0
- data/lib/thredded/view_hooks/renderer.rb +1 -0
- metadata +5 -7
- data/db/upgrade_migrations/20160410111522_upgrade_v0_2_to_v0_3.rb +0 -63
- data/db/upgrade_migrations/20160429222452_upgrade_v0_3_to_v0_4.rb +0 -13
- data/db/upgrade_migrations/20160501151908_upgrade_v0_4_to_v0_5.rb +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbd4a76e413440eb1929c482f59356da08d89280
|
4
|
+
data.tar.gz: 6ace994d8e7fef840df035c2e51d3b4e76231bbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28b4cd12daa8d8883b3dfb03eabfb7d6f9905610df218fa475e4472244ad829c59fcb539f4a8ea438ec88d0fda0235d81faf97dec4fe36f210056ce0eff8038c
|
7
|
+
data.tar.gz: fca695541cfc0437c02cb17bedc40e6058d3b35d1ab48c1cf68554da6c5572a3d17721e4eed0174cd3fc351e514ae3fef55526c970d4f881800f65705511f88b
|
data/README.md
CHANGED
@@ -99,7 +99,7 @@ Then, see the rest of this Readme for more information about using and customizi
|
|
99
99
|
Add the gem to your Gemfile:
|
100
100
|
|
101
101
|
```ruby
|
102
|
-
gem 'thredded', '~> 0.12.
|
102
|
+
gem 'thredded', '~> 0.12.2'
|
103
103
|
```
|
104
104
|
|
105
105
|
Add the Thredded [initializer] to your parent app by running the install generator.
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Thredded
|
3
4
|
class MessageboardsController < Thredded::ApplicationController
|
4
|
-
before_action :thredded_require_login!, only: [
|
5
|
+
before_action :thredded_require_login!, only: %i[new create edit update]
|
5
6
|
|
6
|
-
after_action :verify_authorized, except: %i
|
7
|
-
after_action :verify_policy_scoped, except: %i
|
7
|
+
after_action :verify_authorized, except: %i[index]
|
8
|
+
after_action :verify_policy_scoped, except: %i[new create edit update]
|
8
9
|
|
9
10
|
def index
|
10
11
|
@groups = MessageboardGroupView.grouped(policy_scope(Messageboard.all))
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Thredded
|
3
4
|
class PreferencesController < Thredded::ApplicationController
|
4
5
|
before_action :thredded_require_login!,
|
@@ -32,9 +33,9 @@ module Thredded
|
|
32
33
|
:messageboard_auto_follow_topics,
|
33
34
|
:follow_topics_on_mention,
|
34
35
|
:messageboard_follow_topics_on_mention,
|
35
|
-
messageboard_notifications_for_followed_topics_attributes: %i
|
36
|
-
notifications_for_followed_topics_attributes: %i
|
37
|
-
notifications_for_private_topics_attributes: %i
|
36
|
+
messageboard_notifications_for_followed_topics_attributes: %i[notifier_key id messageboard_id enabled],
|
37
|
+
notifications_for_followed_topics_attributes: %i[notifier_key id enabled],
|
38
|
+
notifications_for_private_topics_attributes: %i[notifier_key id enabled]
|
38
39
|
)
|
39
40
|
end
|
40
41
|
end
|
@@ -1,19 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Thredded
|
3
4
|
class TopicsController < Thredded::ApplicationController # rubocop:disable Metrics/ClassLength
|
4
5
|
include Thredded::NewTopicParams
|
5
6
|
include Thredded::NewPostParams
|
6
7
|
|
7
8
|
before_action :thredded_require_login!,
|
8
|
-
only: %i
|
9
|
+
only: %i[edit new update create destroy follow unfollow]
|
9
10
|
|
10
11
|
before_action :use_topic_messageboard,
|
11
|
-
only: %i
|
12
|
+
only: %i[show edit update destroy follow unfollow]
|
12
13
|
|
13
14
|
after_action :update_user_activity
|
14
15
|
|
15
|
-
after_action :verify_authorized, except: %i
|
16
|
-
after_action :verify_policy_scoped, except: %i
|
16
|
+
after_action :verify_authorized, except: %i[search]
|
17
|
+
after_action :verify_policy_scoped, except: %i[show new create edit update destroy follow unfollow]
|
17
18
|
|
18
19
|
def index
|
19
20
|
authorize_reading messageboard
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Thredded
|
3
4
|
class PostForm
|
4
5
|
attr_reader :post, :topic
|
@@ -16,6 +17,7 @@ module Thredded
|
|
16
17
|
@messageboard = topic.messageboard
|
17
18
|
@topic = topic
|
18
19
|
@post = post ? post : topic.posts.build
|
20
|
+
user ||= Thredded::NullUser.new
|
19
21
|
|
20
22
|
if post_params.include?(:quote_post)
|
21
23
|
post_params[:content] =
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Thredded
|
3
4
|
class PrivatePostForm
|
4
5
|
attr_reader :post, :topic
|
@@ -15,6 +16,7 @@ module Thredded
|
|
15
16
|
def initialize(user:, topic:, post: nil, post_params: {})
|
16
17
|
@topic = topic
|
17
18
|
@post = post ? post : topic.posts.build
|
19
|
+
user ||= Thredded::NullUser.new
|
18
20
|
|
19
21
|
if post_params.include?(:quote_post)
|
20
22
|
post_params[:content] =
|
@@ -1,29 +1,30 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'set'
|
3
4
|
module Thredded
|
4
5
|
module NavHelper
|
5
6
|
USER_NAV_MODERATION_PAGES = Set.new(
|
6
|
-
%w
|
7
|
+
%w[
|
7
8
|
thredded--pending-moderation
|
8
9
|
thredded--moderation-activity
|
9
10
|
thredded--moderation-history
|
10
11
|
thredded--moderation-users
|
11
12
|
thredded--moderation-user
|
12
|
-
|
13
|
+
]
|
13
14
|
)
|
14
15
|
|
15
16
|
USER_NAV_PREFERENCES_PAGES = Set.new(
|
16
|
-
%w
|
17
|
+
%w[
|
17
18
|
thredded--preferences
|
18
|
-
|
19
|
+
]
|
19
20
|
)
|
20
21
|
|
21
22
|
USER_NAV_PRIVATE_TOPICS_PAGES = Set.new(
|
22
|
-
%w
|
23
|
+
%w[
|
23
24
|
thredded--new-private-topic
|
24
25
|
thredded--private-topics-index
|
25
26
|
thredded--private-topic-show
|
26
|
-
|
27
|
+
]
|
27
28
|
)
|
28
29
|
|
29
30
|
def current_page_preferences?
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Thredded
|
3
4
|
# A base class for Thredded mailer previews.
|
4
5
|
# @abstract
|
@@ -98,7 +99,7 @@ Additionally, Markdown is extended to support the following:
|
|
98
99
|
end
|
99
100
|
|
100
101
|
def mock_user(attr = {})
|
101
|
-
name = %w
|
102
|
+
name = %w[Alice Bob].sample
|
102
103
|
Thredded.user_class.new(
|
103
104
|
attr.reverse_merge(
|
104
105
|
Thredded.user_name_column => name,
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Thredded
|
3
4
|
# Previews for the PostMailer
|
4
5
|
class PostMailerPreview < BaseMailerPreview
|
5
6
|
def post_notification
|
6
7
|
PostMailer.post_notification(
|
7
|
-
mock_post(content: mock_content(mention_users: %w
|
8
|
-
%w
|
8
|
+
mock_post(content: mock_content(mention_users: %w[glebm joel])),
|
9
|
+
%w[glebm@test.com joel@test.com]
|
9
10
|
)
|
10
11
|
end
|
11
12
|
end
|