community_block.html.erb
1.95 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
50
51
52
<div class="community-block">
<div class="community-block-logo">
<%= link_to profile_image(profile, :big), profile.url %>
</div>
<div class="community-block-info">
<div class="community-block-title">
<%
links = []
if logged_in?
if profile.enable_contact?
links.push(_('Send an e-mail') => {:href => url_for({:controller => 'contact', :action => 'new', :profile => profile.identifier})})
end
links.push(_('Report abuse') => {:href => url_for({:controller => 'profile', :action => 'report_abuse', :profile => profile.identifier})})
if !user.nil? && user.has_permission?('edit_profile', profile)
links.push(_('Control panel') => {:href => url_for({:controller => 'profile_editor', :profile => profile.identifier})})
end %>
<%= link_to(
content_tag('span','',:class => 'community-block-button icon-arrow'),
'#',
:onclick => "toggleSubmenu(this,'',#{CGI::escapeHTML(links.to_json)}); return false;",
:class => 'simplemenu-trigger') %>
<% end %>
<% if logged_in? %>
<% if profile.members.include?(user) || profile.already_request_membership?(user) %>
<%= link_to(
content_tag('span', '', :class => 'community-block-button icon-remove'),
profile.leave_url, :class => 'join-community') %>
<% else %>
<%= link_to(
content_tag('span', '', :class => 'community-block-button icon-add'),
profile.join_url, :class => 'join-community') %>
<% end %>
<% else %>
<%= link_to(
content_tag('span', '', :class => 'community-block-button icon-add'),
profile.join_not_logged_url) %>
<% end %>
<h1><%=profile.name%></h1>
</div>
<div class="community-block-description"><%= profile.description %></div>
</div>
<div style="clear:both"></div>
</div>