Skip to content
Extraits de code Groupes Projets
Valider 5ac5f586 rédigé par Raphael's avatar Raphael
Parcourir les fichiers

Tabs on the top aren't all selected on group select, some other view tweaks

parent d3c10f87
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -16,11 +16,8 @@ class ApplicationController < ActionController::Base
end
def set_friends_and_status
unless current_user.nil?
@group = :all
@groups = current_user.groups
@friends = current_user.friends
end
@groups = current_user.groups
@friends = current_user.friends
end
def count_requests
......
......@@ -3,10 +3,7 @@ class GroupsController < ApplicationController
def index
@posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :order => 'created_at DESC'
@friends = current_user.friends
@groups = current_user.groups.find_all_by_id(params[:group_ids]) if params[:group_ids]
@groups ||= current_user.groups
@group = :all
end
def create
......
module ApplicationHelper
def current_group?(group)
@group == :all || @group.id == group.id
@group != :all && @group.id == group.id
end
def object_path(object)
......
......@@ -60,7 +60,8 @@
.container
#group
%ul
%li= link_to "All Groups", root_url
%li{:class => ("selected" if @group == :all)}
= link_to "All Groups", root_url
- for group in @groups
%li{:class => ("selected" if current_group?(group))}
= link_for_group group
......
......@@ -9,7 +9,7 @@
%ul.group_selector
going to...
- for group in current_user.groups
- for group in @groups
%li
= check_box_tag("group_ids[]", group.id, current_group?(group) )
= group.name
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter