Module: DashboardHelper

Defined in:
app/helpers/dashboard_helper.rb

Instance Method Summary collapse

Instance Method Details

#electives_exceptions(items) ⇒ Object



38
39
40
# File 'app/helpers/dashboard_helper.rb', line 38

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

#electives_history(items) ⇒ Object



34
35
36
# File 'app/helpers/dashboard_helper.rb', line 34

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

#electives_points(points_earned, points_total) ⇒ Object



29
30
31
32
# File 'app/helpers/dashboard_helper.rb', line 29

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

#electives_section(presenter) ⇒ Object



24
25
26
27
# File 'app/helpers/dashboard_helper.rb', line 24

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

#essentials_completed(items) ⇒ Object



16
17
18
# File 'app/helpers/dashboard_helper.rb', line 16

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

#essentials_exceptions(items) ⇒ Object



20
21
22
# File 'app/helpers/dashboard_helper.rb', line 20

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

#essentials_section(presenter) ⇒ Object



11
12
13
14
# File 'app/helpers/dashboard_helper.rb', line 11

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

#organization_accounts(accounts) ⇒ Object



47
48
49
# File 'app/helpers/dashboard_helper.rb', line 47

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

#render_collection_partial(items, presenter, partial) ⇒ Object



42
43
44
45
# File 'app/helpers/dashboard_helper.rb', line 42

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

#status_alert(color, description) ⇒ Object



2
3
4
5
# File 'app/helpers/dashboard_helper.rb', line 2

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

#user_and_status(data) ⇒ Object



7
8
9
# File 'app/helpers/dashboard_helper.rb', line 7

def user_and_status(data)
  render partial: 'woople-theme/dashboard/user_and_status', object: ThemePresentation.wrap(data, WoopleTheme::Dashboard::UserAndStatusPresenter)
end