Sha256: 7e212b0cccbdcb8126a382482e1cab721ebbdb8515cbc8cefeac6bf506dfa1f7

Contents?: true

Size: 702 Bytes

Versions: 5

Compression:

Stored size: 702 Bytes

Contents

class Tramway::Event::EventAsPageWithButtonDecorator < Tramway::Event::EventDecorator
  def anchor
    "event_#{object.id}"
  end

  delegate :photo, to: :object
  delegate :title, to: :object
  alias background photo

  def description
    if object.short_description.present?
      content_tag :div do
        concat duration
        concat content_tag :br
        concat object.short_description
      end
    else
      duration
    end
  end

  def button
    content_tag :div do
      content_tag(
        :a,
        href: ::Tramway::Event::Engine.routes.url_helpers.event_path(object.id),
        class: 'btn btn-primary'
      ) do
        'Регистрация'
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tramway-conference-1.9.1.1 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.1 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.0.2 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.0.1 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9 app/decorators/tramway/event/event_as_page_with_button_decorator.rb