community_block.rhtml
1.7 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
<div class="community-block">
<div class="community-block-logo">
<%= link_to profile_image(profile, :big), profile.url %>
</div>
<div class="community-block-info">
<h1 class="community-block-title"><%=profile.name%></h1>
<div class="community-block-description"><%= profile.description %></div>
<div class="community-block-buttons">
<% if logged_in? %>
<% if profile.members.include?(user) %>
<%= 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;') %>
<% else %>
<% unless profile.already_request_membership?(user) %>
<%= 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;') %>
<% end %>
<% end %>
<% else %>
<%= link_to content_tag('span', _('Join')), profile.join_not_logged_url, :class => 'button with-text icon-add', :title => _("Join comunity") %>
<% end %>
</div>
</div>
<div style="clear:both"></div>
</div>