<% plugins_tabs = @plugins.map(:profile_tabs) %> <% tabs = plugins_tabs.select { |tab| tab[:start] } %> <% if logged_in? && current_person.follows?(@profile) %> <% tabs << {:title => _('Wall'), :id => 'profile-wall', :content => (render :partial => 'profile_wall')} %> <% end %> <% if @profile.organization? %> <% if @profile.public? || (logged_in? && current_person.follows?(@profile)) %> <% tabs << {:title => _('What\'s new'), :id => 'profile-network', :content => (render :partial => 'profile_network')} %> <% end %> <% tabs << {:title => _('Profile'), :id => 'organization-profile', :content => (render :partial => 'organization_profile')} %> <% elsif @profile.person? %> <% if logged_in? && current_person.follows?(@profile) %> <% tabs << {:title => _('Network'), :id => 'profile-network', :content => (render :partial => 'profile_network')} %> <% end %> <% if @profile.public? || (logged_in? && current_person.follows?(@profile)) %> <% tabs << {:title => _('Activity'), :id => 'profile-activity', :content => (render :partial => 'profile_activity')} %> <% end %> <% tabs << {:title => _('Profile'), :id => 'person-profile', :content => (render :partial => 'person_profile')} %> <% end %> <% tabs += plugins_tabs.select { |tab| !tab[:start] } %> <%= render_tabs(tabs) %>