From be7ad56cbb3473ca59e898af20e5c5884c1db65b Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Fri, 22 Feb 2008 19:37:17 +0000 Subject: [PATCH] ActionItem167: and action item 168 are now working --- app/controllers/public/profile_controller.rb | 8 ++++++++ app/models/person.rb | 4 ++++ app/views/profile/communities.rhtml | 11 +++++++++++ app/views/profile/enterprises.rhtml | 11 +++++++++++ app/views/profile/index.rhtml | 2 +- 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 app/views/profile/communities.rhtml create mode 100644 app/views/profile/enterprises.rhtml diff --git a/app/controllers/public/profile_controller.rb b/app/controllers/public/profile_controller.rb index b13b040..f7d25a5 100644 --- a/app/controllers/public/profile_controller.rb +++ b/app/controllers/public/profile_controller.rb @@ -12,4 +12,12 @@ class ProfileController < ApplicationController @tagged = profile.find_tagged_with(@tag) end + def communities + @communities = profile.communities + end + + def enterprises + @enterprises = profile.enterprises + end + end diff --git a/app/models/person.rb b/app/models/person.rb index f1c7304..c84bd11 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -28,10 +28,14 @@ class Person < Profile memberships(:type => Enterprise.name) end + alias :enterprises :enterprise_memberships + def community_memberships memberships(:type => Community.name) end + alias :communities :community_memberships + def info person_info diff --git a/app/views/profile/communities.rhtml b/app/views/profile/communities.rhtml new file mode 100644 index 0000000..0cd6e08 --- /dev/null +++ b/app/views/profile/communities.rhtml @@ -0,0 +1,11 @@ +

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

+ + + +<% button_bar do %> + <%= button(:back, _('Go back'), :controller => 'profile') %> +<% end %> diff --git a/app/views/profile/enterprises.rhtml b/app/views/profile/enterprises.rhtml new file mode 100644 index 0000000..c136901 --- /dev/null +++ b/app/views/profile/enterprises.rhtml @@ -0,0 +1,11 @@ +

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

+ + + +<% button_bar do %> + <%= button(:back, _('Go back'), :controller => 'profile') %> +<% end %> diff --git a/app/views/profile/index.rhtml b/app/views/profile/index.rhtml index 7a5f5c4..a09f60a 100644 --- a/app/views/profile/index.rhtml +++ b/app/views/profile/index.rhtml @@ -7,7 +7,7 @@
  • <%= _('Homepage: ') %> - <%= link_to profile.url, profile.url %> + <%= link_to url_for(profile.url), profile.url %>
  • <%# FIXME %> -- libgit2 0.21.2