app/helpers/dashboard_helper.rb in woople-theme-0.5.8 vs app/helpers/dashboard_helper.rb in woople-theme-0.5.9

- old
+ new

@@ -7,20 +7,33 @@ 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 completed_essentials(items) - collection = ThemePresentation.wrap_collection(items, WoopleTheme::Dashboard::CompletedEssentialPresenter) - render partial: 'dashboard/completed_essential', collection: collection + def electives_history(items) + render_collection_partial(items, WoopleTheme::Dashboard::ElectiveHistoryPresenter, 'woople-theme/content_item') end - def total_courses(total) - render partial: 'dashboard/total_courses', locals: {total: total} + 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