profile_description_block.rb
895 Bytes
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
class ProfileDescriptionBlock < Block
settings_items :show_name, :type => :boolean,
:default => false
attr_accessor :show_name
def self.description
_('Profile Description')
end
def help
_('this block displays the description field of the profile')
end
def default_title
_('PROFILE DESCRIPTION')
end
def content(args={})
description = if self.owner.description.blank?
"Description field is empty or
not enabled on enviroment"
else
self.owner.description
end
block = self
s = show_name
proc do
render(
:file => 'blocks/profile_description',
:locals => { :block => block, :show_name => s ,
:description => description}
)
end
end
def cacheable?
false
end
end