Module: Marley::Plugins::MessageNav::ClassMethods

Defined in:
lib/marley/joints/forum.rb

Instance Method Summary collapse

Instance Method Details

#recent_topicsObject



58
59
60
# File 'lib/marley/joints/forum.rb', line 58

def recent_topics
  list(lambda {date_created > Date.today - 2})
end

#section_navObject



49
50
51
52
53
54
55
56
57
# File 'lib/marley/joints/forum.rb', line 49

def section_nav
  [
    self.reggae_link(:new, 'New Post'),
    self.reggae_link(:list, 'All Posts'),
    self.reggae_link(:recent_topics, 'Recent Topics'),
    Marley::ReggaeSection.new({:title => 'Public Tags', :navigation => MR::PublicTag.group(:tag).map{|t| reggae_link('list',t[:tag],"#{resource_name}[_public_tags]=#{t.tag}")}}),
    Marley::ReggaeSection.new({:title => 'Private Tags', :navigation => MR::PrivateTag.current_user_ds.join(:messages_tags,:tag_id => :tags__id).join(:messages,:messages__id => :message_id).filter(:message_type => 'PublicMessage').group(:tag).map{|t| reggae_link('list',t[:tag],"#{resource_name}[_private_tags]=#{t.tag}")}})
  ]
end