Skip to content
Extraits de code Groupes Projets
Valider 24cd518f rédigé par Daniel Vincent Grippi's avatar Daniel Vincent Grippi
Parcourir les fichiers

DG, RS; Album creation no longer ejects you from context

parent da8ec589
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -24,15 +24,15 @@ class AlbumsController < ApplicationController ...@@ -24,15 +24,15 @@ class AlbumsController < ApplicationController
respond_to :json, :only => [:index, :show] respond_to :json, :only => [:index, :show]
def index def index
@aspect = current_user.aspect_by_id( params[:aspect] ) unless params[:aspect] == 'all'
@albums = current_user.albums_by_aspect(@aspect).paginate @albums = current_user.albums_by_aspect(@aspect).paginate
respond_with @albums respond_with @albums, :aspect => @aspect
end end
def create def create
aspect = params[:album][:to]
@album = current_user.post(:album, params[:album]) @album = current_user.post(:album, params[:album])
flash[:notice] = "You've created an album called #{@album.name}." flash[:notice] = "You've created an album called #{@album.name}."
respond_with @album redirect_to :action => :show, :id => @album.id, :aspect => aspect
end end
def new def new
......
...@@ -36,7 +36,7 @@ class ApplicationController < ActionController::Base ...@@ -36,7 +36,7 @@ class ApplicationController < ActionController::Base
def set_friends_and_status def set_friends_and_status
if current_user if current_user
if params[:aspect] == 'all' || params[:aspect] == nil if params[:aspect] == nil || params[:aspect] == 'all'
@aspect = :all @aspect = :all
else else
@aspect = current_user.aspect_by_id( params[:aspect]) @aspect = current_user.aspect_by_id( params[:aspect])
......
...@@ -18,15 +18,15 @@ ...@@ -18,15 +18,15 @@
.album{:id => post.id, :class => ("mine" if current_user.owns?(post))} .album{:id => post.id, :class => ("mine" if current_user.owns?(post))}
%div.name %div.name
= link_to post.name, object_path(post, :aspect => params[:aspect]) = link_to post.name, object_path(post, :aspect => @aspect)
%div.time %div.time
by by
= link_to ((current_user.person == post.person)? 'you' : post.person.real_name), person_path(post.person) = link_to ((current_user.person == post.person)? 'you' : post.person.real_name), person_path(post.person)
%br %br
= link_to(how_long_ago(post), object_path(post, :aspect => params[:aspect])) = link_to(how_long_ago(post), object_path(post, :aspect => @aspect))
%div.image_cycle %div.image_cycle
- for photo in post.photos[0..3] - for photo in post.photos[0..3]
= link_to (image_tag photo.url(:thumb_large)), album_path(post, :aspect => params[:aspect]) = link_to (image_tag photo.url(:thumb_large)), album_path(post, :aspect => @aspect)
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
%ul %ul
- content_for :publish do - content_for :publish do
.new_aspect= link_to("add a new aspect", "#add_aspect_pane", :id => "add_aspect_button", :title => "Add a new relation") = link_to("add a new aspect", "#add_aspect_pane", :id => "add_aspect_button", :class => "new_aspect button", :title => "Add a new aspect")
......
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