Sha256: 8b90d8f571378b81bec4f4c3730eb03ef618f52ae11bb143876c52b5c3cc6244

Contents?: true

Size: 499 Bytes

Versions: 7

Compression:

Stored size: 499 Bytes

Contents

class Tramway::Event::ActionDecorator < Tramway::Core::ApplicationDecorator
  class << self
    delegate :human_action_state_event_name, to: :model_class
    delegate :human_attribute_name, to: :model_class
  end

  def name
    "#{object.title} - #{date_view(object.deadline)} - #{state_machine_view(object, :action_state)}"
  end
  
  def action_state_button_color(event)
    case event
    when :do
      :success
    when :decline
      :danger
    when :return
      :warning
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tramway-event-1.11.0.1 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.11 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.10.2 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.10.1 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.10.0.2 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.10.0.1 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.10 app/decorators/tramway/event/action_decorator.rb