serpro_integration_plugin.rb
1.23 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
class SerproIntegrationPlugin < Noosfero::Plugin
#include ActionController::UrlWriter
# include ActionView::Helpers::TagHelper
# include ActionView::Helpers::FormTagHelper
# include FormsHelper
# include ActionView::Helpers
# include FormsHelper
def self.plugin_name
"Serpro Integration Plugin"
end
def self.plugin_description
_("Make integration with serpro servers.")
end
# def filter_comment(c)
# c.reject! unless logged_in? || allowed_by_profile
# end
#FIXME make this test
# User could not have this block
def self.extra_blocks
{ SonarPlugin::SonarWidgetBlock => {:type => [Community] },
SonarPlugin::SmileBlock => {:type => [Community] }
}
end
#FIXME make this test
def profile_editor_extras
lambda do
render :file => 'profile-editor-extras'
end
end
def profile_id
context.profile
end
def stylesheet?
true
end
# FIXME make this test
def js_files
['smile_face.js']
end
# def body_beginning
# "<meta name='profile.allow_unauthenticated_comments'/>" if allowed_by_profile
# end
#
# protected
#
# delegate :logged_in?, :to => :context
#
# def allowed_by_profile
# context.profile && context.profile.allow_unauthenticated_comments
# end
end