diff --git a/app/views/projects/_top_menu.html.haml b/app/views/projects/_top_menu.html.haml index e281b93b287a2b42985cf6d2f6aad493ed203c5e..59f2533ea7f4b530032cad3e087ea5cf51cbd3a1 100644 --- a/app/views/projects/_top_menu.html.haml +++ b/app/views/projects/_top_menu.html.haml @@ -5,7 +5,7 @@ %span= link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "tree", :id => @project) ? "current" : nil %span= link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil %span - = link_to team_project_path(@project), :class => current_page?(:controller => "projects", :action => "team", :id => @project) ? "current" : nil do + = link_to team_project_path(@project), :class => (current_page?(:controller => "projects", :action => "team", :id => @project) || controller.controller_name == "team_members") ? "current" : nil do Team - if @project.users_projects.count > 0 %span{ :class => "top_menu_count" }= @project.users_projects.count diff --git a/app/views/team_members/_show.html.haml b/app/views/team_members/_show.html.haml index 6d310768afa05c8ddd170deb9e5e7e37305c4fa1..b9a68e6cfb0b1cee8c979148809c369c25b009f8 100644 --- a/app/views/team_members/_show.html.haml +++ b/app/views/team_members/_show.html.haml @@ -1,8 +1,10 @@ - user = member.user %tr{:id => dom_id(member)} %td - = image_tag gravatar_icon(user.email), :class => "left", :width => 40, :style => "padding:0 5px;" - = truncate user.name, :lenght => 16 + = link_to image_tag(gravatar_icon(user.email), :class => "left", :width => 40, :style => "padding:0 5px;"), project_team_member_path(@project, member) + + = link_to truncate(user.name, :lenght => 16), project_team_member_path(@project, member) + %td= truncate user.email, :lenght => 16 - if can? current_user, :admin_project, @project = form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f| diff --git a/app/views/team_members/show.html.haml b/app/views/team_members/show.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..d07c54f8b6881792f16496853a84e2579a0a8f6d --- /dev/null +++ b/app/views/team_members/show.html.haml @@ -0,0 +1,28 @@ +- user = @team_member.user +.span-2 + = image_tag gravatar_icon(user.email), :class => "left", :width => 60, :style => "padding-right:5px;" +%p + %b Name: + = user.name +%p + %b Email: + = user.email + +%br + +- unless user.skype.empty? + .div + %b Skype: + = user.skype + +- unless user.linkedin.empty? + .div + %b LinkedIn: + = user.linkedin + +- unless user.twitter.empty? + .div + %b Twitter: + = user.twitter + + diff --git a/db/migrate/20111021101550_change_social_fields_in_users.rb b/db/migrate/20111021101550_change_social_fields_in_users.rb new file mode 100644 index 0000000000000000000000000000000000000000..6f05c05da7c8fe7f33252198978c66d1a5fff46f --- /dev/null +++ b/db/migrate/20111021101550_change_social_fields_in_users.rb @@ -0,0 +1,10 @@ +class ChangeSocialFieldsInUsers < ActiveRecord::Migration + def up + change_column(:users, :skype, :string, {:null => false, :default => ''}) + change_column(:users, :linkedin, :string, {:null => false, :default => ''}) + change_column(:users, :twitter, :string, {:null => false, :default => ''}) + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 6408792f9acd42c19bc86fe9556c372bae39c488..cc805990a8b6804ddd7a5f0e9cf617398bd9356c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20111019212429) do +ActiveRecord::Schema.define(:version => 20111021101550) do create_table "issues", :force => true do |t| t.string "title" @@ -82,9 +82,9 @@ ActiveRecord::Schema.define(:version => 20111019212429) do t.string "name" t.boolean "admin", :default => false, :null => false t.integer "projects_limit", :default => 10 - t.string "skype" - t.string "linkedin" - t.string "twitter" + t.string "skype", :default => "", :null => false + t.string "linkedin", :default => "", :null => false + t.string "twitter", :default => "", :null => false end add_index "users", ["email"], :name => "index_users_on_email", :unique => true diff --git a/spec/requests/team_members_spec.rb b/spec/requests/team_members_spec.rb index db7513ae956b2bed8e0be427e0e6923be8639ebe..dd92febf7009ba8a70d575bbc0cd029c8f3c7c93 100644 --- a/spec/requests/team_members_spec.rb +++ b/spec/requests/team_members_spec.rb @@ -7,6 +7,15 @@ describe "TeamMembers" do @project.add_access(@user, :read, :admin) end + describe "View profile" do + it "should be available" do + visit(team_project_path(@project)) + find(:xpath, "//table[@id='team-table']//a[1]").click + page.should have_content @user.skype + page.should_not have_content 'Twitter' + end + end + describe "New Team member", :js => true do before do @user_1 = Factory :user diff --git a/spec/support/login.rb b/spec/support/login.rb index 09f64f9e3c30e69d0cd04b180c1432e7162a610d..462647ab8563cf1e8a233d3e9125a2a4b9162b1a 100644 --- a/spec/support/login.rb +++ b/spec/support/login.rb @@ -3,7 +3,8 @@ module LoginMacros @user = User.create(:email => "user#{User.count}@mail.com", :name => "John Smith", :password => "123456", - :password_confirmation => "123456") + :password_confirmation => "123456", + :skype => 'user_skype') if role == :admin @user.admin = true