thredded 0.8.4 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +48 -9
- data/app/assets/images/thredded/breadcrumb-chevron.svg +1 -1
- data/app/assets/images/thredded/follow.svg +1 -1
- data/app/assets/images/thredded/moderation.svg +1 -4
- data/app/assets/images/thredded/private-messages.svg +1 -4
- data/app/assets/images/thredded/settings.svg +1 -4
- data/app/assets/images/thredded/unfollow.svg +1 -1
- data/app/assets/javascripts/thredded/components/time_stamps.es6 +1 -1
- data/app/assets/javascripts/thredded/components/user_preferences_form.es6 +26 -49
- data/app/assets/javascripts/thredded/dependencies.js +2 -1
- data/app/assets/stylesheets/thredded/base/_grid.scss +4 -4
- data/app/assets/stylesheets/thredded/base/_typography.scss +18 -0
- data/app/assets/stylesheets/thredded/components/_base.scss +4 -0
- data/app/assets/stylesheets/thredded/components/_currently-online.scss +4 -0
- data/app/assets/stylesheets/thredded/components/_form-list.scss +5 -0
- data/app/assets/stylesheets/thredded/components/_messageboard.scss +3 -0
- data/app/assets/stylesheets/thredded/components/_post-form.scss +7 -4
- data/app/assets/stylesheets/thredded/components/_post.scss +3 -0
- data/app/assets/stylesheets/thredded/components/_topic-delete.scss +3 -0
- data/app/assets/stylesheets/thredded/components/_topic-header.scss +20 -0
- data/app/assets/stylesheets/thredded/components/_topics.scss +13 -1
- data/app/assets/stylesheets/thredded/layout/_main-navigation.scss +1 -1
- data/app/assets/stylesheets/thredded/layout/_navigation.scss +3 -1
- data/app/assets/stylesheets/thredded/layout/_search-navigation.scss +4 -0
- data/app/assets/stylesheets/thredded/layout/_user-navigation.scss +3 -0
- data/app/commands/thredded/at_notification_extractor.rb +1 -2
- data/app/commands/thredded/autofollow_mentioned_users.rb +0 -1
- data/app/commands/thredded/notify_following_users.rb +20 -11
- data/app/commands/thredded/notify_private_topic_users.rb +12 -28
- data/app/controllers/thredded/application_controller.rb +8 -4
- data/app/controllers/thredded/messageboards_controller.rb +2 -2
- data/app/controllers/thredded/moderation_controller.rb +12 -13
- data/app/controllers/thredded/posts_controller.rb +1 -1
- data/app/controllers/thredded/preferences_controller.rb +11 -7
- data/app/controllers/thredded/private_topics_controller.rb +13 -9
- data/app/controllers/thredded/topics_controller.rb +20 -12
- data/app/forms/thredded/user_preferences_form.rb +23 -4
- data/app/helpers/thredded/application_helper.rb +11 -1
- data/app/mailers/thredded/post_mailer.rb +2 -3
- data/app/mailers/thredded/private_topic_mailer.rb +2 -3
- data/app/models/concerns/thredded/content_moderation_state.rb +1 -1
- data/app/models/concerns/thredded/notifier_preference.rb +18 -0
- data/app/models/concerns/thredded/post_common.rb +5 -1
- data/{lib → app/models/concerns}/thredded/search_parser.rb +0 -0
- data/app/models/concerns/thredded/topic_common.rb +3 -3
- data/{lib → app/models/concerns}/thredded/topics_search.rb +2 -3
- data/app/models/thredded/messageboard.rb +11 -0
- data/app/models/thredded/messageboard_notifications_for_followed_topics.rb +29 -0
- data/app/models/thredded/notifications_for_followed_topics.rb +22 -0
- data/app/models/thredded/notifications_for_private_topics.rb +21 -0
- data/app/models/thredded/post.rb +5 -3
- data/app/models/thredded/post_moderation_record.rb +1 -1
- data/app/models/thredded/private_post.rb +1 -1
- data/app/models/thredded/private_topic.rb +8 -4
- data/app/models/thredded/stats.rb +1 -1
- data/app/models/thredded/topic.rb +10 -7
- data/app/models/thredded/user_detail.rb +1 -1
- data/app/models/thredded/user_extender.rb +3 -1
- data/app/models/thredded/user_preference.rb +16 -5
- data/app/models/thredded/user_private_topic_read_state.rb +1 -1
- data/app/models/thredded/user_topic_read_state.rb +1 -1
- data/app/notifiers/thredded/base_notifier.rb +28 -0
- data/app/notifiers/thredded/email_notifier.rb +34 -0
- data/app/policies/thredded/post_policy.rb +3 -4
- data/app/policies/thredded/private_post_policy.rb +2 -3
- data/app/policies/thredded/topic_policy.rb +1 -2
- data/app/view_hooks/thredded/all_view_hooks.rb +0 -3
- data/app/view_models/thredded/base_topic_view.rb +0 -1
- data/app/view_models/thredded/post_view.rb +0 -1
- data/app/view_models/thredded/posts_page_view.rb +1 -4
- data/app/view_models/thredded/private_topic_view.rb +3 -1
- data/app/view_models/thredded/private_topics_page_view.rb +8 -3
- data/app/view_models/thredded/topic_posts_page_view.rb +1 -2
- data/app/view_models/thredded/topic_view.rb +3 -3
- data/app/view_models/thredded/topics_page_view.rb +0 -1
- data/app/views/thredded/messageboard_groups/new.html.erb +5 -1
- data/app/views/thredded/messageboards/_form.html.erb +7 -2
- data/app/views/thredded/posts/_form.html.erb +2 -1
- data/app/views/thredded/posts/edit.html.erb +3 -2
- data/app/views/thredded/posts_common/_form.html.erb +6 -2
- data/app/views/thredded/preferences/_form.html.erb +41 -29
- data/app/views/thredded/private_posts/_form.html.erb +1 -0
- data/app/views/thredded/private_topics/_form.html.erb +3 -2
- data/app/views/thredded/private_topics/_header.html.erb +4 -0
- data/app/views/thredded/private_topics/_no_private_topics.html.erb +1 -1
- data/app/views/thredded/private_topics/_private_topic.html.erb +5 -2
- data/app/views/thredded/private_topics/edit.html.erb +2 -1
- data/app/views/thredded/private_topics/header/_participant.html.erb +1 -0
- data/app/views/thredded/private_topics/index.html.erb +6 -5
- data/app/views/thredded/private_topics/new.html.erb +0 -1
- data/app/views/thredded/private_topics/private_topic/_participant.html.erb +1 -0
- data/app/views/thredded/private_topics/show.html.erb +1 -3
- data/app/views/thredded/topics/_form.html.erb +1 -1
- data/app/views/thredded/topics/show.html.erb +4 -5
- data/config/locales/en.yml +22 -9
- data/config/locales/pt-BR.yml +22 -10
- data/config/routes.rb +1 -1
- data/db/migrate/20160329231848_create_thredded.rb +23 -3
- data/db/upgrade_migrations/20160410111522_upgrade_v0_2_to_v0_3.rb +1 -1
- data/db/upgrade_migrations/20161113161801_upgrade_v0_8_to_v0_9.rb +56 -0
- data/lib/generators/thredded/install/templates/initializer.rb +28 -0
- data/lib/thredded.rb +32 -8
- data/lib/thredded/content_formatter.rb +3 -2
- data/lib/thredded/database_seeder.rb +11 -8
- data/lib/thredded/db_tools.rb +82 -0
- data/lib/thredded/html_pipeline/wrap_iframes_filter.rb +12 -0
- data/lib/thredded/version.rb +1 -1
- metadata +18 -8
- data/app/models/thredded/null_preference.rb +0 -16
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Thredded
|
3
3
|
class UserPrivateTopicReadState < ActiveRecord::Base
|
4
|
-
include UserTopicReadStateCommon
|
4
|
+
include Thredded::UserTopicReadStateCommon
|
5
5
|
belongs_to :user,
|
6
6
|
class_name: Thredded.user_class,
|
7
7
|
inverse_of: :thredded_private_topic_read_states
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Thredded
|
3
3
|
class UserTopicReadState < ActiveRecord::Base
|
4
|
-
include UserTopicReadStateCommon
|
4
|
+
include Thredded::UserTopicReadStateCommon
|
5
5
|
belongs_to :user,
|
6
6
|
class_name: Thredded.user_class,
|
7
7
|
inverse_of: :thredded_topic_read_states
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Thredded
|
4
|
+
class BaseNotifier
|
5
|
+
def self.validate_notifier(notifier)
|
6
|
+
unless notifier.respond_to?(:key) && /^[a-z_]+$/.match(notifier.key)
|
7
|
+
fail "Notifier problem: #{notifier.class.name} must respond to #key with a snake_case string"
|
8
|
+
end
|
9
|
+
[:human_name, :new_post, :new_private_post].each do |m|
|
10
|
+
unless notifier.respond_to?(m)
|
11
|
+
fail "#{notifier.class.name} must respond to ##{m}"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class NotificationsDefault
|
17
|
+
def initialize(enabled)
|
18
|
+
@enabled = enabled
|
19
|
+
end
|
20
|
+
|
21
|
+
attr_reader :enabled
|
22
|
+
|
23
|
+
def enabled?
|
24
|
+
enabled
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Thredded
|
3
|
+
class EmailNotifier
|
4
|
+
def human_name
|
5
|
+
I18n.t('thredded.email_notifier.by_email')
|
6
|
+
end
|
7
|
+
|
8
|
+
def key
|
9
|
+
'email'
|
10
|
+
end
|
11
|
+
|
12
|
+
def new_post(post, users)
|
13
|
+
PostMailer.post_notification(post.id, users.map(&:email)).deliver_now
|
14
|
+
MembersMarkedNotified.new(post, users).run
|
15
|
+
end
|
16
|
+
|
17
|
+
def new_private_post(post, users)
|
18
|
+
users = exclude_previously_notified(post, users)
|
19
|
+
return unless users.present?
|
20
|
+
PrivateTopicMailer
|
21
|
+
.message_notification(post.postable.id, users.map(&:email))
|
22
|
+
.deliver_now
|
23
|
+
MembersMarkedNotified.new(post, users).run
|
24
|
+
end
|
25
|
+
|
26
|
+
def exclude_previously_notified(post, users)
|
27
|
+
emails_notified = post.post_notifications.map(&:email)
|
28
|
+
|
29
|
+
users.reject do |user|
|
30
|
+
emails_notified.include? user.email
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require_dependency 'thredded/topic_policy'
|
3
2
|
module Thredded
|
4
3
|
class PostPolicy
|
5
4
|
# The scope of readable posts.
|
@@ -30,7 +29,7 @@ module Thredded
|
|
30
29
|
end
|
31
30
|
|
32
31
|
def read?
|
33
|
-
TopicPolicy.new(@user, @post.postable).read? && @post.moderation_state_visible_to_user?(@user)
|
32
|
+
Thredded::TopicPolicy.new(@user, @post.postable).read? && @post.moderation_state_visible_to_user?(@user)
|
34
33
|
end
|
35
34
|
|
36
35
|
def update?
|
@@ -38,7 +37,7 @@ module Thredded
|
|
38
37
|
end
|
39
38
|
|
40
39
|
def destroy?
|
41
|
-
|
40
|
+
!@post.first_post_in_topic? && update?
|
42
41
|
end
|
43
42
|
|
44
43
|
delegate :moderate?, to: :messageboard_policy
|
@@ -46,7 +45,7 @@ module Thredded
|
|
46
45
|
private
|
47
46
|
|
48
47
|
def messageboard_policy
|
49
|
-
@messageboard_policy ||= MessageboardPolicy.new(@user, @post.messageboard)
|
48
|
+
@messageboard_policy ||= Thredded::MessageboardPolicy.new(@user, @post.messageboard)
|
50
49
|
end
|
51
50
|
|
52
51
|
def own_post?
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require_dependency 'thredded/private_topic_policy'
|
3
2
|
module Thredded
|
4
3
|
class PrivatePostPolicy
|
5
4
|
# @param user [Thredded.user_class]
|
@@ -14,7 +13,7 @@ module Thredded
|
|
14
13
|
end
|
15
14
|
|
16
15
|
def read?
|
17
|
-
PrivateTopicPolicy.new(@user, @post.postable).read?
|
16
|
+
Thredded::PrivateTopicPolicy.new(@user, @post.postable).read?
|
18
17
|
end
|
19
18
|
|
20
19
|
def update?
|
@@ -22,7 +21,7 @@ module Thredded
|
|
22
21
|
end
|
23
22
|
|
24
23
|
def destroy?
|
25
|
-
|
24
|
+
!@post.first_post_in_topic? && update?
|
26
25
|
end
|
27
26
|
|
28
27
|
private
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require_dependency 'thredded/messageboard_policy'
|
3
2
|
module Thredded
|
4
3
|
class TopicPolicy
|
5
4
|
# The scope of readable topics.
|
@@ -23,7 +22,7 @@ module Thredded
|
|
23
22
|
def initialize(user, topic)
|
24
23
|
@user = user
|
25
24
|
@topic = topic
|
26
|
-
@messageboard_policy = MessageboardPolicy.new(user, topic.messageboard)
|
25
|
+
@messageboard_policy = Thredded::MessageboardPolicy.new(user, topic.messageboard)
|
27
26
|
end
|
28
27
|
|
29
28
|
def create?
|
@@ -1,7 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require_dependency 'thredded/post_view'
|
3
|
-
require_dependency 'thredded/topic_view'
|
4
|
-
require_dependency 'thredded/private_topic_view'
|
5
2
|
module Thredded
|
6
3
|
# A view model for a page of PostViews.
|
7
4
|
class PostsPageView
|
@@ -20,7 +17,7 @@ module Thredded
|
|
20
17
|
# @param paginated_scope [ActiveRecord::Relation<Thredded::PostCommon>]
|
21
18
|
def initialize(user, paginated_scope)
|
22
19
|
@paginated_scope = paginated_scope
|
23
|
-
@post_views = paginated_scope.map { |post| PostView.new(post, Pundit.policy!(user, post)) }
|
20
|
+
@post_views = paginated_scope.map { |post| Thredded::PostView.new(post, Pundit.policy!(user, post)) }
|
24
21
|
end
|
25
22
|
end
|
26
23
|
end
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Thredded
|
3
3
|
# A view model for PrivateTopic.
|
4
|
-
class PrivateTopicView < BaseTopicView
|
4
|
+
class PrivateTopicView < Thredded::BaseTopicView
|
5
|
+
delegate :users, to: :@topic
|
6
|
+
|
5
7
|
def edit_path
|
6
8
|
Thredded::UrlsHelper.edit_private_topic_path(@topic)
|
7
9
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require_dependency 'thredded/private_topic_view'
|
3
2
|
module Thredded
|
4
3
|
# A view model for a page of BaseTopicViews.
|
5
4
|
class PrivateTopicsPageView
|
@@ -15,10 +14,16 @@ module Thredded
|
|
15
14
|
# @param user [Thredded.user_class] the user who is viewing the posts page
|
16
15
|
# @param topics_page_scope [ActiveRecord::Relation<Thredded::Topic>]
|
17
16
|
def initialize(user, topics_page_scope)
|
18
|
-
@topics_page_scope = topics_page_scope
|
17
|
+
@topics_page_scope = refine_scope(topics_page_scope)
|
19
18
|
@topic_views = @topics_page_scope.with_read_states(user).map do |(topic, read_state)|
|
20
|
-
PrivateTopicView.new(topic, read_state, Pundit.policy!(user, topic))
|
19
|
+
Thredded::PrivateTopicView.new(topic, read_state, Pundit.policy!(user, topic))
|
21
20
|
end
|
22
21
|
end
|
22
|
+
|
23
|
+
protected
|
24
|
+
|
25
|
+
def refine_scope(topics_page_scope)
|
26
|
+
topics_page_scope.includes(:user, :last_user, :users)
|
27
|
+
end
|
23
28
|
end
|
24
29
|
end
|
@@ -1,8 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require_dependency 'thredded/posts_page_view'
|
3
2
|
module Thredded
|
4
3
|
# A view model for a page of PostViews of a Topic.
|
5
|
-
class TopicPostsPageView < PostsPageView
|
4
|
+
class TopicPostsPageView < Thredded::PostsPageView
|
6
5
|
# @return [Thredded::BaseTopicView]
|
7
6
|
attr_reader :topic
|
8
7
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Thredded
|
3
3
|
# A view model for Topic.
|
4
|
-
class TopicView < BaseTopicView
|
4
|
+
class TopicView < Thredded::BaseTopicView
|
5
5
|
delegate :categories, :id, :blocked?, :last_moderation_record, :followers,
|
6
6
|
:last_post, :messageboard_id, :messageboard_name,
|
7
7
|
to: :@topic
|
@@ -17,8 +17,8 @@ module Thredded
|
|
17
17
|
def self.from_user(topic, user)
|
18
18
|
read_state = follow = nil
|
19
19
|
if user && !user.thredded_anonymous?
|
20
|
-
read_state = UserTopicReadState.find_by(user_id: user.id, postable_id: topic.id)
|
21
|
-
follow = UserTopicFollow.find_by(user_id: user.id, topic_id: topic.id)
|
20
|
+
read_state = Thredded::UserTopicReadState.find_by(user_id: user.id, postable_id: topic.id)
|
21
|
+
follow = Thredded::UserTopicFollow.find_by(user_id: user.id, topic_id: topic.id)
|
22
22
|
end
|
23
23
|
new(topic, read_state, follow, Pundit.policy!(user, topic))
|
24
24
|
end
|
@@ -16,7 +16,11 @@
|
|
16
16
|
<%= f.text_field :name, required: true %>
|
17
17
|
</li>
|
18
18
|
|
19
|
-
<li
|
19
|
+
<li>
|
20
|
+
<%= f.submit t('thredded.messageboard_group.create'),
|
21
|
+
class: 'thredded--form--submit',
|
22
|
+
'data-disable-with' => t('thredded.messageboard_group.form.create_btn_submitting') %>
|
23
|
+
</li>
|
20
24
|
</ul>
|
21
25
|
<% end %>
|
22
26
|
<% end %>
|
@@ -13,7 +13,12 @@
|
|
13
13
|
<%= f.collection_select :messageboard_group_id, Thredded::MessageboardGroup.all, :id, :name,
|
14
14
|
include_blank: t('thredded.messageboard.form.no_group') %>
|
15
15
|
</li>
|
16
|
-
<li
|
17
|
-
|
16
|
+
<li>
|
17
|
+
<%= f.submit @messageboard.persisted? ? t('thredded.messageboard.update') : t('thredded.messageboard.create'),
|
18
|
+
class: 'thredded--form--submit',
|
19
|
+
'data-disable-with' => @messageboard.persisted? ?
|
20
|
+
t('thredded.messageboard.form.update_btn_submitting') :
|
21
|
+
t('thredded.messageboard.form.create_btn_submitting') %>
|
22
|
+
</li>
|
18
23
|
</ul>
|
19
24
|
<% end %>
|
@@ -9,9 +9,10 @@
|
|
9
9
|
<%= thredded_page do %>
|
10
10
|
<section class="thredded--main-section">
|
11
11
|
<%= render 'thredded/posts/form',
|
12
|
-
messageboard: messageboard,
|
12
|
+
messageboard: (messageboard unless @post.private_topic_post?),
|
13
13
|
topic: topic,
|
14
14
|
post: @post,
|
15
|
-
button_text: t('thredded.posts.form.update_btn')
|
15
|
+
button_text: t('thredded.posts.form.update_btn'),
|
16
|
+
button_submitting_text: t('thredded.posts.form.update_btn_submitting')%>
|
16
17
|
</section>
|
17
18
|
<% end %>
|
@@ -1,3 +1,4 @@
|
|
1
|
+
<%# locals: messageboard, topic, post, content_label, button_text, button_submitting_text. %>
|
1
2
|
<%= form_for (post.private_topic_post? ? [topic, post] : [messageboard, topic, post]), as: :post,
|
2
3
|
html: {
|
3
4
|
class: 'thredded--form thredded--post-form',
|
@@ -7,9 +8,12 @@
|
|
7
8
|
} do |form| %>
|
8
9
|
<ul class="thredded--form-list">
|
9
10
|
<%= render 'thredded/posts_common/form/content_field', form: form, content_label: content_label %>
|
10
|
-
|
11
11
|
<li>
|
12
|
-
|
12
|
+
<% button_submitting_text ||=
|
13
|
+
post.persisted? ? t('thredded.form.update_btn_submitting') : t('thredded.form.create_btn_submitting') %>
|
14
|
+
<button type="submit" class="thredded--form--submit" data-disable-with="<%= button_submitting_text %>">
|
15
|
+
<%= button_text %>
|
16
|
+
</button>
|
13
17
|
</li>
|
14
18
|
</ul>
|
15
19
|
<% end %>
|
@@ -11,31 +11,37 @@
|
|
11
11
|
<ul class="thredded--form-list">
|
12
12
|
<li>
|
13
13
|
<%= f.label :follow_topics_on_mention do %>
|
14
|
-
<%= f.check_box :follow_topics_on_mention %>
|
14
|
+
<%= f.check_box :follow_topics_on_mention, 'data-thredded-bound-messageboard-pref' => 'user_preferences_form[messageboard_follow_topics_on_mention]' %>
|
15
15
|
<%= t 'thredded.preferences.form.follow_topics_on_mention.label' %>
|
16
16
|
<p class="thredded--form-list--hint">
|
17
17
|
<%= t 'thredded.preferences.form.follow_topics_on_mention.hint' %>
|
18
18
|
</p>
|
19
19
|
<% end %>
|
20
20
|
</li>
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
<%=
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
21
|
+
<% if Thredded.notifiers.present? %>
|
22
|
+
<li>
|
23
|
+
<label><%= t 'thredded.preferences.form.notifications_for_followed_topics.label' %></label>
|
24
|
+
<%= f.fields_for :notifications_for_followed_topics, preferences.notifications_for_followed_topics do |fn| %>
|
25
|
+
<%= fn.label :enabled do %>
|
26
|
+
<%= fn.hidden_field :notifier_key %>
|
27
|
+
<%= fn.check_box :enabled,
|
28
|
+
'data-thredded-bound-messageboard-pref' =>
|
29
|
+
"user_preferences_form[messageboard_notifications_for_followed_topics_attributes][#{fn.index}][enabled]" %>
|
30
|
+
<%= fn.object.notifier_human_name %>
|
31
|
+
<%- end %>
|
32
|
+
<%- end %>
|
33
|
+
</li>
|
34
|
+
<li>
|
35
|
+
<label><%= t 'thredded.preferences.form.notifications_for_private_topics.label' %></label>
|
36
|
+
<%= f.fields_for :notifications_for_private_topics, preferences.notifications_for_private_topics do |fn| %>
|
37
|
+
<%= fn.label :enabled do %>
|
38
|
+
<%= fn.hidden_field :notifier_key %>
|
39
|
+
<%= fn.check_box :enabled %>
|
40
|
+
<%= fn.object.notifier_human_name %>
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
43
|
+
</li>
|
44
|
+
<% end %>
|
39
45
|
</ul>
|
40
46
|
<% if preferences.messageboard %>
|
41
47
|
<h3>
|
@@ -51,18 +57,24 @@
|
|
51
57
|
</p>
|
52
58
|
<% end %>
|
53
59
|
</li>
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
<%=
|
58
|
-
|
59
|
-
<%=
|
60
|
-
|
61
|
-
|
62
|
-
|
60
|
+
<% if Thredded.notifiers.present? %>
|
61
|
+
<li>
|
62
|
+
<label><%= t 'thredded.preferences.form.messageboard_notifications_for_followed_topics.label' %></label>
|
63
|
+
<%= f.fields_for :messageboard_notifications_for_followed_topics,
|
64
|
+
preferences.messageboard_notifications_for_followed_topics do |fn| %>
|
65
|
+
<%= fn.label :enabled do %>
|
66
|
+
<%= fn.hidden_field :notifier_key %>
|
67
|
+
<%= fn.hidden_field :messageboard_id %>
|
68
|
+
<%= fn.check_box :enabled %>
|
69
|
+
<%= fn.object.notifier_human_name %>
|
70
|
+
<% end %>
|
71
|
+
<%- end %>
|
72
|
+
</li>
|
73
|
+
<% end %>
|
63
74
|
</ul>
|
64
75
|
<% end %>
|
65
|
-
<button type="submit" class="thredded--form--submit"
|
76
|
+
<button type="submit" class="thredded--form--submit"
|
77
|
+
data-disable-with="<%= t 'thredded.preferences.form.update_btn_submitting' %>">
|
66
78
|
<%= t 'thredded.preferences.form.submit_btn' %>
|
67
79
|
</button>
|
68
80
|
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= form_for private_topic,
|
2
2
|
url: private_topics_path(@private_topic),
|
3
|
-
html: { class: "thredded--form #{local_assigns[:css_class]}", 'data-thredded-topic-form' => true } do |form| %>
|
3
|
+
html: { class: "thredded--form thredded--new-private-topic-form #{local_assigns[:css_class]}", 'data-thredded-topic-form' => true } do |form| %>
|
4
4
|
|
5
5
|
<ul class="thredded--form-list on-top">
|
6
6
|
<li class="title">
|
@@ -21,7 +21,8 @@
|
|
21
21
|
content_label: t('thredded.private_topics.form.content_label') %>
|
22
22
|
|
23
23
|
<li>
|
24
|
-
<button type="submit" class="thredded--form--submit"
|
24
|
+
<button type="submit" class="thredded--form--submit"
|
25
|
+
data-disable-with="<%= t 'thredded.private_topics.form.create_btn_submitting' %>">
|
25
26
|
<%= t('thredded.private_topics.form.create_btn') %>
|
26
27
|
</button>
|
27
28
|
</li>
|