community.rhtml
1.68 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
<ul>
<% if logged_in? %>
<% if profile.members.include?(user) %>
<li>
<%= button(:delete, content_tag('span', __('Leave community')), profile.leave_url,
:class => 'leave-community',
:title => _("Leave community"),
:style => 'position: relative;') %>
<%= button(:add, content_tag('span', __('Join')), profile.join_url,
:class => 'join-community',
:title => _("Join community"),
:style => 'position: relative; display: none;') %>
</li>
<% else %>
<% unless profile.already_request_membership?(user) %>
<li>
<%= button(:delete, content_tag('span', __('Leave community')), profile.leave_url,
:class => 'leave-community',
:title => _("Leave community"),
:style => 'position: relative; display: none;') %>
<%= button(:add, content_tag('span', __('Join')), profile.join_url,
:class => 'join-community',
:title => _("Join community"),
:style => 'position: relative;') %>
</li>
<% end %>
<% end %>
<% if profile.enable_contact? %>
<li>
<%= link_to content_tag('span', _('Send an e-mail')),
{ :profile => profile.identifier,
:controller => 'contact',
:action => 'new' },
:class => 'button with-text icon-menu-mail' %>
</li>
<% end %>
<li><%= report_abuse(profile, :button) %></li>
<%= render_environment_features(:profile_actions) %>
<% else %>
<li>
<%= link_to content_tag('span', _('Join')), profile.join_not_logged_url,
:class => 'button with-text icon-add',
:title => _('Join this community') %>
</li>
<% end %>
</ul>