software_information_block.rb
683 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
class SoftwareInformationBlock < Block
attr_accessible :show_name
settings_items :show_name, :type => :boolean, :default => false
def self.description
_('Basic Software Information')
end
def help
_('This block displays the basic information of a software profile.')
end
def content(args={})
block = self
s = show_name
lambda do |object|
render(
:file => 'blocks/software_information',
:locals => { :block => block, :show_name => s}
)
end
end
def cacheable?
false
end
private
def owner_has_ratings?
ratings = CommunityRating.where(community_id: block.owner.id)
!ratings.empty?
end
end