photo large is now at 300px. a person's profile photo now references the larger size instead of medium.

This commit is contained in:
danielvincent 2010-11-22 10:31:59 -08:00
parent f4ff48f5c0
commit 857a4b5f11
8 changed files with 12 additions and 10 deletions

View file

@ -69,7 +69,7 @@ class DevUtilitiesController < ApplicationController
current_user.raw_visible_posts << photo current_user.raw_visible_posts << photo
current_user.save 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 current_user.save
end end

View file

@ -76,7 +76,7 @@ class PeopleController < ApplicationController
params[:profile_image_hash] = { :user_file => raw_image, :to => "all" } params[:profile_image_hash] = { :user_file => raw_image, :to => "all" }
photo = current_user.post(:photo, params[:profile_image_hash]) 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 end
if current_user.update_profile params[:person][:profile] if current_user.update_profile params[:person][:profile]

View file

@ -65,7 +65,7 @@ class Photo < Post
end end
def ensure_user_picture 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| people.each{ |person|
person.profile.update_attributes(:image_url => nil) person.profile.update_attributes(:image_url => nil)
} }

View file

@ -30,7 +30,7 @@ class ImageUploader < CarrierWave::Uploader::Base
end end
version :thumb_large do version :thumb_large do
process :resize_to_fill => [200,200] process :resize_to_fill => [300,300]
end end
version :scaled_full do version :scaled_full do

View file

@ -40,7 +40,7 @@
-if @ownership -if @ownership
= image_tag 'ajax-loader.gif', :id => "photo_spinner", :class => "hidden" = image_tag 'ajax-loader.gif', :id => "photo_spinner", :class => "hidden"
= image_tag @photo.url(:scaled_full) = 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 t('.make_profile_photo'), '#', :class => 'make_profile_photo'
| |
= link_to 'edit', '#', :id => "edit_photo_toggle" = link_to 'edit', '#', :id => "edit_photo_toggle"

View file

@ -136,6 +136,8 @@ function openVideo(type, videoid, link) {
link.parentNode.insertBefore(container, this.nextSibling); link.parentNode.insertBefore(container, this.nextSibling);
$container.slideDown('fast', function() { }); $container.slideDown('fast', function() { });
link.onclick = function() { $container.slideToggle('fast', function() { } ); } link.onclick = function() { $container.slideToggle('fast', function() { } ); }
} }
$(".make_profile_photo").live("click", function(evt){ $(".make_profile_photo").live("click", function(evt){

View file

@ -82,7 +82,7 @@ describe Photo do
it 'should remove its reference in user profile if it is referred' do it 'should remove its reference in user profile if it is referred' do
@photo.save @photo.save
@user.profile.image_url = @photo.image.url(:thumb_medium) @user.profile.image_url = @photo.image.url(:thumb_large)
@user.person.save @user.person.save
@photo.destroy @photo.destroy
Person.find(@user.person.id).profile.image_url.should be_nil Person.find(@user.person.id).profile.image_url.should be_nil

View file

@ -55,12 +55,12 @@ describe Profile do
lambda {@profile.image_url = ""}.should_not change(@profile, :image_url) lambda {@profile.image_url = ""}.should_not change(@profile, :image_url)
end end
it 'makes relative urls absolute' do it 'makes relative urls absolute' do
@profile.image_url = @photo.url(:thumb_medium) @profile.image_url = @photo.url(:thumb_large)
@profile.image_url.should == "#{@pod_url}#{@photo.url(:thumb_medium)}" @profile.image_url.should == "#{@pod_url}#{@photo.url(:thumb_large)}"
end end
it 'accepts absolute urls' do it 'accepts absolute urls' do
@profile.image_url = "#{@pod_url}#{@photo.url(:thumb_medium)}" @profile.image_url = "#{@pod_url}#{@photo.url(:thumb_large)}"
@profile.image_url.should == "#{@pod_url}#{@photo.url(:thumb_medium)}" @profile.image_url.should == "#{@pod_url}#{@photo.url(:thumb_large)}"
end end
end end
describe 'serialization' do describe 'serialization' do