Sha256: d87a247f0b59b63b771ede1282b06e3818f9d0d6a91e80ca9b11333bd8174091

Contents?: true

Size: 528 Bytes

Versions: 17

Compression:

Stored size: 528 Bytes

Contents

# frozen_string_literal: true

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

17 entries across 17 versions & 1 rubygems

Version Path
tramway-event-1.12.3.4 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.3.3 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.3.2 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.3.1 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.3 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.2 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.1.1 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.1 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.0.1 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.11.5.1 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.11.5 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.11.4.1 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.11.4 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.11.2.1 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.11.2 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.11.1 app/decorators/tramway/event/action_decorator.rb