From 857a4b5f112088afd81504776431ae1e687c3dd9 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 22 Nov 2010 10:31:59 -0800 Subject: [PATCH] photo large is now at 300px. a person's profile photo now references the larger size instead of medium. --- app/controllers/dev_utilities_controller.rb | 2 +- app/controllers/people_controller.rb | 2 +- app/models/photo.rb | 2 +- app/uploaders/image_uploader.rb | 2 +- app/views/photos/show.html.haml | 2 +- public/javascripts/view.js | 2 ++ spec/models/photo_spec.rb | 2 +- spec/models/profile_spec.rb | 8 ++++---- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/controllers/dev_utilities_controller.rb b/app/controllers/dev_utilities_controller.rb index 8eb7b788c..d0c6320da 100644 --- a/app/controllers/dev_utilities_controller.rb +++ b/app/controllers/dev_utilities_controller.rb @@ -69,7 +69,7 @@ class DevUtilitiesController < ApplicationController current_user.raw_visible_posts << photo current_user.save - current_user.update_profile(:image_url => photo.url(:thumb_medium)) + current_user.update_profile(:image_url => photo.url(:thumb_large)) current_user.save end diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index e67d794c8..93ff34e87 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -76,7 +76,7 @@ class PeopleController < ApplicationController params[:profile_image_hash] = { :user_file => raw_image, :to => "all" } photo = current_user.post(:photo, params[:profile_image_hash]) - params[:person][:profile][:image_url] = photo.url(:thumb_medium) + params[:person][:profile][:image_url] = photo.url(:thumb_large) end if current_user.update_profile params[:person][:profile] diff --git a/app/models/photo.rb b/app/models/photo.rb index e07422735..46f6286ec 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -65,7 +65,7 @@ class Photo < Post end def ensure_user_picture - people = Person.all('profile.image_url' => absolute_url(:thumb_medium) ) + people = Person.all('profile.image_url' => absolute_url(:thumb_large) ) people.each{ |person| person.profile.update_attributes(:image_url => nil) } diff --git a/app/uploaders/image_uploader.rb b/app/uploaders/image_uploader.rb index f94189076..71b842ecc 100644 --- a/app/uploaders/image_uploader.rb +++ b/app/uploaders/image_uploader.rb @@ -30,7 +30,7 @@ class ImageUploader < CarrierWave::Uploader::Base end version :thumb_large do - process :resize_to_fill => [200,200] + process :resize_to_fill => [300,300] end version :scaled_full do diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 6ed450384..8a12ac3be 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -40,7 +40,7 @@ -if @ownership = image_tag 'ajax-loader.gif', :id => "photo_spinner", :class => "hidden" = image_tag @photo.url(:scaled_full) - .photo_options{:data=>{:actor=>"#{@photo.person.owner.id}",:actor_person=>"#{@photo.person.id}",:image_url=>"#{@photo.url(:thumb_medium)}"}} + .photo_options{:data=>{:actor=>"#{@photo.person.owner.id}",:actor_person=>"#{@photo.person.id}",:image_url=>"#{@photo.url(:thumb_large)}"}} = link_to t('.make_profile_photo'), '#', :class => 'make_profile_photo' | = link_to 'edit', '#', :id => "edit_photo_toggle" diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 15d5fd1ff..41b943b58 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -136,6 +136,8 @@ function openVideo(type, videoid, link) { link.parentNode.insertBefore(container, this.nextSibling); $container.slideDown('fast', function() { }); link.onclick = function() { $container.slideToggle('fast', function() { } ); } + + } $(".make_profile_photo").live("click", function(evt){ diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index 24bbaff4c..95686ab36 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -82,7 +82,7 @@ describe Photo do it 'should remove its reference in user profile if it is referred' do @photo.save - @user.profile.image_url = @photo.image.url(:thumb_medium) + @user.profile.image_url = @photo.image.url(:thumb_large) @user.person.save @photo.destroy Person.find(@user.person.id).profile.image_url.should be_nil diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb index 8ce848a85..e74a08c78 100644 --- a/spec/models/profile_spec.rb +++ b/spec/models/profile_spec.rb @@ -55,12 +55,12 @@ describe Profile do lambda {@profile.image_url = ""}.should_not change(@profile, :image_url) end it 'makes relative urls absolute' do - @profile.image_url = @photo.url(:thumb_medium) - @profile.image_url.should == "#{@pod_url}#{@photo.url(:thumb_medium)}" + @profile.image_url = @photo.url(:thumb_large) + @profile.image_url.should == "#{@pod_url}#{@photo.url(:thumb_large)}" end it 'accepts absolute urls' do - @profile.image_url = "#{@pod_url}#{@photo.url(:thumb_medium)}" - @profile.image_url.should == "#{@pod_url}#{@photo.url(:thumb_medium)}" + @profile.image_url = "#{@pod_url}#{@photo.url(:thumb_large)}" + @profile.image_url.should == "#{@pod_url}#{@photo.url(:thumb_large)}" end end describe 'serialization' do