diff --git a/app/models/profile.rb b/app/models/profile.rb index 9da0e24..a00dda4 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -137,6 +137,10 @@ class Profile < ActiveRecord::Base has_many :profile_categorizations, :conditions => [ 'categories_profiles.virtual = ?', false ] has_many :categories, :through => :profile_categorizations + def interests + categories.select {|item| !item.is_a?(Region)} + end + belongs_to :region def location diff --git a/app/views/profile/_person.rhtml b/app/views/profile/_person.rhtml index 1120912..3c85373 100644 --- a/app/views/profile/_person.rhtml +++ b/app/views/profile/_person.rhtml @@ -21,19 +21,38 @@ <%= display_field(_('Organization:'), profile, :organization) %> <%= display_field(_('Organization website:'), profile, :organization_website) { |url| link_to(url, url) }%> +<% if !profile.enterprises.empty? %> + <% profile.enterprises.each_with_index do |item, i| %> + + <%= __('Enterprises:') if (i == 0) %> + <%= button 'menu-enterprise', item.name, item.url %> + + <% end %> +<% end %> <%= _('Network')%> - - <%= link_to __('Friends'), :controller => 'profile', :action => 'friends' %> - - — <%= link_to __('Communities'), :controller => "profile", :action => 'communities' %> + + <%= link_to __('Friends') + (' (%d)' % profile.friends.count), { :controller => 'profile', :action => 'friends' } %> + + + <%= link_to __('Communities') + (' (%d)' % profile.communities.count), :controller => "profile", :action => 'communities' %> + - <% if !environment.enabled?('disable_asset_enterprises') %> - — <%= link_to __('Enterprises'), :controller => 'profile', :action => 'enterprises' %> - <% end %> +<% if !environment.enabled?('disable_categories') && !profile.interests.empty? %> + + <%= _('Interests') %> + + <% profile.interests.each do |item| %> + + + <%= link_to item.name, :controller => 'search', :action => 'category_index', :category_path => item.explode_path %> + + <% end %> +<% end %> diff --git a/app/views/profile/index.rhtml b/app/views/profile/index.rhtml index 8739e34..126253d 100644 --- a/app/views/profile/index.rhtml +++ b/app/views/profile/index.rhtml @@ -1,9 +1,10 @@ -<% if profile.enterprise? and !profile.enabled? and !profile.blocks.select {|b| b.class == DisabledEnterpriseMessageBlock}.any? %> +<% if profile.enterprise? && !profile.enabled? && !profile.blocks.select {|b| b.class == DisabledEnterpriseMessageBlock}.any? %>
<%= environment.message_for_disabled_enterprise %>
<% end %> +<% cache_timeout(profile.identifier + '-profile', 30.minutes.from_now) do %>

<%= _("%s's profile") % profile.identifier %>

@@ -30,3 +31,4 @@
+<% end %> -- libgit2 0.21.2