Module: ActionTrace::ActivityLogPresenter
- Includes:
- ActionView::Helpers::TagHelper, ActionView::Helpers::TranslationHelper
- Included in:
- ActivityLog
- Defined in:
- app/presenters/action_trace/activity_log_presenter.rb
Constant Summary collapse
- VISUAL_CONFIG =
{ 'data_create' => { icon: 'fas fa-plus-circle', color: 'text-success' }, 'data_change' => { icon: 'fas fa-pencil-alt', color: 'text-primary' }, 'data_destroy' => { icon: 'fas fa-trash-alt', color: 'text-danger' }, 'page_visit' => { icon: 'fas fa-globe-pointer', color: 'text-secondary' }, 'session_start' => { icon: 'fas fa-arrow-left-to-bracket', color: 'text-warning' }, 'session_end' => { icon: 'fas fa-arrow-right-to-bracket', color: 'text-danger' } }.freeze
Instance Method Summary collapse
Instance Method Details
#color ⇒ Object
21 22 23 |
# File 'app/presenters/action_trace/activity_log_presenter.rb', line 21 def color visual[:color] end |
#icon ⇒ Object
17 18 19 |
# File 'app/presenters/action_trace/activity_log_presenter.rb', line 17 def icon visual[:icon] end |
#subject ⇒ Object
25 26 27 28 29 |
# File 'app/presenters/action_trace/activity_log_presenter.rb', line 25 def subject return raw_subject unless %w[page_visit session_end].include?(source) format_subject(details['controller'], details['action'], details['path']) end |