diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index 6dd7e6cb3f2e392420bc60831ab9d8bbc6f295bc..52ecfa45bb1aaabb21da11b53eb979005d2e755e 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -9,8 +9,13 @@ class AlbumsController < ApplicationController respond_to :json, :only => [:index, :show] def index - @albums = current_user.albums_by_aspect(@aspect).paginate :page => params[:page], :per_page => 9, :order => 'created_at DESC' - respond_with @albums, :aspect => @aspect + if params[:person_id] + @person = current_user.visible_people.find_by_person_id(params[:person_id]) + end + @person ||= current_user.person + + @albums = current_user.visible_posts(:_type => 'Album').paginate :page => params[:page], :per_page => 9, :order => 'created_at DESC' + respond_with @albums end def create diff --git a/app/views/albums/index.html.haml b/app/views/albums/index.html.haml index 3003713932cfd92708cb29e0d95f35fa2ed014f4..f46d3b8c762d904208480719fefab88719539c85 100644 --- a/app/views/albums/index.html.haml +++ b/app/views/albums/index.html.haml @@ -2,10 +2,7 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -.span-4.append-1.last - = render "shared/aspect_friends" - -.span-15.last +.span-24.last = render "shared/publisher", :type => :album, :aspect => @aspect %div diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index dbc8ec95ea924ad5458f8236abd1fe9d27ce8974..af5e399d21ee8dc8ac8e7971590e9909fac8a855 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. .span-4.append-1.last - = render "shared/aspect_friends" + = render 'shared/aspect_friends', :people => @friends, :aspect => @aspect .span-15.last = render 'aspects/no_friends_message' diff --git a/app/views/aspects/show.html.haml b/app/views/aspects/show.html.haml index dbc8ec95ea924ad5458f8236abd1fe9d27ce8974..af5e399d21ee8dc8ac8e7971590e9909fac8a855 100644 --- a/app/views/aspects/show.html.haml +++ b/app/views/aspects/show.html.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. .span-4.append-1.last - = render "shared/aspect_friends" + = render 'shared/aspect_friends', :people => @friends, :aspect => @aspect .span-15.last = render 'aspects/no_friends_message' diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index fd8bedee1a261d4ae25a49bf17dfb63e359b3396..7d068a14f331557ec81d8aaf50f112f4ba5c4fa9 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -36,10 +36,7 @@ %br %br - - if @person != current_user.person && @contact - %ul - %li= link_to 'stream', person_path(@person) - %li= link_to 'photos', person_photos_path(@person) + = link_to 'photos', person_photos_path(@person) .span-15.last diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index c7137b0252e217258dd0c258e383966d58536727..b2899747017271ed31a95e706198178f95809736 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -4,18 +4,15 @@ #left_pane - - if @aspect == :all - %h2= "Everyone" - - else - %h2= @aspect + %h2= aspect == :all ? "Everyone" : aspect .friend_pictures = owner_image_link - - for friend in @friends + - for friend in people = person_image_link(friend) - -unless (@aspect == :all) + -unless (aspect == :all) = link_to (image_tag('add_friend_button.png', :title => "add to #{@aspect}")), "#add_request_pane", :class => 'add_request_button' .fancybox_content @@ -28,10 +25,7 @@ %br %br - %ul - %li= link_to 'stream', aspect_or_all_path(@aspect) - %li= link_to t('.photos'), albums_path(:aspect => @aspect) - + %br %br = render "shared/invitations", :invites => @invites