-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.rb
32 lines (29 loc) · 1022 Bytes
/
plugin.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
module Plugins
module LoomioContentPreview
class Plugin < Plugins::Base
setup! :loomio_content_preview do |plugin|
plugin.enabled = true
plugin.use_component :preview_button, outlet: [
:before_comment_form_textarea,
:before_proposal_form_textarea,
:before_discussion_form_textarea
]
plugin.use_component :preview_pane, outlet: [
:after_comment_form_textarea,
:after_proposal_form_textarea,
:after_discussion_form_textarea
]
plugin.use_translations 'config/locales', :loomio_content_preview
plugin.use_test_route(:setup_comment_preview) do
sign_in patrick
test_discussion.group.update(enable_experiments: true)
@comment = CommentService.create(
comment: FactoryGirl.build(:comment, discussion: test_discussion),
actor: patrick
)
redirect_to discussion_path(@comment.discussion)
end
end
end
end
end