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

RS, DG; DashboardsController has been eliminated.

parent cd875d06
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
class DashboardsController < ApplicationController
before_filter :authenticate_user!
include ApplicationHelper
def index
if params[:group]
@people_ids = @group.people.map {|p| p.id}
@posts = Post.paginate :person_id => @people_ids, :order => 'created_at DESC'
else
@posts = Post.paginate :page => params[:page], :order => 'created_at DESC'
end
end
end
class GroupsController < ApplicationController
before_filter :authenticate_user!
def index
@posts = Post.paginate :page => params[:page], :order => 'created_at DESC'
end
def create
@group = current_user.group(params[:group])
if @group.created_at
flash[:notice] = "Successfully created group."
redirect_to root_url
redirect_to @group
else
render :action => 'new'
end
......@@ -24,7 +28,10 @@ class GroupsController < ApplicationController
end
def show
@people_ids = @group.people.map {|p| p.id}
@posts = Post.paginate :person_id => @people_ids, :order => 'created_at DESC'
@group = Group.first(:id => params[:id])
render :index
end
def edit
......
......@@ -25,14 +25,14 @@ class PhotosController < ApplicationController
end
def destroy
@photo = Photo.where(:id => params[:id]).first
@photo = Photo.first(:id => params[:id])
@photo.destroy
flash[:notice] = "Successfully deleted photo."
redirect_to @photo.album
end
def show
@photo = Photo.where(:id => params[:id]).first
@photo = Photo.first(:id => params[:id])
@album = @photo.album
end
......
Fichier déplacé
#group
%ul
- for group in @groups
%li{:class => ("selected" if group.id.to_s == params[:group])}
= link_to group.name, root_path(:group =>group.id)
%li{:class => ("selected" if group.id.to_s == params[:id])}
= link_to group.name, group
%li#add_group_button.new_group= link_to "NEW GROUP", "#"
......
......@@ -32,5 +32,5 @@ Diaspora::Application.routes.draw do |map|
match 'hcard', :to => 'publics#hcard'
#root
root :to => 'dashboards#index'
root :to => 'groups#index'
end
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