Sha256: d448afdf51b4d245d962f8535c808218d6d4cc7c8ae87dfbbbcd8b33fe34ab27

Contents?: true

Size: 564 Bytes

Versions: 18

Compression:

Stored size: 564 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 title
    object.title
  end

  def action_state_button_color(event)
    case event
    when :do
      :success
    when :decline
      :danger
    when :return
      :warning
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
tramway-event-1.12.9.1 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.9 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.8.2 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.8.1 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.8 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.7 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.6.4 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.6.3 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.6.2 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.6 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.5 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.4 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.3.10 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.3.9 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.3.8 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.3.7 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.3.6 app/decorators/tramway/event/action_decorator.rb
tramway-event-1.12.3.5 app/decorators/tramway/event/action_decorator.rb