Sha256: 49e922099c8730ac17e3c3221a3fa989a9e3c22e333e9c645317170028054fee

Contents?: true

Size: 1.66 KB

Versions: 10

Compression:

Stored size: 1.66 KB

Contents

module DashboardHelper
  def status_alert(color, description)
    render partial: 'dashboard/status_alert',
           object: ThemePresentation.wrap({ color: color, description: description }, WoopleTheme::Dashboard::StatusAlertPresenter)
  end

  def essentials_section(presenter)
    render partial: 'dashboard/essentials_section',
           object: ThemePresentation.wrap(presenter, WoopleTheme::Dashboard::EssentialsSectionPresenter)
  end

  def essentials_completed(items)
    render_collection_partial(items, WoopleTheme::Dashboard::EssentialCompletedPresenter, 'woople-theme/content_item')
  end

  def essentials_exceptions(items)
    render_collection_partial(items, WoopleTheme::Dashboard::EssentialExceptionPresenter, 'dashboard/exception')
  end

  def electives_section(presenter)
    render partial: 'dashboard/electives_section',
           object: ThemePresentation.wrap(presenter, WoopleTheme::Dashboard::ElectivesSectionPresenter)
  end

  def electives_points(points_earned, points_total)
    render partial: 'dashboard/points',
           object: ThemePresentation.wrap({ earned: points_earned, total: points_total }, WoopleTheme::Dashboard::PointsPresenter)
  end

  def electives_history(items)
    render_collection_partial(items, WoopleTheme::Dashboard::ElectiveHistoryPresenter, 'woople-theme/content_item')
  end

  def electives_exceptions(items)
    render_collection_partial(items, WoopleTheme::Dashboard::ElectiveExceptionPresenter, 'dashboard/exception')
  end

  private

  def render_collection_partial(items, presenter, partial)
    collection = ThemePresentation.wrap_collection(items, presenter)
    render partial: partial, collection: collection
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
woople-theme-0.6.5 app/helpers/dashboard_helper.rb
woople-theme-0.6.4 app/helpers/dashboard_helper.rb
woople-theme-0.6.3 app/helpers/dashboard_helper.rb
woople-theme-0.6.2 app/helpers/dashboard_helper.rb
woople-theme-0.6.1 app/helpers/dashboard_helper.rb
woople-theme-0.6 app/helpers/dashboard_helper.rb
woople-theme-0.5.17 app/helpers/dashboard_helper.rb
woople-theme-0.5.16 app/helpers/dashboard_helper.rb
woople-theme-0.5.15 app/helpers/dashboard_helper.rb
woople-theme-0.5.14 app/helpers/dashboard_helper.rb