index.html.erb 1.75 KB
<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 %>