Module: MailyHerald::Webui::LogsHelper

Defined in:
app/helpers/maily_herald/webui/logs_helper.rb

Instance Method Summary collapse

Instance Method Details

#display_log_status(log) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
# File 'app/helpers/maily_herald/webui/logs_helper.rb', line 24

def display_log_status log
  case log.status
  when :delivered
    (:span, icon(:check, tw("logs.status.delivered")), class: "text-success")
  when :skipped
  when :error
    (:span, icon(:exclamation, tw("logs.status.error")), class: "text-danger")
  when :scheduled
    (:span, icon(:"clock-o", tw("logs.status.scheduled")), class: "text-muted")
  end
end

#log_actions(log) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/helpers/maily_herald/webui/logs_helper.rb', line 4

def log_actions log
  actions = []
  subscription = log.mailing.list.subscription_for(log.entity) if log.entity
  actions << {
    name:      :custom, 
    url:       subscription_path(subscription),
    icon:      "fa fa-book",
    title:     tw("label_subscription")
  } if subscription && !@item.is_a?(Subscription)
  actions << {
    name: :custom, 
    url: preview_log_path(log), 
    icon: "fa fa-file-o", 
    data: {
      toggle: "modal", 
      target: "#modal-generic"
    }
  }
end