diff --git a/.pairs b/.pairs new file mode 100644 index 000000000..3930858be --- /dev/null +++ b/.pairs @@ -0,0 +1,8 @@ +pairs: + dg: Daniel Grippi; daniel + rs: Raphael Sofaer; raphael + iz: Ilya Zhitomirskiy; ilya + ms: Maxwell Salzberg; maxwell +email: + prefix: pair + domain: joindiaspora.com diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 0a6a44dfc..c4ea5c044 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -14,11 +14,9 @@ class PeopleController < ApplicationController def show @person = current_user.visible_person_by_id(params[:id]) @profile = @person.profile - @person_groups = current_user.groups_with_person(@person) - - - @groups_array = current_user.groups.collect{|x| [x.to_s, x.id]} + @groups_with_person = current_user.groups_with_person(@person) + @all_groups = current_user.groups.collect{|x| [x.to_s, x.id]} @posts = Post.where(:person_id => @person.id, :_id.in => current_user.visible_post_ids).paginate :page => params[:page], :order => 'created_at DESC' diff --git a/app/models/photo.rb b/app/models/photo.rb index 5fcb0ea70..153aee214 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -63,6 +63,6 @@ class Photo < Post end def thumb_hash - {:thumb_url => image.url(:thumb_medium), :id => id, :album_id => album_id} + {:thumb_url => url(:thumb_medium), :id => id, :album_id => album_id} end end diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 76fc3acef..df4b94e59 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -13,17 +13,15 @@ -unless @posts.first.nil? %li %i= "last seen: #{how_long_ago(@posts.first)}" - %li - %i= "friends since: #{how_long_ago(@person)}" - %li - ="groups: #{@person_groups}" - = "edit" - = @groups_array.inspect - = form_tag move_person_path - = select :to, :to, @groups_array - = hidden_field_tag :from, :from, :value => @person_groups.first.id - = hidden_field_tag :friend_id, :friend_id, :value => @person.id - = submit_tag "save" + - unless @person == current_user.person + %li + %i= "friends since: #{how_long_ago(@person)}" + %li + = form_tag move_person_path + = select :to, :to, @all_groups + = hidden_field_tag :from, :from, :value => @groups_with_person.first.id + = hidden_field_tag :friend_id, :friend_id, :value => @person.id + = submit_tag "save" %li url: = @person.url diff --git a/app/views/photos/_new_photo.haml b/app/views/photos/_new_photo.haml index 5bc6d6882..32fd2a3e8 100644 --- a/app/views/photos/_new_photo.haml +++ b/app/views/photos/_new_photo.haml @@ -1,33 +1,3 @@ -:javascript - $(function() { - $("#photo_image").html5_upload({ - // WE INSERT ALBUM_ID PARAM HERE - url: "/photos?album_id=#{@album.id}", - sendBoundary: window.FormData || $.browser.mozilla, - setName: function(text) { - $("#progress_report_name").text(text); - }, - onFinish: function(event, total){ - $("#add_photo_button").html( "Add Photos" ); - $("#add_photo_loader").fadeOut(400); - - $("#photo_title_status").text("Done!"); - $("#progress_report").html("Good job me!"); - - $("#add_photo_button").addClass("uploading_complete"); - }, - onStart: function(event, total){ - $("#add_photo_button").html( "Uploading Photos" ); - $("#add_photo_loader").fadeIn(400); - - $("form").fadeOut(0); - $("#progress_report").fadeIn(0); - $("#photo_title_status").text("Uploading..."); - return true; - } - }); - }); - %h1 %span{:id=>"photo_title_status"} Add photos to diff --git a/public/javascripts/photos.js b/public/javascripts/photos.js index b04585402..3980c008e 100644 --- a/public/javascripts/photos.js +++ b/public/javascripts/photos.js @@ -22,3 +22,30 @@ function reset_photo_fancybox(){ $("#new_photo_pane").html(ajax.responseText) }); } + +$("#photo_image").html5_upload({ + // WE INSERT ALBUM_ID PARAM HERE + url: "/photos?album_id="+$(".album_id")[0].id, + sendBoundary: window.FormData || $.browser.mozilla, + setName: function(text) { + $("#progress_report_name").text(text); + }, + onFinish: function(event, total){ + $("#add_photo_button").html( "Add Photos" ); + $("#add_photo_loader").fadeOut(400); + + $("#photo_title_status").text("Done!"); + $("#progress_report").html("Good job me!"); + + $("#add_photo_button").addClass("uploading_complete"); + }, + onStart: function(event, total){ + $("#add_photo_button").html( "Uploading Photos" ); + $("#add_photo_loader").fadeIn(400); + + $("form.new_photo").fadeOut(0); + $("#progress_report").fadeIn(0); + $("#photo_title_status").text("Uploading..."); + return true; + } +});