Changeset 4612
- Timestamp:
- 09/25/07 17:46:09 (1 year ago)
- Files:
-
- components/news/trunk/news/_install/component_info.rb (modified) (2 diffs)
- components/news/trunk/news/admin_controller.rb (modified) (1 diff)
- components/news/trunk/news/news_config.rb (modified) (1 diff)
- components/news/trunk/news/news_controller.rb (modified) (3 diffs)
- components/news/trunk/news/news_item.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
components/news/trunk/news/_install/component_info.rb
r2894 r4612 6 6 @author = 'Rubricks.org' 7 7 @license = 'MIT' 8 @blocks = [ 9 { 10 :title => '[_News_Title_News]', 11 :controller => '/news/news', 12 :action => 'block', 13 :function => 'access', 14 :description => 'news block', 15 :widget => { 16 :default_height => '240', 17 :default_width => '400', 18 :visible => true 19 } 20 } 21 ] 8 22 @functions = [ 9 23 { … … 32 46 } 33 47 ] 34 @ blocks = [48 @trails = [ 35 49 { 36 :title => '[_News_Title_News]', 37 :controller => '/news/news', 38 :action => 'block', 39 :function => 'access', 40 :description => 'news block', 41 :widget => { 42 :default_height => '240', 43 :default_width => '400', 44 :visible => true 45 } 46 } 50 :record_type => 'read', 51 :examples => '[_News_Info_TrailRead]' 52 }, 53 { 54 :record_type => 'update', 55 :examples => '[_News_Info_TrailUpdate]' 56 }, 47 57 ] 48 58 end components/news/trunk/news/admin_controller.rb
r4578 r4612 5 5 def main 6 6 @nc = News::NewsConfig.instance 7 rubricks_logger({:action_type => :detail, :data => @nc}) 7 8 end 8 9 components/news/trunk/news/news_config.rb
r4578 r4612 1 1 class News::NewsConfig < ActiveRecord::Base 2 acts_as_record_trails :trails_fields => {:approval => '[_News_Need_Approval_Posted_News]', :news_per_block => '[_News_News_Per_Block]', :news_per_page => '[_News_News_Per_Page]', :new_days => '[_News_New_Days]'}, :default_methods => [:approval, :news_per_block, :news_per_page, :new_days], :auto_logger => {:update => true} 2 3 validates_bool_of :approval 3 4 validates_inclusion_of :news_per_block, :in => 1..20 components/news/trunk/news/news_controller.rb
r4578 r4612 80 80 end 81 81 @pages, @news_items = paginate(:'news/news_item', :per_page => @nc.news_per_page, :conditions => ['approval = 1'], :order => 'publish_date DESC, id DESC') 82 rubricks_logger({:action_type => :list, :data => @news_items}) 82 83 end 83 84 … … 111 112 end 112 113 end 114 rubricks_logger({:action_type => :detail, :data => @news}) 113 115 end 114 116 … … 284 286 if administrator? 285 287 @pages, @news_items = paginate(:'news/news_item', :per_page => nc.news_per_page, :conditions => ['approval = ?', approval], :order => 'updated_on DESC, id DESC') 288 rubricks_logger({:action_type => :list, :data => @news_items}) 286 289 else 287 290 @pages, @news_items = paginate(:'news/news_item', :per_page => nc.news_per_page, :conditions => ['rubricks_user_id = ? and approval = ?', current_user.id, approval], :order => 'updated_on DESC, id DESC') 291 rubricks_logger({:action_type => :list, :data => @news_items}) 288 292 end 289 293 end components/news/trunk/news/news_item.rb
r4578 r4612 1 1 class News::NewsItem < ActiveRecord::Base 2 2 acts_as_approval 3 acts_as_record_trails :trails_fields => {:title => '[_Common_Title]'}, :default_methods => [:title], :auto_logger => {:update => true} 3 4 acts_as_strippable :article 4 5 acts_as_tiny_mce_attachable :article
