diff --git a/app/controllers/my_profile/profile_members_controller.rb b/app/controllers/my_profile/profile_members_controller.rb index 8f29751..0223918 100644 --- a/app/controllers/my_profile/profile_members_controller.rb +++ b/app/controllers/my_profile/profile_members_controller.rb @@ -1,5 +1,6 @@ class ProfileMembersController < MyProfileController protect 'manage_memberships', :profile + no_design_blocks def index @members = profile.members @@ -43,7 +44,7 @@ class ProfileMembersController < MyProfileController else flash[:notice] = 'Failed to unassociate member' end - redirect_to :aciton => 'index' + render :layout => false end def unassociate @@ -56,7 +57,23 @@ class ProfileMembersController < MyProfileController flash[:notice] = 'Failed to unassociate member' end end - redirect_to :action => 'index' + render :layout => false + end + + def add_members + end + + def add_member + if profile.enterprise? + member = Person.find_by_identifier(params[:id]) + member.define_roles(Profile::Roles.all_roles(environment), profile) + end + render :layout => false + end + + def find_users + @users_found = Person.find_by_contents(params[:query]) + render :layout => false end end diff --git a/app/views/profile_members/_find_users.rhtml b/app/views/profile_members/_find_users.rhtml new file mode 120000 index 0000000..aa4a9e4 --- /dev/null +++ b/app/views/profile_members/_find_users.rhtml @@ -0,0 +1 @@ +find_users.rhtml \ No newline at end of file diff --git a/app/views/profile_members/_members_list.rhtml b/app/views/profile_members/_members_list.rhtml new file mode 100644 index 0000000..06baca8 --- /dev/null +++ b/app/views/profile_members/_members_list.rhtml @@ -0,0 +1,24 @@ +
<%= _('Member') %> | +<%= _('Actions') %> | +
---|---|
<%= link_to_profile m.short_name, m.identifier, :title => m.name %> | ++ | + +
<%= _('Name') %> | |
---|---|
+
+ <%= image_tag('/images/grip-clue.png') %>
+ <%= profile_image(user, :icon) %>
+ <%= [link_to_profile(user.short_name + " (#{user.identifier})", user.identifier, :title => user.name),
+ (user.sex ? gettext(user.sex.capitalize) : _('Sex not informed')),
+ user.location.empty? ? nil : user.location ].compact.join(' ') %>
+
+ <%= draggable_element(user.identifier, :revert => true) %>
+ |
+ + <%= button_to_remote_without_text(:add, _('Add member'), + { :loading => '$("members-list").addClassName("loading")', + :update => 'members-list', + :url => {:action => 'add_member', :profile => profile.identifier, :id => user.identifier}, + :success => "$('tr-#{user.identifier}').hide()", + :complete => '$("members-list").removeClassName("loading")'}) %> + + + | +
<%= _('Member') %> | -<%= _('Actions') %> | -
---|---|
<%= m.name %> | -- <%= button_without_text :edit, _('Edit'), :action => 'change_role', :id => m %> - <%= button_without_text :delete, _('Remove'), :action => 'unassociate', :id => m %> - | -