diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bd0ede89b..d6913a9e5 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -31,12 +31,6 @@ module ApplicationHelper end end - def link_to_person(user) - person = user.person - puts person.inspect - link_to person.real_name, person_path(person) - end - def owner_image_tag person_image_tag(User.owner) end diff --git a/app/models/album.rb b/app/models/album.rb index 3fb8917c4..302cb3b07 100644 --- a/app/models/album.rb +++ b/app/models/album.rb @@ -26,9 +26,9 @@ class Album def self.mine_or_friends(friend_param, current_user) if friend_param - Album.where(:person_id.ne => current_user.id) + Album.where(:person_id.ne => current_user.person.id) else - Album.where(:person_id => current_user.id) + Album.where(:person_id => current_user.person.id) end end diff --git a/app/views/albums/index.html.haml b/app/views/albums/index.html.haml index 2e47295d6..735ec809f 100644 --- a/app/views/albums/index.html.haml +++ b/app/views/albums/index.html.haml @@ -5,7 +5,7 @@ .right#add_album_button = link_to 'New Album', "#", :class => "button" - #add_album_box.contextual_pane + #add_album_pane.contextual_pane = render "albums/new_album" .sub_header diff --git a/app/views/albums/show.html.haml b/app/views/albums/show.html.haml index 6911d2555..6bdcafb6b 100644 --- a/app/views/albums/show.html.haml +++ b/app/views/albums/show.html.haml @@ -5,10 +5,10 @@ = @album.name -if current_user.owns? @album - .button.right#add_photos_button + .button.right#add_photo_button = link_to 'Add Photos', '#' - #add_photo_box.contextual_pane + #add_photo_pane.contextual_pane = render "photos/new_photo", :photo => @photo, :album => @album .sub_header diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 02568e239..cb06b10f9 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -33,7 +33,7 @@ #session_action - if user_signed_in? - = link_to_person current_user + = link_to current_user.real_name, current_user.person | = link_to "requests (#{@request_count})", requests_path, :class => new_request(@request_count) | diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index 9b663531a..e6734639a 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -2,7 +2,7 @@ = person_image_tag(post.person) %span.from - = link_to_person post.person + = link_to post.person.real_name, post.person %b posted a new photo to = link_to post.album.name, object_path(post.album) diff --git a/app/views/shared/_group_nav.haml b/app/views/shared/_group_nav.haml index c61712038..47810c9c3 100644 --- a/app/views/shared/_group_nav.haml +++ b/app/views/shared/_group_nav.haml @@ -3,7 +3,10 @@ - for group in @groups %li= link_to group.name, group_path(group) - %li.new_group= link_to "NEW GROUP", new_group_path + %li#add_group_button.new_group= link_to "NEW GROUP", "#" + + #add_group_pane.contextual_pane + = render "groups/new_group" #friend_pictures - for friend in @friends diff --git a/public/javascripts/view.js b/public/javascripts/view.js index c181e3bcc..0c14d431e 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -81,21 +81,19 @@ $(document).ready(function(){ }); //buttons////// - $("#add_photos_button").toggle( + function pane_toggler_button( name ) { + $("#add_" + name + "_button").toggle( function(){ - $("#add_photo_box").fadeIn(300); + $("#add_" + name + "_pane").fadeIn(300); },function(){ - $("#add_photo_box").fadeOut(200); + $("#add_" + name +"_pane").fadeOut(200); } ); + } - $("#add_album_button").toggle( - function(){ - $("#add_album_box").fadeIn(300); - },function(){ - $("#add_album_box").fadeOut(200); - } - ); + pane_toggler_button("album"); + pane_toggler_button("group"); + pane_toggler_button("photo"); $("input[type='submit']").addClass("button");