Skip to content

Commit

Permalink
Merge branch 'master' of github.com:fredwu/angel_nest
Browse files Browse the repository at this point in the history
  • Loading branch information
gitfly committed Jul 22, 2011
2 parents 299fd19 + cf3d74d commit a95bda2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/concerns/editable.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ jQuery ->
$('.inline_edtiable_container').delegate('form', 'submit', ->
return true if $(@).parents('.follow_button').length > 0

inline_popup = $(@).parent().hasClass('inline_popup')
edit_target = $(@).parent().parent()
inline_popup = $(@).parent().hasClass('inline_popup') or edit_target.hasClass('inline_popup')
target_link = edit_target.data('target_link')

$(@).ajaxSubmit(
Expand Down
3 changes: 3 additions & 0 deletions app/models/startup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ def invite_or_attach_user(role_identifier, attributes)
user = User.find_by_email(attributes[:email]) || attributes[:email] # && TODO: send an invitation email

attach_user(user, role_identifier, attributes[:member_title])

# TODO: remove the confirmation and make the target user to confirm the invite manually
confirm_user(user, role_identifier)
end

def attach_user(user, role_identifier = :member, member_title = '')
Expand Down
10 changes: 5 additions & 5 deletions app/views/startups/_profile_team.html.slim
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.team
h2= t('label.members')
= render 'startups/add_user_link', :startup => startup, :role_identifier => 'member'
= render 'users/index', :collection => startup.members, :meta => { :removable => true, :editable => true, :parent => startup, :role_identifier => 'member' }
.clear
.team.inline_popup data-target_link="#{startup_profile_team_path(startup)}" data-edit_target="#profile_team"
h2= t('label.members')
= render 'startups/add_user_link', :startup => startup, :role_identifier => 'member'
= render 'users/index', :collection => startup.members, :meta => { :removable => true, :editable => true, :parent => startup, :role_identifier => 'member' }
.clear

.team
h2= t('label.investors')
Expand Down
8 changes: 8 additions & 0 deletions spec/models/startup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@
subject.member_title(user).should == 'CEO'
subject.user_role(user).should == 'Member'
end

it "invites the user" do
user = User.make!(:email => 'hello@world.com')
subject.invite_or_attach_user(:member, { :email => 'hello@world.com' })

subject.members.last.should == user
subject.user_meta(user).confirmed.should == true
end
end

describe "logo" do
Expand Down

0 comments on commit a95bda2

Please sign in to comment.