forked from ManageIQ/manageiq-ui-classic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmiq_event_definition_controller.rb
62 lines (51 loc) · 1.45 KB
/
miq_event_definition_controller.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
class MiqEventDefinitionController < ApplicationController
before_action :check_privileges
before_action :get_session_data
after_action :cleanup_action
after_action :set_session_data
include Mixins::GenericListMixin
include Mixins::GenericShowMixin
include Mixins::GenericSessionMixin
include Mixins::BreadcrumbsMixin
include Mixins::PolicyMixin
def title
@title = _("Events")
end
def show_list
@no_checkboxes = true # Don't show checkboxes, read_only
process_show_list(:filter => MiqPolicy.all_policy_events_filter)
end
def init_show
@record = identify_record(params[:id], MiqEventDefinition)
return false if record_no_longer_exists?(@record)
@lastaction = 'show'
@gtl_url = gtl_url
unless pagination_or_gtl_request?
@display = params[:display] || default_display
end
true
end
private
def get_session_data
@title = _("Events")
@layout = "miq_event_definition"
@lastaction = session[:miq_event_lastaction]
@display = session[:miq_event_display]
@current_page = session[:miq_event_current_page]
end
def set_session_data
super
session[:layout] = @layout
session[:miq_event_current_page] = @current_page
end
def breadcrumbs_options
{
:breadcrumbs => [
{:title => _("Control")},
{:title => _('Events'), :url => controller_url},
].compact,
:record_title => :description,
}
end
menu_section :con
end