Commit b08a7579 authored by Alexandre Friquet's avatar Alexandre Friquet

Originating group open again after member edition: refs #69.

parent aeb12b9c
......@@ -261,10 +261,9 @@ function display_selected_contacts_in ($container) {
/* Members management */
function expand_path (e) {
path = $(e).attr('data-expand');
tab = path.split("|")[0]
mg = path.split("|")[1]
$('#tabs').tabs('select',tab);
toggle_fields(mg);
tab = path.split("|")[0].slice(1);
mg = path.split("|")[1].slice(0, -1);
fetch_or_toggle_members(mg);
}
function fetch_or_toggle_members (mg) {
......
......@@ -43,8 +43,11 @@ class MemberGroupsController < ApplicationController
Member.by_name.admins
when "blocked"
Member.by_name.blocked
else MemberGroup.find(params[:id]).members.by_name
else
member_group = MemberGroup.find(params[:id])
member_group.members.by_name
end
@mg_id = member_group.try(:id) || params[:id]
end
end
end
......
......@@ -28,7 +28,7 @@ class MembersController < ApplicationController
respond_to do |format|
format.html do
@path_to_expand = if params[:mg_id] && params[:mg_id] != "0"
"#groups_management|" << (params[:mg_id] == "ungrouped_members" ? "#ungrouped_members" : "#mg-#{params[:mg_id]}")
"#groups_management|" << (params[:mg_id] == "ungrouped" ? "#ungrouped" : "#mg-#{params[:mg_id]}")
end
@member_groups = MemberGroup.by_title
end
......
......@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
%>
<% unless @members.empty? %>
<%= render @members %>
<%= render @members, mg_id: @mg_id%>
<% else %>
<li>Aucun</li>
<% end %>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment