Sha256: c81eece4daf16b995164e4bb3e9c5991dc9939cf61bf7f75ba905df348daf935

Contents?: true

Size: 894 Bytes

Versions: 6

Compression:

Stored size: 894 Bytes

Contents

class Plugins::Sidebars::RecentCommentsController < Sidebars::ComponentPlugin
  # display_name "Recent comments" # Default
  description "Displays the most recent comments."

  # Declare your settings.

  setting :title,     "Recent Comments", :label => "Title"
  setting :count,     5, :label => "Number of Comments"
  setting :show_username,  true, :label => "Show Username", :input_type => :checkbox
  setting :show_article,   true, :label => "Show Article Title", :input_type => :checkbox

  # Check the other sidebars for the sort of thing you can do with
  # setting declarations. Expect more documentation when it's
  # written.

  # setting :key,       'some text'
  # setting :selection, 'foo', :choices => %{foo bar baz}
  # setting :flag,       true, :input_type => :checkbox

  def content
    @comments = Comment.find(:all, :limit => count, :order => 'created_at DESC' )
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
typo-3.99.0 components/plugins/sidebars/recent_comments_controller.rb
typo-3.99.1 components/plugins/sidebars/recent_comments_controller.rb
typo-3.99.2 components/plugins/sidebars/recent_comments_controller.rb
typo-3.99.3 components/plugins/sidebars/recent_comments_controller.rb
typo-3.99.4 components/plugins/sidebars/recent_comments_controller.rb
typo-4.0.0 components/plugins/sidebars/recent_comments_controller.rb