now you can view comrade profile info #134
This commit is contained in:
parent
48924dfeea
commit
cee932500c
7 changed files with 58 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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|
|
||||
|
|
28
app/views/team_members/show.html.haml
Normal file
28
app/views/team_members/show.html.haml
Normal file
|
@ -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
|
||||
|
||||
|
10
db/migrate/20111021101550_change_social_fields_in_users.rb
Normal file
10
db/migrate/20111021101550_change_social_fields_in_users.rb
Normal file
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue