Commit 9fa4df16ec8f8317c83371c5768c30e276e49ae9
1 parent
b3279b9b
Exists in
master
and in
4 other branches
now you can view comrade profile info #134
Showing
7 changed files
with
58 additions
and
8 deletions
Show diff stats
app/views/projects/_top_menu.html.haml
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | %span= link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "tree", :id => @project) ? "current" : nil | 5 | %span= link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "tree", :id => @project) ? "current" : nil |
6 | %span= link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil | 6 | %span= link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil |
7 | %span | 7 | %span |
8 | - = link_to team_project_path(@project), :class => current_page?(:controller => "projects", :action => "team", :id => @project) ? "current" : nil do | 8 | + = link_to team_project_path(@project), :class => (current_page?(:controller => "projects", :action => "team", :id => @project) || controller.controller_name == "team_members") ? "current" : nil do |
9 | Team | 9 | Team |
10 | - if @project.users_projects.count > 0 | 10 | - if @project.users_projects.count > 0 |
11 | %span{ :class => "top_menu_count" }= @project.users_projects.count | 11 | %span{ :class => "top_menu_count" }= @project.users_projects.count |
app/views/team_members/_show.html.haml
1 | - user = member.user | 1 | - user = member.user |
2 | %tr{:id => dom_id(member)} | 2 | %tr{:id => dom_id(member)} |
3 | %td | 3 | %td |
4 | - = image_tag gravatar_icon(user.email), :class => "left", :width => 40, :style => "padding:0 5px;" | ||
5 | - = truncate user.name, :lenght => 16 | 4 | + = link_to image_tag(gravatar_icon(user.email), :class => "left", :width => 40, :style => "padding:0 5px;"), project_team_member_path(@project, member) |
5 | + | ||
6 | + = link_to truncate(user.name, :lenght => 16), project_team_member_path(@project, member) | ||
7 | + | ||
6 | %td= truncate user.email, :lenght => 16 | 8 | %td= truncate user.email, :lenght => 16 |
7 | - if can? current_user, :admin_project, @project | 9 | - if can? current_user, :admin_project, @project |
8 | = form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f| | 10 | = form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f| |
@@ -0,0 +1,28 @@ | @@ -0,0 +1,28 @@ | ||
1 | +- user = @team_member.user | ||
2 | +.span-2 | ||
3 | + = image_tag gravatar_icon(user.email), :class => "left", :width => 60, :style => "padding-right:5px;" | ||
4 | +%p | ||
5 | + %b Name: | ||
6 | + = user.name | ||
7 | +%p | ||
8 | + %b Email: | ||
9 | + = user.email | ||
10 | + | ||
11 | +%br | ||
12 | + | ||
13 | +- unless user.skype.empty? | ||
14 | + .div | ||
15 | + %b Skype: | ||
16 | + = user.skype | ||
17 | + | ||
18 | +- unless user.linkedin.empty? | ||
19 | + .div | ||
20 | + %b LinkedIn: | ||
21 | + = user.linkedin | ||
22 | + | ||
23 | +- unless user.twitter.empty? | ||
24 | + .div | ||
25 | + %b Twitter: | ||
26 | + = user.twitter | ||
27 | + | ||
28 | + |
db/migrate/20111021101550_change_social_fields_in_users.rb
0 → 100644
@@ -0,0 +1,10 @@ | @@ -0,0 +1,10 @@ | ||
1 | +class ChangeSocialFieldsInUsers < ActiveRecord::Migration | ||
2 | + def up | ||
3 | + change_column(:users, :skype, :string, {:null => false, :default => ''}) | ||
4 | + change_column(:users, :linkedin, :string, {:null => false, :default => ''}) | ||
5 | + change_column(:users, :twitter, :string, {:null => false, :default => ''}) | ||
6 | + end | ||
7 | + | ||
8 | + def down | ||
9 | + end | ||
10 | +end |
db/schema.rb
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | # | 11 | # |
12 | # It's strongly recommended to check this file into your version control system. | 12 | # It's strongly recommended to check this file into your version control system. |
13 | 13 | ||
14 | -ActiveRecord::Schema.define(:version => 20111019212429) do | 14 | +ActiveRecord::Schema.define(:version => 20111021101550) do |
15 | 15 | ||
16 | create_table "issues", :force => true do |t| | 16 | create_table "issues", :force => true do |t| |
17 | t.string "title" | 17 | t.string "title" |
@@ -82,9 +82,9 @@ ActiveRecord::Schema.define(:version => 20111019212429) do | @@ -82,9 +82,9 @@ ActiveRecord::Schema.define(:version => 20111019212429) do | ||
82 | t.string "name" | 82 | t.string "name" |
83 | t.boolean "admin", :default => false, :null => false | 83 | t.boolean "admin", :default => false, :null => false |
84 | t.integer "projects_limit", :default => 10 | 84 | t.integer "projects_limit", :default => 10 |
85 | - t.string "skype" | ||
86 | - t.string "linkedin" | ||
87 | - t.string "twitter" | 85 | + t.string "skype", :default => "", :null => false |
86 | + t.string "linkedin", :default => "", :null => false | ||
87 | + t.string "twitter", :default => "", :null => false | ||
88 | end | 88 | end |
89 | 89 | ||
90 | add_index "users", ["email"], :name => "index_users_on_email", :unique => true | 90 | add_index "users", ["email"], :name => "index_users_on_email", :unique => true |
spec/requests/team_members_spec.rb
@@ -7,6 +7,15 @@ describe "TeamMembers" do | @@ -7,6 +7,15 @@ describe "TeamMembers" do | ||
7 | @project.add_access(@user, :read, :admin) | 7 | @project.add_access(@user, :read, :admin) |
8 | end | 8 | end |
9 | 9 | ||
10 | + describe "View profile" do | ||
11 | + it "should be available" do | ||
12 | + visit(team_project_path(@project)) | ||
13 | + find(:xpath, "//table[@id='team-table']//a[1]").click | ||
14 | + page.should have_content @user.skype | ||
15 | + page.should_not have_content 'Twitter' | ||
16 | + end | ||
17 | + end | ||
18 | + | ||
10 | describe "New Team member", :js => true do | 19 | describe "New Team member", :js => true do |
11 | before do | 20 | before do |
12 | @user_1 = Factory :user | 21 | @user_1 = Factory :user |
spec/support/login.rb
@@ -3,7 +3,8 @@ module LoginMacros | @@ -3,7 +3,8 @@ module LoginMacros | ||
3 | @user = User.create(:email => "user#{User.count}@mail.com", | 3 | @user = User.create(:email => "user#{User.count}@mail.com", |
4 | :name => "John Smith", | 4 | :name => "John Smith", |
5 | :password => "123456", | 5 | :password => "123456", |
6 | - :password_confirmation => "123456") | 6 | + :password_confirmation => "123456", |
7 | + :skype => 'user_skype') | ||
7 | 8 | ||
8 | if role == :admin | 9 | if role == :admin |
9 | @user.admin = true | 10 | @user.admin = true |