Sha256: d18d18564794eb3af8f85e8be4e3df94f0fccc89a583fabb2a7dafbea3c1e126

Contents?: true

Size: 1.93 KB

Versions: 8

Compression:

Stored size: 1.93 KB

Contents

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

  def essentials_section(presenter)
    render partial: 'woople-theme/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, 'woople-theme/dashboard/exception')
  end

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

  def electives_points(points_earned, points_total)
    render partial: 'woople-theme/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, 'woople-theme/dashboard/exception')
  end

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

  def organization_accounts(accounts)
    render partial: 'woople-theme/dashboard/organization_accounts', object: ThemePresentation.wrap(accounts, WoopleTheme::Dashboard::OrganizationAccountsPresenter)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
woople-theme-0.6.14 app/helpers/dashboard_helper.rb
woople-theme-0.6.12 app/helpers/dashboard_helper.rb
woople-theme-0.6.11 app/helpers/dashboard_helper.rb
woople-theme-0.6.10 app/helpers/dashboard_helper.rb
woople-theme-0.6.9 app/helpers/dashboard_helper.rb
woople-theme-0.6.8 app/helpers/dashboard_helper.rb
woople-theme-0.6.7 app/helpers/dashboard_helper.rb
woople-theme-0.6.6 app/helpers/dashboard_helper.rb