forked from bborn/communityengine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
paperclip uploading for photos and user avatar
- Loading branch information
Showing
37 changed files
with
781 additions
and
552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
class ClippingImage < Asset | ||
include UrlUpload | ||
has_attached_file :clipping_image_file, default_s3_options.merge( | ||
:storage => :s3, | ||
:styles => { :original => '465>', :thumb => "100x100#", :medium_square => "200x200#", :medium => "200>" }, | ||
:path => "/:attachment/:id/:basename:maybe_style.:extension") | ||
validates_attachment_presence :clipping_image_file | ||
validates_attachment_content_type :clipping_image_file, :content_type => ['image/jpg', 'image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png'] | ||
validates_attachment_size :clipping_image_file, :less_than => 3.megabytes | ||
has_attached_file :asset, configatron.clipping.paperclip_options | ||
validates_attachment_presence :asset | ||
validates_attachment_content_type :photo, :content_type => configatron.clipping.validation_options.content_type | ||
validates_attachment_size :photo, :less_than => configatron.clipping.validation_options.max_size.to_i.megabytes | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,28 @@ | ||
.yui-b | ||
= render :partial => 'posts/author_profile', :locals => {:user => @user} | ||
|
||
-box :id => 'tag_list', :class => 'yui-u first' do | ||
%h3=:tags.l | ||
%ul.tags | ||
- @tags.each do |tag| | ||
%li | ||
- if (tag.name.eql?(params[:tag_name]) ) | ||
= link_to tag.name, user_photos_path(@user), :class => "selected" | ||
- else | ||
= link_to tag.name, user_photos_path(:user_id => @user, :tag_name => tag.name) | ||
- @tags.each do |tag| | ||
%li | ||
- if (tag.name.eql?(params[:tag_name]) ) | ||
= link_to tag.name, user_photos_path(@user), :class => "selected" | ||
- else | ||
= link_to tag.name, user_photos_path(:user_id => @user, :tag_name => tag.name) | ||
|
||
|
||
#yui-main | ||
.yui-b | ||
.yui-gd | ||
=box :id => 'tag_list', :class => 'yui-u first' do | ||
%h3=:tags.l | ||
%ul.tags | ||
- @tags.each do |tag| | ||
%li | ||
- if (tag.name.eql?(params[:tag_name]) ) | ||
= link_to tag.name, user_photos_path(@user), :class => "selected" | ||
- else | ||
= link_to tag.name, user_photos_path(:user_id => @user, :tag_name => tag.name) | ||
|
||
=box :id => "photos", :class => "yui-u" do | ||
%h3= link_to :users_photos.l(:user=>@user.login), user_photos_path(@user) | ||
= link_to( :new_photo.l, new_user_photo_path(@user), {:class => 'right'}) if @is_current_user | ||
|
||
.clear | ||
- @photos.each do |photo| | ||
= link_to image_tag( photo.photo.url(:thumb), :class => "polaroid"), user_photo_path(@user, photo) | ||
|
||
.pagination=paginating_links @photos if @photos.total_pages > 1 | ||
|
||
-box :id => "photos" do | ||
%h3= link_to :users_photos.l(:user=>@user.login), user_photos_path(@user) | ||
= link_to( :new_photo.l, new_user_photo_path(@user), {:class => 'right'}) if @is_current_user | ||
|
||
.clear | ||
- @photos.each do |photo| | ||
= link_to tag('img', :src => photo.photo.url(:thumb), :class => "polaroid"), user_photo_path(@user, photo) | ||
|
||
.pagination=paginating_links @photos if @photos.total_pages > 1 | ||
|
||
|
Oops, something went wrong.