members_block.rb
805 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 MembersBlock < ProfileListBlock
settings_items :show_join_leave_button, :type => :boolean, :default => false
attr_accessible :show_join_leave_button
def self.description
_('Members')
end
def default_title
_('{#} members')
end
def help
_('This block presents the members of a collective.')
end
def footer
profile = self.owner
s = show_join_leave_button
proc do
render :file => 'blocks/members', :locals => { :profile => profile, :show_join_leave_button => s}
end
end
def profiles
owner.members
end
def extra_option
data = {
:human_name => _("Show join leave button"),
:name => 'block[show_join_leave_button]',
:value => true,
:checked => show_join_leave_button,
:options => {}
}
end
end