public
Description: Adds basic social networking capabilities to your existing application, including users, blogs, photos, clippings, favorites, and more.
Homepage: http://www.communityengine.org
Clone URL: git://github.com/bborn/communityengine.git
Search Repo:
updating clipping image and hompage_feature to use filesystem backend as 
default
bborn (author)
Sun Mar 30 19:12:27 -0700 2008
commit  f0993287c4839052d89ae74eaa0ad504ab460aa6
tree    6d5e47fc4825753c7c81299d48eb83b656d73e0f
parent  1353701f35da7de5e4474123c95c2c5819c7b9ff
...
1
2
3
4
5
6
7
8
 
 
9
10
11
...
1
 
 
 
 
 
 
 
2
3
4
5
6
0
@@ -1,10 +1,5 @@
0
 class ClippingImage < Asset
0
- has_attachment :content_type => :image,
0
- :storage => :s3,
0
- :max_size => 3.megabytes,
0
- :resize_to => "465>",
0
- :path_prefix => "assets",
0
- :thumbnails => { :thumb => "100x100!", :medium_square => '200x200!', :medium => "200>" }
0
-
0
+ has_attachment prepare_options_for_attachment_fu(AppConfig.clipping['attachment_fu_options'])
0
+
0
   validates_as_attachment
0
 end
0
\ No newline at end of file
...
1
2
3
4
5
6
 
7
8
9
...
1
 
 
 
 
 
2
3
4
5
0
@@ -1,9 +1,5 @@
0
 class HomepageFeature < ActiveRecord::Base
0
- has_attachment :storage => :s3,
0
- :min_size => 1,
0
- :max_size => 1.megabytes,
0
- :content_type => ['image/jpg', 'image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png'],
0
- :thumbnails => AppConfig.feature['thumbs']
0
+ has_attachment prepare_options_for_attachment_fu(AppConfig.feature['attachment_fu_options'])
0
 
0
   validates_presence_of
0
   validates_presence_of :content_type
...
1
2
3
4
5
6
7
 
8
9
10
...
1
2
 
 
 
3
 
4
5
6
7
0
@@ -1,10 +1,7 @@
0
 class Photo < ActiveRecord::Base
0
   acts_as_commentable
0
-
0
- attachment_fu_options = AppConfig.photo['attachment_fu_options']
0
- attachment_fu_options = attachment_fu_options.symbolize_keys.merge({:storage => attachment_fu_options['storage'].to_sym, :max_size => attachment_fu_options['max_size'].to_i.megabytes })
0
   
0
- has_attachment attachment_fu_options
0
+ has_attachment prepare_options_for_attachment_fu(AppConfig.photo['attachment_fu_options'])
0
 
0
   acts_as_taggable
0
 
...
70
71
72
73
74
75
 
 
 
 
 
76
77
78
...
70
71
72
 
 
 
73
74
75
76
77
78
79
80
0
@@ -70,9 +70,11 @@ Object.extend(Object.extend(Glider.prototype, Abstract.prototype), {
0
       var nextIndex = (this.sections.length - 1 == currentIndex) ? 0 : currentIndex + 1;
0
     } else var nextIndex = 1;
0
 
0
- this.moveTo(this.sections[nextIndex], this.scroller, {
0
- duration: this.options.duration
0
- });
0
+ if(this.sections.length > 1){
0
+ this.moveTo(this.sections[nextIndex], this.scroller, {
0
+ duration: this.options.duration
0
+ });
0
+ }
0
   },
0
   
0
   previous: function(){
...
4
5
6
 
 
 
7
8
9
...
22
23
24
25
26
27
28
29
30
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
...
4
5
6
7
8
9
10
11
12
...
25
26
27
 
28
29
 
 
 
 
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
0
@@ -4,6 +4,9 @@ community_description: "The Best Place for People Who Love Communities"
0
 support_email: "support@community.com"
0
 meta_description: 'A description of your community for use in META tags.'
0
 meta_keywords: 'keywords for use in META tags'
0
+sections_enabled: ['photos', 'posts', 'clippings', 'contests', 'categories', 'events']
0
+show_advertising: false
0
+closed_beta_mode: false
0
 
0
 # The label you use for 'staff' writers (featured writer, staff, pro, etc.)
0
 featured_writer_label: 'Featured Writer'
0
@@ -22,10 +25,21 @@ photo:
0
     content_type: ['image/jpg', 'image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png']
0
       
0
 feature:
0
- thumbs: {thumb: [45,45], large: [635,150]}
0
   use_thumbs: false
0
   dimensions: [150, 635]
0
-sections_enabled: ['photos', 'posts', 'clippings', 'contests', 'categories', 'events']
0
-show_advertising: false
0
-closed_beta_mode: false
0
-
0
+ attachment_fu_options:
0
+ resize_to: "465>"
0
+ min_size: 1
0
+ max_size: 1
0
+ thumbnails: {thumb: '45x45!', large: '635x150!'}
0
+ storage: 'file_system'
0
+ content_type: ['image/jpg', 'image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png']
0
+
0
+clipping:
0
+ attachment_fu_options:
0
+ resize_to: "465>"
0
+ min_size: 1
0
+ max_size: 3
0
+ thumbnails: {thumb: "100x100!", medium_square: "200x200!", medium: "200>"}
0
+ storage: 'file_system'
0
+ content_type: ['image/jpg', 'image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png']
0
\ No newline at end of file
...
 
1
2
3
...
1
2
3
4
0
@@ -1,3 +1,4 @@
0
+require 'community_engine'
0
 require 's3_cache_control'
0
 
0
 Module.class_eval do
...
1
2
 
 
 
 
 
 
 
 
 
 
 
 
 
...
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
0
@@ -1 +1,13 @@
0
-# CommunityEngine
0
\ No newline at end of file
0
+# CommunityEngine
0
+module CommunityEngine
0
+ module ActiveRecordExtensions
0
+
0
+ def prepare_options_for_attachment_fu(options)
0
+ attachment_fu_options = options.symbolize_keys.merge({:storage => options['storage'].to_sym,
0
+ :max_size => options['max_size'].to_i.megabytes})
0
+ end
0
+
0
+ end
0
+end
0
+
0
+ActiveRecord::Base.send(:extend, CommunityEngine::ActiveRecordExtensions)

Comments

    No one has commented yet.