Class: Marley::Joints::Section::Resources::MainMenu

Inherits:
Section show all
Defined in:
lib/marley/joints/section.rb

Class Method Summary collapse

Methods inherited from Section

rest_get

Class Method Details

.requires_user?Boolean

Returns:

  • (Boolean)


37
38
39
40
41
42
43
# File 'lib/marley/joints/section.rb', line 37

def self.requires_user?
  if respond_to?(:current_user)
    ! ($request[:path].nil? || $request[:path].empty?)
  else
    false
  end
end

.section_contentObject



54
55
56
57
58
# File 'lib/marley/joints/section.rb', line 54

def self.section_content
  if respond_to?(:current_user) && (current_user.nil? || current_user.new?)
    [[:msg,{:title => 'New users, please sign up below'}],MR::User.new]
  end
end

.section_descObject



59
60
61
62
63
# File 'lib/marley/joints/section.rb', line 59

def self.section_desc
  if respond_to?(:current_user) && (current_user.nil? || current_user.new?)
    ReggaeLink.new({:url => '/main_menu', :title => 'Existing users, please click here to log in.'})
  end
end

.section_navObject



47
48
49
50
51
52
53
# File 'lib/marley/joints/section.rb', line 47

def self.section_nav
  if !(respond_to?(:current_user) && (current_user.nil? || current_user.new?))
    MR.resources_responding_to(:section).sort {|l,r|l.resource_name <=> r.resource_name}.map{|r| next if r==self; r.section}.compact
  else
    []
  end
end

.section_titleObject



44
45
46
# File 'lib/marley/joints/section.rb', line 44

def self.section_title
  Marley.config[:app_name]
end