diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7d7c28dd24757f892e0a50b9fc1303d9f6180f72..d747a219cbbe4c6bda3dc2ed3cff8a9f4793764f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -36,7 +36,12 @@ class ApplicationController < ActionController::Base def set_friends_and_status if current_user - @aspect = :all + if params[:aspect] == 'all' || params[:aspect] == nil + @aspect = :all + else + @aspect = current_user.aspect_by_id( params[:aspect]) + end + @aspects = current_user.aspects @friends = current_user.friends end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 04ae66897ceb22ff1740c0ae13a6dd1accc80879..234cf80ee3b9065da280e442c60814ac255d9154 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -23,8 +23,8 @@ module ApplicationHelper @aspect != :all && @aspect.id == aspect.id end - def object_path(object) - eval("#{object.class.to_s.underscore}_path(object)") + def object_path(object, opts = {}) + eval("#{object.class.to_s.underscore}_path(object, opts)") end def object_fields(object) diff --git a/app/views/albums/_album.html.haml b/app/views/albums/_album.html.haml index 3ff1a507d1d3693379f8d83e136241a86f1563f9..9e0585781c650cd52f0b7e77e8154d1e89a31013 100644 --- a/app/views/albums/_album.html.haml +++ b/app/views/albums/_album.html.haml @@ -17,17 +17,16 @@ -# .album{:id => post.id, :class => ("mine" if current_user.owns?(post))} - %div.name - = link_to post.name, object_path(post) + = link_to post.name, object_path(post, :aspect => params[:aspect]) %div.time by = link_to ((current_user.person == post.person)? 'you' : post.person.real_name), person_path(post.person) %br - = link_to(how_long_ago(post), object_path(post)) + = link_to(how_long_ago(post), object_path(post, :aspect => params[:aspect])) %div.image_cycle - for photo in post.photos[0..3] - = link_to (image_tag photo.url(:thumb_large)), album_path(post) + = link_to (image_tag photo.url(:thumb_large)), album_path(post, :aspect => params[:aspect]) diff --git a/app/views/albums/index.html.haml b/app/views/albums/index.html.haml index 114eef205d3776fb8dcb5a36fc9cf78e0ecebba6..3f54c05eea6e0fa196a815868c152d27d4277392 100644 --- a/app/views/albums/index.html.haml +++ b/app/views/albums/index.html.haml @@ -24,7 +24,7 @@ }); = content_for :page_title do - = link_to "â—‚ Home", aspects_path + = link_to "â—‚ Home", aspects_path, :aspect => params[:aspect] - content_for :left_pane do = render "shared/aspect_friends" diff --git a/app/views/albums/show.html.haml b/app/views/albums/show.html.haml index 10a239c64ce66850ba64267bf2588a22b9b05bd4..e55d1962ba4a563831c75e299f8be8ab784fd63c 100644 --- a/app/views/albums/show.html.haml +++ b/app/views/albums/show.html.haml @@ -25,7 +25,7 @@ }); = content_for :page_title do - = link_to "â—‚ Albums", albums_path + = link_to "â—‚ Albums", albums_path(:aspect => @aspect) - content_for :left_pane do = render "shared/aspect_friends"