Class: Crm::Reports::LeadReportController

Inherits:
CrmController
  • Object
show all
Includes:
Controllers::ReportCommandFlashable, Controllers::RequireTurboFrame
Defined in:
app/controllers/crm/reports/lead_report_controller.rb

Overview

Controller: lead report.

Constant Summary collapse

TAB_ACTIONS =

Tab fragments never render standalone — non-frame hits redirect to the
report page with the tab preselected.

%i[tab_customers_created tab_opportunities tab_orders tab_services tab_rooms_created tab_calls_in_out tab_communications tab_sms tab_website_visits].freeze

Instance Method Summary collapse

Methods included from Controllers::RequireTurboFrame

require_in_pane_tab_frames, require_turbo_frame

Instance Method Details

#showObject

Runs the lead report command.



15
16
17
18
19
20
21
22
23
# File 'app/controllers/crm/reports/lead_report_controller.rb', line 15

def show
  authorize! :read, LedgerCompanyAccount
  @report_command = ::Report::LeadReport::LeadReportCommand.new(lead_report_command_params)
  flash_report_command_errors
  respond_to do |format|
    format.html
    format.turbo_stream
  end
end

#tab_calls_in_outObject

In-pane tab: inbound/outbound calls.



71
72
73
74
75
76
77
# File 'app/controllers/crm/reports/lead_report_controller.rb', line 71

def tab_calls_in_out
  initialize_command_params
  respond_to do |format|
    format.html { render "tab_calls_in_out", layout: should_render_layout? }
    format.turbo_stream
  end
end

#tab_communicationsObject

In-pane tab: communications.



80
81
82
83
84
85
86
# File 'app/controllers/crm/reports/lead_report_controller.rb', line 80

def tab_communications
  initialize_command_params
  respond_to do |format|
    format.html { render "tab_communications", layout: should_render_layout? }
    format.turbo_stream
  end
end

#tab_customers_createdObject

In-pane tab: customers created.



26
27
28
29
30
31
32
# File 'app/controllers/crm/reports/lead_report_controller.rb', line 26

def tab_customers_created
  initialize_command_params
  respond_to do |format|
    format.html { render "tab_customers_created", layout: should_render_layout? }
    format.turbo_stream
  end
end

#tab_opportunitiesObject

In-pane tab: opportunities.



35
36
37
38
39
40
41
# File 'app/controllers/crm/reports/lead_report_controller.rb', line 35

def tab_opportunities
  initialize_command_params
  respond_to do |format|
    format.html { render "tab_opportunities", layout: should_render_layout? }
    format.turbo_stream
  end
end

#tab_ordersObject

In-pane tab: orders.



44
45
46
47
48
49
50
# File 'app/controllers/crm/reports/lead_report_controller.rb', line 44

def tab_orders
  initialize_command_params
  respond_to do |format|
    format.html { render "tab_orders", layout: should_render_layout? }
    format.turbo_stream
  end
end

#tab_rooms_createdObject

In-pane tab: rooms created.



62
63
64
65
66
67
68
# File 'app/controllers/crm/reports/lead_report_controller.rb', line 62

def tab_rooms_created
  initialize_command_params
  respond_to do |format|
    format.html { render "tab_rooms_created", layout: should_render_layout? }
    format.turbo_stream
  end
end

#tab_servicesObject

In-pane tab: services.



53
54
55
56
57
58
59
# File 'app/controllers/crm/reports/lead_report_controller.rb', line 53

def tab_services
  initialize_command_params
  respond_to do |format|
    format.html { render "tab_services", layout: should_render_layout? }
    format.turbo_stream
  end
end

#tab_smsObject

In-pane tab: SMS messages.



89
90
91
92
93
94
95
# File 'app/controllers/crm/reports/lead_report_controller.rb', line 89

def tab_sms
  initialize_command_params
  respond_to do |format|
    format.html { render "tab_sms", layout: should_render_layout? }
    format.turbo_stream
  end
end

#tab_website_visitsObject

In-pane tab: website visits.



98
99
100
101
102
103
104
# File 'app/controllers/crm/reports/lead_report_controller.rb', line 98

def tab_website_visits
  initialize_command_params
  respond_to do |format|
    format.html { render "tab_website_visits", layout: should_render_layout? }
    format.turbo_stream
  end
end