Sha256: b2a168b87b9fbf19754c15acc675578fecba700eb29c3a234fc5a911ff5e108e

Contents?: true

Size: 709 Bytes

Versions: 21

Compression:

Stored size: 709 Bytes

Contents

# frozen_string_literal: true

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

  delegate_attributes :photo, :title

  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

21 entries across 21 versions & 1 rubygems

Version Path
tramway-conference-1.9.5.12 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.5.11 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.5.10 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.5.9 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.5.8 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.5.7 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.5.6 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.5.5 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.5.4 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.5.1 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.5 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.4.4 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.4.3 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.4.2 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.4.1 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.4 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.3.1 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.3 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.2.2 app/decorators/tramway/event/event_as_page_with_button_decorator.rb
tramway-conference-1.9.2.1 app/decorators/tramway/event/event_as_page_with_button_decorator.rb