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