Sha256: 6e5a8361d0d20604cbd5577a86389e82d926f78b3ced8e1f3389ee41f02af19c

Contents?: true

Size: 978 Bytes

Versions: 101

Compression:

Stored size: 978 Bytes

Contents

require 'action_view'
require 'delegate'

class OutlinePresenter < SimpleDelegator
  include ActionView::Helpers::TagHelper

  attr_accessor :view_context

  def name
    content_tag(:h2, outline.name)
  end

  def videos(videos = outline.videos)
    wrapped_videos = ThemePresentation.wrap_collection(videos, OutlineVideoPresenter)
    view_context.render partial: 'woople-theme/outline_videos', locals: { videos: wrapped_videos }
  end

  def downloads(downloads = outline.downloads)
    wrapped_downloads = ThemePresentation.wrap_collection(downloads, OutlineDownloadPresenter)
    view_context.render partial: 'woople-theme/outline_downloads', locals: { downloads: wrapped_downloads }
  end

  def assessment
    wrapped_assessment = ThemePresentation.wrap(outline.assessment, OutlineAssessmentPresenter)
    view_context.render partial: 'woople-theme/outline_assessment', locals: { assessment: wrapped_assessment }
  end

  private

  def outline
    __getobj__
  end

end

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
woople-theme-0.10.0 app/presenters/outline_presenter.rb
woople-theme-0.9.0 app/presenters/outline_presenter.rb
woople-theme-0.8.19 app/presenters/outline_presenter.rb
woople-theme-0.8.18 app/presenters/outline_presenter.rb
woople-theme-0.8.17 app/presenters/outline_presenter.rb
woople-theme-0.8.16 app/presenters/outline_presenter.rb
woople-theme-0.8.15 app/presenters/outline_presenter.rb
woople-theme-0.8.14 app/presenters/outline_presenter.rb
woople-theme-0.8.13 app/presenters/outline_presenter.rb
woople-theme-0.8.12 app/presenters/outline_presenter.rb
woople-theme-0.8.11 app/presenters/outline_presenter.rb
woople-theme-0.8.10 app/presenters/outline_presenter.rb
woople-theme-0.8.9 app/presenters/outline_presenter.rb
woople-theme-0.8.8 app/presenters/outline_presenter.rb
woople-theme-0.8.7 app/presenters/outline_presenter.rb
woople-theme-0.8.6 app/presenters/outline_presenter.rb
woople-theme-0.8.5 app/presenters/outline_presenter.rb
woople-theme-0.8.4 app/presenters/outline_presenter.rb
woople-theme-0.8.3 app/presenters/outline_presenter.rb
woople-theme-0.8.2 app/presenters/outline_presenter.rb