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) { ...@@ -261,10 +261,9 @@ function display_selected_contacts_in ($container) {
/* Members management */ /* Members management */
function expand_path (e) { function expand_path (e) {
path = $(e).attr('data-expand'); path = $(e).attr('data-expand');
tab = path.split("|")[0] tab = path.split("|")[0].slice(1);
mg = path.split("|")[1] mg = path.split("|")[1].slice(0, -1);
$('#tabs').tabs('select',tab); fetch_or_toggle_members(mg);
toggle_fields(mg);
} }
function fetch_or_toggle_members (mg) { function fetch_or_toggle_members (mg) {
......
...@@ -43,8 +43,11 @@ class MemberGroupsController < ApplicationController ...@@ -43,8 +43,11 @@ class MemberGroupsController < ApplicationController
Member.by_name.admins Member.by_name.admins
when "blocked" when "blocked"
Member.by_name.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 end
@mg_id = member_group.try(:id) || params[:id]
end end
end end
end end
......
...@@ -28,7 +28,7 @@ class MembersController < ApplicationController ...@@ -28,7 +28,7 @@ class MembersController < ApplicationController
respond_to do |format| respond_to do |format|
format.html do format.html do
@path_to_expand = if params[:mg_id] && params[:mg_id] != "0" @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 end
@member_groups = MemberGroup.by_title @member_groups = MemberGroup.by_title
end end
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
# along with OLIGAA. If not, see <http://www.gnu.org/licenses/>. # along with OLIGAA. If not, see <http://www.gnu.org/licenses/>.
%> %>
<% unless @members.empty? %> <% unless @members.empty? %>
<%= render @members %> <%= render @members, mg_id: @mg_id%>
<% else %> <% else %>
<li>Aucun</li> <li>Aucun</li>
<% end %> <% 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