index.html.erb
1.75 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
<h1><%= h profile.name %></h1>
<% if @action %>
<%= render :partial => 'private_profile' %>
<% else %>
<% unless profile.description.blank? %>
<div class='public-profile-description'>
<%= raw profile.description %>
</div>
<% end %>
<div id='public-profile-search'>
<%= render :partial => 'shared/profile_search_form' %>
</div>
<% end %>
<% if @profile.public? || (logged_in? && current_person.follows?(@profile)) %>
<table class='profile'>
<tr>
<td colspan='2'>
<% plugins_tabs = @plugins.dispatch(:profile_tabs).map { |tab| {:title => tab[:title], :id => tab[:id], :content => instance_exec(&tab[:content]), :start => tab[:start]} }%>
<% tabs = plugins_tabs.select { |tab| tab[:start] } %>
<% if @profile.organization? %>
<% if logged_in? && current_person.follows?(@profile) %>
<% tabs << {:title => _('Wall'), :id => 'profile-wall', :content => (render :partial => 'profile_wall')} %>
<% end %>
<% tabs << {:title => _('Profile'), :id => 'organization-profile', :content => (render :partial => 'organization_profile')} %>
<% elsif @profile.person? %>
<% if logged_in? && current_person.follows?(@profile) %>
<% tabs << {:title => _('Wall'), :id => 'profile-wall', :content => (render :partial => 'profile_wall')} %>
<% tabs << {:title => _('Network'), :id => 'profile-network', :content => (render :partial => 'profile_network')} %>
<% end %>
<% tabs << {:title => _('Profile'), :id => 'person-profile', :content => (render :partial => 'person_profile')} %>
<% end %>
<% tabs += plugins_tabs.select { |tab| !tab[:start] } %>
<%= render_tabs(tabs) %>
</td>
</tr>
</table>
<% end %>