|
|
|
@ -38,10 +38,11 @@ class MembersController < ApplicationController |
|
|
|
|
search_for User, :search_in_project |
|
|
|
|
search_options_for User, lambda { |_| {:project => @project} } |
|
|
|
|
|
|
|
|
|
TAB_SCRIPTS = <<JS |
|
|
|
|
hideOnLoad(); |
|
|
|
|
init_members_cb(); |
|
|
|
|
JS |
|
|
|
|
@@scripts = ['hideOnLoad', 'init_members_cb'] |
|
|
|
|
|
|
|
|
|
def self.add_tab_script(script) |
|
|
|
|
@@scripts << script |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def create |
|
|
|
|
if params[:member] |
|
|
|
@ -60,7 +61,7 @@ JS |
|
|
|
|
page.replace_html "tab-content-members", :partial => 'projects/settings/members' |
|
|
|
|
page.insert_html :top, "tab-content-members", render_flash_messages |
|
|
|
|
|
|
|
|
|
page << TAB_SCRIPTS |
|
|
|
|
page << MembersController.tab_scripts |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
@ -94,7 +95,7 @@ JS |
|
|
|
|
else |
|
|
|
|
page.replace_html "tab-content-members", :partial => 'projects/settings/members' |
|
|
|
|
end |
|
|
|
|
page << TAB_SCRIPTS |
|
|
|
|
page << MembersController.tab_scripts |
|
|
|
|
page.visual_effect(:highlight, "member-#{@member.id}") unless Member.find_by_id(@member.id).nil? |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -111,7 +112,7 @@ JS |
|
|
|
|
@pagination_url_options = {controller: 'projects', action: 'settings', id: @project} |
|
|
|
|
render(:update) {|page| |
|
|
|
|
page.replace_html "tab-content-members", :partial => 'projects/settings/members' |
|
|
|
|
page << TAB_SCRIPTS |
|
|
|
|
page << MembersController.tab_scripts |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
@ -150,6 +151,10 @@ JS |
|
|
|
|
|
|
|
|
|
private |
|
|
|
|
|
|
|
|
|
def self.tab_scripts |
|
|
|
|
@@scripts.join('(); ') + '();' |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def new_members_from_params |
|
|
|
|
user_ids = possibly_seperated_ids_for_entity(params[:member], :user) |
|
|
|
|
roles = Role.find_all_by_id(possibly_seperated_ids_for_entity(params[:member], :role)) |
|
|
|
|