Module: AdminLayoutHelper

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ApplicationHelper

#controller_id, #define_application_layout_variables, #h_money, #money_for_input

Class Method Details

.append_features(base) ⇒ Object



78
79
80
81
82
83
84
85
86
# File 'app/helpers/admin_layout_helper.rb', line 78

def self.append_features(base)
  super
  
  base.class_eval do
    layout 'admin'
    
    
  end
end

Instance Method Details

#controller_url(for_controller) ⇒ Object



74
75
76
# File 'app/helpers/admin_layout_helper.rb', line 74

def controller_url( for_controller )
  url_for :controller => for_controller, :only_path => true
end

#define_layout_variablesObject



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'app/helpers/admin_layout_helper.rb', line 45

def define_layout_variables
  define_application_layout_variables

  @main_navigation = NavigationMenu.new('Administration') do |admin|
    admin.item('Activity Management', controller_url("Admin/Activities")) do |activity|
      activity.item 'Labor',          controller_url("Admin/Labors")
      activity.item 'Materials',      controller_url("Admin/Materials") 
      activity.item 'Proposals',      controller_url("Admin/Proposals")
      activity.item 'Adjustments',    controller_url("Admin/Adjustments")
    end

    admin.item 'Accounts Ledger', controller_url("Admin/Client_Accounting") do |accounting|
      accounting.item 'All Invoices', controller_url("Admin/Invoices")
      accounting.item 'Draft Invoices', controller_url("Admin/draft_invoices")
      accounting.item 'Payments', controller_url("Admin/Payments")
    end

    admin.item( 'Clients',            controller_url("Admin/Clients") ) do |clients|
      clients.item 'Representatives', controller_url("Admin/Client_Representatives")
    end
    
    admin.item 'Employees', controller_url("Admin/Employees")
    
    admin.item 'Site Settings',  controller_url("Admin/Settings")

    admin.item 'Sign-Out',  logout_url, ['distance']
  end
end