Tabs on the top aren't all selected on group select, some other view tweaks
This commit is contained in:
parent
d3c10f8777
commit
5ac5f58679
5 changed files with 7 additions and 12 deletions
|
|
@ -16,12 +16,9 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_friends_and_status
|
def set_friends_and_status
|
||||||
unless current_user.nil?
|
|
||||||
@group = :all
|
|
||||||
@groups = current_user.groups
|
@groups = current_user.groups
|
||||||
@friends = current_user.friends
|
@friends = current_user.friends
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def count_requests
|
def count_requests
|
||||||
@request_count = Request.for_user(current_user).size if current_user
|
@request_count = Request.for_user(current_user).size if current_user
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,7 @@ class GroupsController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :order => 'created_at DESC'
|
@posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :order => 'created_at DESC'
|
||||||
@friends = current_user.friends
|
@group = :all
|
||||||
|
|
||||||
@groups = current_user.groups.find_all_by_id(params[:group_ids]) if params[:group_ids]
|
|
||||||
@groups ||= current_user.groups
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
|
|
||||||
def current_group?(group)
|
def current_group?(group)
|
||||||
@group == :all || @group.id == group.id
|
@group != :all && @group.id == group.id
|
||||||
end
|
end
|
||||||
|
|
||||||
def object_path(object)
|
def object_path(object)
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,8 @@
|
||||||
.container
|
.container
|
||||||
#group
|
#group
|
||||||
%ul
|
%ul
|
||||||
%li= link_to "All Groups", root_url
|
%li{:class => ("selected" if @group == :all)}
|
||||||
|
= link_to "All Groups", root_url
|
||||||
- for group in @groups
|
- for group in @groups
|
||||||
%li{:class => ("selected" if current_group?(group))}
|
%li{:class => ("selected" if current_group?(group))}
|
||||||
= link_for_group group
|
= link_for_group group
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
%ul.group_selector
|
%ul.group_selector
|
||||||
going to...
|
going to...
|
||||||
- for group in current_user.groups
|
- for group in @groups
|
||||||
%li
|
%li
|
||||||
= check_box_tag("group_ids[]", group.id, current_group?(group) )
|
= check_box_tag("group_ids[]", group.id, current_group?(group) )
|
||||||
= group.name
|
= group.name
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue